function _handlerListener(action, addon, requiresRestart) {
    // Since this is called as an observer, we explicitly trap errors and
    // log them to ourselves so we don't see errors reported elsewhere.
    try {
      let id = addon.id;
      this._log.debug("Add-on change: " + action + " to " + id);

      // We assume that every event for non-restartless add-ons is
      // followed by another event and that this follow-up event is the most
      // appropriate to react to. Currently we ignore onEnabling, onDisabling,
      // and onUninstalling for non-restartless add-ons.
      if (requiresRestart === false) {
        this._log.debug("Ignoring " + action + " for restartless add-on.");
        return;
      }

      switch (action) {
        case "onEnabling":
        case "onEnabled":
        case "onDisabling":
        case "onDisabled":
        case "onInstalled":
        case "onInstallEnded":
        case "onOperationCancelled":
          this.rectifyStateFromAddon(addon);
          break;

        case "onUninstalling":
        case "onUninstalled":
          let id = addon.id;
          let addons = this.addons;
          if (id in addons) {
            let now = new Date();
            let record = addons[id];
            record.installed = false;
            record.modified = now;
            this._log.debug("Adding change because of uninstall listener: " +
                            id);
            this._addChange(now, CHANGE_UNINSTALLED, record);
          }
      }

      // See note for _shouldPersist.
      if (this._shouldPersist) {
        let cb = Async.makeSpinningCallback();
        this.saveState(null, cb);
        cb.wait();
      }
    }
    catch (ex) {
      this._log.warn("Exception: " + Utils.exceptionStr(ex));
    }
  }
/**
   * Handler that is invoked as part of the AddonManager listeners.
   */
Handler that is invoked as part of the AddonManager listeners.
Handler that is invoked as part of the AddonManager listeners .
function _handlerListener(action, addon, requiresRestart) {
    try {
      let id = addon.id;
      this._log.debug("Add-on change: " + action + " to " + id);
      if (requiresRestart === false) {
        this._log.debug("Ignoring " + action + " for restartless add-on.");
        return;
      }
      switch (action) {
        case "onEnabling":
        case "onEnabled":
        case "onDisabling":
        case "onDisabled":
        case "onInstalled":
        case "onInstallEnded":
        case "onOperationCancelled":
          this.rectifyStateFromAddon(addon);
          break;
        case "onUninstalling":
        case "onUninstalled":
          let id = addon.id;
          let addons = this.addons;
          if (id in addons) {
            let now = new Date();
            let record = addons[id];
            record.installed = false;
            record.modified = now;
            this._log.debug("Adding change because of uninstall listener: " +
                            id);
            this._addChange(now, CHANGE_UNINSTALLED, record);
          }
      }
      if (this._shouldPersist) {
        let cb = Async.makeSpinningCallback();
        this.saveState(null, cb);
        cb.wait();
      }
    }
    catch (ex) {
      this._log.warn("Exception: " + Utils.exceptionStr(ex));
    }
  }
function _handlerListener ( action , addon , requiresRestart ) { try { let id = addon . id ; this . _log . debug ( "Add-on change: " + action + " to " + id ) ; if ( requiresRestart === false ) { this . _log . debug ( "Ignoring " + action + " for restartless add-on." ) ; return ; } switch ( action ) { case "onEnabling" : case "onEnabled" : case "onDisabling" : case "onDisabled" : case "onInstalled" : case "onInstallEnded" : case "onOperationCancelled" : this . rectifyStateFromAddon ( addon ) ; break ; case "onUninstalling" : case "onUninstalled" : let id = addon . id ; let addons = this . addons ; if ( id in addons ) { let now = new Date ( ) ; let record = addons [ id ] ; record . installed = false ; record . modified = now ; this . _log . debug ( "Adding change because of uninstall listener: " + id ) ; this . _addChange ( now , CHANGE_UNINSTALLED , record ) ; } } if ( this . _shouldPersist ) { let cb = Async . makeSpinningCallback ( ) ; this . saveState ( null , cb ) ; cb . wait ( ) ; } } catch ( ex ) { this . _log . warn ( "Exception: " + Utils . exceptionStr ( ex ) ) ; } }
Handler that is invoked as part of the AddonManager listeners.
Handler that is invoked as part of the AddonManager listeners .
// Since this is called as an observer, we explicitly trap errors and // log them to ourselves so we don't see errors reported elsewhere. // We assume that every event for non-restartless add-ons is // followed by another event and that this follow-up event is the most // appropriate to react to. Currently we ignore onEnabling, onDisabling, // and onUninstalling for non-restartless add-ons. // See note for _shouldPersist.