B2G/gecko/toolkit/components/exthelper/extApplication.js
/**
   * Remove a preference observer.
   *
   * This function's parameters are identical to addListener's.
   */
Remove a preference observer.
This function's parameters are identical to addListener's.
Remove a preference observer . This function ' s parameters are identical to addListener ' s .
function po_rl(aPrefs, aDomain, aEvent, aListener) {
    var root = aPrefs.root;
    if (!this._observersDict[root] ||
        !this._observersDict[root][aDomain]) {
      return;
    }
    var observer = this._observersDict[root][aDomain];
    observer.events.removeListener(aEvent, aListener);
    if (observer.events._listeners.length == 0) {
      observer.prefBranch.removeObserver(aDomain, observer);
      delete this._observersDict[root][aDomain];
      if (Object.keys(this._observersDict[root]).length == 0) {
        delete this._observersDict[root];
      }
    }
  }
function po_rl ( aPrefs , aDomain , aEvent , aListener ) { var root = aPrefs . root ; if ( ! this . _observersDict [ root ] || ! this . _observersDict [ root ] [ aDomain ] ) { return ; } var observer = this . _observersDict [ root ] [ aDomain ] ; observer . events . removeListener ( aEvent , aListener ) ; if ( observer . events . _listeners . length == 0 ) { observer . prefBranch . removeObserver ( aDomain , observer ) ; delete this . _observersDict [ root ] [ aDomain ] ; if ( Object . keys ( this . _observersDict [ root ] ) . length == 0 ) { delete this . _observersDict [ root ] ; } } }
Remove a preference observer.
Remove a preference observer .
// nsIPrefBranch objects are not singletons -- we can have two // nsIPrefBranch'es for the same branch.  There's no guarantee that // aPrefs is the same object as observer.prefBranch, so we have to call // removeObserver on observer.prefBranch.