B2G/gecko/toolkit/mozapps/extensions/AddonManager.jsm
/**
   * Asynchronously get an add-on with a specific Sync GUID.
   *
   * @param  aGUID
   *         String GUID of add-on to retrieve
   * @param  aCallback
   *         The callback to pass the retrieved add-on to.
   * @throws if the aGUID or aCallback arguments are not specified
   */
Asynchronously get an add-on with a specific Sync GUID.
@param  aGUID
String GUID of add-on to retrieve
@param  aCallback
The callback to pass the retrieved add-on to.
@throws if the aGUID or aCallback arguments are not specified
Asynchronously get an add - on with a specific Sync GUID . @param aGUID String GUID of add - on to retrieve @param aCallback The callback to pass the retrieved add - on to . @throws if the aGUID or aCallback arguments are not specified
function AMI_getAddonBySyncGUID(aGUID, aCallback) {
    if (!gStarted)
      throw Components.Exception("AddonManager is not initialized",
                                 Cr.NS_ERROR_NOT_INITIALIZED);
    if (!aGUID || typeof aGUID != "string")
      throw Components.Exception("aGUID must be a non-empty string",
                                 Cr.NS_ERROR_INVALID_ARG);
    if (typeof aCallback != "function")
      throw Components.Exception("aCallback must be a function",
                                 Cr.NS_ERROR_INVALID_ARG);
    new AsyncObjectCaller(this.providers, "getAddonBySyncGUID", {
      nextObject: function(aCaller, aProvider) {
        callProvider(aProvider, "getAddonBySyncGUID", null, aGUID, function(aAddon) {
          if (aAddon) {
            safeCall(aCallback, aAddon);
          } else {
            aCaller.callNext();
          }
        });
      },
      noMoreObjects: function(aCaller) {
        safeCall(aCallback, null);
      }
    });
  }
function AMI_getAddonBySyncGUID ( aGUID , aCallback ) { if ( ! gStarted ) throw Components . Exception ( "AddonManager is not initialized" , Cr . NS_ERROR_NOT_INITIALIZED ) ; if ( ! aGUID || typeof aGUID != "string" ) throw Components . Exception ( "aGUID must be a non-empty string" , Cr . NS_ERROR_INVALID_ARG ) ; if ( typeof aCallback != "function" ) throw Components . Exception ( "aCallback must be a function" , Cr . NS_ERROR_INVALID_ARG ) ; new AsyncObjectCaller ( this . providers , "getAddonBySyncGUID" , { nextObject : function ( aCaller , aProvider ) { callProvider ( aProvider , "getAddonBySyncGUID" , null , aGUID , function ( aAddon ) { if ( aAddon ) { safeCall ( aCallback , aAddon ) ; } else { aCaller . callNext ( ) ; } } ) ; } , noMoreObjects : function ( aCaller ) { safeCall ( aCallback , null ) ; } } ) ; }
Asynchronously get an add-on with a specific Sync GUID.
Asynchronously get an add - on with a specific Sync GUID .