B2G/gecko/toolkit/mozapps/extensions/XPIProviderUtils.js
/**
   * Synchronously updates an add-ons metadata in the database. Currently just
   * removes and recreates.
   *
   * @param  aOldAddon
   *         The DBAddonInternal to be replaced
   * @param  aNewAddon
   *         The new AddonInternal to add
   * @param  aDescriptor
   *         The file descriptor of the add-on
   */
Synchronously updates an add-ons metadata in the database. Currently just
removes and recreates.

@param  aOldAddon
The DBAddonInternal to be replaced
@param  aNewAddon
The new AddonInternal to add
@param  aDescriptor
The file descriptor of the add-on
Synchronously updates an add - ons metadata in the database . Currently just removes and recreates . @param aOldAddon The DBAddonInternal to be replaced @param aNewAddon The new AddonInternal to add @param aDescriptor The file descriptor of the add - on
function XPIDB_updateAddonMetadata(aOldAddon, aNewAddon,
                                                          aDescriptor) {
    this.beginTransaction();
    try {
      this.removeAddonMetadata(aOldAddon);
      aNewAddon.syncGUID = aOldAddon.syncGUID;
      aNewAddon.installDate = aOldAddon.installDate;
      aNewAddon.applyBackgroundUpdates = aOldAddon.applyBackgroundUpdates;
      aNewAddon.foreignInstall = aOldAddon.foreignInstall;
      aNewAddon.active = (aNewAddon.visible && !aNewAddon.userDisabled &&
                          !aNewAddon.appDisabled && !aNewAddon.pendingUninstall)
      this.addAddonMetadata(aNewAddon, aDescriptor);
      this.commitTransaction();
    }
    catch (e) {
      this.rollbackTransaction();
      throw e;
    }
  }
function XPIDB_updateAddonMetadata ( aOldAddon , aNewAddon , aDescriptor ) { this . beginTransaction ( ) ; try { this . removeAddonMetadata ( aOldAddon ) ; aNewAddon . syncGUID = aOldAddon . syncGUID ; aNewAddon . installDate = aOldAddon . installDate ; aNewAddon . applyBackgroundUpdates = aOldAddon . applyBackgroundUpdates ; aNewAddon . foreignInstall = aOldAddon . foreignInstall ; aNewAddon . active = ( aNewAddon . visible && ! aNewAddon . userDisabled && ! aNewAddon . appDisabled && ! aNewAddon . pendingUninstall ) this . addAddonMetadata ( aNewAddon , aDescriptor ) ; this . commitTransaction ( ) ; } catch ( e ) { this . rollbackTransaction ( ) ; throw e ; } }
Synchronously updates an add-ons metadata in the database.
Synchronously updates an add - ons metadata in the database .
// Any errors in here should rollback the transaction