B2G/gecko/toolkit/mozapps/extensions/XPIProviderUtils.js
/**
   * Synchronously makes a DBAddonInternal from a storage row or returns one
   * from the cache.
   *
   * @param  aRow
   *         The storage row to make the DBAddonInternal from
   * @return a DBAddonInternal
   */
Synchronously makes a DBAddonInternal from a storage row or returns one
from the cache.

@param  aRow
The storage row to make the DBAddonInternal from
@return a DBAddonInternal
Synchronously makes a DBAddonInternal from a storage row or returns one from the cache . @param aRow The storage row to make the DBAddonInternal from @return a DBAddonInternal
function XPIDB_makeAddonFromRow(aRow) {
    if (this.addonCache[aRow.internal_id]) {
      let addon = this.addonCache[aRow.internal_id].get();
      if (addon)
        return addon;
    }
    let addon = new XPIProvider.DBAddonInternal();
    addon._internal_id = aRow.internal_id;
    addon._installLocation = XPIProvider.installLocationsByName[aRow.location];
    addon._descriptor = aRow.descriptor;
    addon._defaultLocale = aRow.defaultLocale;
    copyProperties(aRow, PROP_METADATA, addon);
    copyProperties(aRow, DB_METADATA, addon);
    DB_BOOL_METADATA.forEach(function(aProp) {
      addon[aProp] = aRow[aProp] != 0;
    });
    try {
      addon._sourceBundle = addon._installLocation.getLocationForID(addon.id);
    }
    catch (e) {
    }
    this.addonCache[aRow.internal_id] = Components.utils.getWeakReference(addon);
    return addon;
  }
function XPIDB_makeAddonFromRow ( aRow ) { if ( this . addonCache [ aRow . internal_id ] ) { let addon = this . addonCache [ aRow . internal_id ] . get ( ) ; if ( addon ) return addon ; } let addon = new XPIProvider . DBAddonInternal ( ) ; addon . _internal_id = aRow . internal_id ; addon . _installLocation = XPIProvider . installLocationsByName [ aRow . location ] ; addon . _descriptor = aRow . descriptor ; addon . _defaultLocale = aRow . defaultLocale ; copyProperties ( aRow , PROP_METADATA , addon ) ; copyProperties ( aRow , DB_METADATA , addon ) ; DB_BOOL_METADATA . forEach ( function ( aProp ) { addon [ aProp ] = aRow [ aProp ] != 0 ; } ) ; try { addon . _sourceBundle = addon . _installLocation . getLocationForID ( addon . id ) ; } catch ( e ) { } this . addonCache [ aRow . internal_id ] = Components . utils . getWeakReference ( addon ) ; return addon ; }
Synchronously makes a DBAddonInternal from a storage row or returns one
 from the cache.
Synchronously makes a DBAddonInternal from a storage row or returns one from the cache .
// An exception will be thrown if the add-on appears in the database but // not on disk. In general this should only happen during startup as // this change is being detected.