diff options
author | yami <34216515+kn-yami@users.noreply.github.com> | 2018-10-04 22:05:58 +0200 |
---|---|---|
committer | yami <34216515+kn-yami@users.noreply.github.com> | 2018-10-04 22:05:58 +0200 |
commit | 06086f82f78676f1f2829c2f9a01adb779f61966 (patch) | |
tree | 34f27825c9fb4c50d3ad01f0ae85b12fc873ea43 /toolkit/mozapps | |
parent | 0d97c6ada56219b66adb0f66b9dd26676afdd24a (diff) | |
download | uxp-06086f82f78676f1f2829c2f9a01adb779f61966.tar.gz |
remove named function syntax in AddonManager.jsm
Diffstat (limited to 'toolkit/mozapps')
-rw-r--r-- | toolkit/mozapps/extensions/AddonManager.jsm | 223 |
1 files changed, 107 insertions, 116 deletions
diff --git a/toolkit/mozapps/extensions/AddonManager.jsm b/toolkit/mozapps/extensions/AddonManager.jsm index d453a8981b..f9827345c3 100644 --- a/toolkit/mozapps/extensions/AddonManager.jsm +++ b/toolkit/mozapps/extensions/AddonManager.jsm @@ -123,13 +123,13 @@ function providerName(aProvider) { * parent 'addons' level logger accordingly. */ var PrefObserver = { - init: function PrefObserver_init() { + init: function() { Services.prefs.addObserver(PREF_LOGGING_ENABLED, this, false); Services.obs.addObserver(this, "xpcom-shutdown", false); this.observe(null, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, PREF_LOGGING_ENABLED); }, - observe: function PrefObserver_observe(aSubject, aTopic, aData) { + observe: function(aSubject, aTopic, aData) { if (aTopic == "xpcom-shutdown") { Services.prefs.removeObserver(PREF_LOGGING_ENABLED, this); Services.obs.removeObserver(this, "xpcom-shutdown"); @@ -323,7 +323,7 @@ AsyncObjectCaller.prototype = { * Passes the next object to the listener or calls noMoreObjects if there * are none left. */ - callNext: function AOC_callNext() { + callNext: function() { if (this.objects.length == 0) { this.listener.noMoreObjects(this); return; @@ -449,7 +449,7 @@ AddonAuthor.prototype = { url: null, // Returns the author's name, defaulting to the empty string - toString: function AddonAuthor_toString() { + toString: function() { return this.name || ""; } } @@ -493,7 +493,7 @@ AddonScreenshot.prototype = { caption: null, // Returns the screenshot URL, defaulting to the empty string - toString: function AddonScreenshot_toString() { + toString: function() { return this.url || ""; } } @@ -640,11 +640,11 @@ var AddonManagerInternal = { // Store telemetry details per addon provider telemetryDetails: {}, - recordTimestamp: function AMI_recordTimestamp(name, value) { + recordTimestamp: function(name, value) { this.TelemetryTimestamps.add(name, value); }, - validateBlocklist: function AMI_validateBlocklist() { + validateBlocklist: function() { let appBlocklist = FileUtils.getFile(KEY_APPDIR, [FILE_BLOCKLIST]); // If there is no application shipped blocklist then there is nothing to do @@ -771,7 +771,7 @@ var AddonManagerInternal = { * Initializes the AddonManager, loading any known providers and initializing * them. */ - startup: function AMI_startup() { + startup: function() { try { if (gStarted) return; @@ -925,7 +925,7 @@ var AddonManagerInternal = { * @param aTypes * An optional array of add-on types */ - registerProvider: function AMI_registerProvider(aProvider, aTypes) { + registerProvider: function(aProvider, aTypes) { if (!aProvider || typeof aProvider != "object") throw Components.Exception("aProvider must be specified", Cr.NS_ERROR_INVALID_ARG); @@ -977,7 +977,7 @@ var AddonManagerInternal = { * For providers that have async shutdown methods returning Promises, * the caller should wait for that Promise to resolve. */ - unregisterProvider: function AMI_unregisterProvider(aProvider) { + unregisterProvider: function(aProvider) { if (!aProvider || typeof aProvider != "object") throw Components.Exception("aProvider must be specified", Cr.NS_ERROR_INVALID_ARG); @@ -1032,7 +1032,7 @@ var AddonManagerInternal = { * * @param aProvider Provider object to mark safe */ - markProviderSafe: function AMI_markProviderSafe(aProvider) { + markProviderSafe: function(aProvider) { if (!gStarted) { throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1062,7 +1062,7 @@ var AddonManagerInternal = { * The method name to call * @see callProvider */ - callProviders: function AMI_callProviders(aMethod, ...aArgs) { + callProviders: function(aMethod, ...aArgs) { if (!aMethod || typeof aMethod != "string") throw Components.Exception("aMethod must be a non-empty string", Cr.NS_ERROR_INVALID_ARG); @@ -1163,7 +1163,7 @@ var AddonManagerInternal = { * * @see nsIObserver */ - observe: function AMI_observe(aSubject, aTopic, aData) { + observe: function(aSubject, aTopic, aData) { switch (aData) { case PREF_EM_CHECK_COMPATIBILITY: { let oldValue = gCheckCompatibility; @@ -1247,7 +1247,7 @@ var AddonManagerInternal = { * The optional application version to use for %APP_VERSION% * @return The appropriately escaped URI. */ - escapeAddonURI: function AMI_escapeAddonURI(aAddon, aUri, aAppVersion) + escapeAddonURI: function(aAddon, aUri, aAppVersion) { if (!aAddon || typeof aAddon != "object") throw Components.Exception("aAddon must be an Addon object", @@ -1318,7 +1318,7 @@ var AddonManagerInternal = { * @return Promise{null} Resolves when the background update check is complete * (the resulting addon installations may still be in progress). */ - backgroundUpdateCheck: function AMI_backgroundUpdateCheck() { + backgroundUpdateCheck: function() { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1347,7 +1347,7 @@ var AddonManagerInternal = { // be applied updates.push(new Promise((resolve, reject) => { addon.findUpdates({ - onUpdateAvailable: function BUC_onUpdateAvailable(aAddon, aInstall) { + onUpdateAvailable: function(aAddon, aInstall) { // Start installing updates when the add-on can be updated and // background updates should be applied. logger.debug("Found update for add-on ${id}", aAddon); @@ -1389,7 +1389,7 @@ var AddonManagerInternal = { * @param aID * The ID of the add-on */ - addStartupChange: function AMI_addStartupChange(aType, aID) { + addStartupChange: function(aType, aID) { if (!aType || typeof aType != "string") throw Components.Exception("aType must be a non-empty string", Cr.NS_ERROR_INVALID_ARG); @@ -1418,7 +1418,7 @@ var AddonManagerInternal = { * @param aID * The ID of the add-on */ - removeStartupChange: function AMI_removeStartupChange(aType, aID) { + removeStartupChange: function(aType, aID) { if (!aType || typeof aType != "string") throw Components.Exception("aType must be a non-empty string", Cr.NS_ERROR_INVALID_ARG); @@ -1444,7 +1444,7 @@ var AddonManagerInternal = { * @param aMethod * The method on the listeners to call */ - callManagerListeners: function AMI_callManagerListeners(aMethod, ...aArgs) { + callManagerListeners: function(aMethod, ...aArgs) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1475,7 +1475,7 @@ var AddonManagerInternal = { * An optional array of extra InstallListeners to also call * @return false if any of the listeners returned false, true otherwise */ - callInstallListeners: function AMI_callInstallListeners(aMethod, + callInstallListeners: function(aMethod, aExtraListeners, ...aArgs) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", @@ -1517,7 +1517,7 @@ var AddonManagerInternal = { * @param aMethod * The method on the listeners to call */ - callAddonListeners: function AMI_callAddonListeners(aMethod, ...aArgs) { + callAddonListeners: function(aMethod, ...aArgs) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1551,7 +1551,7 @@ var AddonManagerInternal = { * A boolean indicating if the change will only take place the next * time the application is restarted */ - notifyAddonChanged: function AMI_notifyAddonChanged(aID, aType, aPendingRestart) { + notifyAddonChanged: function(aID, aType, aPendingRestart) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1588,7 +1588,7 @@ var AddonManagerInternal = { * their add-ons in response to an application change such as a blocklist * update. */ - updateAddonAppDisabledStates: function AMI_updateAddonAppDisabledStates() { + updateAddonAppDisabledStates: function() { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1603,7 +1603,7 @@ var AddonManagerInternal = { * @param aCallback * Function to call when operation is complete. */ - updateAddonRepositoryData: function AMI_updateAddonRepositoryData(aCallback) { + updateAddonRepositoryData: function(aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1613,11 +1613,11 @@ var AddonManagerInternal = { Cr.NS_ERROR_INVALID_ARG); new AsyncObjectCaller(this.providers, "updateAddonRepositoryData", { - nextObject: function updateAddonRepositoryData_nextObject(aCaller, aProvider) { + nextObject: function(aCaller, aProvider) { callProviderAsync(aProvider, "updateAddonRepositoryData", aCaller.callNext.bind(aCaller)); }, - noMoreObjects: function updateAddonRepositoryData_noMoreObjects(aCaller) { + noMoreObjects: function(aCaller) { safeCall(aCallback); // only tests should care about this Services.obs.notifyObservers(null, "TEST:addon-repository-data-updated", null); @@ -1646,7 +1646,7 @@ var AddonManagerInternal = { * An optional nsILoadGroup to associate any network requests with * @throws if the aUrl, aCallback or aMimetype arguments are not specified */ - getInstallForURL: function AMI_getInstallForURL(aUrl, aCallback, aMimetype, + getInstallForURL: function(aUrl, aCallback, aMimetype, aHash, aName, aIcons, aVersion, aBrowser) { if (!gStarted) @@ -1716,7 +1716,7 @@ var AddonManagerInternal = { * An optional mimetype hint for the add-on * @throws if the aFile or aCallback arguments are not specified */ - getInstallForFile: function AMI_getInstallForFile(aFile, aCallback, aMimetype) { + getInstallForFile: function(aFile, aCallback, aMimetype) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1734,7 +1734,7 @@ var AddonManagerInternal = { Cr.NS_ERROR_INVALID_ARG); new AsyncObjectCaller(this.providers, "getInstallForFile", { - nextObject: function getInstallForFile_nextObject(aCaller, aProvider) { + nextObject: function(aCaller, aProvider) { callProviderAsync(aProvider, "getInstallForFile", aFile, function getInstallForFile_safeCall(aInstall) { if (aInstall) @@ -1744,7 +1744,7 @@ var AddonManagerInternal = { }); }, - noMoreObjects: function getInstallForFile_noMoreObjects(aCaller) { + noMoreObjects: function(aCaller) { safeCall(aCallback, null); } }); @@ -1760,7 +1760,7 @@ var AddonManagerInternal = { * A callback which will be passed an array of AddonInstalls * @throws If the aCallback argument is not specified */ - getInstallsByTypes: function AMI_getInstallsByTypes(aTypes, aCallback) { + getInstallsByTypes: function(aTypes, aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1776,7 +1776,7 @@ var AddonManagerInternal = { let installs = []; new AsyncObjectCaller(this.providers, "getInstallsByTypes", { - nextObject: function getInstallsByTypes_nextObject(aCaller, aProvider) { + nextObject: function(aCaller, aProvider) { callProviderAsync(aProvider, "getInstallsByTypes", aTypes, function getInstallsByTypes_safeCall(aProviderInstalls) { if (aProviderInstalls) { @@ -1786,7 +1786,7 @@ var AddonManagerInternal = { }); }, - noMoreObjects: function getInstallsByTypes_noMoreObjects(aCaller) { + noMoreObjects: function(aCaller) { safeCall(aCallback, installs); } }); @@ -1798,7 +1798,7 @@ var AddonManagerInternal = { * @param aCallback * A callback which will be passed an array of AddonInstalls */ - getAllInstalls: function AMI_getAllInstalls(aCallback) { + getAllInstalls: function(aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1818,7 +1818,7 @@ var AddonManagerInternal = { * @return string containing the Addon ID or null * @see amIAddonManager.mapURIToAddonID */ - mapURIToAddonID: function AMI_mapURIToAddonID(aURI) { + mapURIToAddonID: function(aURI) { if (!(aURI instanceof Ci.nsIURI)) { throw Components.Exception("aURI is not a nsIURI", Cr.NS_ERROR_INVALID_ARG); @@ -1843,7 +1843,7 @@ var AddonManagerInternal = { * The mimetype to check * @return true if installation is enabled for the mimetype */ - isInstallEnabled: function AMI_isInstallEnabled(aMimetype) { + isInstallEnabled: function(aMimetype) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1871,7 +1871,7 @@ var AddonManagerInternal = { * The nsIPrincipal that initiated the install * @return true if the source is allowed to install this mimetype */ - isInstallAllowed: function AMI_isInstallAllowed(aMimetype, aInstallingPrincipal) { + isInstallAllowed: function(aMimetype, aInstallingPrincipal) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -1906,10 +1906,7 @@ var AddonManagerInternal = { * @param aInstalls * The array of AddonInstalls to be installed */ - installAddonsFromWebpage: function AMI_installAddonsFromWebpage(aMimetype, - aBrowser, - aInstallingPrincipal, - aInstalls) { + installAddonsFromWebpage: function(aMimetype, aBrowser, aInstallingPrincipal, aInstalls) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -2011,7 +2008,7 @@ var AddonManagerInternal = { * @param aListener * The InstallListener to add */ - addInstallListener: function AMI_addInstallListener(aListener) { + addInstallListener: function(aListener) { if (!aListener || typeof aListener != "object") throw Components.Exception("aListener must be a InstallListener object", Cr.NS_ERROR_INVALID_ARG); @@ -2027,7 +2024,7 @@ var AddonManagerInternal = { * @param aListener * The InstallListener to remove */ - removeInstallListener: function AMI_removeInstallListener(aListener) { + removeInstallListener: function(aListener) { if (!aListener || typeof aListener != "object") throw Components.Exception("aListener must be a InstallListener object", Cr.NS_ERROR_INVALID_ARG); @@ -2050,7 +2047,7 @@ var AddonManagerInternal = { * The callback to pass the retrieved add-on to * @throws if the aID or aCallback arguments are not specified */ - getAddonByID: function AMI_getAddonByID(aID, aCallback) { + getAddonByID: function(aID, aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -2064,7 +2061,7 @@ var AddonManagerInternal = { Cr.NS_ERROR_INVALID_ARG); new AsyncObjectCaller(this.providers, "getAddonByID", { - nextObject: function getAddonByID_nextObject(aCaller, aProvider) { + nextObject: function(aCaller, aProvider) { callProviderAsync(aProvider, "getAddonByID", aID, function getAddonByID_safeCall(aAddon) { if (aAddon) @@ -2074,7 +2071,7 @@ var AddonManagerInternal = { }); }, - noMoreObjects: function getAddonByID_noMoreObjects(aCaller) { + noMoreObjects: function(aCaller) { safeCall(aCallback, null); } }); @@ -2089,7 +2086,7 @@ var AddonManagerInternal = { * The callback to pass the retrieved add-on to. * @throws if the aGUID or aCallback arguments are not specified */ - getAddonBySyncGUID: function AMI_getAddonBySyncGUID(aGUID, aCallback) { + getAddonBySyncGUID: function(aGUID, aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -2103,7 +2100,7 @@ var AddonManagerInternal = { Cr.NS_ERROR_INVALID_ARG); new AsyncObjectCaller(this.providers, "getAddonBySyncGUID", { - nextObject: function getAddonBySyncGUID_nextObject(aCaller, aProvider) { + nextObject: function(aCaller, aProvider) { callProviderAsync(aProvider, "getAddonBySyncGUID", aGUID, function getAddonBySyncGUID_safeCall(aAddon) { if (aAddon) { @@ -2114,7 +2111,7 @@ var AddonManagerInternal = { }); }, - noMoreObjects: function getAddonBySyncGUID_noMoreObjects(aCaller) { + noMoreObjects: function(aCaller) { safeCall(aCallback, null); } }); @@ -2129,7 +2126,7 @@ var AddonManagerInternal = { * The callback to pass an array of Addons to * @throws if the aID or aCallback arguments are not specified */ - getAddonsByIDs: function AMI_getAddonsByIDs(aIDs, aCallback) { + getAddonsByIDs: function(aIDs, aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -2145,7 +2142,7 @@ var AddonManagerInternal = { let addons = []; new AsyncObjectCaller(aIDs, null, { - nextObject: function getAddonsByIDs_nextObject(aCaller, aID) { + nextObject: function(aCaller, aID) { AddonManagerInternal.getAddonByID(aID, function getAddonsByIDs_getAddonByID(aAddon) { addons.push(aAddon); @@ -2153,7 +2150,7 @@ var AddonManagerInternal = { }); }, - noMoreObjects: function getAddonsByIDs_noMoreObjects(aCaller) { + noMoreObjects: function(aCaller) { safeCall(aCallback, addons); } }); @@ -2168,7 +2165,7 @@ var AddonManagerInternal = { * The callback to pass an array of Addons to. * @throws if the aCallback argument is not specified */ - getAddonsByTypes: function AMI_getAddonsByTypes(aTypes, aCallback) { + getAddonsByTypes: function(aTypes, aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -2184,7 +2181,7 @@ var AddonManagerInternal = { let addons = []; new AsyncObjectCaller(this.providers, "getAddonsByTypes", { - nextObject: function getAddonsByTypes_nextObject(aCaller, aProvider) { + nextObject: function(aCaller, aProvider) { callProviderAsync(aProvider, "getAddonsByTypes", aTypes, function getAddonsByTypes_concatAddons(aProviderAddons) { if (aProviderAddons) { @@ -2194,7 +2191,7 @@ var AddonManagerInternal = { }); }, - noMoreObjects: function getAddonsByTypes_noMoreObjects(aCaller) { + noMoreObjects: function(aCaller) { safeCall(aCallback, addons); } }); @@ -2206,7 +2203,7 @@ var AddonManagerInternal = { * @param aCallback * A callback which will be passed an array of Addons */ - getAllAddons: function AMI_getAllAddons(aCallback) { + getAllAddons: function(aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -2228,8 +2225,7 @@ var AddonManagerInternal = { * The callback to pass the array of Addons to * @throws if the aCallback argument is not specified */ - getAddonsWithOperationsByTypes: - function AMI_getAddonsWithOperationsByTypes(aTypes, aCallback) { + getAddonsWithOperationsByTypes: function(aTypes, aCallback) { if (!gStarted) throw Components.Exception("AddonManager is not initialized", Cr.NS_ERROR_NOT_INITIALIZED); @@ -2245,8 +2241,7 @@ var AddonManagerInternal = { let addons = []; new AsyncObjectCaller(this.providers, "getAddonsWithOperationsByTypes", { - nextObject: function getAddonsWithOperationsByTypes_nextObject - (aCaller, aProvider) { + nextObject: function(aCaller, aProvider) { callProviderAsync(aProvider, "getAddonsWithOperationsByTypes", aTypes, function getAddonsWithOperationsByTypes_concatAddons (aProviderAddons) { @@ -2257,7 +2252,7 @@ var AddonManagerInternal = { }); }, - noMoreObjects: function getAddonsWithOperationsByTypes_noMoreObjects(caller) { + noMoreObjects: function(caller) { safeCall(aCallback, addons); } }); @@ -2269,7 +2264,7 @@ var AddonManagerInternal = { * @param aListener * The listener to add */ - addManagerListener: function AMI_addManagerListener(aListener) { + addManagerListener: function(aListener) { if (!aListener || typeof aListener != "object") throw Components.Exception("aListener must be an AddonManagerListener object", Cr.NS_ERROR_INVALID_ARG); @@ -2285,7 +2280,7 @@ var AddonManagerInternal = { * @param aListener * The listener to remove */ - removeManagerListener: function AMI_removeManagerListener(aListener) { + removeManagerListener: function(aListener) { if (!aListener || typeof aListener != "object") throw Components.Exception("aListener must be an AddonManagerListener object", Cr.NS_ERROR_INVALID_ARG); @@ -2305,7 +2300,7 @@ var AddonManagerInternal = { * @param aListener * The AddonListener to add */ - addAddonListener: function AMI_addAddonListener(aListener) { + addAddonListener: function(aListener) { if (!aListener || typeof aListener != "object") throw Components.Exception("aListener must be an AddonListener object", Cr.NS_ERROR_INVALID_ARG); @@ -2321,7 +2316,7 @@ var AddonManagerInternal = { * @param aListener * The AddonListener to remove */ - removeAddonListener: function AMI_removeAddonListener(aListener) { + removeAddonListener: function(aListener) { if (!aListener || typeof aListener != "object") throw Components.Exception("aListener must be an AddonListener object", Cr.NS_ERROR_INVALID_ARG); @@ -2341,7 +2336,7 @@ var AddonManagerInternal = { * @param aListener * The TypeListener to add */ - addTypeListener: function AMI_addTypeListener(aListener) { + addTypeListener: function(aListener) { if (!aListener || typeof aListener != "object") throw Components.Exception("aListener must be a TypeListener object", Cr.NS_ERROR_INVALID_ARG); @@ -2357,7 +2352,7 @@ var AddonManagerInternal = { * @param aListener * The TypeListener to remove */ - removeTypeListener: function AMI_removeTypeListener(aListener) { + removeTypeListener: function(aListener) { if (!aListener || typeof aListener != "object") throw Components.Exception("aListener must be a TypeListener object", Cr.NS_ERROR_INVALID_ARG); @@ -2496,23 +2491,23 @@ var AddonManagerInternal = { * subject to change at any time. */ this.AddonManagerPrivate = { - startup: function AMP_startup() { + startup: function() { AddonManagerInternal.startup(); }, - registerProvider: function AMP_registerProvider(aProvider, aTypes) { + registerProvider: function(aProvider, aTypes) { AddonManagerInternal.registerProvider(aProvider, aTypes); }, - unregisterProvider: function AMP_unregisterProvider(aProvider) { + unregisterProvider: function(aProvider) { AddonManagerInternal.unregisterProvider(aProvider); }, - markProviderSafe: function AMP_markProviderSafe(aProvider) { + markProviderSafe: function(aProvider) { AddonManagerInternal.markProviderSafe(aProvider); }, - backgroundUpdateCheck: function AMP_backgroundUpdateCheck() { + backgroundUpdateCheck: function() { return AddonManagerInternal.backgroundUpdateCheck(); }, @@ -2526,32 +2521,32 @@ this.AddonManagerPrivate = { AddonManagerInternal.backgroundUpdateCheck(); }, - addStartupChange: function AMP_addStartupChange(aType, aID) { + addStartupChange: function(aType, aID) { AddonManagerInternal.addStartupChange(aType, aID); }, - removeStartupChange: function AMP_removeStartupChange(aType, aID) { + removeStartupChange: function(aType, aID) { AddonManagerInternal.removeStartupChange(aType, aID); }, - notifyAddonChanged: function AMP_notifyAddonChanged(aID, aType, aPendingRestart) { + notifyAddonChanged: function(aID, aType, aPendingRestart) { AddonManagerInternal.notifyAddonChanged(aID, aType, aPendingRestart); }, - updateAddonAppDisabledStates: function AMP_updateAddonAppDisabledStates() { + updateAddonAppDisabledStates: function() { AddonManagerInternal.updateAddonAppDisabledStates(); }, - updateAddonRepositoryData: function AMP_updateAddonRepositoryData(aCallback) { + updateAddonRepositoryData: function(aCallback) { AddonManagerInternal.updateAddonRepositoryData(aCallback); }, - callInstallListeners: function AMP_callInstallListeners(...aArgs) { + callInstallListeners: function(...aArgs) { return AddonManagerInternal.callInstallListeners.apply(AddonManagerInternal, aArgs); }, - callAddonListeners: function AMP_callAddonListeners(...aArgs) { + callAddonListeners: function(...aArgs) { AddonManagerInternal.callAddonListeners.apply(AddonManagerInternal, aArgs); }, @@ -2563,16 +2558,16 @@ this.AddonManagerPrivate = { AddonType: AddonType, - recordTimestamp: function AMP_recordTimestamp(name, value) { + recordTimestamp: function(name, value) { AddonManagerInternal.recordTimestamp(name, value); }, _simpleMeasures: {}, - recordSimpleMeasure: function AMP_recordSimpleMeasure(name, value) { + recordSimpleMeasure: function(name, value) { this._simpleMeasures[name] = value; }, - recordException: function AMP_recordException(aModule, aContext, aException) { + recordException: function(aModule, aContext, aException) { let report = { module: aModule, context: aContext @@ -2592,15 +2587,15 @@ this.AddonManagerPrivate = { this._simpleMeasures.exception = report; }, - getSimpleMeasures: function AMP_getSimpleMeasures() { + getSimpleMeasures: function() { return this._simpleMeasures; }, - getTelemetryDetails: function AMP_getTelemetryDetails() { + getTelemetryDetails: function() { return AddonManagerInternal.telemetryDetails; }, - setTelemetryDetails: function AMP_setTelemetryDetails(aProvider, aDetails) { + setTelemetryDetails: function(aProvider, aDetails) { AddonManagerInternal.telemetryDetails[aProvider] = aDetails; }, @@ -2619,7 +2614,7 @@ this.AddonManagerPrivate = { * This can be used as an implementation for Addon.findUpdates() when * no update mechanism is available. */ - callNoUpdateListeners: function (addon, listener, reason, appVersion, platformVersion) { + callNoUpdateListeners: function(addon, listener, reason, appVersion, platformVersion) { if ("onNoCompatibilityUpdateAvailable" in listener) { safeCall(listener.onNoCompatibilityUpdateAvailable.bind(listener), addon); } @@ -2830,14 +2825,13 @@ this.AddonManager = { return gStartupComplete && !gShutdownInProgress; }, - getInstallForURL: function AM_getInstallForURL(aUrl, aCallback, aMimetype, - aHash, aName, aIcons, - aVersion, aBrowser) { + getInstallForURL: function(aUrl, aCallback, aMimetype, aHash, aName, aIcons, + aVersion, aBrowser) { AddonManagerInternal.getInstallForURL(aUrl, aCallback, aMimetype, aHash, aName, aIcons, aVersion, aBrowser); }, - getInstallForFile: function AM_getInstallForFile(aFile, aCallback, aMimetype) { + getInstallForFile: function(aFile, aCallback, aMimetype) { AddonManagerInternal.getInstallForFile(aFile, aCallback, aMimetype); }, @@ -2848,94 +2842,91 @@ this.AddonManager = { * The type of startup change to get * @return An array of add-on IDs */ - getStartupChanges: function AM_getStartupChanges(aType) { + getStartupChangesAM_ge: function(aType) { if (!(aType in AddonManagerInternal.startupChanges)) return []; return AddonManagerInternal.startupChanges[aType].slice(0); }, - getAddonByID: function AM_getAddonByID(aID, aCallback) { + getAddonByID: function(aID, aCallback) { AddonManagerInternal.getAddonByID(aID, aCallback); }, - getAddonBySyncGUID: function AM_getAddonBySyncGUID(aGUID, aCallback) { + getAddonBySyncGUID: function(aGUID, aCallback) { AddonManagerInternal.getAddonBySyncGUID(aGUID, aCallback); }, - getAddonsByIDs: function AM_getAddonsByIDs(aIDs, aCallback) { + getAddonsByIDs: function(aIDs, aCallback) { AddonManagerInternal.getAddonsByIDs(aIDs, aCallback); }, - getAddonsWithOperationsByTypes: - function AM_getAddonsWithOperationsByTypes(aTypes, aCallback) { + getAddonsWithOperationsByTypes: function(aTypes, aCallback) { AddonManagerInternal.getAddonsWithOperationsByTypes(aTypes, aCallback); }, - getAddonsByTypes: function AM_getAddonsByTypes(aTypes, aCallback) { + getAddonsByTypes: function(aTypes, aCallback) { AddonManagerInternal.getAddonsByTypes(aTypes, aCallback); }, - getAllAddons: function AM_getAllAddons(aCallback) { + getAllAddons: function(aCallback) { AddonManagerInternal.getAllAddons(aCallback); }, - getInstallsByTypes: function AM_getInstallsByTypes(aTypes, aCallback) { + getInstallsByTypes: function(aTypes, aCallback) { AddonManagerInternal.getInstallsByTypes(aTypes, aCallback); }, - getAllInstalls: function AM_getAllInstalls(aCallback) { + getAllInstalls: function(aCallback) { AddonManagerInternal.getAllInstalls(aCallback); }, - mapURIToAddonID: function AM_mapURIToAddonID(aURI) { + mapURIToAddonID: function(aURI) { return AddonManagerInternal.mapURIToAddonID(aURI); }, - isInstallEnabled: function AM_isInstallEnabled(aType) { + isInstallEnabled: function(aType) { return AddonManagerInternal.isInstallEnabled(aType); }, - isInstallAllowed: function AM_isInstallAllowed(aType, aInstallingPrincipal) { + isInstallAllowed: function(aType, aInstallingPrincipal) { return AddonManagerInternal.isInstallAllowed(aType, ensurePrincipal(aInstallingPrincipal)); }, - installAddonsFromWebpage: function AM_installAddonsFromWebpage(aType, aBrowser, - aInstallingPrincipal, - aInstalls) { + installAddonsFromWebpage: function(aType, aBrowser, aInstallingPrincipal, aInstalls) { AddonManagerInternal.installAddonsFromWebpage(aType, aBrowser, ensurePrincipal(aInstallingPrincipal), aInstalls); }, - addManagerListener: function AM_addManagerListener(aListener) { + addManagerListener: function(aListener) { AddonManagerInternal.addManagerListener(aListener); }, - removeManagerListener: function AM_removeManagerListener(aListener) { + removeManagerListener: function(aListener) { AddonManagerInternal.removeManagerListener(aListener); }, - addInstallListener: function AM_addInstallListener(aListener) { + addInstallListener: function(aListener) { AddonManagerInternal.addInstallListener(aListener); }, - removeInstallListener: function AM_removeInstallListener(aListener) { + removeInstallListener: function(aListener) { AddonManagerInternal.removeInstallListener(aListener); }, - addAddonListener: function AM_addAddonListener(aListener) { + addAddonListener: function(aListener) { AddonManagerInternal.addAddonListener(aListener); }, - removeAddonListener: function AM_removeAddonListener(aListener) { + removeAddonListener: function(aListener) { AddonManagerInternal.removeAddonListener(aListener); }, - addTypeListener: function AM_addTypeListener(aListener) { + addTypeListener: function(aListener) { AddonManagerInternal.addTypeListener(aListener); }, - removeTypeListener: function AM_removeTypeListener(aListener) { + removeTypeListener: function(aListener) { AddonManagerInternal.removeTypeListener(aListener); }, @@ -2950,7 +2941,7 @@ this.AddonManager = { * The Addon representing the add-on * @return true if the addon should auto-update, false otherwise. */ - shouldAutoUpdate: function AM_shouldAutoUpdate(aAddon) { + shouldAutoUpdate: function(aAddon) { if (!aAddon || typeof aAddon != "object") throw Components.Exception("aAddon must be specified", Cr.NS_ERROR_INVALID_ARG); @@ -3008,7 +2999,7 @@ this.AddonManager = { AddonManagerInternal.autoUpdateDefault = aValue; }, - escapeAddonURI: function AM_escapeAddonURI(aAddon, aUri, aAppVersion) { + escapeAddonURI: function(aAddon, aUri, aAppVersion) { return AddonManagerInternal.escapeAddonURI(aAddon, aUri, aAppVersion); }, |