Bug 767236 - Part 4: Name all anonymous functions in remaining Add-ons Manager code. r=Unfocused
authorAtul Jangra <atuljangra66@gmail.com>
Wed, 24 Oct 2012 22:58:00 +1300
changeset 111349 2a7e4bc714fe8afd70545a2962c220db3d0c302b
parent 111348 ad1bb0c1002d9ec6a1986463b29c4439581f0ab0
child 111350 53ae9eb476e9009c2c4ac1de410f40b91a357331
push id23744
push userttaubert@mozilla.com
push dateThu, 25 Oct 2012 19:25:10 +0000
treeherdermozilla-central@55658b5ed234 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersUnfocused
bugs767236
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 767236 - Part 4: Name all anonymous functions in remaining Add-ons Manager code. r=Unfocused
toolkit/mozapps/extensions/AddonLogging.jsm
toolkit/mozapps/extensions/AddonManager.jsm
toolkit/mozapps/extensions/AddonRepository.jsm
toolkit/mozapps/extensions/AddonUpdateChecker.jsm
toolkit/mozapps/extensions/ChromeManifestParser.jsm
toolkit/mozapps/extensions/LightweightThemeImageOptimizer.jsm
toolkit/mozapps/extensions/LightweightThemeManager.jsm
toolkit/mozapps/extensions/XPIProviderUtils.js
toolkit/mozapps/extensions/addonManager.js
toolkit/mozapps/extensions/amContentHandler.js
toolkit/mozapps/extensions/amWebInstallListener.js
toolkit/mozapps/extensions/content/blocklist.js
toolkit/mozapps/extensions/content/extensions-content.js
toolkit/mozapps/extensions/content/newaddon.js
toolkit/mozapps/extensions/content/selectAddons.js
toolkit/mozapps/extensions/content/update.js
toolkit/mozapps/extensions/content/xpinstallConfirm.js
toolkit/mozapps/extensions/nsBlocklistService.js
--- a/toolkit/mozapps/extensions/AddonLogging.jsm
+++ b/toolkit/mozapps/extensions/AddonLogging.jsm
@@ -64,17 +64,17 @@ function getStackDetails(aException) {
 
 function AddonLogger(aName) {
   this.name = aName;
 }
 
 AddonLogger.prototype = {
   name: null,
 
-  error: function(aStr, aException) {
+  error: function AddonLogger_error(aStr, aException) {
     let message = formatLogMessage("error", this.name, aStr, aException);
 
     let stack = getStackDetails(aException);
 
     let consoleMessage = Cc["@mozilla.org/scripterror;1"].
                          createInstance(Ci.nsIScriptError);
     consoleMessage.init(message, stack.sourceName, null, stack.lineNumber, 0,
                         Ci.nsIScriptError.errorFlag, "component javascript");
@@ -95,66 +95,66 @@ AddonLogger.prototype = {
       writer.writeString(tstamp.toLocaleFormat("%Y-%m-%d %H:%M:%S ") +
                          message + " at " + stack.sourceName + ":" +
                          stack.lineNumber + "\n");
       writer.close();
     }
     catch (e) { }
   },
 
-  warn: function(aStr, aException) {
+  warn: function AddonLogger_warn(aStr, aException) {
     let message = formatLogMessage("warn", this.name, aStr, aException);
 
     let stack = getStackDetails(aException);
 
     let consoleMessage = Cc["@mozilla.org/scripterror;1"].
                          createInstance(Ci.nsIScriptError);
     consoleMessage.init(message, stack.sourceName, null, stack.lineNumber, 0,
                         Ci.nsIScriptError.warningFlag, "component javascript");
     Services.console.logMessage(consoleMessage);
 
     if (gDebugLogEnabled)
       dump("*** " + message + "\n");
   },
 
-  log: function(aStr, aException) {
+  log: function AddonLogger_log(aStr, aException) {
     if (gDebugLogEnabled) {
       let message = formatLogMessage("log", this.name, aStr, aException);
       dump("*** " + message + "\n");
       Services.console.logStringMessage(message);
     }
   }
 };
 
 var LogManager = {
-  getLogger: function(aName, aTarget) {
+  getLogger: function LogManager_getLogger(aName, aTarget) {
     let logger = new AddonLogger(aName);
 
     if (aTarget) {
       ["error", "warn", "log"].forEach(function(name) {
         let fname = name.toUpperCase();
         delete aTarget[fname];
-        aTarget[fname] = function(aStr, aException) {
+        aTarget[fname] = function LogManager_targetName(aStr, aException) {
           logger[name](aStr, aException);
         };
       });
     }
 
     return logger;
   }
 };
 
 var PrefObserver = {
-  init: function() {
+  init: function PrefObserver_init() {
     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(aSubject, aTopic, aData) {
+  observe: function PrefObserver_observe(aSubject, aTopic, aData) {
     if (aTopic == "xpcom-shutdown") {
       Services.prefs.removeObserver(PREF_LOGGING_ENABLED, this);
       Services.obs.removeObserver(this, "xpcom-shutdown");
     }
     else if (aTopic == NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) {
       try {
         gDebugLogEnabled = Services.prefs.getBoolPref(PREF_LOGGING_ENABLED);
       }
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -39,17 +39,17 @@ var PREF_EM_CHECK_COMPATIBILITY;
 
 const TOOLKIT_ID                      = "toolkit@mozilla.org";
 
 const VALID_TYPES_REGEXP = /^[\w\-]+$/;
 
 Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
-XPCOMUtils.defineLazyGetter(this, "CertUtils", function() {
+XPCOMUtils.defineLazyGetter(this, "CertUtils", function certUtilsLazyGetter() {
   let certUtils = {};
   Components.utils.import("resource://gre/modules/CertUtils.jsm", certUtils);
   return certUtils;
 });
 
 
 var EXPORTED_SYMBOLS = [ "AddonManager", "AddonManagerPrivate" ];
 
@@ -57,17 +57,17 @@ const CATEGORY_PROVIDER_MODULE = "addon-
 
 // A list of providers to load by default
 const DEFAULT_PROVIDERS = [
   "resource://gre/modules/XPIProvider.jsm",
   "resource://gre/modules/LightweightThemeManager.jsm"
 ];
 
 ["LOG", "WARN", "ERROR"].forEach(function(aName) {
-  this.__defineGetter__(aName, function() {
+  this.__defineGetter__(aName, function logFuncGetter() {
     Components.utils.import("resource://gre/modules/AddonLogging.jsm");
 
     LogManager.getLogger("addons.manager", this);
     return this[aName];
   });
 }, this);
 
 /**
@@ -199,17 +199,17 @@ function AddonAuthor(aName, aURL) {
   this.url = aURL;
 }
 
 AddonAuthor.prototype = {
   name: null,
   url: null,
 
   // Returns the author's name, defaulting to the empty string
-  toString: function() {
+  toString: function AddonAuthor_toString() {
     return this.name || "";
   }
 }
 
 /**
  * This represents an screenshot for an add-on
  *
  * @param  aURL
@@ -243,17 +243,17 @@ AddonScreenshot.prototype = {
   width: null,
   height: null,
   thumbnailURL: null,
   thumbnailWidth: null,
   thumbnailHeight: null,
   caption: null,
 
   // Returns the screenshot URL, defaulting to the empty string
-  toString: function() {
+  toString: function AddonScreenshot_toString() {
     return this.url || "";
   }
 }
 
 
 /**
  * This represents a compatibility override for an addon.
  *
@@ -349,17 +349,17 @@ function AddonType(aID, aLocaleURI, aLoc
                                Cr.NS_ERROR_INVALID_ARG);
 
   this.id = aID;
   this.uiPriority = aUIPriority;
   this.viewType = aViewType;
   this.flags = aFlags;
 
   if (aLocaleURI) {
-    this.__defineGetter__("name", function() {
+    this.__defineGetter__("name", function nameGetter() {
       delete this.name;
       let bundle = Services.strings.createBundle(aLocaleURI);
       this.name = bundle.GetStringFromName(aLocaleKey.replace("%ID%", aID));
       return this.name;
     });
   }
   else {
     this.name = aLocaleKey;
@@ -386,56 +386,56 @@ var AddonManagerInternal = {
   addonListeners: [],
   typeListeners: [],
   providers: [],
   types: {},
   startupChanges: {},
 
   // A read-only wrapper around the types dictionary
   typesProxy: Proxy.create({
-    getOwnPropertyDescriptor: function(aName) {
+    getOwnPropertyDescriptor: function typesProxy_getOwnPropertyDescriptor(aName) {
       if (!(aName in AddonManagerInternal.types))
         return undefined;
 
       return {
         value: AddonManagerInternal.types[aName].type,
         writable: false,
         configurable: false,
         enumerable: true
       }
     },
 
-    getPropertyDescriptor: function(aName) {
+    getPropertyDescriptor: function typesProxy_getPropertyDescriptor(aName) {
       return this.getOwnPropertyDescriptor(aName);
     },
 
-    getOwnPropertyNames: function() {
+    getOwnPropertyNames: function typesProxy_getOwnPropertyNames() {
       return Object.keys(AddonManagerInternal.types);
     },
 
-    getPropertyNames: function() {
+    getPropertyNames: function typesProxy_getPropertyNames() {
       return this.getOwnPropertyNames();
     },
 
-    delete: function(aName) {
+    delete: function typesProxy_delete(aName) {
       // Not allowed to delete properties
       return false;
     },
 
-    defineProperty: function(aName, aProperty) {
+    defineProperty: function typesProxy_defineProperty(aName, aProperty) {
       // Ignore attempts to define properties
     },
 
-    fix: function() {
+    fix: function typesProxy_fix(){
       return undefined;
     },
 
     // Despite MDC's claims to the contrary, it is required that this trap
     // be defined
-    enumerate: function() {
+    enumerate: function typesProxy_enumerate() {
       // All properties are enumerable
       return this.getPropertyNames();
     }
   }),
 
   /**
    * Initializes the AddonManager, loading any known providers and initializing
    * them.
@@ -582,17 +582,17 @@ var AddonManagerInternal = {
 
           this.types[aType.id] = {
             type: aType,
             providers: [aProvider]
           };
 
           let typeListeners = this.typeListeners.slice(0);
           for (let listener of typeListeners) {
-            safeCall(function() {
+            safeCall(function listenerSafeCall() {
               listener.onTypeAdded(aType);
             });
           }
         }
         else {
           this.types[aType.id].providers.push(aProvider);
         }
       }, this);
@@ -618,24 +618,24 @@ var AddonManagerInternal = {
     while (pos < this.providers.length) {
       if (this.providers[pos] == aProvider)
         this.providers.splice(pos, 1);
       else
         pos++;
     }
 
     for (let type in this.types) {
-      this.types[type].providers = this.types[type].providers.filter(function(p) p != aProvider);
+      this.types[type].providers = this.types[type].providers.filter(function filterProvider(p) p != aProvider);
       if (this.types[type].providers.length == 0) {
         let oldType = this.types[type].type;
         delete this.types[type];
 
         let typeListeners = this.typeListeners.slice(0);
         for (let listener of typeListeners) {
-          safeCall(function() {
+          safeCall(function listenerSafeCall() {
             listener.onTypeRemoved(oldType);
           });
         }
       }
     }
 
     // If we're unregistering after startup call this provider's shutdown.
     if (gStarted)
@@ -839,17 +839,17 @@ var AddonManagerInternal = {
     uri = uri.replace(/%APP_OS%/g, Services.appinfo.OS);
     uri = uri.replace(/%APP_ABI%/g, xpcomABI);
     uri = uri.replace(/%APP_LOCALE%/g, getLocale());
     uri = uri.replace(/%CURRENT_APP_VERSION%/g, Services.appinfo.version);
 
     // Replace custom parameters (names of custom parameters must have at
     // least 3 characters to prevent lookups for something like %D0%C8)
     var catMan = null;
-    uri = uri.replace(/%(\w{3,})%/g, function(aMatch, aParam) {
+    uri = uri.replace(/%(\w{3,})%/g, function parameterReplace(aMatch, aParam) {
       if (!catMan) {
         catMan = Cc["@mozilla.org/categorymanager;1"].
                  getService(Ci.nsICategoryManager);
       }
 
       try {
         var contractID = catMan.getCategoryEntry(CATEGORY_UPDATE_PARAMS, aParam);
         var paramHandler = Cc[contractID].getService(Ci.nsIPropertyBag2);
@@ -906,18 +906,20 @@ var AddonManagerInternal = {
 
       pendingUpdates++;
       this.getAllAddons(function getAddonsCallback(aAddons) {
         // If there is a known hotfix then exclude it from the list of add-ons to update.
         var ids = [a.id for each (a in aAddons) if (a.id != hotfixID)];
 
         // Repopulate repository cache first, to ensure compatibility overrides
         // are up to date before checking for addon updates.
-        scope.AddonRepository.backgroundUpdateCheck(ids, function BUC_backgroundUpdateCheckCallback() {
-          AddonManagerInternal.updateAddonRepositoryData(function BUC_updateAddonCallback() {
+        scope.AddonRepository.backgroundUpdateCheck(
+                     ids, function BUC_backgroundUpdateCheckCallback() {
+          AddonManagerInternal.updateAddonRepositoryData(
+                                    function BUC_updateAddonCallback() {
 
             pendingUpdates += aAddons.length;
             aAddons.forEach(function BUC_forEachCallback(aAddon) {
               if (aAddon.id == hotfixID) {
                 notifyComplete();
                 return;
               }
 
@@ -962,34 +964,35 @@ var AddonManagerInternal = {
         version: hotfixVersion,
         userDisabled: false,
         appDisabled: false
       }, url);
 
       pendingUpdates++;
       Components.utils.import("resource://gre/modules/AddonUpdateChecker.jsm");
       AddonUpdateChecker.checkForUpdates(hotfixID, null, url, {
-        onUpdateCheckComplete: function(aUpdates) {
+        onUpdateCheckComplete: function BUC_onUpdateCheckComplete(aUpdates) {
           let update = AddonUpdateChecker.getNewestCompatibleUpdate(aUpdates);
           if (!update) {
             notifyComplete();
             return;
           }
 
           // If the available version isn't newer than the last installed
           // version then ignore it.
           if (Services.vc.compare(hotfixVersion, update.version) >= 0) {
             notifyComplete();
             return;
           }
 
           LOG("Downloading hotfix version " + update.version);
-          AddonManager.getInstallForURL(update.updateURL, function(aInstall) {
+          AddonManager.getInstallForURL(update.updateURL,
+                                       function BUC_getInstallForURL(aInstall) {
             aInstall.addListener({
-              onDownloadEnded: function(aInstall) {
+              onDownloadEnded: function BUC_onDownloadEnded(aInstall) {
                 try {
                   if (!Services.prefs.getBoolPref(PREF_EM_CERT_CHECKATTRIBUTES))
                     return;
                 }
                 catch (e) {
                   // By default don't do certificate checks.
                   return;
                 }
@@ -1000,23 +1003,23 @@ var AddonManagerInternal = {
                 }
                 catch (e) {
                   WARN("The hotfix add-on was not signed by the expected " +
                        "certificate and so will not be installed.");
                   aInstall.cancel();
                 }
               },
 
-              onInstallEnded: function(aInstall) {
+              onInstallEnded: function BUC_onInstallEnded(aInstall) {
                 // Remember the last successfully installed version.
                 Services.prefs.setCharPref(PREF_EM_HOTFIX_LASTVERSION,
                                            aInstall.version);
               },
 
-              onInstallCancelled: function(aInstall) {
+              onInstallCancelled: function BUC_onInstallCancelled(aInstall) {
                 // Revert to the previous version if the installation was
                 // cancelled.
                 Services.prefs.setCharPref(PREF_EM_HOTFIX_LASTVERSION,
                                            hotfixVersion);
               }
             });
 
             aInstall.install();
@@ -1084,17 +1087,18 @@ var AddonManagerInternal = {
                                  Cr.NS_ERROR_INVALID_ARG);
 
     if (gStartupComplete)
       return;
 
     if (!(aType in this.startupChanges))
       return;
 
-    this.startupChanges[aType] = this.startupChanges[aType].filter(function(aItem) aItem != aID);
+    this.startupChanges[aType] = this.startupChanges[aType].filter(
+                                 function filterItem(aItem) aItem != aID);
   },
 
   /**
    * Calls all registered AddonManagerListeners with an event. Any parameters
    * after the method parameter are passed to the listener.
    *
    * @param  aMethod
    *         The method on the listeners to call
@@ -1125,17 +1129,18 @@ var AddonManagerInternal = {
    * the extraListeners parameter are passed to the listener.
    *
    * @param  aMethod
    *         The method on the listeners to call
    * @param  aExtraListeners
    *         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, aExtraListeners, ...aArgs) {
+  callInstallListeners: function AMI_callInstallListeners(aMethod, 
+                                 aExtraListeners, ...aArgs) {
     if (!gStarted)
       throw Components.Exception("AddonManager is not initialized",
                                  Cr.NS_ERROR_NOT_INITIALIZED);
 
     if (!aMethod || typeof aMethod != "string")
       throw Components.Exception("aMethod must be a non-empty string",
                                  Cr.NS_ERROR_INVALID_ARG);
 
@@ -1246,23 +1251,23 @@ var AddonManagerInternal = {
       throw Components.Exception("AddonManager is not initialized",
                                  Cr.NS_ERROR_NOT_INITIALIZED);
 
     if (typeof aCallback != "function")
       throw Components.Exception("aCallback must be a function",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     new AsyncObjectCaller(this.providers, "updateAddonRepositoryData", {
-      nextObject: function(aCaller, aProvider) {
+      nextObject: function updateAddonRepositoryData_nextObject(aCaller, aProvider) {
         callProvider(aProvider,
                      "updateAddonRepositoryData",
                      null,
                      aCaller.callNext.bind(aCaller));
       },
-      noMoreObjects: function(aCaller) {
+      noMoreObjects: function updateAddonRepositoryData_noMoreObjects(aCaller) {
         safeCall(aCallback);
       }
     });
   },
 
   /**
    * Asynchronously gets an AddonInstall for a URL.
    *
@@ -1329,17 +1334,17 @@ var AddonManagerInternal = {
       throw Components.Exception("aLoadGroup must be a nsILoadGroup or null",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     let providers = this.providers.slice(0);
     for (let provider of providers) {
       if (callProvider(provider, "supportsMimetype", false, aMimetype)) {
         callProvider(provider, "getInstallForURL", null,
                      aUrl, aHash, aName, aIcons, aVersion, aLoadGroup,
-                     function(aInstall) {
+                     function  getInstallForURL_safeCall(aInstall) {
           safeCall(aCallback, aInstall);
         });
         return;
       }
     }
     safeCall(aCallback, null);
   },
 
@@ -1367,27 +1372,27 @@ var AddonManagerInternal = {
       throw Components.Exception("aCallback must be a function",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     if (aMimetype && typeof aMimetype != "string")
       throw Components.Exception("aMimetype must be a string or null",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     new AsyncObjectCaller(this.providers, "getInstallForFile", {
-      nextObject: function(aCaller, aProvider) {
+      nextObject: function getInstallForFile_nextObject(aCaller, aProvider) {
         callProvider(aProvider, "getInstallForFile", null, aFile,
-                     function(aInstall) {
+                     function getInstallForFile_safeCall(aInstall) {
           if (aInstall)
             safeCall(aCallback, aInstall);
           else
             aCaller.callNext();
         });
       },
 
-      noMoreObjects: function(aCaller) {
+      noMoreObjects: function getInstallForFile_noMoreObjects(aCaller) {
         safeCall(aCallback, null);
       }
     });
   },
 
   /**
    * Asynchronously gets all current AddonInstalls optionally limiting to a list
    * of types.
@@ -1409,25 +1414,25 @@ var AddonManagerInternal = {
 
     if (typeof aCallback != "function")
       throw Components.Exception("aCallback must be a function",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     let installs = [];
 
     new AsyncObjectCaller(this.providers, "getInstallsByTypes", {
-      nextObject: function(aCaller, aProvider) {
+      nextObject: function getInstallsByTypes_nextObject(aCaller, aProvider) {
         callProvider(aProvider, "getInstallsByTypes", null, aTypes,
-                     function(aProviderInstalls) {
+                     function getInstallsByTypes_safeCall(aProviderInstalls) {
           installs = installs.concat(aProviderInstalls);
           aCaller.callNext();
         });
       },
 
-      noMoreObjects: function(aCaller) {
+      noMoreObjects: function getInstallsByTypes_noMoreObjects(aCaller) {
         safeCall(aCallback, installs);
       }
     });
   },
 
   /**
    * Asynchronously gets all current AddonInstalls.
    *
@@ -1584,17 +1589,18 @@ var AddonManagerInternal = {
    * @param  aListener
    *         The InstallListener to add
    */
   addInstallListener: function AMI_addInstallListener(aListener) {
     if (!aListener || typeof aListener != "object")
       throw Components.Exception("aListener must be a InstallListener object",
                                  Cr.NS_ERROR_INVALID_ARG);
     
-    if (!this.installListeners.some(function(i) { return i == aListener; }))
+    if (!this.installListeners.some(function addInstallListener_matchListener(i) {
+      return i == aListener; }))
       this.installListeners.push(aListener);
   },
 
   /**
    * Removes an InstallListener if the listener is registered.
    *
    * @param  aListener
    *         The InstallListener to remove
@@ -1631,26 +1637,27 @@ var AddonManagerInternal = {
       throw Components.Exception("aID 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, "getAddonByID", {
-      nextObject: function(aCaller, aProvider) {
-        callProvider(aProvider, "getAddonByID", null, aID, function(aAddon) {
+      nextObject: function getAddonByID_nextObject(aCaller, aProvider) {
+        callProvider(aProvider, "getAddonByID", null, aID,
+                    function getAddonByID_safeCall(aAddon) {
           if (aAddon)
             safeCall(aCallback, aAddon);
           else
             aCaller.callNext();
         });
       },
 
-      noMoreObjects: function(aCaller) {
+      noMoreObjects: function getAddonByID_noMoreObjects(aCaller) {
         safeCall(aCallback, null);
       }
     });
   },
 
   /**
    * Asynchronously get an add-on with a specific Sync GUID.
    *
@@ -1669,27 +1676,28 @@ var AddonManagerInternal = {
       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) {
+      nextObject: function getAddonBySyncGUID_nextObject(aCaller, aProvider) {
+        callProvider(aProvider, "getAddonBySyncGUID", null, aGUID,
+                    function getAddonBySyncGUID_safeCall(aAddon) {
           if (aAddon) {
             safeCall(aCallback, aAddon);
           } else {
             aCaller.callNext();
           }
         });
       },
 
-      noMoreObjects: function(aCaller) {
+      noMoreObjects: function getAddonBySyncGUID_noMoreObjects(aCaller) {
         safeCall(aCallback, null);
       }
     });
   },
 
   /**
    * Asynchronously gets an array of add-ons.
    *
@@ -1710,24 +1718,25 @@ var AddonManagerInternal = {
 
     if (typeof aCallback != "function")
       throw Components.Exception("aCallback must be a function",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     let addons = [];
 
     new AsyncObjectCaller(aIDs, null, {
-      nextObject: function(aCaller, aID) {
-        AddonManagerInternal.getAddonByID(aID, function(aAddon) {
+      nextObject: function getAddonsByIDs_nextObject(aCaller, aID) {
+        AddonManagerInternal.getAddonByID(aID, 
+                             function getAddonsByIDs_getAddonByID(aAddon) {
           addons.push(aAddon);
           aCaller.callNext();
         });
       },
 
-      noMoreObjects: function(aCaller) {
+      noMoreObjects: function getAddonsByIDs_noMoreObjects(aCaller) {
         safeCall(aCallback, addons);
       }
     });
   },
 
   /**
    * Asynchronously gets add-ons of specific types.
    *
@@ -1748,25 +1757,25 @@ var AddonManagerInternal = {
 
     if (typeof aCallback != "function")
       throw Components.Exception("aCallback must be a function",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     let addons = [];
 
     new AsyncObjectCaller(this.providers, "getAddonsByTypes", {
-      nextObject: function(aCaller, aProvider) {
+      nextObject: function getAddonsByTypes_nextObject(aCaller, aProvider) {
         callProvider(aProvider, "getAddonsByTypes", null, aTypes,
-                     function(aProviderAddons) {
+                     function getAddonsByTypes_concatAddons(aProviderAddons) {
           addons = addons.concat(aProviderAddons);
           aCaller.callNext();
         });
       },
 
-      noMoreObjects: function(aCaller) {
+      noMoreObjects: function getAddonsByTypes_noMoreObjects(aCaller) {
         safeCall(aCallback, addons);
       }
     });
   },
 
   /**
    * Asynchronously gets all installed add-ons.
    *
@@ -1807,42 +1816,45 @@ var AddonManagerInternal = {
 
     if (typeof aCallback != "function")
       throw Components.Exception("aCallback must be a function",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     let addons = [];
 
     new AsyncObjectCaller(this.providers, "getAddonsWithOperationsByTypes", {
-      nextObject: function(aCaller, aProvider) {
+      nextObject: function getAddonsWithOperationsByTypes_nextObject
+                           (aCaller, aProvider) {
         callProvider(aProvider, "getAddonsWithOperationsByTypes", null, aTypes,
-                     function(aProviderAddons) {
+                     function getAddonsWithOperationsByTypes_concatAddons
+                              (aProviderAddons) {
           addons = addons.concat(aProviderAddons);
           aCaller.callNext();
         });
       },
 
-      noMoreObjects: function(caller) {
+      noMoreObjects: function getAddonsWithOperationsByTypes_noMoreObjects(caller) {
         safeCall(aCallback, addons);
       }
     });
   },
 
   /**
    * Adds a new AddonManagerListener if the listener is not already registered.
    *
    * @param  aListener
    *         The listener to add
    */
   addManagerListener: function AMI_addManagerListener(aListener) {
     if (!aListener || typeof aListener != "object")
       throw Components.Exception("aListener must be an AddonManagerListener object",
                                  Cr.NS_ERROR_INVALID_ARG);
 
-    if (!this.managerListeners.some(function(i) { return i == aListener; }))
+    if (!this.managerListeners.some(function addManagerListener_matchListener(i) {
+      return i == aListener; }))
       this.managerListeners.push(aListener);
   },
 
   /**
    * Removes an AddonManagerListener if the listener is registered.
    *
    * @param  aListener
    *         The listener to remove
@@ -1867,17 +1879,18 @@ var AddonManagerInternal = {
    * @param  aListener
    *         The AddonListener to add
    */
   addAddonListener: function AMI_addAddonListener(aListener) {
     if (!aListener || typeof aListener != "object")
       throw Components.Exception("aListener must be an AddonListener object",
                                  Cr.NS_ERROR_INVALID_ARG);
 
-    if (!this.addonListeners.some(function(i) { return i == aListener; }))
+    if (!this.addonListeners.some(function addAddonListener_matchListener(i) {
+      return i == aListener; }))
       this.addonListeners.push(aListener);
   },
 
   /**
    * Removes an AddonListener if the listener is registered.
    *
    * @param  aListener
    *         The AddonListener to remove
@@ -1902,17 +1915,18 @@ var AddonManagerInternal = {
    * @param  aListener
    *         The TypeListener to add
    */
   addTypeListener: function AMI_addTypeListener(aListener) {
     if (!aListener || typeof aListener != "object")
       throw Components.Exception("aListener must be a TypeListener object",
                                  Cr.NS_ERROR_INVALID_ARG);
 
-    if (!this.typeListeners.some(function(i) { return i == aListener; }))
+    if (!this.typeListeners.some(function addTypeListener_matchListener(i) {
+      return i == aListener; }))
       this.typeListeners.push(aListener);
   },
 
   /**
    * Removes an TypeListener if the listener is registered.
    *
    * @param  aListener
    *         The TypeListener to remove
--- a/toolkit/mozapps/extensions/AddonRepository.jsm
+++ b/toolkit/mozapps/extensions/AddonRepository.jsm
@@ -1864,17 +1864,17 @@ var AddonDatabase = {
 
           getAllIcons();
         }
       });
     }
 
     function getAllIcons() {
       self.getAsyncStatement("getAllIcons").executeAsync({
-        handleResult: function(aResults) {
+        handleResult: function getAllIcons_handleResult(aResults) {
           let row = null;
           while (row = aResults.getNextRow()) {
             let addon_internal_id = row.getResultByName("addon_internal_id");
             if (!(addon_internal_id in addons)) {
               WARN("Found an icon not linked to an add-on in database");
               continue;
             }
 
@@ -1883,17 +1883,17 @@ var AddonDatabase = {
             addon.icons[size] = url;
             if (size == 32)
               addon.iconURL = url;
           }
         },
 
         handleError: self.asyncErrorLogger,
 
-        handleCompletion: function(aReason) {
+        handleCompletion: function getAllIcons_handleCompletion(aReason) {
           if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {
             ERROR("Error retrieving icons from database. Returning empty results");
             aCallback({});
             return;
           }
 
           let returnedAddons = {};
           for each (let addon in addons)
--- a/toolkit/mozapps/extensions/AddonUpdateChecker.jsm
+++ b/toolkit/mozapps/extensions/AddonUpdateChecker.jsm
@@ -30,27 +30,27 @@ Components.utils.import("resource://gre/
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
                                   "resource://gre/modules/AddonManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
                                   "resource://gre/modules/AddonRepository.jsm");
 
 // Shared code for suppressing bad cert dialogs.
-XPCOMUtils.defineLazyGetter(this, "CertUtils", function() {
+XPCOMUtils.defineLazyGetter(this, "CertUtils", function certUtilsLazyGetter() {
   let certUtils = {};
   Components.utils.import("resource://gre/modules/CertUtils.jsm", certUtils);
   return certUtils;
 });
 
 var gRDF = Cc["@mozilla.org/rdf/rdf-service;1"].
            getService(Ci.nsIRDFService);
 
 ["LOG", "WARN", "ERROR"].forEach(function(aName) {
-  this.__defineGetter__(aName, function() {
+  this.__defineGetter__(aName, function logFuncGetter() {
     Components.utils.import("resource://gre/modules/AddonLogging.jsm");
 
     LogManager.getLogger("addons.updates", this);
     return this[aName];
   });
 }, this);
 
 
@@ -408,18 +408,18 @@ function UpdateParser(aId, aUpdateKey, a
   try {
     this.request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].
                    createInstance(Ci.nsIXMLHttpRequest);
     this.request.open("GET", aUrl, true);
     this.request.channel.notificationCallbacks = new CertUtils.BadCertHandler(!requireBuiltIn);
     this.request.channel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
     this.request.overrideMimeType("text/xml");
     var self = this;
-    this.request.addEventListener("load", function(event) { self.onLoad() }, false);
-    this.request.addEventListener("error", function(event) { self.onError() }, false);
+    this.request.addEventListener("load", function loadEventListener(event) { self.onLoad() }, false);
+    this.request.addEventListener("error", function errorEventListener(event) { self.onError() }, false);
     this.request.send(null);
   }
   catch (e) {
     ERROR("Failed to request update manifest", e);
   }
 }
 
 UpdateParser.prototype = {
--- a/toolkit/mozapps/extensions/ChromeManifestParser.jsm
+++ b/toolkit/mozapps/extensions/ChromeManifestParser.jsm
@@ -147,13 +147,13 @@ var ChromeManifestParser = {
   *
   * @param  aManifest
   *         Manifest data, as returned by ChromeManifestParser.parseSync().
   * @param  aType
   *         Instruction type to filter by.
   * @return True if any matching instructions were found in the manifest.
   */
   hasType: function CMP_hasType(aManifest, aType) {
-    return aManifest.some(function(aEntry) {
+    return aManifest.some(function hasType_matchEntryType(aEntry) {
       return aEntry.type == aType;
     });
   }
 };
--- a/toolkit/mozapps/extensions/LightweightThemeImageOptimizer.jsm
+++ b/toolkit/mozapps/extensions/LightweightThemeImageOptimizer.jsm
@@ -92,17 +92,17 @@ let ImageCropper = {
   _crop: function ImageCropper_crop(aURI, aTargetFile, aScreen, aOrigin) {
     let inProgress = this._inProgress;
     inProgress[aTargetFile.path] = true;
 
     function resetInProgress() {
       delete inProgress[aTargetFile.path];
     }
 
-    ImageFile.read(aURI, function (aInputStream, aContentType) {
+    ImageFile.read(aURI, function crop_readImageFile(aInputStream, aContentType) {
       if (aInputStream && aContentType) {
         let image = ImageTools.decode(aInputStream, aContentType);
         if (image && image.width && image.height) {
           let stream = ImageTools.encode(image, aScreen, aOrigin, aContentType);
           if (stream) {
             ImageFile.write(aTargetFile, stream, resetInProgress);
             return;
           }
@@ -111,29 +111,29 @@ let ImageCropper = {
 
       resetInProgress();
     });
   }
 };
 
 let ImageFile = {
   read: function ImageFile_read(aURI, aCallback) {
-    this._netUtil.asyncFetch(aURI, function (aInputStream, aStatus, aRequest) {
+    this._netUtil.asyncFetch(aURI, function read_asyncFetch(aInputStream, aStatus, aRequest) {
       if (Components.isSuccessCode(aStatus) && aRequest instanceof Ci.nsIChannel) {
         let channel = aRequest.QueryInterface(Ci.nsIChannel);
         aCallback(aInputStream, channel.contentType);
       } else {
         aCallback();
       }
     });
   },
 
   write: function ImageFile_write(aFile, aInputStream, aCallback) {
     let fos = FileUtils.openSafeFileOutputStream(aFile);
-    this._netUtil.asyncCopy(aInputStream, fos, function (aResult) {
+    this._netUtil.asyncCopy(aInputStream, fos, function write_asyncCopy(aResult) {
       FileUtils.closeSafeFileOutputStream(fos);
 
       // Remove the file if writing was not successful.
       if (!Components.isSuccessCode(aResult)) {
         try {
           aFile.remove(false);
         } catch (e) {}
       }
--- a/toolkit/mozapps/extensions/LightweightThemeManager.jsm
+++ b/toolkit/mozapps/extensions/LightweightThemeManager.jsm
@@ -37,33 +37,33 @@ const PERSIST_BYPASS_CACHE = false;
 const PERSIST_FILES = {
   headerURL: "lightweighttheme-header",
   footerURL: "lightweighttheme-footer"
 };
 
 XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer",
   "resource://gre/modules/LightweightThemeImageOptimizer.jsm");
 
-__defineGetter__("_prefs", function () {
+__defineGetter__("_prefs", function prefsGetter() {
   delete this._prefs;
   return this._prefs = Services.prefs.getBranch("lightweightThemes.");
 });
 
-__defineGetter__("_maxUsedThemes", function() {
+__defineGetter__("_maxUsedThemes", function maxUsedThemesGetter() {
   delete this._maxUsedThemes;
   try {
     this._maxUsedThemes = _prefs.getIntPref("maxUsedThemes");
   }
   catch (e) {
     this._maxUsedThemes = DEFAULT_MAX_USED_THEMES_COUNT;
   }
   return this._maxUsedThemes;
 });
 
-__defineSetter__("_maxUsedThemes", function(aVal) {
+__defineSetter__("_maxUsedThemes", function maxUsedThemesSetter(aVal) {
   delete this._maxUsedThemes;
   return this._maxUsedThemes = aVal;
 });
 
 // Holds the ID of the theme being enabled or disabled while sending out the
 // events so cached AddonWrapper instances can return correct values for
 // permissions and pendingOperations
 var _themeIDBeingEnabled = null;
@@ -103,30 +103,30 @@ var LightweightThemeManager = {
 
     return data;
   },
 
   set currentTheme (aData) {
     return _setCurrentTheme(aData, false);
   },
 
-  setLocalTheme: function (aData) {
+  setLocalTheme: function LightweightThemeManager_setLocalTheme(aData) {
     _setCurrentTheme(aData, true);
   },
 
-  getUsedTheme: function (aId) {
+  getUsedTheme: function LightweightThemeManager_getUsedTheme(aId) {
     var usedThemes = this.usedThemes;
     for (let usedTheme of usedThemes) {
       if (usedTheme.id == aId)
         return usedTheme;
     }
     return null;
   },
 
-  forgetUsedTheme: function (aId) {
+  forgetUsedTheme: function LightweightThemeManager_forgetUsedTheme(aId) {
     let theme = this.getUsedTheme(aId);
     if (!theme)
       return;
 
     let wrapper = new AddonWrapper(theme);
     AddonManagerPrivate.callAddonListeners("onUninstalling", wrapper, false);
 
     var currentTheme = this.currentTheme;
@@ -134,17 +134,17 @@ var LightweightThemeManager = {
       this.themeChanged(null);
       AddonManagerPrivate.notifyAddonChanged(null, ADDON_TYPE, false);
     }
 
     _updateUsedThemes(_usedThemesExceptId(aId));
     AddonManagerPrivate.callAddonListeners("onUninstalled", wrapper);
   },
 
-  previewTheme: function (aData) {
+  previewTheme: function LightweightThemeManager_previewTheme(aData) {
     if (!aData)
       return;
 
     let cancel = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
     cancel.data = false;
     Services.obs.notifyObservers(cancel, "lightweight-theme-preview-requested",
                                  JSON.stringify(aData));
     if (cancel.data)
@@ -156,33 +156,33 @@ var LightweightThemeManager = {
       _previewTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
     _previewTimer.initWithCallback(_previewTimerCallback,
                                    MAX_PREVIEW_SECONDS * 1000,
                                    _previewTimer.TYPE_ONE_SHOT);
 
     _notifyWindows(aData);
   },
 
-  resetPreview: function () {
+  resetPreview: function LightweightThemeManager_resetPreview() {
     if (_previewTimer) {
       _previewTimer.cancel();
       _previewTimer = null;
       _notifyWindows(this.currentThemeForDisplay);
     }
   },
 
-  parseTheme: function (aString, aBaseURI) {
+  parseTheme: function LightweightThemeManager_parseTheme(aString, aBaseURI) {
     try {
       return _sanitizeTheme(JSON.parse(aString), aBaseURI, false);
     } catch (e) {
       return null;
     }
   },
 
-  updateCurrentTheme: function () {
+  updateCurrentTheme: function LightweightThemeManager_updateCurrentTheme() {
     try {
       if (!_prefs.getBoolPref("update.enabled"))
         return;
     } catch (e) {
       return;
     }
 
     var theme = this.currentTheme;
@@ -192,17 +192,17 @@ var LightweightThemeManager = {
     var req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
                 .createInstance(Ci.nsIXMLHttpRequest);
 
     req.mozBackgroundRequest = true;
     req.overrideMimeType("text/plain");
     req.open("GET", theme.updateURL, true);
 
     var self = this;
-    req.addEventListener("load", function () {
+    req.addEventListener("load", function loadEventListener() {
       if (req.status != 200)
         return;
 
       let newData = self.parseTheme(req.responseText, theme.updateURL);
       if (!newData ||
           newData.id != theme.id ||
           _version(newData) == _version(theme))
         return;
@@ -216,76 +216,76 @@ var LightweightThemeManager = {
   },
 
   /**
    * Switches to a new lightweight theme.
    *
    * @param  aData
    *         The lightweight theme to switch to
    */
-  themeChanged: function(aData) {
+  themeChanged: function LightweightThemeManager_themeChanged(aData) {
     if (_previewTimer) {
       _previewTimer.cancel();
       _previewTimer = null;
     }
 
     if (aData) {
       let usedThemes = _usedThemesExceptId(aData.id);
       usedThemes.unshift(aData);
       _updateUsedThemes(usedThemes);
       if (PERSIST_ENABLED) {
         LightweightThemeImageOptimizer.purge();
-        _persistImages(aData, function () {
+        _persistImages(aData, function themeChanged_persistImages() {
           _notifyWindows(this.currentThemeForDisplay);
         }.bind(this));
       }
     }
 
     _prefs.setBoolPref("isThemeSelected", aData != null);
     _notifyWindows(aData);
     Services.obs.notifyObservers(null, "lightweight-theme-changed", null);
   },
 
   /**
    * Starts the Addons provider and enables the new lightweight theme if
    * necessary.
    */
-  startup: function() {
+  startup: function LightweightThemeManager_startup() {
     if (Services.prefs.prefHasUserValue(PREF_LWTHEME_TO_SELECT)) {
       let id = Services.prefs.getCharPref(PREF_LWTHEME_TO_SELECT);
       if (id)
         this.themeChanged(this.getUsedTheme(id));
       else
         this.themeChanged(null);
       Services.prefs.clearUserPref(PREF_LWTHEME_TO_SELECT);
     }
 
     _prefs.addObserver("", _prefObserver, false);
   },
 
   /**
    * Shuts down the provider.
    */
-  shutdown: function() {
+  shutdown: function LightweightThemeManager_shutdown() {
     _prefs.removeObserver("", _prefObserver);
   },
 
   /**
    * Called when a new add-on has been enabled when only one add-on of that type
    * can be enabled.
    *
    * @param  aId
    *         The ID of the newly enabled add-on
    * @param  aType
    *         The type of the newly enabled add-on
    * @param  aPendingRestart
    *         true if the newly enabled add-on will only become enabled after a
    *         restart
    */
-  addonChanged: function(aId, aType, aPendingRestart) {
+  addonChanged: function LightweightThemeManager_addonChanged(aId, aType, aPendingRestart) {
     if (aType != ADDON_TYPE)
       return;
 
     let id = _getInternalID(aId);
     let current = this.currentTheme;
 
     try {
       let next = Services.prefs.getCharPref(PREF_LWTHEME_TO_SELECT);
@@ -348,17 +348,17 @@ var LightweightThemeManager = {
   /**
    * Called to get an Addon with a particular ID.
    *
    * @param  aId
    *         The ID of the add-on to retrieve
    * @param  aCallback
    *         A callback to pass the Addon to
    */
-  getAddonByID: function(aId, aCallback) {
+  getAddonByID: function LightweightThemeManager_getAddonByID(aId, aCallback) {
     let id = _getInternalID(aId);
     if (!id) {
       aCallback(null);
       return;
      }
 
     let theme = this.getUsedTheme(id);
     if (!theme) {
@@ -372,141 +372,143 @@ var LightweightThemeManager = {
   /**
    * Called to get Addons of a particular type.
    *
    * @param  aTypes
    *         An array of types to fetch. Can be null to get all types.
    * @param  aCallback
    *         A callback to pass an array of Addons to
    */
-  getAddonsByTypes: function(aTypes, aCallback) {
+  getAddonsByTypes: function LightweightThemeManager_getAddonsByTypes(aTypes, aCallback) {
     if (aTypes && aTypes.indexOf(ADDON_TYPE) == -1) {
       aCallback([]);
       return;
     }
 
     aCallback([new AddonWrapper(a) for each (a in this.usedThemes)]);
   },
 };
 
 /**
  * The AddonWrapper wraps lightweight theme to provide the data visible to
  * consumers of the AddonManager API.
  */
 function AddonWrapper(aTheme) {
-  this.__defineGetter__("id", function() aTheme.id + ID_SUFFIX);
-  this.__defineGetter__("type", function() ADDON_TYPE);
-  this.__defineGetter__("isActive", function() {
+  this.__defineGetter__("id", function AddonWrapper_idGetter() aTheme.id + ID_SUFFIX);
+  this.__defineGetter__("type", function AddonWrapper_typeGetter() ADDON_TYPE);
+  this.__defineGetter__("isActive", function AddonWrapper_isActiveGetter() {
     let current = LightweightThemeManager.currentTheme;
     if (current)
       return aTheme.id == current.id;
     return false;
   });
 
-  this.__defineGetter__("name", function() aTheme.name);
-  this.__defineGetter__("version", function() {
+  this.__defineGetter__("name", function AddonWrapper_nameGetter() aTheme.name);
+  this.__defineGetter__("version", function AddonWrapper_versionGetter() {
     return "version" in aTheme ? aTheme.version : "";
   });
 
   ["description", "homepageURL", "iconURL"].forEach(function(prop) {
-    this.__defineGetter__(prop, function() {
+    this.__defineGetter__(prop, function AddonWrapper_optionalPropGetter() {
       return prop in aTheme ? aTheme[prop] : null;
     });
   }, this);
 
   ["installDate", "updateDate"].forEach(function(prop) {
-    this.__defineGetter__(prop, function() {
+    this.__defineGetter__(prop, function AddonWrapper_datePropGetter() {
       return prop in aTheme ? new Date(aTheme[prop]) : null;
     });
   }, this);
 
-  this.__defineGetter__("creator", function() {
+  this.__defineGetter__("creator", function AddonWrapper_creatorGetter() {
     return new AddonManagerPrivate.AddonAuthor(aTheme.author);
   });
 
-  this.__defineGetter__("screenshots", function() {
+  this.__defineGetter__("screenshots", function AddonWrapper_screenshotsGetter() {
     let url = aTheme.previewURL;
     return [new AddonManagerPrivate.AddonScreenshot(url)];
   });
 
-  this.__defineGetter__("pendingOperations", function() {
+  this.__defineGetter__("pendingOperations",
+                       function AddonWrapper_pendingOperationsGetter() {
     let pending = AddonManager.PENDING_NONE;
     if (this.isActive == this.userDisabled)
       pending |= this.isActive ? AddonManager.PENDING_DISABLE : AddonManager.PENDING_ENABLE;
     return pending;
   });
 
-  this.__defineGetter__("operationsRequiringRestart", function() {
+  this.__defineGetter__("operationsRequiringRestart", 
+               function AddonWrapper_operationsRequiringRestartGetter() {
     // If a non-default theme is in use then a restart will be required to
     // enable lightweight themes unless dynamic theme switching is enabled
     if (Services.prefs.prefHasUserValue(PREF_GENERAL_SKINS_SELECTEDSKIN)) {
       try {
         if (Services.prefs.getBoolPref(PREF_EM_DSS_ENABLED))
           return AddonManager.OP_NEEDS_RESTART_NONE;
       }
       catch (e) {
       }
       return AddonManager.OP_NEEDS_RESTART_ENABLE;
     }
 
     return AddonManager.OP_NEEDS_RESTART_NONE;
   });
 
-  this.__defineGetter__("size", function() {
+  this.__defineGetter__("size", function AddonWrapper_sizeGetter() {
     // The size changes depending on whether the theme is in use or not, this is
     // probably not worth exposing.
     return null;
   });
 
-  this.__defineGetter__("permissions", function() {
+  this.__defineGetter__("permissions", function AddonWrapper_permissionsGetter() {
     let permissions = AddonManager.PERM_CAN_UNINSTALL;
     if (this.userDisabled)
       permissions |= AddonManager.PERM_CAN_ENABLE;
     else
       permissions |= AddonManager.PERM_CAN_DISABLE;
     return permissions;
   });
 
-  this.__defineGetter__("userDisabled", function() {
+  this.__defineGetter__("userDisabled", function AddonWrapper_userDisabledGetter() {
     if (_themeIDBeingEnabled == aTheme.id)
       return false;
     if (_themeIDBeingDisbled == aTheme.id)
       return true;
 
     try {
       let toSelect = Services.prefs.getCharPref(PREF_LWTHEME_TO_SELECT);
       return aTheme.id != toSelect;
     }
     catch (e) {
       let current = LightweightThemeManager.currentTheme;
       return !current || current.id != aTheme.id;
     }
   });
 
-  this.__defineSetter__("userDisabled", function(val) {
+  this.__defineSetter__("userDisabled", function AddonWrapper_userDisabledSetter(val) {
     if (val == this.userDisabled)
       return val;
 
     if (val)
       LightweightThemeManager.currentTheme = null;
     else
       LightweightThemeManager.currentTheme = aTheme;
 
     return val;
   });
 
-  this.uninstall = function() {
+  this.uninstall = function AddonWrapper_uninstall() {
     LightweightThemeManager.forgetUsedTheme(aTheme.id);
   };
 
-  this.cancelUninstall = function() {
+  this.cancelUninstall = function AddonWrapper_cancelUninstall() {
     throw new Error("Theme is not marked to be uninstalled");
   };
 
-  this.findUpdates = function(listener, reason, appVersion, platformVersion) {
+  this.findUpdates = function AddonWrapper_findUpdates(listener, reason, appVersion, platformVersion) {
     if ("onNoCompatibilityUpdateAvailable" in listener)
       listener.onNoCompatibilityUpdateAvailable(this);
     if ("onNoUpdateAvailable" in listener)
       listener.onNoUpdateAvailable(this);
     if ("onUpdateFinished" in listener)
       listener.onUpdateFinished(this);
   };
 }
@@ -530,17 +532,17 @@ AddonWrapper.prototype = {
     return AddonManager.SCOPE_PROFILE;
   },
 
   get foreignInstall() {
     return false;
   },
 
   // Lightweight themes are always compatible
-  isCompatibleWith: function(appVersion, platformVersion) {
+  isCompatibleWith: function AddonWrapper_isCompatibleWith(appVersion, platformVersion) {
     return true;
   },
 
   // Lightweight themes are always securely updated
   get providesUpdatesSecurely() {
     return true;
   },
 
@@ -664,17 +666,18 @@ function _sanitizeTheme(aData, aBaseURI,
       continue;
     result[optionalProperty] = val;
   }
 
   return result;
 }
 
 function _usedThemesExceptId(aId)
-  LightweightThemeManager.usedThemes.filter(function (t) "id" in t && t.id != aId);
+  LightweightThemeManager.usedThemes.filter(
+       function usedThemesExceptId_filterID(t) "id" in t && t.id != aId);
 
 function _version(aThemeData)
   aThemeData.version || "";
 
 function _makeURI(aURL, aBaseURI)
   Services.io.newURI(aURL, null, aBaseURI);
 
 function _updateUsedThemes(aList) {
@@ -696,17 +699,17 @@ function _updateUsedThemes(aList) {
 
 function _notifyWindows(aThemeData) {
   Services.obs.notifyObservers(null, "lightweight-theme-styling-update",
                                JSON.stringify(aThemeData));
 }
 
 var _previewTimer;
 var _previewTimerCallback = {
-  notify: function () {
+  notify: function _previewTimerCallback_notify() {
     LightweightThemeManager.resetPreview();
   }
 };
 
 /**
  * Called when any of the lightweightThemes preferences are changed.
  */
 function _prefObserver(aSubject, aTopic, aData) {
@@ -769,21 +772,21 @@ function _persistImage(sourceURL, localF
        Ci.nsIWebBrowserPersist.PERSIST_FLAGS_FROM_CACHE);
 
   persist.progressListener = new _persistProgressListener(successCallback);
 
   persist.saveURI(sourceURI, null, null, null, null, targetURI, null);
 }
 
 function _persistProgressListener(successCallback) {
-  this.onLocationChange = function () {};
-  this.onProgressChange = function () {};
-  this.onStatusChange   = function () {};
-  this.onSecurityChange = function () {};
-  this.onStateChange    = function (aWebProgress, aRequest, aStateFlags, aStatus) {
+  this.onLocationChange = function persistProgressListener_onLocationChange() {};
+  this.onProgressChange = function persistProgressListener_onProgressChange() {};
+  this.onStatusChange   = function persistProgressListener_onStatusChange() {};
+  this.onSecurityChange = function persistProgressListener_onSecurityChange() {};
+  this.onStateChange    = function persistProgressListener_onStateChange(aWebProgress, aRequest, aStateFlags, aStatus) {
     if (aRequest &&
         aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK &&
         aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) {
       try {
         if (aRequest.QueryInterface(Ci.nsIHttpChannel).requestSucceeded) {
           // success
           successCallback();
           return;
--- a/toolkit/mozapps/extensions/XPIProviderUtils.js
+++ b/toolkit/mozapps/extensions/XPIProviderUtils.js
@@ -13,17 +13,17 @@ Components.utils.import("resource://gre/
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
                                   "resource://gre/modules/AddonRepository.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 
 
 ["LOG", "WARN", "ERROR"].forEach(function(aName) {
-  this.__defineGetter__(aName, function() {
+  this.__defineGetter__(aName, function logFuncGetter () {
     Components.utils.import("resource://gre/modules/AddonLogging.jsm");
 
     LogManager.getLogger("addons.xpi-utils", this);
     return this[aName];
   })
 }, this);
 
 
@@ -77,17 +77,17 @@ const PROP_TARGETAPP     = ["id", "minVe
 const PREFIX_ITEM_URI                 = "urn:mozilla:item:";
 const RDFURI_ITEM_ROOT                = "urn:mozilla:item:root"
 const PREFIX_NS_EM                    = "http://www.mozilla.org/2004/em-rdf#";
 
 
 var XPIProvider;
 
 
-this.__defineGetter__("gRDF", function() {
+this.__defineGetter__("gRDF", function gRDFGetter() {
   delete this.gRDF;
   return this.gRDF = Cc["@mozilla.org/rdf/rdf-service;1"].
                      getService(Ci.nsIRDFService);
 });
 
 function EM_R(aProperty) {
   return gRDF.GetResource(PREFIX_NS_EM + aProperty);
 }
@@ -140,22 +140,22 @@ function AsyncAddonListCallback(aCallbac
 }
 
 AsyncAddonListCallback.prototype = {
   callback: null,
   complete: false,
   count: 0,
   addons: null,
 
-  handleResult: function(aResults) {
+  handleResult: function AsyncAddonListCallback_handleResult(aResults) {
     let row = null;
     while ((row = aResults.getNextRow())) {
       this.count++;
       let self = this;
-      XPIDatabase.makeAddonFromRowAsync(row, function(aAddon) {
+      XPIDatabase.makeAddonFromRowAsync(row, function handleResult_makeAddonFromRowAsync(aAddon) {
         function completeAddon(aRepositoryAddon) {
           aAddon._repositoryAddon = aRepositoryAddon;
           aAddon.compatibilityOverrides = aRepositoryAddon ?
                                             aRepositoryAddon.compatibilityOverrides :
                                             null;
           self.addons.push(aAddon);
           if (self.complete && self.addons.length == self.count)
            self.callback(self.addons);
@@ -166,17 +166,17 @@ AsyncAddonListCallback.prototype = {
         else
           completeAddon(null);
       });
     }
   },
 
   handleError: asyncErrorLogger,
 
-  handleCompletion: function(aReason) {
+  handleCompletion: function AsyncAddonListCallback_handleCompletion(aReason) {
     this.complete = true;
     if (this.addons.length == this.count)
       this.callback(this.addons);
   }
 };
 
 
 /**
@@ -851,22 +851,22 @@ var XPIDatabase = {
         Services.prefs.setBoolPref(PREF_PENDING_OPERATIONS, true);
 
       this.initialized = false;
       let connection = this.connection;
       delete this.connection;
 
       // Re-create the connection smart getter to allow the database to be
       // re-loaded during testing.
-      this.__defineGetter__("connection", function() {
+      this.__defineGetter__("connection", function connectionGetter() {
         this.openConnection(true);
         return this.connection;
       });
 
-      connection.asyncClose(function() {
+      connection.asyncClose(function shutdown_asyncClose() {
         LOG("Database closed");
         aCallback();
       });
     }
     else {
       if (aCallback)
         aCallback();
     }
@@ -1116,49 +1116,49 @@ var XPIDatabase = {
    *         The callback to call when the metadata is completely retrieved
    */
   fetchAddonMetadata: function XPIDB_fetchAddonMetadata(aAddon) {
     function readLocaleStrings(aLocale, aCallback) {
       let stmt = XPIDatabase.getStatement("_readLocaleStrings");
 
       stmt.params.id = aLocale.id;
       stmt.executeAsync({
-        handleResult: function(aResults) {
+        handleResult: function readLocaleStrings_handleResult(aResults) {
           let row = null;
           while ((row = aResults.getNextRow())) {
             let type = row.getResultByName("type");
             if (!(type in aLocale))
               aLocale[type] = [];
             aLocale[type].push(row.getResultByName("value"));
           }
         },
 
         handleError: asyncErrorLogger,
 
-        handleCompletion: function(aReason) {
+        handleCompletion: function readLocaleStrings_handleCompletion(aReason) {
           aCallback();
         }
       });
     }
 
     function readDefaultLocale() {
       delete aAddon.defaultLocale;
       let stmt = XPIDatabase.getStatement("_getDefaultLocale");
 
       stmt.params.id = aAddon._defaultLocale;
       stmt.executeAsync({
-        handleResult: function(aResults) {
+        handleResult: function readDefaultLocale_handleResult(aResults) {
           aAddon.defaultLocale = copyRowProperties(aResults.getNextRow(),
                                                    PROP_LOCALE_SINGLE);
           aAddon.defaultLocale.id = aAddon._defaultLocale;
         },
 
         handleError: asyncErrorLogger,
 
-        handleCompletion: function(aReason) {
+        handleCompletion: function readDefaultLocale_handleCompletion(aReason) {
           if (aAddon.defaultLocale) {
             readLocaleStrings(aAddon.defaultLocale, readLocales);
           }
           else {
             ERROR("Missing default locale for " + aAddon.id);
             readLocales();
           }
         }
@@ -1167,31 +1167,31 @@ var XPIDatabase = {
 
     function readLocales() {
       delete aAddon.locales;
       aAddon.locales = [];
       let stmt = XPIDatabase.getStatement("_getLocales");
 
       stmt.params.internal_id = aAddon._internal_id;
       stmt.executeAsync({
-        handleResult: function(aResults) {
+        handleResult: function readLocales_handleResult(aResults) {
           let row = null;
           while ((row = aResults.getNextRow())) {
             let locale = {
               id: row.getResultByName("id"),
               locales: [row.getResultByName("locale")]
             };
             copyRowProperties(row, PROP_LOCALE_SINGLE, locale);
             aAddon.locales.push(locale);
           }
         },
 
         handleError: asyncErrorLogger,
 
-        handleCompletion: function(aReason) {
+        handleCompletion: function readLocales_handleCompletion(aReason) {
           let pos = 0;
           function readNextLocale() {
             if (pos < aAddon.locales.length)
               readLocaleStrings(aAddon.locales[pos++], readNextLocale);
             else
               readTargetApplications();
           }
 
@@ -1202,46 +1202,46 @@ var XPIDatabase = {
 
     function readTargetApplications() {
       delete aAddon.targetApplications;
       aAddon.targetApplications = [];
       let stmt = XPIDatabase.getStatement("_getTargetApplications");
 
       stmt.params.internal_id = aAddon._internal_id;
       stmt.executeAsync({
-        handleResult: function(aResults) {
+        handleResult: function readTargetApplications_handleResult(aResults) {
           let row = null;
           while ((row = aResults.getNextRow()))
             aAddon.targetApplications.push(copyRowProperties(row, PROP_TARGETAPP));
         },
 
         handleError: asyncErrorLogger,
 
-        handleCompletion: function(aReason) {
+        handleCompletion: function readTargetApplications_handleCompletion(aReason) {
           readTargetPlatforms();
         }
       });
     }
 
     function readTargetPlatforms() {
       delete aAddon.targetPlatforms;
       aAddon.targetPlatforms = [];
       let stmt = XPIDatabase.getStatement("_getTargetPlatforms");
 
       stmt.params.internal_id = aAddon._internal_id;
       stmt.executeAsync({
-        handleResult: function(aResults) {
+        handleResult: function readTargetPlatforms_handleResult(aResults) {
           let row = null;
           while ((row = aResults.getNextRow()))
             aAddon.targetPlatforms.push(copyRowProperties(row, ["os", "abi"]));
         },
 
         handleError: asyncErrorLogger,
 
-        handleCompletion: function(aReason) {
+        handleCompletion: function readTargetPlatforms_handleCompletion(aReason) {
           let callbacks = aAddon._pendingCallbacks;
           delete aAddon._pendingCallbacks;
           callbacks.forEach(function(aCallback) {
             aCallback(aAddon);
           });
         }
       });
     }
@@ -1348,17 +1348,17 @@ var XPIDatabase = {
       aCallback(null);
       return;
     }
 
     let stmt = this.getStatement("getAddonInLocation");
 
     stmt.params.id = aId;
     stmt.params.location = aLocation;
-    stmt.executeAsync(new AsyncAddonListCallback(function(aAddons) {
+    stmt.executeAsync(new AsyncAddonListCallback(function getAddonInLocation_executeAsync(aAddons) {
       if (aAddons.length == 0) {
         aCallback(null);
         return;
       }
       // This should never happen but indicates invalid data in the database if
       // it does
       if (aAddons.length > 1)
         ERROR("Multiple addons with ID " + aId + " found in location " + aLocation);
@@ -1378,17 +1378,17 @@ var XPIDatabase = {
     if (!this.connection) {
       aCallback(null);
       return;
     }
 
     let stmt = this.getStatement("getVisibleAddonForID");
 
     stmt.params.id = aId;
-    stmt.executeAsync(new AsyncAddonListCallback(function(aAddons) {
+    stmt.executeAsync(new AsyncAddonListCallback(function getVisibleAddonForID_executeAsync(aAddons) {
       if (aAddons.length == 0) {
         aCallback(null);
         return;
       }
       // This should never happen but indicates invalid data in the database if
       // it does
       if (aAddons.length > 1)
         ERROR("Multiple visible addons with ID " + aId + " found");
@@ -1522,17 +1522,17 @@ var XPIDatabase = {
    *         A callback to pass the DBAddonInternal record to. Receives null
    *         if no add-on with that GUID is found.
    *
    */
   getAddonBySyncGUID: function XPIDB_getAddonBySyncGUID(aGUID, aCallback) {
     let stmt = this.getStatement("getAddonBySyncGUID");
     stmt.params.syncGUID = aGUID;
 
-    stmt.executeAsync(new AsyncAddonListCallback(function(aAddons) {
+    stmt.executeAsync(new AsyncAddonListCallback(function getAddonBySyncGUID_executeAsync(aAddons) {
       if (aAddons.length == 0) {
         aCallback(null);
         return;
       }
       aCallback(aAddons[0]);
     }));
   },
 
--- a/toolkit/mozapps/extensions/addonManager.js
+++ b/toolkit/mozapps/extensions/addonManager.js
@@ -89,46 +89,46 @@ amManager.prototype = {
 
     let installs = [];
     function buildNextInstall() {
       if (aUris.length == 0) {
         AddonManager.installAddonsFromWebpage(aMimetype, aWindow, aReferer, installs);
         return;
       }
       let uri = aUris.shift();
-      AddonManager.getInstallForURL(uri, function(aInstall) {
+      AddonManager.getInstallForURL(uri, function buildNextInstall_getInstallForURL(aInstall) {
         function callCallback(aUri, aStatus) {
           try {
             aCallback.onInstallEnded(aUri, aStatus);
           }
           catch (e) {
             Components.utils.reportError(e);
           }
         }
 
         if (aInstall) {
           installs.push(aInstall);
           if (aCallback) {
             aInstall.addListener({
-              onDownloadCancelled: function(aInstall) {
+              onDownloadCancelled: function buildNextInstall_onDownloadCancelled(aInstall) {
                 callCallback(uri, USER_CANCELLED);
               },
 
-              onDownloadFailed: function(aInstall) {
+              onDownloadFailed: function buildNextInstall_onDownloadFailed(aInstall) {
                 if (aInstall.error == AddonManager.ERROR_CORRUPT_FILE)
                   callCallback(uri, CANT_READ_ARCHIVE);
                 else
                   callCallback(uri, DOWNLOAD_ERROR);
               },
 
-              onInstallFailed: function(aInstall) {
+              onInstallFailed: function buildNextInstall_onInstallFailed(aInstall) {
                 callCallback(uri, EXECUTION_ERROR);
               },
 
-              onInstallEnded: function(aInstall, aStatus) {
+              onInstallEnded: function buildNextInstall_onInstallEnded(aInstall, aStatus) {
                 callCallback(uri, SUCCESS);
               }
             });
           }
         }
         else if (aCallback) {
           aCallback.onInstallEnded(uri, UNSUPPORTED_TYPE);
         }
@@ -145,17 +145,17 @@ amManager.prototype = {
   },
 
   /**
    * messageManager callback function.
    *
    * Listens to requests from child processes for InstallTrigger
    * activity, and sends back callbacks.
    */
-  receiveMessage: function(aMessage) {
+  receiveMessage: function AMC_receiveMessage(aMessage) {
     var payload = aMessage.json;
     var referer = Services.io.newURI(payload.referer, null, null);
     switch (aMessage.name) {
       case MSG_INSTALL_ENABLED:
         return this.isInstallEnabled(payload.mimetype, referer);
 
       case MSG_INSTALL_ADDONS:
         var callback = null;
@@ -186,17 +186,17 @@ amManager.prototype = {
         return this.installAddonsFromWebpage(payload.mimetype,
           window, referer, payload.uris, payload.hashes, payload.names,
           payload.icons, callback, payload.uris.length);
     }
   },
 
   classID: Components.ID("{4399533d-08d1-458c-a87a-235f74451cfa}"),
   _xpcom_factory: {
-    createInstance: function(aOuter, aIid) {
+    createInstance: function AMC_createInstance(aOuter, aIid) {
       if (aOuter != null)
         throw Components.Exception("Component does not support aggregation",
                                    Cr.NS_ERROR_NO_AGGREGATION);
   
       if (!gSingleton)
         gSingleton = new amManager();
       return gSingleton.QueryInterface(aIid);
     }
--- a/toolkit/mozapps/extensions/amContentHandler.js
+++ b/toolkit/mozapps/extensions/amContentHandler.js
@@ -71,17 +71,17 @@ amContentHandler.prototype = {
       manager.installAddonsFromWebpage(aMimetype, window, referer, [uri.spec],
                                        [null], [null], [null], null, 1);
     }
   },
 
   classID: Components.ID("{7beb3ba8-6ec3-41b4-b67c-da89b8518922}"),
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentHandler]),
 
-  log : function(aMsg) {
+  log : function XCH_log(aMsg) {
     let msg = "amContentHandler.js: " + (aMsg.join ? aMsg.join("") : aMsg);
     Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService).
       logStringMessage(msg);
     dump(msg + "\n");
   }
 };
 
 var NSGetFactory = XPCOMUtils.generateNSGetFactory([amContentHandler]);
--- a/toolkit/mozapps/extensions/amWebInstallListener.js
+++ b/toolkit/mozapps/extensions/amWebInstallListener.js
@@ -25,17 +25,17 @@ const URI_XPINSTALL_DIALOG = "chrome://m
 const READY_STATES = [
   AddonManager.STATE_AVAILABLE,
   AddonManager.STATE_DOWNLOAD_FAILED,
   AddonManager.STATE_INSTALL_FAILED,
   AddonManager.STATE_CANCELLED
 ];
 
 ["LOG", "WARN", "ERROR"].forEach(function(aName) {
-  this.__defineGetter__(aName, function() {
+  this.__defineGetter__(aName, function logFuncGetter() {
     Components.utils.import("resource://gre/modules/AddonLogging.jsm");
 
     LogManager.getLogger("addons.weblistener", this);
     return this[aName];
   });
 }, this);
 
 function notifyObservers(aTopic, aWindow, aUri, aInstalls) {
@@ -83,17 +83,17 @@ Installer.prototype = {
   window: null,
   downloads: null,
   installed: null,
   isDownloading: true,
 
   /**
    * Checks if all downloads are now complete and if so prompts to install.
    */
-  checkAllDownloaded: function() {
+  checkAllDownloaded: function Installer_checkAllDownloaded() {
     // Prevent re-entrancy caused by the confirmation dialog cancelling unwanted
     // installs.
     if (!this.isDownloading)
       return;
 
     var failed = [];
     var installs = [];
 
@@ -187,17 +187,17 @@ Installer.prototype = {
       notifyObservers("addon-install-cancelled", this.window, this.url,
                       this.downloads);
     }
   },
 
   /**
    * Checks if all installs are now complete and if so notifies observers.
    */
-  checkAllInstalled: function() {
+  checkAllInstalled: function Installer_checkAllInstalled() {
     var failed = [];
 
     for (let install of this.downloads) {
       switch(install.state) {
       case AddonManager.STATE_DOWNLOADED:
       case AddonManager.STATE_INSTALLING:
         // Exit early if any add-ons haven't started installing yet or are
         // still installing
@@ -213,42 +213,42 @@ Installer.prototype = {
     if (failed.length > 0)
       notifyObservers("addon-install-failed", this.window, this.url, failed);
 
     if (this.installed.length > 0)
       notifyObservers("addon-install-complete", this.window, this.url, this.installed);
     this.installed = null;
   },
 
-  onDownloadCancelled: function(aInstall) {
+  onDownloadCancelled: function Installer_onDownloadCancelled(aInstall) {
     aInstall.removeListener(this);
     this.checkAllDownloaded();
   },
 
-  onDownloadFailed: function(aInstall) {
+  onDownloadFailed: function Installer_onDownloadFailed(aInstall) {
     aInstall.removeListener(this);
     this.checkAllDownloaded();
   },
 
-  onDownloadEnded: function(aInstall) {
+  onDownloadEnded: function Installer_onDownloadEnded(aInstall) {
     this.checkAllDownloaded();
     return false;
   },
 
-  onInstallCancelled: function(aInstall) {
+  onInstallCancelled: function Installer_onInstallCancelled(aInstall) {
     aInstall.removeListener(this);
     this.checkAllInstalled();
   },
 
-  onInstallFailed: function(aInstall) {
+  onInstallFailed: function Installer_onInstallFailed(aInstall) {
     aInstall.removeListener(this);
     this.checkAllInstalled();
   },
 
-  onInstallEnded: function(aInstall) {
+  onInstallEnded: function Installer_onInstallEnded(aInstall) {
     aInstall.removeListener(this);
     this.installed.push(aInstall);
 
     // If installing a theme that is disabled and can be enabled then enable it
     if (aInstall.addon.type == "theme" &&
         aInstall.addon.userDisabled == true &&
         aInstall.addon.appDisabled == false) {
       aInstall.addon.userDisabled = false;
@@ -260,51 +260,51 @@ Installer.prototype = {
 
 function extWebInstallListener() {
 }
 
 extWebInstallListener.prototype = {
   /**
    * @see amIWebInstallListener.idl
    */
-  onWebInstallDisabled: function(aWindow, aUri, aInstalls) {
+  onWebInstallDisabled: function extWebInstallListener_onWebInstallDisabled(aWindow, aUri, aInstalls) {
     let info = {
       originatingWindow: aWindow,
       originatingURI: aUri,
       installs: aInstalls,
 
       QueryInterface: XPCOMUtils.generateQI([Ci.amIWebInstallInfo])
     };
     Services.obs.notifyObservers(info, "addon-install-disabled", null);
   },
 
   /**
    * @see amIWebInstallListener.idl
    */
-  onWebInstallBlocked: function(aWindow, aUri, aInstalls) {
+  onWebInstallBlocked: function extWebInstallListener_onWebInstallBlocked(aWindow, aUri, aInstalls) {
     let info = {
       originatingWindow: aWindow,
       originatingURI: aUri,
       installs: aInstalls,
 
-      install: function() {
+      install: function onWebInstallBlocked_install() {
         new Installer(this.originatingWindow, this.originatingURI, this.installs);
       },
 
       QueryInterface: XPCOMUtils.generateQI([Ci.amIWebInstallInfo])
     };
     Services.obs.notifyObservers(info, "addon-install-blocked", null);
 
     return false;
   },
 
   /**
    * @see amIWebInstallListener.idl
    */
-  onWebInstallRequested: function(aWindow, aUri, aInstalls) {
+  onWebInstallRequested: function extWebInstallListener_onWebInstallRequested(aWindow, aUri, aInstalls) {
     new Installer(aWindow, aUri, aInstalls);
 
     // We start the installs ourself
     return false;
   },
 
   classDescription: "XPI Install Handler",
   contractID: "@mozilla.org/addons/web-install-listener;1",
--- a/toolkit/mozapps/extensions/content/blocklist.js
+++ b/toolkit/mozapps/extensions/content/blocklist.js
@@ -21,17 +21,17 @@ function init() {
               createBundle("chrome://mozapps/locale/update/updates.properties");
   let cancelButton = document.documentElement.getButton("cancel");
   cancelButton.setAttribute("label", bundle.GetStringFromName("restartLaterButton"));
   cancelButton.setAttribute("accesskey",
                             bundle.GetStringFromName("restartLaterButton.accesskey"));
 
   var richlist = document.getElementById("addonList");
   var list = gArgs.list;
-  list.sort(function(a, b) { return String.localeCompare(a.name, b.name); });
+  list.sort(function listSort(a, b) { return String.localeCompare(a.name, b.name); });
   for (let listItem of list) {
     let item = document.createElement("richlistitem");
     item.setAttribute("name", listItem.name);
     item.setAttribute("version", listItem.version);
     item.setAttribute("icon", listItem.icon);
     if (listItem.blocked) {
       item.setAttribute("class", "hardBlockedAddon");
       hasHardBlocks = true;
--- a/toolkit/mozapps/extensions/content/extensions-content.js
+++ b/toolkit/mozapps/extensions/content/extensions-content.js
@@ -43,33 +43,33 @@ function createInstallTrigger(window) {
     SKIN: Ci.amIInstallTrigger.SKIN,
     LOCALE: Ci.amIInstallTrigger.LOCALE,
     CONTENT: Ci.amIInstallTrigger.CONTENT,
     PACKAGE: Ci.amIInstallTrigger.PACKAGE,
 
     /**
      * @see amIInstallTriggerInstaller.idl
      */
-    enabled: function() {
+    enabled: function createInstallTrigger_enabled() {
       return sendSyncMessage(MSG_INSTALL_ENABLED, {
         mimetype: "application/x-xpinstall", referer: this.url.spec
       })[0];
     },
 
     /**
      * @see amIInstallTriggerInstaller.idl
      */
-    updateEnabled: function() {
+    updateEnabled: function createInstallTrigger_updateEnabled() {
       return this.enabled();
     },
 
     /**
      * @see amIInstallTriggerInstaller.idl
      */
-    install: function(aArgs, aCallback) {
+    install: function createInstallTrigger_install(aArgs, aCallback) {
       if (!aArgs || typeof aArgs != "object")
         throw Components.Exception("Incorrect arguments passed to InstallTrigger.install()",
                                    Cr.NS_ERROR_INVALID_ARGS);
 
       var params = {
         installerId: this.installerId,
         mimetype: "application/x-xpinstall",
         referer: this.url.spec,
@@ -108,50 +108,50 @@ function createInstallTrigger(window) {
       params.callbackId = manager.addCallback(aCallback, params.uris);
       // Send message
       return sendSyncMessage(MSG_INSTALL_ADDONS, params)[0];
     },
 
     /**
      * @see amIInstallTriggerInstaller.idl
      */
-    startSoftwareUpdate: function(aUrl, aFlags) {
+    startSoftwareUpdate: function createInstallTrigger_startSoftwareUpdate(aUrl, aFlags) {
       var url = gIoService.newURI(aUrl, null, null)
                           .QueryInterface(Ci.nsIURL).filename;
       var object = {};
       object[url] = { "URL": aUrl };
       return this.install(object);
     },
 
     /**
      * @see amIInstallTriggerInstaller.idl
      */
-    installChrome: function(aType, aUrl, aSkin) {
+    installChrome: function createInstallTrigger_installChrome(aType, aUrl, aSkin) {
       return this.startSoftwareUpdate(aUrl);
     },
 
     /**
      * Resolves a URL in the context of our current window. We need to do
      * this before sending URLs to the parent process.
      *
      * @param  aUrl
      *         The url to resolve.
      *
      * @return A resolved, absolute nsURI object.
      */
-    resolveURL: function(aUrl) {
+    resolveURL: function createInstallTrigger_resolveURL(aUrl) {
       return gIoService.newURI(aUrl, null, this.url);
     },
 
     /**
      * @see amInstallTrigger.cpp
      * TODO: When e10s lands on m-c, consider removing amInstallTrigger.cpp
      *       See bug 571166
      */
-    checkLoadURIFromScript: function(aUri) {
+    checkLoadURIFromScript: function createInstallTrigger_checkLoadURIFromScript(aUri) {
       var secman = Cc["@mozilla.org/scriptsecuritymanager;1"].
                    getService(Ci.nsIScriptSecurityManager);
       var principal = this.window.document.nodePrincipal;
       try {
         secman.checkLoadURIWithPrincipal(principal, aUri,
           Ci.nsIScriptSecurityManager.DISALLOW_INHERIT_PRINCIPAL);
         return true;
       }
@@ -199,41 +199,41 @@ function InstallTriggerManager() {
   this.callbacks = {};
 
   addMessageListener(MSG_INSTALL_CALLBACK, this);
 
   try {
     // only if we live in a child process...
     if (Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).processType !== Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
       // ... propagate JAR cache flush notifications across process boundaries
-      addMessageListener(MSG_JAR_FLUSH, function(msg) {
+      addMessageListener(MSG_JAR_FLUSH, function jar_flushMessageListener(msg) {
         let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
         file.initWithPath(msg.json);
         Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService)
           .notifyObservers(file, "flush-cache-entry", null);
       });
     }
   } catch(e) {
     Cu.reportError(e);
   }
     
   addEventListener("DOMWindowCreated", this, false);
 
   var self = this;
-  addEventListener("unload", function() {
+  addEventListener("unload", function unloadEventListener() {
     // Clean up all references, to help gc work quickly
     self.callbacks = null;
   }, false);
 }
 
 InstallTriggerManager.prototype = {
-  handleEvent: function handleEvent(aEvent) {
+  handleEvent: function ITM_handleEvent(aEvent) {
     var window = aEvent.target.defaultView;
 
-    window.wrappedJSObject.__defineGetter__("InstallTrigger", function() {
+    window.wrappedJSObject.__defineGetter__("InstallTrigger", function installTriggerGetter() {
       // We do this in a getter, so that we create these objects
       // only on demand (this is a potential concern, since
       // otherwise we might add one per iframe, and keep them
       // alive for as long as the tab is alive).
 
       delete window.wrappedJSObject.InstallTrigger;
       var installTrigger = createInstallTrigger(window);
       window.wrappedJSObject.InstallTrigger = installTrigger;
@@ -250,17 +250,17 @@ InstallTriggerManager.prototype = {
    *         The callback function
    * @param  urls
    *         The urls this callback function will receive responses for.
    *         After all the callbacks have arrived, we can forget about the
    *         callback.
    *
    * @return The callback ID, an integer identifying this callback.
    */
-  addCallback: function(aCallback, aUrls) {
+  addCallback: function ITM_addCallback(aCallback, aUrls) {
     if (!aCallback || typeof aCallback != "function")
       return -1;
     var callbackId = 0;
     while (callbackId in this.callbacks)
       callbackId++;
     this.callbacks[callbackId] = {
       callback: aCallback,
       urls: aUrls.slice(0), // Clone the urls for our own use (it lets
@@ -274,17 +274,17 @@ InstallTriggerManager.prototype = {
    * Receives a message about a callback. Performs the actual callback
    * (for the callback with the ID we are given). When
    * all URLs are exhausted, can free the callbackId and linked stuff.
    *
    * @param  message
    *         The IPC message. Contains the callback ID.
    *
    */
-  receiveMessage: function(aMessage) {
+  receiveMessage: function ITM_receiveMessage(aMessage) {
     var payload = aMessage.json;
     var callbackId = payload.callbackId;
     var url = payload.url;
     var status = payload.status;
     var callbackObj = this.callbacks[callbackId];
     if (!callbackObj)
       return;
     try {
--- a/toolkit/mozapps/extensions/content/newaddon.js
+++ b/toolkit/mozapps/extensions/content/newaddon.js
@@ -8,17 +8,17 @@ const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/AddonManager.jsm");
 
 var gAddon = null;
 
 // If the user enables the add-on through some other UI close this window
 var EnableListener = {
-  onEnabling: function(aAddon) {
+  onEnabling: function EnableListener_onEnabling(aAddon) {
     if (aAddon.id == gAddon.id)
       window.close();
   }
 }
 AddonManager.addAddonListener(EnableListener);
 
 function initialize() {
   // About URIs don't implement nsIURL so we have to find the query string
@@ -33,17 +33,17 @@ function initialize() {
   let id = query.substring(3);
   if (!id) {
     window.location = "about:blank";
     return;
   }
 
   let bundle = Services.strings.createBundle("chrome://mozapps/locale/extensions/newaddon.properties");
 
-  AddonManager.getAddonByID(id, function(aAddon) {
+  AddonManager.getAddonByID(id, function initialize_getAddonByID(aAddon) {
     // If the add-on doesn't exist or it is already enabled or it cannot be
     // enabled then this UI is useless, just close it. This shouldn't normally
     // happen unless session restore restores the tab
     if (!aAddon || !aAddon.userDisabled ||
         !(aAddon.permissions & AddonManager.PERM_CAN_ENABLE)) {
       window.close();
       return;
     }
--- a/toolkit/mozapps/extensions/content/selectAddons.js
+++ b/toolkit/mozapps/extensions/content/selectAddons.js
@@ -57,28 +57,28 @@ var gAddons = {};
 
 var gChecking = {
   nodeID: "checking",
 
   _progress: null,
   _addonCount: 0,
   _completeCount: 0,
 
-  show: function() {
+  show: function gChecking_show() {
     showButtons(true, false, false, false);
     this._progress = document.getElementById("checking-progress");
 
     let self = this;
-    AddonManager.getAllAddons(function(aAddons) {
+    AddonManager.getAllAddons(function gChecking_getAllAddons(aAddons) {
       if (aAddons.length == 0) {
         window.close();
         return;
       }
 
-      aAddons = aAddons.filter(function(aAddon) {
+      aAddons = aAddons.filter(function gChecking_filterAddons(aAddon) {
         if (aAddon.type == "plugin")
           return false;
 
         if (aAddon.type == "theme") {
           // Don't show application shipped themes
           if (aAddon.scope == AddonManager.SCOPE_APPLICATION)
             return false;
           // Don't show already disabled themes
@@ -92,18 +92,18 @@ var gChecking = {
       self._addonCount = aAddons.length;
       self._progress.value = 0;
       self._progress.max = aAddons.length;
       self._progress.mode = "determined";
 
       // Ensure compatibility overrides are up to date before checking for
       // individual addon updates.
       let ids = [addon.id for each (addon in aAddons)];
-      AddonRepository.repopulateCache(ids, function() {
-        AddonManagerPrivate.updateAddonRepositoryData(function() {
+      AddonRepository.repopulateCache(ids, function gChecking_repopulateCache() {
+        AddonManagerPrivate.updateAddonRepositoryData(function gChecking_updateAddonRepositoryData() {
 
           for (let addonItem of aAddons) {
             // Ignore disabled themes
             if (addonItem.type != "theme" || !addonItem.userDisabled) {
               gAddons[addonItem.id] = {
                 addon: addonItem,
                 install: null,
                 wasActive: addonItem.isActive
@@ -112,32 +112,32 @@ var gChecking = {
 
             addonItem.findUpdates(self, AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
           }
         });
       });
     });
   },
 
-  onUpdateAvailable: function(aAddon, aInstall) {
+  onUpdateAvailable: function gChecking_onUpdateAvailable(aAddon, aInstall) {
     // If the add-on can be upgraded then remember the new version
     if (aAddon.permissions & AddonManager.PERM_CAN_UPGRADE)
       gAddons[aAddon.id].install = aInstall;
   },
 
-  onUpdateFinished: function(aAddon, aError) {
+  onUpdateFinished: function gChecking_onUpdateFinished(aAddon, aError) {
     this._completeCount++;
     this._progress.value = this._completeCount;
 
     if (this._completeCount < this._addonCount)
       return;
 
     var addons = [gAddons[id] for (id in gAddons)];
 
-    addons.sort(function(a, b) {
+    addons.sort(function sortAddons(a, b) {
       let orderA = orderForScope(a.addon.scope);
       let orderB = orderForScope(b.addon.scope);
 
       if (orderA != orderB)
         return orderA - orderB;
 
       return String.localeCompare(a.addon.name, b.addon.name);
     });
@@ -166,48 +166,48 @@ var gChecking = {
 
     showView(gSelect);
   }
 };
 
 var gSelect = {
   nodeID: "select",
 
-  show: function() {
+  show: function gSelect_show() {
     this.updateButtons();
   },
 
-  updateButtons: function() {
+  updateButtons: function gSelect_updateButtons() {
     for (let row = document.getElementById("select-rows").firstChild;
          row; row = row.nextSibling) {
       if (row.localName == "separator")
         continue;
 
       if (row.action) {
         showButtons(false, false, true, false);
         return;
       }
     }
 
     showButtons(false, false, false, true);
   },
 
-  next: function() {
+  next: function gSelect_next() {
     showView(gConfirm);
   },
 
-  done: function() {
+  done: function gSelect_done() {
     window.close();
   }
 };
 
 var gConfirm = {
   nodeID: "confirm",
 
-  show: function() {
+  show: function gConfirm_show() {
     showButtons(false, true, false, true);
 
     let box = document.getElementById("confirm-scrollbox").firstChild;
     while (box) {
       box.hidden = true;
       while (box.lastChild != box.firstChild)
         box.removeChild(box.lastChild);
       box = box.nextSibling;
@@ -234,25 +234,25 @@ var gConfirm = {
         item.setAttribute("active", "true");
       list.appendChild(item);
 
       if (action == "update")
         showButtons(false, true, true, false);
     }
   },
 
-  back: function() {
+  back: function gConfirm_back() {
     showView(gSelect);
   },
 
-  next: function() {
+  next: function gConfirm_next() {
     showView(gUpdate);
   },
 
-  done: function() {
+  done: function gConfirm_done() {
     for (let row = document.getElementById("select-rows").firstChild;
          row; row = row.nextSibling) {
       if (row.localName != "separator")
         row.apply();
     }
 
     window.close();
   }
@@ -261,83 +261,84 @@ var gConfirm = {
 var gUpdate = {
   nodeID: "update",
 
   _progress: null,
   _waitingCount: 0,
   _completeCount: 0,
   _errorCount: 0,
 
-  show: function() {
+  show: function gUpdate_show() {
     showButtons(true, false, false, false);
 
     this._progress = document.getElementById("update-progress");
 
     for (let row = document.getElementById("select-rows").firstChild;
          row; row = row.nextSibling) {
       if (row.localName != "separator")
         row.apply();
     }
 
     this._progress.mode = "determined";
     this._progress.max = this._waitingCount;
     this._progress.value = this._completeCount;
   },
 
-  checkComplete: function() {
+  checkComplete: function gUpdate_checkComplete() {
     this._progress.value = this._completeCount;
     if (this._completeCount < this._waitingCount)
       return;
 
     if (this._errorCount > 0) {
       showView(gErrors);
       return;
     }
 
     window.close();
   },
 
-  onDownloadStarted: function(aInstall) {
+  onDownloadStarted: function gUpdate_onDownloadStarted(aInstall) {
     this._waitingCount++;
   },
 
-  onDownloadFailed: function(aInstall) {
+  onDownloadFailed: function gUpdate_onDownloadFailed(aInstall) {
     this._errorCount++;
     this._completeCount++;
     this.checkComplete();
   },
 
-  onInstallFailed: function(aInstall) {
+  onInstallFailed: function gUpdate_onInstallFailed(aInstall) {
     this._errorCount++;
     this._completeCount++;
     this.checkComplete();
   },
 
-  onInstallEnded: function(aInstall) {
+  onInstallEnded: function gUpdate_onInstallEnded(aInstall) {
     this._completeCount++;
     this.checkComplete();
   }
 };
 
 var gErrors = {
   nodeID: "errors",
 
-  show: function() {
+  show: function gErrors_show() {
     showButtons(false, false, false, true);
   },
 
-  done: function() {
+  done: function gErrors_done() {
     window.close();
   }
 };
 
-window.addEventListener("load", function() { showView(gChecking); }, false);
+window.addEventListener("load", function loadEventListener() {
+                                         showView(gChecking); }, false);
 
 // When closing the window cancel any pending or in-progress installs
-window.addEventListener("unload", function() {
+window.addEventListener("unload", function unloadEventListener() {
   for (let id in gAddons) {
     let entry = gAddons[id];
     if (!entry.install)
       return;
 
     aEntry.install.removeListener(gUpdate);
 
     if (entry.install.state != AddonManager.STATE_INSTALLED &&
--- a/toolkit/mozapps/extensions/content/update.js
+++ b/toolkit/mozapps/extensions/content/update.js
@@ -31,17 +31,17 @@ var gUpdateWizard = {
   inactiveAddonIDs: [],
   // The add-ons that we found updates available for
   addonsToUpdate: [],
   shouldSuggestAutoChecking: false,
   shouldAutoCheck: false,
   xpinstallEnabled: true,
   xpinstallLocked: false,
 
-  init: function ()
+  init: function gUpdateWizard_init()
   {
     this.inactiveAddonIDs = window.arguments[0];
 
     try {
       this.shouldSuggestAutoChecking =
         !Services.prefs.getBoolPref(PREF_UPDATE_EXTENSIONS_ENABLED);
     }
     catch (e) {
@@ -55,62 +55,62 @@ var gUpdateWizard = {
     }
 
     if (Services.io.offline)
       document.documentElement.currentPage = document.getElementById("offline");
     else
       document.documentElement.currentPage = document.getElementById("versioninfo");
   },
 
-  onWizardFinish: function ()
+  onWizardFinish: function gUpdateWizard_onWizardFinish ()
   {
     if (this.shouldSuggestAutoChecking)
       Services.prefs.setBoolPref(PREF_UPDATE_EXTENSIONS_ENABLED, this.shouldAutoCheck);
   },
 
-  _setUpButton: function (aButtonID, aButtonKey, aDisabled)
+  _setUpButton: function gUpdateWizard_setUpButton(aButtonID, aButtonKey, aDisabled)
   {
     var strings = document.getElementById("updateStrings");
     var button = document.documentElement.getButton(aButtonID);
     if (aButtonKey) {
       button.label = strings.getString(aButtonKey);
       try {
         button.setAttribute("accesskey", strings.getString(aButtonKey + "Accesskey"));
       }
       catch (e) {
       }
     }
     button.disabled = aDisabled;
   },
 
-  setButtonLabels: function (aBackButton, aBackButtonIsDisabled,
+  setButtonLabels: function gUpdateWizard_setButtonLabels(aBackButton, aBackButtonIsDisabled,
                              aNextButton, aNextButtonIsDisabled,
                              aCancelButton, aCancelButtonIsDisabled)
   {
     this._setUpButton("back", aBackButton, aBackButtonIsDisabled);
     this._setUpButton("next", aNextButton, aNextButtonIsDisabled);
     this._setUpButton("cancel", aCancelButton, aCancelButtonIsDisabled);
   },
 
   /////////////////////////////////////////////////////////////////////////////
   // Update Errors
   errorItems: [],
 
-  checkForErrors: function (aElementIDToShow)
+  checkForErrors: function gUpdateWizard_checkForErrors(aElementIDToShow)
   {
     if (this.errorItems.length > 0)
       document.getElementById(aElementIDToShow).hidden = false;
   },
 
-  onWizardClose: function (aEvent)
+  onWizardClose: function gUpdateWizard_onWizardClose(aEvent)
   {
     return this.onWizardCancel();
   },
 
-  onWizardCancel: function ()
+  onWizardCancel: function gUpdateWizard_onWizardCancel()
   {
     if (!gInteruptable) {
       gPendingClose = true;
       this._setUpButton("back", null, true);
       this._setUpButton("next", null, true);
       this._setUpButton("cancel", null, true);
       return false;
     }
@@ -119,75 +119,75 @@ var gUpdateWizard = {
       gInstallingPage.cancelInstalls();
       return false;
     }
     return true;
   }
 };
 
 var gOfflinePage = {
-  onPageAdvanced: function ()
+  onPageAdvanced: function gOfflinePage_onPageAdvanced()
   {
     Services.io.offline = false;
     return true;
   },
 
-  toggleOffline: function ()
+  toggleOffline: function gOfflinePage_toggleOffline()
   {
     var nextbtn = document.documentElement.getButton("next");
     nextbtn.disabled = !nextbtn.disabled;
   }
 }
 
 var gVersionInfoPage = {
   _completeCount: 0,
   _totalCount: 0,
-  onPageShow: function ()
+  onPageShow: function gVersionInfoPage_onPageShow()
   {
     gUpdateWizard.setButtonLabels(null, true,
                                   "nextButtonText", true,
                                   "cancelButtonText", false);
 
     try {
       var hotfixID = Services.prefs.getCharPref(PREF_EM_HOTFIX_ID);
     }
     catch (e) { }
 
     // Retrieve all add-ons in order to sync their app compatibility information
-    AddonManager.getAllAddons(function(aAddons) {
-      gUpdateWizard.addons = aAddons.filter(function(a) {
+    AddonManager.getAllAddons(function gVersionInfoPage_getAllAddons(aAddons) {
+      gUpdateWizard.addons = aAddons.filter(function gVersionInfoPage_filterAddons(a) {
         return a.type != "plugin" && a.id != hotfixID;
       });
 
       gVersionInfoPage._totalCount = gUpdateWizard.addons.length;
 
       // Ensure compatibility overrides are up to date before checking for
       // individual addon updates.
       let ids = [addon.id for each (addon in gUpdateWizard.addons)];
 
       gInteruptable = false;
-      AddonRepository.repopulateCache(ids, function() {
-        AddonManagerPrivate.updateAddonRepositoryData(function() {
+      AddonRepository.repopulateCache(ids, function gVersionInfoPage_repolulateCache() {
+        AddonManagerPrivate.updateAddonRepositoryData(function gVersionInfoPage_updateAddonRepoData() {
           gInteruptable = true;
           if (gPendingClose) {
             window.close();
             return;
           }
 
           for (let addon of gUpdateWizard.addons)
             addon.findUpdates(gVersionInfoPage, AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
         });
       });
     });
   },
 
-  onAllUpdatesFinished: function() {
+  onAllUpdatesFinished: function gVersionInfoPage_onAllUpdatesFinished() {
     // Filter out any add-ons that were disabled before the application was
     // upgraded or are already compatible
-    gUpdateWizard.addons = gUpdateWizard.addons.filter(function(a) {
+    gUpdateWizard.addons = gUpdateWizard.addons.filter(function onAllUpdatesFinished_filterAddons(a) {
       return a.appDisabled && gUpdateWizard.inactiveAddonIDs.indexOf(a.id) < 0;
     });
 
     if (gUpdateWizard.addons.length > 0) {
       // There are still incompatible addons, inform the user.
       document.documentElement.currentPage = document.getElementById("mismatch");
     }
     else {
@@ -196,17 +196,17 @@ var gVersionInfoPage = {
       //XXX Bug 314754 - We need to use setTimeout to close the window due to
       // the EM using xmlHttpRequest when checking for updates.
       setTimeout(close, 0);
     }
   },
 
   /////////////////////////////////////////////////////////////////////////////
   // UpdateListener
-  onUpdateFinished: function(aAddon, status) {
+  onUpdateFinished: function gVersionInfoPage_onUpdateFinished(aAddon, status) {
     // If the add-on is now active then it won't have been disabled by startup
     if (aAddon.active)
       AddonManagerPrivate.removeStartupChange("disabled", aAddon.id);
 
     if (status != AddonManager.UPDATE_STATUS_NO_ERROR)
       gUpdateWizard.errorItems.push(aAddon);
 
     ++this._completeCount;
@@ -223,17 +223,17 @@ var gVersionInfoPage = {
     progress.value = Math.ceil((this._completeCount / this._totalCount) * 100);
 
     if (this._completeCount == this._totalCount)
       this.onAllUpdatesFinished();
   },
 };
 
 var gMismatchPage = {
-  onPageShow: function ()
+  onPageShow: function gMismatchPage_onPageShow()
   {
     gUpdateWizard.setButtonLabels(null, true,
                                   "mismatchCheckNow", false,
                                   "mismatchDontCheck", false);
     document.documentElement.getButton("next").focus();
 
     var incompatible = document.getElementById("mismatch.incompatible");
     for (let addon of gUpdateWizard.addons) {
@@ -242,17 +242,17 @@ var gMismatchPage = {
       incompatible.appendChild(listitem);
     }
   }
 };
 
 var gUpdatePage = {
   _totalCount: 0,
   _completeCount: 0,
-  onPageShow: function ()
+  onPageShow: function gUpdatePage_onPageShow()
   {
     if (!gUpdateWizard.xpinstallEnabled && gUpdateWizard.xpinstallLocked) {
       document.documentElement.currentPage = document.getElementById("adminDisabled");
       return;
     }
 
     gUpdateWizard.setButtonLabels(null, true,
                                   "nextButtonText", true,
@@ -261,30 +261,30 @@ var gUpdatePage = {
 
     gUpdateWizard.errorItems = [];
 
     this._totalCount = gUpdateWizard.addons.length;
     for (let addon of gUpdateWizard.addons)
       addon.findUpdates(this, AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
   },
 
-  onAllUpdatesFinished: function() {
+  onAllUpdatesFinished: function gUpdatePage_onAllUpdatesFinished() {
     var nextPage = document.getElementById("noupdates");
     if (gUpdateWizard.addonsToUpdate.length > 0)
       nextPage = document.getElementById("found");
     document.documentElement.currentPage = nextPage;
   },
 
   /////////////////////////////////////////////////////////////////////////////
   // UpdateListener
-  onUpdateAvailable: function(aAddon, aInstall) {
+  onUpdateAvailable: function gUpdatePage_onUpdateAvailable(aAddon, aInstall) {
     gUpdateWizard.addonsToUpdate.push(aInstall);
   },
 
-  onUpdateFinished: function(aAddon, status) {
+  onUpdateFinished: function gUpdatePage_onUpdateFinished(aAddon, status) {
     if (status != AddonManager.UPDATE_STATUS_NO_ERROR)
       gUpdateWizard.errorItems.push(aAddon);
 
     ++this._completeCount;
 
     // Update the status text and progress bar
     var updateStrings = document.getElementById("updateStrings");
     var status = document.getElementById("checking.status");
@@ -295,17 +295,17 @@ var gUpdatePage = {
     progress.value = Math.ceil((this._completeCount / this._totalCount) * 100);
 
     if (this._completeCount == this._totalCount)
       this.onAllUpdatesFinished()
   },
 };
 
 var gFoundPage = {
-  onPageShow: function ()
+  onPageShow: function gFoundPage_onPageShow()
   {
     gUpdateWizard.setButtonLabels(null, true,
                                   "installButtonText", false,
                                   null, false);
 
     var foundUpdates = document.getElementById("found.updates");
     var itemCount = gUpdateWizard.addonsToUpdate.length;
     for (let install of gUpdateWizard.addonsToUpdate) {
@@ -321,27 +321,27 @@ var gFoundPage = {
       document.documentElement.getButton("next").disabled = true;
     }
     else {
       document.documentElement.getButton("next").focus();
       document.documentElement.getButton("next").disabled = false;
     }
   },
 
-  toggleXPInstallEnable: function(aEvent)
+  toggleXPInstallEnable: function gFoundPage_toggleXPInstallEnable(aEvent)
   {
     var enabled = aEvent.target.checked;
     gUpdateWizard.xpinstallEnabled = enabled;
     var pref = Components.classes["@mozilla.org/preferences-service;1"]
                          .getService(Components.interfaces.nsIPrefBranch);
     pref.setBoolPref(PREF_XPINSTALL_ENABLED, enabled);
     this.updateNextButton();
   },
 
-  updateNextButton: function ()
+  updateNextButton: function gFoundPage_updateNextButton()
   {
     if (!gUpdateWizard.xpinstallEnabled) {
       document.documentElement.getButton("next").disabled = true;
       return;
     }
 
     var oneChecked = false;
     var foundUpdates = document.getElementById("found.updates");
@@ -363,17 +363,17 @@ var gFoundPage = {
 
 var gInstallingPage = {
   _installs         : [],
   _errors           : [],
   _strings          : null,
   _currentInstall   : -1,
   _installing       : false,
 
-  onPageShow: function ()
+  onPageShow: function gInstallingPage_onPageShow()
   {
     gUpdateWizard.setButtonLabels(null, true,
                                   "nextButtonText", true,
                                   null, true);
     this._errors = [];
 
     var foundUpdates = document.getElementById("found.updates");
     var updates = foundUpdates.getElementsByTagName("listitem");
@@ -383,17 +383,17 @@ var gInstallingPage = {
       this._installs.push(update.install);
     }
 
     this._strings = document.getElementById("updateStrings");
     this._installing = true;
     this.startNextInstall();
   },
 
-  startNextInstall: function() {
+  startNextInstall: function gInstallingPage_startNextInstall() {
     if (this._currentInstall >= 0) {
       this._installs[this._currentInstall].removeListener(this);
     }
 
     this._currentInstall++;
 
     if (this._installs.length == this._currentInstall) {
       this._installing = false;
@@ -402,89 +402,89 @@ var gInstallingPage = {
       document.documentElement.advance();
       return;
     }
 
     this._installs[this._currentInstall].addListener(this);
     this._installs[this._currentInstall].install();
   },
 
-  cancelInstalls: function() {
+  cancelInstalls: function gInstallingPage_cancelInstalls() {
     this._installs[this._currentInstall].removeListener(this);
     this._installs[this._currentInstall].cancel();
   },
 
   /////////////////////////////////////////////////////////////////////////////
   // InstallListener
-  onDownloadStarted: function(aInstall) {
+  onDownloadStarted: function gInstallingPage_onDownloadStarted(aInstall) {
     var strings = document.getElementById("updateStrings");
     var label = strings.getFormattedString("downloadingPrefix", [aInstall.name]);
     var actionItem = document.getElementById("actionItem");
     actionItem.value = label;
   },
 
-  onDownloadProgress: function(aInstall) {
+  onDownloadProgress: function gInstallingPage_onDownloadProgress(aInstall) {
     var downloadProgress = document.getElementById("downloadProgress");
     downloadProgress.value = Math.ceil(100 * aInstall.progress / aInstall.maxProgress);
   },
 
-  onDownloadEnded: function(aInstall) {
+  onDownloadEnded: function gInstallingPage_onDownloadEnded(aInstall) {
   },
 
-  onDownloadFailed: function(aInstall) {
+  onDownloadFailed: function gInstallingPage_onDownloadFailed(aInstall) {
     this._errors.push(aInstall);
 
     this.startNextInstall();
   },
 
-  onInstallStarted: function(aInstall) {
+  onInstallStarted: function gInstallingPage_onInstallStarted(aInstall) {
     var strings = document.getElementById("updateStrings");
     var label = strings.getFormattedString("installingPrefix", [aInstall.name]);
     var actionItem = document.getElementById("actionItem");
     actionItem.value = label;
   },
 
-  onInstallEnded: function(aInstall, aAddon) {
+  onInstallEnded: function gInstallingPage_onInstallEnded(aInstall, aAddon) {
     // Remember that this add-on was updated during startup
     AddonManagerPrivate.addStartupChange(AddonManager.STARTUP_CHANGE_CHANGED,
                                          aAddon.id);
 
     this.startNextInstall();
   },
 
-  onInstallFailed: function(aInstall) {
+  onInstallFailed: function gInstallingPage_onInstallFailed(aInstall) {
     this._errors.push(aInstall);
 
     this.startNextInstall();
   }
 };
 
 var gInstallErrorsPage = {
-  onPageShow: function ()
+  onPageShow: function gInstallErrorsPage_onPageShow()
   {
     gUpdateWizard.setButtonLabels(null, true, null, true, null, true);
     document.documentElement.getButton("finish").focus();
   },
 };
 
 // Displayed when there are incompatible add-ons and the xpinstall.enabled
 // pref is false and locked.
 var gAdminDisabledPage = {
-  onPageShow: function ()
+  onPageShow: function gAdminDisabledPage_onPageShow()
   {
     gUpdateWizard.setButtonLabels(null, true, null, true,
                                   "cancelButtonText", true);
     document.documentElement.getButton("finish").focus();
   }
 };
 
 // Displayed when selected add-on updates have been installed without error.
 // There can still be add-ons that are not compatible and don't have an update.
 var gFinishedPage = {
-  onPageShow: function ()
+  onPageShow: function gFinishedPage_onPageShow()
   {
     gUpdateWizard.setButtonLabels(null, true, null, true, null, true);
     document.documentElement.getButton("finish").focus();
 
     if (gUpdateWizard.shouldSuggestAutoChecking) {
       document.getElementById("finishedCheckDisabled").hidden = false;
       gUpdateWizard.shouldAutoCheck = true;
     }
@@ -493,17 +493,17 @@ var gFinishedPage = {
 
     document.documentElement.getButton("finish").focus();
   }
 };
 
 // Displayed when there are incompatible add-ons and there are no available
 // updates.
 var gNoUpdatesPage = {
-  onPageShow: function (aEvent)
+  onPageShow: function gNoUpdatesPage_onPageLoad(aEvent)
   {
     gUpdateWizard.setButtonLabels(null, true, null, true, null, true);
     if (gUpdateWizard.shouldSuggestAutoChecking) {
       document.getElementById("noupdatesCheckDisabled").hidden = false;
       gUpdateWizard.shouldAutoCheck = true;
     }
     else
       document.getElementById("noupdatesCheckEnabled").hidden = false;
--- a/toolkit/mozapps/extensions/content/xpinstallConfirm.js
+++ b/toolkit/mozapps/extensions/content/xpinstallConfirm.js
@@ -3,17 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var args
 
 var XPInstallConfirm = {};
 
-XPInstallConfirm.init = function ()
+XPInstallConfirm.init = function XPInstallConfirm_init()
 {
   var _installCountdown;
   var _installCountdownInterval;
   var _focused;
   var _timeout;
 
   var bundle = document.getElementById("xpinstallConfirmStrings");
 
@@ -131,25 +131,25 @@ XPInstallConfirm.init = function ()
 
     okButton.disabled = true;
     setWidgetsAfterFocus();
   }
   else
     okButton.label = bundle.getString("installButtonLabel");
 }
 
-XPInstallConfirm.onOK = function ()
+XPInstallConfirm.onOK = function XPInstallConfirm_onOk()
 {
   Components.classes["@mozilla.org/base/telemetry;1"].
     getService(Components.interfaces.nsITelemetry).
     getHistogramById("SECURITY_UI").
     add(Components.interfaces.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL_CLICK_THROUGH);
   for (let install of args.installs)
     install.install();
   return true;
 }
 
-XPInstallConfirm.onCancel = function ()
+XPInstallConfirm.onCancel = function XPInstallConfirm_onCancel()
 {
   for (let install of args.installs)
     install.cancel();
   return true;
 }
--- a/toolkit/mozapps/extensions/nsBlocklistService.js
+++ b/toolkit/mozapps/extensions/nsBlocklistService.js
@@ -270,17 +270,17 @@ Blocklist.prototype = {
    *                   "minVersion"  The minimum version in a version range
    *                                 (default = 0)
    *                   "maxVersion"  The maximum version in a version range
    *                                 (default = *)
    */
   _addonEntries: null,
   _pluginEntries: null,
 
-  observe: function(aSubject, aTopic, aData) {
+  observe: function Blocklist_observe(aSubject, aTopic, aData) {
     switch (aTopic) {
     case "xpcom-shutdown":
       let os = getObserverService();
       os.removeObserver(this, "xpcom-shutdown");
       gPref.removeObserver("extensions.blocklist.", this);
       break;
     case "nsPref:changed":
       switch (aData) {
@@ -295,23 +295,23 @@ Blocklist.prototype = {
           this._blocklistUpdated(null, null);
           break;
       }
       break;
     }
   },
 
   /* See nsIBlocklistService */
-  isAddonBlocklisted: function(id, version, appVersion, toolkitVersion) {
+  isAddonBlocklisted: function Blocklist_isAddonBlocklisted(id, version, appVersion, toolkitVersion) {
     return this.getAddonBlocklistState(id, version, appVersion, toolkitVersion) ==
                    Ci.nsIBlocklistService.STATE_BLOCKED;
   },
 
   /* See nsIBlocklistService */
-  getAddonBlocklistState: function(id, version, appVersion, toolkitVersion) {
+  getAddonBlocklistState: function Blocklist_getAddonBlocklistState(id, version, appVersion, toolkitVersion) {
     if (!this._addonEntries)
       this._loadBlocklist();
     return this._getAddonBlocklistState(id, version, this._addonEntries,
                                         appVersion, toolkitVersion);
   },
 
   /**
    * Private version of getAddonBlocklistState that allows the caller to pass in
@@ -327,17 +327,18 @@ Blocklist.prototype = {
    *          The application version to compare to, will use the current
    *          version if null.
    * @param   toolkitVersion
    *          The toolkit version to compare to, will use the current version if
    *          null.
    * @returns The blocklist state for the item, one of the STATE constants as
    *          defined in nsIBlocklistService.
    */
-  _getAddonBlocklistState: function(id, version, addonEntries, appVersion, toolkitVersion) {
+  _getAddonBlocklistState: function Blocklist_getAddonBlocklistStateCall(id,
+                           version, addonEntries, appVersion, toolkitVersion) {
     if (!gBlocklistEnabled)
       return Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
 
     if (!appVersion)
       appVersion = gApp.version;
     if (!toolkitVersion)
       toolkitVersion = gApp.platformVersion;
 
@@ -349,38 +350,38 @@ Blocklist.prototype = {
       if (currentblItem.includesItem(version, appVersion, toolkitVersion))
         return currentblItem.severity >= gBlocklistLevel ? Ci.nsIBlocklistService.STATE_BLOCKED :
                                                        Ci.nsIBlocklistService.STATE_SOFTBLOCKED;
     }
     return Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
   },
 
   /* See nsIBlocklistService */
-  getAddonBlocklistURL: function(id, version, appVersion, toolkitVersion) {
+  getAddonBlocklistURL: function Blocklist_getAddonBlocklistURL(id, version, appVersion, toolkitVersion) {
     if (!gBlocklistEnabled)
       return "";
 
     if (!this._addonEntries)
       this._loadBlocklist();
 
     let blItem = this._addonEntries[id];
     if (!blItem || !blItem.blockID)
       return null;
 
     return this._createBlocklistURL(blItem.blockID);
   },
 
-  _createBlocklistURL: function(id) {
+  _createBlocklistURL: function Blocklist_createBlocklistURL(id) {
     let url = Services.urlFormatter.formatURLPref(PREF_BLOCKLIST_ITEM_URL);
     url = url.replace(/%blockID%/g, id);
 
     return url;
   },
 
-  notify: function(aTimer) {
+  notify: function Blocklist_notify(aTimer) {
     if (!gBlocklistEnabled)
       return;
 
     try {
       var dsURI = gPref.getCharPref(PREF_BLOCKLIST_URL);
     }
     catch (e) {
       LOG("Blocklist::notify: The " + PREF_BLOCKLIST_URL + " preference" +
@@ -474,27 +475,29 @@ Blocklist.prototype = {
                   createInstance(Ci.nsIXMLHttpRequest);
     request.open("GET", uri.spec, true);
     request.channel.notificationCallbacks = new gCertUtils.BadCertHandler();
     request.overrideMimeType("text/xml");
     request.setRequestHeader("Cache-Control", "no-cache");
     request.QueryInterface(Components.interfaces.nsIJSXMLHttpRequest);
 
     var self = this;
-    request.addEventListener("error", function(event) { self.onXMLError(event); }, false);
-    request.addEventListener("load", function(event) { self.onXMLLoad(event);  }, false);
+    request.addEventListener("error", function errorEventListener(event) {
+                                      self.onXMLError(event); }, false);
+    request.addEventListener("load", function loadEventListener(event) {
+                                     self.onXMLLoad(event);  }, false);
     request.send(null);
 
     // When the blocklist loads we need to compare it to the current copy so
     // make sure we have loaded it.
     if (!this._addonEntries)
       this._loadBlocklist();
   },
 
-  onXMLLoad: function(aEvent) {
+  onXMLLoad: function Blocklist_onXMLLoad(aEvent) {
     var request = aEvent.target;
     try {
       gCertUtils.checkCert(request.channel);
     }
     catch (e) {
       LOG("Blocklist::onXMLLoad: " + e);
       return;
     }
@@ -516,17 +519,17 @@ Blocklist.prototype = {
     this._addonEntries = { };
     this._pluginEntries = { };
     this._loadBlocklistFromFile(FileUtils.getFile(KEY_PROFILEDIR,
                                                   [FILE_BLOCKLIST]));
 
     this._blocklistUpdated(oldAddonEntries, oldPluginEntries);
   },
 
-  onXMLError: function(aEvent) {
+  onXMLError: function Blocklist_onXMLError(aEvent) {
     try {
       var request = aEvent.target;
       // the following may throw (e.g. a local file or timeout)
       var status = request.status;
     }
     catch (e) {
       request = aEvent.target.channel.QueryInterface(Ci.nsIRequest);
       status = request.status;
@@ -542,17 +545,17 @@ Blocklist.prototype = {
     LOG("Blocklist:onError: There was an error loading the blocklist file\r\n" +
         statusText);
   },
 
   /**
    * Finds the newest blocklist file from the application and the profile and
    * load it or does nothing if neither exist.
    */
-  _loadBlocklist: function() {
+  _loadBlocklist: function Blocklist_loadBlocklist() {
     this._addonEntries = { };
     this._pluginEntries = { };
     var profFile = FileUtils.getFile(KEY_PROFILEDIR, [FILE_BLOCKLIST]);
     if (profFile.exists()) {
       this._loadBlocklistFromFile(profFile);
       return;
     }
     var appFile = FileUtils.getFile(KEY_APPDIR, [FILE_BLOCKLIST]);
@@ -610,17 +613,17 @@ Blocklist.prototype = {
 #          <!-- All match tags must match a plugin to blocklist a plugin -->
 #          <match name="name" exp="some plugin"/>
 #          <match name="description" exp="1[.]2[.]3"/>
 #        </pluginItem>
 #      </pluginItems>
 #    </blocklist>
    */
 
-  _loadBlocklistFromFile: function(file) {
+  _loadBlocklistFromFile: function Blocklist_loadBlocklistFromFile(file) {
     if (!gBlocklistEnabled) {
       LOG("Blocklist::_loadBlocklistFromFile: blocklist is disabled");
       return;
     }
 
     if (!file.exists()) {
       LOG("Blocklist::_loadBlocklistFromFile: XML File does not exist");
       return;
@@ -662,31 +665,31 @@ Blocklist.prototype = {
     }
     catch (e) {
       LOG("Blocklist::_loadBlocklistFromFile: Error constructing blocklist " + e);
       return;
     }
     fileStream.close();
   },
 
-  _processItemNodes: function(itemNodes, prefix, handler) {
+  _processItemNodes: function Blocklist_processItemNodes(itemNodes, prefix, handler) {
     var result = [];
     var itemName = prefix + "Item";
     for (var i = 0; i < itemNodes.length; ++i) {
       var blocklistElement = itemNodes.item(i);
       if (!(blocklistElement instanceof Ci.nsIDOMElement) ||
           blocklistElement.localName != itemName)
         continue;
 
       handler(blocklistElement, result);
     }
     return result;
   },
 
-  _handleEmItemNode: function(blocklistElement, result) {
+  _handleEmItemNode: function Blocklist_handleEmItemNode(blocklistElement, result) {
     if (!matchesOSABI(blocklistElement))
       return;
 
     var versionNodes = blocklistElement.childNodes;
     var id = blocklistElement.getAttribute("id");
     result[id] = [];
     for (var x = 0; x < versionNodes.length; ++x) {
       var versionRangeElement = versionNodes.item(x);
@@ -699,17 +702,17 @@ Blocklist.prototype = {
     // if only the extension ID is specified block all versions of the
     // extension for the current application.
     if (result[id].length == 0)
       result[id].push(new BlocklistItemData(null));
 
     result[id].blockID = blocklistElement.getAttribute("blockID");
   },
 
-  _handlePluginItemNode: function(blocklistElement, result) {
+  _handlePluginItemNode: function Blocklist_handlePluginItemNode(blocklistElement, result) {
     if (!matchesOSABI(blocklistElement))
       return;
 
     var matchNodes = blocklistElement.childNodes;
     var blockEntry = {
       matches: {},
       versions: [],
       blockID: null,
@@ -740,17 +743,18 @@ Blocklist.prototype = {
       blockEntry.versions.push(new BlocklistItemData(null));
 
     blockEntry.blockID = blocklistElement.getAttribute("blockID");
 
     result.push(blockEntry);
   },
 
   /* See nsIBlocklistService */
-  getPluginBlocklistState: function(plugin, appVersion, toolkitVersion) {
+  getPluginBlocklistState: function Blocklist_getPluginBlocklistState(plugin,
+                           appVersion, toolkitVersion) {
     if (!this._pluginEntries)
       this._loadBlocklist();
     return this._getPluginBlocklistState(plugin, this._pluginEntries,
                                          appVersion, toolkitVersion);
   },
 
   /**
    * Private version of getPluginBlocklistState that allows the caller to pass in
@@ -764,17 +768,18 @@ Blocklist.prototype = {
    *          The application version to compare to, will use the current
    *          version if null.
    * @param   toolkitVersion
    *          The toolkit version to compare to, will use the current version if
    *          null.
    * @returns The blocklist state for the item, one of the STATE constants as
    *          defined in nsIBlocklistService.
    */
-  _getPluginBlocklistState: function(plugin, pluginEntries, appVersion, toolkitVersion) {
+  _getPluginBlocklistState: function Blocklist_getPluginBlocklistState(plugin,
+                            pluginEntries, appVersion, toolkitVersion) {
     if (!gBlocklistEnabled)
       return Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
 
     if (!appVersion)
       appVersion = gApp.version;
     if (!toolkitVersion)
       toolkitVersion = gApp.platformVersion;
 
@@ -809,17 +814,17 @@ Blocklist.prototype = {
         }
       }
     }
 
     return Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
   },
 
   /* See nsIBlocklistService */
-  getPluginBlocklistURL: function(plugin) {
+  getPluginBlocklistURL: function Blocklist_getPluginBlocklistURL(plugin) {
     if (!gBlocklistEnabled)
       return "";
 
     if (!this._pluginEntries)
       this._loadBlocklist();
 
     for each (let blockEntry in this._pluginEntries) {
       let matchFailed = false;
@@ -836,21 +841,22 @@ Blocklist.prototype = {
         if(!blockEntry.blockID)
           return null;
         else
           return this._createBlocklistURL(blockEntry.blockID);
       }
     }
   },
 
-  _blocklistUpdated: function(oldAddonEntries, oldPluginEntries) {
+  _blocklistUpdated: function Blocklist_blocklistUpdated(oldAddonEntries, oldPluginEntries) {
     var addonList = [];
 
     var self = this;
-    AddonManager.getAddonsByTypes(["extension", "theme", "locale", "dictionary"], function(addons) {
+    const types = ["extension", "theme", "locale", "dictionary"]
+    AddonManager.getAddonsByTypes(types, function blocklistUpdated_getAddonsByTypes(addons) {
 
       for (let addon of addons) {
         let oldState = Ci.nsIBlocklistService.STATE_NOTBLOCKED;
         if (oldAddonEntries)
           oldState = self._getAddonBlocklistState(addon.id, addon.version,
                                                   oldAddonEntries);
         let state = self.getAddonBlocklistState(addon.id, addon.version);
 
@@ -964,17 +970,17 @@ Blocklist.prototype = {
       };
       // This lets the dialog get the raw js object
       args.wrappedJSObject = args;
 
       /*
         Some tests run without UI, so the async code listens to a message
         that can be sent programatically
       */
-      let applyBlocklistChanges = function() {
+      let applyBlocklistChanges = function blocklistUpdated_applyBlocklistChanges() {
         for (let addon of addonList) {
           if (!addon.disable)
             continue;
 
           if (addon.item instanceof Ci.nsIPluginTag)
             addon.item.disabled = true;
           else
             addon.item.softDisabled = true;
@@ -1054,17 +1060,17 @@ BlocklistItemData.prototype = {
    *          The version of the item being tested.
    * @param   appVersion
    *          The application version to test with.
    * @param   toolkitVersion
    *          The toolkit version to test with.
    * @returns True if the version range covers the item version and application
    *          or toolkit version.
    */
-  includesItem: function(version, appVersion, toolkitVersion) {
+  includesItem: function BlocklistItemData_includesItem(version, appVersion, toolkitVersion) {
     // Some platforms have no version for plugins, these don't match if there
     // was a min/maxVersion provided
     if (!version && (this.minVersion || this.maxVersion))
       return false;
 
     // Check if the item version matches
     if (!this.matchesRange(version, this.minVersion, this.maxVersion))
       return false;
@@ -1084,34 +1090,34 @@ BlocklistItemData.prototype = {
    *          The version to test.
    * @param   minVersion
    *          The minimum version. If null it is assumed that version is always
    *          larger.
    * @param   maxVersion
    *          The maximum version. If null it is assumed that version is always
    *          smaller.
    */
-  matchesRange: function(version, minVersion, maxVersion) {
+  matchesRange: function BlocklistItemData_matchesRange(version, minVersion, maxVersion) {
     if (minVersion && gVersionChecker.compare(version, minVersion) < 0)
       return false;
     if (maxVersion && gVersionChecker.compare(version, maxVersion) > 0)
       return false;
     return true;
   },
 
   /**
    * Tests if there is a matching range for the given target application id and
    * version.
    * @param   appID
    *          The application ID to test for, may be for an application or toolkit
    * @param   appVersion
    *          The version of the application to test for.
    * @returns True if this version range covers the application version given.
    */
-  matchesTargetRange: function(appID, appVersion) {
+  matchesTargetRange: function BlocklistItemData_matchesTargetRange(appID, appVersion) {
     var blTargetApp = this.targetApps[appID];
     if (!blTargetApp)
       return false;
 
     for (let app of blTargetApp) {
       if (this.matchesRange(appVersion, app.minVersion, app.maxVersion))
         return true;
     }
@@ -1123,17 +1129,17 @@ BlocklistItemData.prototype = {
    * Retrieves a version range (e.g. minVersion and maxVersion) for a
    * blocklist item's targetApplication element.
    * @param   targetAppElement
    *          A targetApplication blocklist element.
    * @returns An array of JS objects with the following properties:
    *          "minVersion"  The minimum version in a version range (default = null).
    *          "maxVersion"  The maximum version in a version range (default = null).
    */
-  getBlocklistAppVersions: function(targetAppElement) {
+  getBlocklistAppVersions: function BlocklistItemData_getBlocklistAppVersions(targetAppElement) {
     var appVersions = [ ];
 
     if (targetAppElement) {
       for (var i = 0; i < targetAppElement.childNodes.length; ++i) {
         var versionRangeElement = targetAppElement.childNodes.item(i);
         if (!(versionRangeElement instanceof Ci.nsIDOMElement) ||
             versionRangeElement.localName != "versionRange")
           continue;
@@ -1151,17 +1157,17 @@ BlocklistItemData.prototype = {
    * Retrieves a version range (e.g. minVersion and maxVersion) for a blocklist
    * versionRange element.
    * @param   versionRangeElement
    *          The versionRange blocklist element.
    * @returns A JS object with the following properties:
    *          "minVersion"  The minimum version in a version range (default = null).
    *          "maxVersion"  The maximum version in a version range (default = null).
    */
-  getBlocklistVersionRange: function(versionRangeElement) {
+  getBlocklistVersionRange: function BlocklistItemData_getBlocklistVersionRange(versionRangeElement) {
     var minVersion = null;
     var maxVersion = null;
     if (!versionRangeElement)
       return { minVersion: minVersion, maxVersion: maxVersion };
 
     if (versionRangeElement.hasAttribute("minVersion"))
       minVersion = versionRangeElement.getAttribute("minVersion");
     if (versionRangeElement.hasAttribute("maxVersion"))