Merge mozilla-central to mozilla-inbound
authorEd Morley <emorley@mozilla.com>
Tue, 24 Jul 2012 17:39:24 +0100
changeset 103422 03fae2283d808405bee71d2d97a5e4f93b19d6ef
parent 103421 511943aecd6000868f5f480a63c078904ca9b267 (current diff)
parent 103390 34b14c220817411ad33df81c5018521e5a3f4006 (diff)
child 103423 aa003aa3a18f365fd805dca30f5aef3ebc584344
push id1989
push userakeybl@mozilla.com
push dateTue, 28 Aug 2012 00:20:43 +0000
treeherdermozilla-aurora@a8e95ae10ea7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone17.0a1
Merge mozilla-central to mozilla-inbound
--- a/browser/themes/gnomestripe/tabview/tabview.css
+++ b/browser/themes/gnomestripe/tabview/tabview.css
@@ -549,16 +549,18 @@ html[dir=rtl] .iq-resizable-se {
 
 #search{
   width: 100%;
   height: 100%;
 }
 
 #searchbox{
   width: 270px;
+  max-width: -moz-available;
+  -moz-margin-start: 20px;
   height: 30px;
   box-shadow: 0px 1px 0px rgba(255,255,255,.5), 0px -1px 0px rgba(0,0,0,1), 0px 0px 9px rgba(0,0,0,.8);
   color: white;
   border: none;
   background-color: #272727;
   border-radius: 0.4em;
   -moz-padding-start: 5px;
   -moz-padding-end: 5px;
--- a/browser/themes/pinstripe/tabview/tabview.css
+++ b/browser/themes/pinstripe/tabview/tabview.css
@@ -545,16 +545,18 @@ html[dir=rtl] .iq-resizable-se {
 
 #search{
   width: 100%;
   height: 100%;
 }
 
 #searchbox {
   width: 270px;
+  max-width: -moz-available;
+  -moz-margin-start: 20px;
   height: 30px;
   box-shadow: 0px 1px 0px rgba(255,255,255,.5), 0px -1px 0px rgba(0,0,0,1), 0px 0px 13px rgba(0,0,0,.8);
   color: white;
   border: none;
   background-color: #272727;
   border-radius: 0.4em;
   -moz-padding-start: 5px;
   -moz-padding-end: 5px;
--- a/browser/themes/winstripe/tabview/tabview.css
+++ b/browser/themes/winstripe/tabview/tabview.css
@@ -564,16 +564,18 @@ html[dir=rtl] .iq-resizable-se {
 
 #search{
   width: 100%;
   height: 100%;
 }
 
 #searchbox{
   width: 270px;
+  max-width: -moz-available;
+  -moz-margin-start: 20px;
   height: 30px;
   box-shadow: 0px 1px 0px rgba(255,255,255,.5), 0px -1px 0px rgba(0,0,0,1), 0px 0px 9px rgba(0,0,0,.8);
   color: white;
   border: none;
   background-color: #272727;
   border-radius: 0.4em;
   -moz-padding-start: 5px;
   -moz-padding-end: 5px;
--- a/toolkit/mozapps/extensions/AddonRepository.jsm
+++ b/toolkit/mozapps/extensions/AddonRepository.jsm
@@ -37,17 +37,17 @@ const DEFAULT_CACHE_TYPES = "extension,t
 
 const KEY_PROFILEDIR = "ProfD";
 const FILE_DATABASE  = "addons.sqlite";
 const DB_SCHEMA      = 4;
 
 const TOOLKIT_ID     = "toolkit@mozilla.org";
 
 ["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.repository", this);
     return this[aName];
   });
 }, this);
 
 
@@ -113,17 +113,17 @@ function getAddonsToCache(aIds, aCallbac
     var types = Services.prefs.getCharPref(PREF_GETADDONS_CACHE_TYPES);
   }
   catch (e) { }
   if (!types)
     types = DEFAULT_CACHE_TYPES;
 
   types = types.split(",");
 
-  AddonManager.getAddonsByIDs(aIds, function(aAddons) {
+  AddonManager.getAddonsByIDs(aIds, function getAddonsToCache_getAddonsByIDs(aAddons) {
     let enabledIds = [];
     for (var i = 0; i < aIds.length; i++) {
       var preference = PREF_GETADDONS_CACHE_ID_ENABLED.replace("%ID%", aIds[i]);
       try {
         if (!Services.prefs.getBoolPref(preference))
           continue;
       } catch(e) {
         // If the preference doesn't exist caching is enabled by default
@@ -375,34 +375,34 @@ AddonSearchResult.prototype = {
    * particular application and platform version.
    *
    * @param  appVersion
    *         An application version to test against
    * @param  platformVersion
    *         A platform version to test against
    * @return Boolean representing if the add-on is compatible
    */
-  isCompatibleWith: function(aAppVerison, aPlatformVersion) {
+  isCompatibleWith: function ASR_isCompatibleWith(aAppVerison, aPlatformVersion) {
     return true;
   },
 
   /**
    * Starts an update check for this add-on. This will perform
    * asynchronously and deliver results to the given listener.
    *
    * @param  aListener
    *         An UpdateListener for the update process
    * @param  aReason
    *         A reason code for performing the update
    * @param  aAppVersion
    *         An application version to check for updates for
    * @param  aPlatformVersion
    *         A platform version to check for updates for
    */
-  findUpdates: function(aListener, aReason, aAppVersion, aPlatformVersion) {
+  findUpdates: function ASR_findUpdates(aListener, aReason, aAppVersion, aPlatformVersion) {
     if ("onNoCompatibilityUpdateAvailable" in aListener)
       aListener.onNoCompatibilityUpdateAvailable(this);
     if ("onNoUpdateAvailable" in aListener)
       aListener.onNoUpdateAvailable(this);
     if ("onUpdateFinished" in aListener)
       aListener.onUpdateFinished(this);
   }
 }
@@ -471,70 +471,70 @@ var AddonRepository = {
   _callback: null,
 
   // Maximum number of results to return
   _maxResults: null,
   
   /**
    * Initialize AddonRepository.
    */
-  initialize: function() {
+  initialize: function AddonRepo_initialize() {
     Services.obs.addObserver(this, "xpcom-shutdown", false);
   },
 
   /**
    * Observe xpcom-shutdown notification, so we can shutdown cleanly.
    */
-  observe: function (aSubject, aTopic, aData) {
+  observe: function AddonRepo_observe(aSubject, aTopic, aData) {
     if (aTopic == "xpcom-shutdown") {
       Services.obs.removeObserver(this, "xpcom-shutdown");
       this.shutdown();
     }
   },
 
   /**
    * Shut down AddonRepository
    */
-  shutdown: function() {
+  shutdown: function AddonRepo_shutdown() {
     this.cancelSearch();
 
     this._addons = null;
     this._pendingCallbacks = null;
-    AddonDatabase.shutdown(function() {
+    AddonDatabase.shutdown(function shutdown_databaseShutdown() {
       Services.obs.notifyObservers(null, "addon-repository-shutdown", null);
     });
   },
 
   /**
    * Asynchronously get a cached add-on by id. The add-on (or null if the
    * add-on is not found) is passed to the specified callback. If caching is
    * disabled, null is passed to the specified callback.
    *
    * @param  aId
    *         The id of the add-on to get
    * @param  aCallback
    *         The callback to pass the result back to
    */
-  getCachedAddonByID: function(aId, aCallback) {
+  getCachedAddonByID: function AddonRepo_getCachedAddonByID(aId, aCallback) {
     if (!aId || !this.cacheEnabled) {
       aCallback(null);
       return;
     }
 
     let self = this;
     function getAddon(aAddons) {
       aCallback((aId in aAddons) ? aAddons[aId] : null);
     }
 
     if (this._addons == null) {
       if (this._pendingCallbacks == null) {
         // Data has not been retrieved from the database, so retrieve it
         this._pendingCallbacks = [];
         this._pendingCallbacks.push(getAddon);
-        AddonDatabase.retrieveStoredData(function(aAddons) {
+        AddonDatabase.retrieveStoredData(function getCachedAddonByID_retrieveData(aAddons) {
           let pendingCallbacks = self._pendingCallbacks;
 
           // Check if cache was shutdown or deleted before callback was called
           if (pendingCallbacks == null)
             return;
 
           // Callbacks may want to trigger a other caching operations that may
           // affect _addons and _pendingCallbacks, so set to final values early
@@ -561,46 +561,46 @@ var AddonRepository = {
    * corresponding to the specified ids. If caching is disabled,
    * the cache is completely removed.
    *
    * @param  aIds
    *         The array of add-on ids to repopulate the cache with
    * @param  aCallback
    *         The optional callback to call once complete
    */
-  repopulateCache: function(aIds, aCallback) {
-    this._repopulateCache(aIds, aCallback, false);
+  repopulateCache: function AddonRepo_repopulateCache(aIds, aCallback) {
+    this._repopulateCacheInternal(aIds, aCallback, false);
   },
 
-  _repopulateCache: function(aIds, aCallback, aSendPerformance) {
+  _repopulateCacheInternal: function AddonRepo_repopulateCacheInternal(aIds, aCallback, aSendPerformance) {
     // Completely remove cache if caching is not enabled
     if (!this.cacheEnabled) {
       this._addons = null;
       this._pendingCallbacks = null;
       AddonDatabase.delete(aCallback);
       return;
     }
 
     let self = this;
-    getAddonsToCache(aIds, function(aAddons) {
+    getAddonsToCache(aIds, function repopulateCache_getAddonsToCache(aAddons) {
       // Completely remove cache if there are no add-ons to cache
       if (aAddons.length == 0) {
         self._addons = null;
         self._pendingCallbacks = null;
         AddonDatabase.delete(aCallback);
         return;
       }
 
       self._beginGetAddons(aAddons, {
-        searchSucceeded: function(aAddons) {
+        searchSucceeded: function repopulateCacheInternal_searchSucceeded(aAddons) {
           self._addons = {};
           aAddons.forEach(function(aAddon) { self._addons[aAddon.id] = aAddon; });
           AddonDatabase.repopulate(aAddons, aCallback);
         },
-        searchFailed: function() {
+        searchFailed: function repopulateCacheInternal_searchFailed() {
           WARN("Search failed when repopulating cache");
           if (aCallback)
             aCallback();
         }
       }, aSendPerformance);
     });
   },
 
@@ -609,38 +609,38 @@ var AddonRepository = {
    * ids. If caching is disabled, the cache is unchanged and the callback is
    * immediatly called if it is defined.
    *
    * @param  aIds
    *         The array of add-on ids to add to the cache
    * @param  aCallback
    *         The optional callback to call once complete
    */
-  cacheAddons: function(aIds, aCallback) {
+  cacheAddons: function AddonRepo_cacheAddons(aIds, aCallback) {
     if (!this.cacheEnabled) {
       if (aCallback)
         aCallback();
       return;
     }
 
     let self = this;
-    getAddonsToCache(aIds, function(aAddons) {
+    getAddonsToCache(aIds, function cacheAddons_getAddonsToCache(aAddons) {
       // If there are no add-ons to cache, act as if caching is disabled
       if (aAddons.length == 0) {
         if (aCallback)
           aCallback();
         return;
       }
 
       self.getAddonsByIDs(aAddons, {
-        searchSucceeded: function(aAddons) {
+        searchSucceeded: function cacheAddons_searchSucceeded(aAddons) {
           aAddons.forEach(function(aAddon) { self._addons[aAddon.id] = aAddon; });
           AddonDatabase.insertAddons(aAddons, aCallback);
         },
-        searchFailed: function() {
+        searchFailed: function cacheAddons_searchFailed() {
           WARN("Search failed when adding add-ons to cache");
           if (aCallback)
             aCallback();
         }
       });
     });
   },
 
@@ -660,41 +660,41 @@ var AddonRepository = {
   get isSearching() {
     return this._searching;
   },
 
   /**
    * The url that can be visited to see recommended add-ons in this repository.
    * If the corresponding preference is not defined, defaults to about:blank.
    */
-  getRecommendedURL: function() {
+  getRecommendedURL: function AddonRepo_getRecommendedURL() {
     let url = this._formatURLPref(PREF_GETADDONS_BROWSERECOMMENDED, {});
     return (url != null) ? url : "about:blank";
   },
 
   /**
    * Retrieves the url that can be visited to see search results for the given
    * terms. If the corresponding preference is not defined, defaults to
    * about:blank.
    *
    * @param  aSearchTerms
    *         Search terms used to search the repository
    */
-  getSearchURL: function(aSearchTerms) {
+  getSearchURL: function AddonRepo_getSearchURL(aSearchTerms) {
     let url = this._formatURLPref(PREF_GETADDONS_BROWSESEARCHRESULTS, {
       TERMS : encodeURIComponent(aSearchTerms)
     });
     return (url != null) ? url : "about:blank";
   },
 
   /**
    * Cancels the search in progress. If there is no search in progress this
    * does nothing.
    */
-  cancelSearch: function() {
+  cancelSearch: function AddonRepo_cancelSearch() {
     this._searching = false;
     if (this._request) {
       this._request.abort();
       this._request = null;
     }
     this._callback = null;
   },
 
@@ -702,32 +702,32 @@ var AddonRepository = {
    * Begins a search for add-ons in this repository by ID. Results will be
    * passed to the given callback.
    *
    * @param  aIDs
    *         The array of ids to search for
    * @param  aCallback
    *         The callback to pass results to
    */
-  getAddonsByIDs: function(aIDs, aCallback) {
+  getAddonsByIDs: function AddonRepo_getAddonsByIDs(aIDs, aCallback) {
     return this._beginGetAddons(aIDs, aCallback, false);
   },
 
   /**
    * Begins a search of add-ons, potentially sending performance data.
    *
    * @param  aIDs
    *         Array of ids to search for.
    * @param  aCallback
    *         Function to pass results to.
    * @param  aSendPerformance
    *         Boolean indicating whether to send performance data with the
    *         request.
    */
-  _beginGetAddons: function(aIDs, aCallback, aSendPerformance) {
+  _beginGetAddons: function AddonRepo_beginGetAddons(aIDs, aCallback, aSendPerformance) {
     let ids = aIDs.slice(0);
 
     let params = {
       API_VERSION : API_VERSION,
       IDS : ids.map(encodeURIComponent).join(',')
     };
 
     let pref = PREF_GETADDONS_BYIDS;
@@ -812,40 +812,40 @@ var AddonRepository = {
    * not be used for any other purpose. Use repopulateCache instead.
    *
    * @param  aIDs
    *         Array of add-on IDs to repopulate the cache with.
    * @param  aCallback
    *         Function to call when data is received. Function must be an object
    *         with the keys searchSucceeded and searchFailed.
    */
-  backgroundUpdateCheck: function(aIDs, aCallback) {
-    this._repopulateCache(aIDs, aCallback, true);
+  backgroundUpdateCheck: function AddonRepo_backgroundUpdateCheck(aIDs, aCallback) {
+    this._repopulateCacheInternal(aIDs, aCallback, true);
   },
 
   /**
    * Begins a search for recommended add-ons in this repository. Results will
    * be passed to the given callback.
    *
    * @param  aMaxResults
    *         The maximum number of results to return
    * @param  aCallback
    *         The callback to pass results to
    */
-  retrieveRecommendedAddons: function(aMaxResults, aCallback) {
+  retrieveRecommendedAddons: function AddonRepo_retrieveRecommendedAddons(aMaxResults, aCallback) {
     let url = this._formatURLPref(PREF_GETADDONS_GETRECOMMENDED, {
       API_VERSION : API_VERSION,
 
       // Get twice as many results to account for potential filtering
       MAX_RESULTS : 2 * aMaxResults
     });
 
     let self = this;
     function handleResults(aElements, aTotalResults) {
-      self._getLocalAddonIds(function(aLocalAddonIds) {
+      self._getLocalAddonIds(function retrieveRecommendedAddons_getLocalAddonIds(aLocalAddonIds) {
         // aTotalResults irrelevant
         self._parseAddons(aElements, -1, aLocalAddonIds);
       });
     }
 
     this._beginSearch(url, aMaxResults, aCallback, handleResults);
   },
 
@@ -855,17 +855,17 @@ var AddonRepository = {
    *
    * @param  aSearchTerms
    *         The terms to search for
    * @param  aMaxResults
    *         The maximum number of results to return
    * @param  aCallback
    *         The callback to pass results to
    */
-  searchAddons: function(aSearchTerms, aMaxResults, aCallback) {
+  searchAddons: function AddonRepo_searchAddons(aSearchTerms, aMaxResults, aCallback) {
     let compatMode = "normal";
     if (!AddonManager.checkCompatibility)
       compatMode = "ignore";
     else if (AddonManager.strictCompatibility)
       compatMode = "strict";
 
     let substitutions = {
       API_VERSION : API_VERSION,
@@ -874,76 +874,76 @@ var AddonRepository = {
       MAX_RESULTS : 2 * aMaxResults,
       COMPATIBILITY_MODE : compatMode,
     };
 
     let url = this._formatURLPref(PREF_GETADDONS_GETSEARCHRESULTS, substitutions);
 
     let self = this;
     function handleResults(aElements, aTotalResults) {
-      self._getLocalAddonIds(function(aLocalAddonIds) {
+      self._getLocalAddonIds(function searchAddons_getLocalAddonIds(aLocalAddonIds) {
         self._parseAddons(aElements, aTotalResults, aLocalAddonIds);
       });
     }
 
     this._beginSearch(url, aMaxResults, aCallback, handleResults);
   },
 
   // Posts results to the callback
-  _reportSuccess: function(aResults, aTotalResults) {
+  _reportSuccess: function AddonRepo_reportSuccess(aResults, aTotalResults) {
     this._searching = false;
     this._request = null;
     // The callback may want to trigger a new search so clear references early
     let addons = [result.addon for each(result in aResults)];
     let callback = this._callback;
     this._callback = null;
     callback.searchSucceeded(addons, addons.length, aTotalResults);
   },
 
   // Notifies the callback of a failure
-  _reportFailure: function() {
+  _reportFailure: function AddonRepo_reportFailure() {
     this._searching = false;
     this._request = null;
     // The callback may want to trigger a new search so clear references early
     let callback = this._callback;
     this._callback = null;
     callback.searchFailed();
   },
 
   // Get descendant by unique tag name. Returns null if not unique tag name.
-  _getUniqueDescendant: function(aElement, aTagName) {
+  _getUniqueDescendant: function AddonRepo_getUniqueDescendant(aElement, aTagName) {
     let elementsList = aElement.getElementsByTagName(aTagName);
     return (elementsList.length == 1) ? elementsList[0] : null;
   },
 
   // Get direct descendant by unique tag name.
   // Returns null if not unique tag name.
-  _getUniqueDirectDescendant: function(aElement, aTagName) {
+  _getUniqueDirectDescendant: function AddonRepo_getUniqueDirectDescendant(aElement, aTagName) {
     let elementsList = Array.filter(aElement.children,
-                                    function(aChild) aChild.tagName == aTagName);
+                                    function arrayFiltering(aChild) aChild.tagName == aTagName);
     return (elementsList.length == 1) ? elementsList[0] : null;
   },
 
   // Parse out trimmed text content. Returns null if text content empty.
-  _getTextContent: function(aElement) {
+  _getTextContent: function AddonRepo_getTextContent(aElement) {
     let textContent = aElement.textContent.trim();
     return (textContent.length > 0) ? textContent : null;
   },
 
   // Parse out trimmed text content of a descendant with the specified tag name
   // Returns null if the parsing unsuccessful.
-  _getDescendantTextContent: function(aElement, aTagName) {
+  _getDescendantTextContent: function AddonRepo_getDescendantTextContent(aElement, aTagName) {
     let descendant = this._getUniqueDescendant(aElement, aTagName);
     return (descendant != null) ? this._getTextContent(descendant) : null;
   },
 
   // Parse out trimmed text content of a direct descendant with the specified
   // tag name.
   // Returns null if the parsing unsuccessful.
-  _getDirectDescendantTextContent: function(aElement, aTagName) {
+  _getDirectDescendantTextContent: function AddonRepo_getDirectDescendantTextContent(aElement, aTagName) {
     let descendant = this._getUniqueDirectDescendant(aElement, aTagName);
     return (descendant != null) ? this._getTextContent(descendant) : null;
   },
 
   /*
    * Creates an AddonSearchResult by parsing an <addon> element
    *
    * @param  aElement
@@ -951,17 +951,17 @@ var AddonRepository = {
    * @param  aSkip
    *         Object containing ids and sourceURIs of add-ons to skip.
    * @param  aCompatData
    *         Array of parsed addon_compatibility elements to accosiate with the
    *         resulting AddonSearchResult. Optional.
    * @return Result object containing the parsed AddonSearchResult, xpiURL and
    *         xpiHash if the parsing was successful. Otherwise returns null.
    */
-  _parseAddon: function(aElement, aSkip, aCompatData) {
+  _parseAddon: function AddonRepo_parseAddon(aElement, aSkip, aCompatData) {
     let skipIDs = (aSkip && aSkip.ids) ? aSkip.ids : [];
     let skipSourceURIs = (aSkip && aSkip.sourceURIs) ? aSkip.sourceURIs : [];
 
     let guid = this._getDescendantTextContent(aElement, "guid");
     if (guid == null || skipIDs.indexOf(guid) != -1)
       return null;
 
     let addon = new AddonSearchResult(guid);
@@ -1109,17 +1109,17 @@ var AddonRepository = {
           break;
         case "status":
           let repositoryStatus = parseInt(node.getAttribute("id"));
           if (!isNaN(repositoryStatus))
             addon.repositoryStatus = repositoryStatus;
           break;
         case "all_compatible_os":
           let nodes = node.getElementsByTagName("os");
-          addon.isPlatformCompatible = Array.some(nodes, function(aNode) {
+          addon.isPlatformCompatible = Array.some(nodes, function parseAddon_platformCompatFilter(aNode) {
             let text = aNode.textContent.toLowerCase().trim();
             return text == "all" || text == Services.appinfo.OS.toLowerCase();
           });
           break;
         case "install":
           // No os attribute means the xpi is compatible with any os
           if (node.hasAttribute("os")) {
             let os = node.getAttribute("os").trim().toLowerCase();
@@ -1155,33 +1155,33 @@ var AddonRepository = {
           addon.icons[node.getAttribute("size")] = this._getTextContent(node);
           break;
       }
     }
 
     return result;
   },
 
-  _parseAddons: function(aElements, aTotalResults, aSkip) {
+  _parseAddons: function AddonRepo_parseAddons(aElements, aTotalResults, aSkip) {
     let self = this;
     let results = [];
 
     function isSameApplication(aAppNode) {
       return self._getTextContent(aAppNode) == Services.appinfo.ID;
     }
 
     for (let i = 0; i < aElements.length && results.length < this._maxResults; i++) {
       let element = aElements[i];
 
       let tags = this._getUniqueDescendant(element, "compatible_applications");
       if (tags == null)
         continue;
 
       let applications = tags.getElementsByTagName("appID");
-      let compatible = Array.some(applications, function(aAppNode) {
+      let compatible = Array.some(applications, function parseAddons_applicationsCompatFilter(aAppNode) {
         if (!isSameApplication(aAppNode))
           return false;
 
         let parent = aAppNode.parentNode;
         let minVersion = self._getDescendantTextContent(parent, "min_version");
         let maxVersion = self._getDescendantTextContent(parent, "max_version");
         if (minVersion == null || maxVersion == null)
           return false;
@@ -1205,17 +1205,17 @@ var AddonRepository = {
       // Don't pass in compatiblity override data, because that's only returned
       // in GUID searches, which don't use _parseAddons().
       let result = this._parseAddon(element, aSkip);
       if (result == null)
         continue;
 
       // Ignore add-on missing a required attribute
       let requiredAttributes = ["id", "name", "version", "type", "creator"];
-      if (requiredAttributes.some(function(aAttribute) !result.addon[aAttribute]))
+      if (requiredAttributes.some(function parseAddons_attributeFilter(aAttribute) !result.addon[aAttribute]))
         continue;
 
       // Add only if the add-on is compatible with the platform
       if (!result.addon.isPlatformCompatible)
         continue;
 
       // Add only if there was an xpi compatible with this OS or there was a
       // way to purchase the add-on
@@ -1235,17 +1235,17 @@ var AddonRepository = {
       this._reportSuccess(results, aTotalResults);
       return;
     }
 
     // Create an AddonInstall for each result
     let self = this;
     results.forEach(function(aResult) {
       let addon = aResult.addon;
-      let callback = function(aInstall) {
+      let callback = function addonInstallCallback(aInstall) {
         addon.install = aInstall;
         pendingResults--;
         if (pendingResults == 0)
           self._reportSuccess(results, aTotalResults);
       }
 
       if (aResult.xpiURL) {
         AddonManager.getInstallForURL(aResult.xpiURL, callback,
@@ -1254,17 +1254,17 @@ var AddonRepository = {
       }
       else {
         callback(null);
       }
     });
   },
 
   // Parses addon_compatibility nodes, that describe compatibility overrides.
-  _parseAddonCompatElement: function(aResultObj, aElement) {
+  _parseAddonCompatElement: function AddonRepo_parseAddonCompatElement(aResultObj, aElement) {
     let guid = this._getDescendantTextContent(aElement, "guid");
     if (!guid) {
         LOG("Compatibility override is missing guid.");
       return;
     }
 
     let compat = {id: guid};
     compat.hosted = aElement.getAttribute("hosted") != "false";
@@ -1327,32 +1327,32 @@ var AddonRepository = {
       override.appMinVersion = appRange.appMinVersion;
       override.appMaxVersion = appRange.appMaxVersion;
 
       return override;
     }
 
     let rangeNodes = aElement.querySelectorAll("version_ranges > version_range");
     compat.compatRanges = Array.map(rangeNodes, parseRangeNode.bind(this))
-                               .filter(function(aItem) !!aItem);
+                               .filter(function compatRangesFilter(aItem) !!aItem);
     if (compat.compatRanges.length == 0)
       return;
 
     aResultObj[compat.id] = compat;
   },
 
   // Parses addon_compatibility elements.
-  _parseAddonCompatData: function(aElements) {
+  _parseAddonCompatData: function AddonRepo_parseAddonCompatData(aElements) {
     let compatData = {};
     Array.forEach(aElements, this._parseAddonCompatElement.bind(this, compatData));
     return compatData;
   },
 
   // Begins a new search if one isn't currently executing
-  _beginSearch: function(aURI, aMaxResults, aCallback, aHandleResults) {
+  _beginSearch: function AddonRepo_beginSearch(aURI, aMaxResults, aCallback, aHandleResults) {
     if (this._searching || aURI == null || aMaxResults <= 0) {
       aCallback.searchFailed();
       return;
     }
 
     this._searching = true;
     this._callback = aCallback;
     this._maxResults = aMaxResults;
@@ -1361,20 +1361,20 @@ var AddonRepository = {
 
     this._request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].
                     createInstance(Ci.nsIXMLHttpRequest);
     this._request.mozBackgroundRequest = true;
     this._request.open("GET", aURI, true);
     this._request.overrideMimeType("text/xml");
 
     let self = this;
-    this._request.addEventListener("error", function(aEvent) {
+    this._request.addEventListener("error", function beginSearch_errorListener(aEvent) {
       self._reportFailure();
     }, false);
-    this._request.addEventListener("load", function(aEvent) {
+    this._request.addEventListener("load", function beginSearch_loadListener(aEvent) {
       let request = aEvent.target;
       let responseXML = request.responseXML;
 
       if (!responseXML || responseXML.documentElement.namespaceURI == XMLURI_PARSE_ERROR ||
           (request.status != 200 && request.status != 0)) {
         self._reportFailure();
         return;
       }
@@ -1392,58 +1392,58 @@ var AddonRepository = {
 
       aHandleResults(elements, totalResults, compatData);
     }, false);
     this._request.send(null);
   },
 
   // Gets the id's of local add-ons, and the sourceURI's of local installs,
   // passing the results to aCallback
-  _getLocalAddonIds: function(aCallback) {
+  _getLocalAddonIds: function AddonRepo_getLocalAddonIds(aCallback) {
     let self = this;
     let localAddonIds = {ids: null, sourceURIs: null};
 
-    AddonManager.getAllAddons(function(aAddons) {
+    AddonManager.getAllAddons(function getLocalAddonIds_getAllAddons(aAddons) {
       localAddonIds.ids = [a.id for each (a in aAddons)];
       if (localAddonIds.sourceURIs)
         aCallback(localAddonIds);
     });
 
-    AddonManager.getAllInstalls(function(aInstalls) {
+    AddonManager.getAllInstalls(function getLocalAddonIds_getAllInstalls(aInstalls) {
       localAddonIds.sourceURIs = [];
       aInstalls.forEach(function(aInstall) {
         if (aInstall.state != AddonManager.STATE_AVAILABLE)
           localAddonIds.sourceURIs.push(aInstall.sourceURI.spec);
       });
 
       if (localAddonIds.ids)
         aCallback(localAddonIds);
     });
   },
 
   // Create url from preference, returning null if preference does not exist
-  _formatURLPref: function(aPreference, aSubstitutions) {
+  _formatURLPref: function AddonRepo_formatURLPref(aPreference, aSubstitutions) {
     let url = null;
     try {
       url = Services.prefs.getCharPref(aPreference);
     } catch(e) {
       WARN("_formatURLPref: Couldn't get pref: " + aPreference);
       return null;
     }
 
-    url = url.replace(/%([A-Z_]+)%/g, function(aMatch, aKey) {
+    url = url.replace(/%([A-Z_]+)%/g, function urlSubstitution(aMatch, aKey) {
       return (aKey in aSubstitutions) ? aSubstitutions[aKey] : aMatch;
     });
 
     return Services.urlFormatter.formatURL(url);
   },
 
   // Find a AddonCompatibilityOverride that matches a given aAddonVersion and
   // application/platform version.
-  findMatchingCompatOverride: function AR_findMatchingCompatOverride(aAddonVersion,
+  findMatchingCompatOverride: function AddonRepo_findMatchingCompatOverride(aAddonVersion,
                                                                      aCompatOverrides,
                                                                      aAppVersion,
                                                                      aPlatformVersion) {
     for (let override of aCompatOverrides) {
 
       let appVersion = null;
       if (override.appID == TOOLKIT_ID)
         appVersion = aPlatformVersion || Services.appinfo.platformVersion;
@@ -1565,17 +1565,17 @@ var AddonDatabase = {
    */
   openConnection: function AD_openConnection(aSecondAttempt) {
     this.initialized = true;
     delete this.connection;
 
     let dbfile = FileUtils.getFile(KEY_PROFILEDIR, [FILE_DATABASE], true);
     let dbMissing = !dbfile.exists();
 
-    var tryAgain = (function() {
+    var tryAgain = (function openConnection_tryAgain() {
       LOG("Deleting database, and attempting openConnection again");
       this.initialized = false;
       if (this.connection.connectionReady)
         this.connection.close();
       if (dbfile.exists())
         dbfile.remove(false);
       return this.openConnection(true);
     }).bind(this);
@@ -1679,32 +1679,32 @@ var AddonDatabase = {
       this.connection.rollbackTransaction();
     }
 
     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 shutdown_connectionGetter() {
       return this.openConnection();
     });
 
     connection.asyncClose(aCallback);
   },
 
   /**
    * Asynchronously deletes the database, shutting down the connection
    * first if initialized
    *
    * @param  aCallback
    *         An optional callback to call once complete
    */
   delete: function AD_delete(aCallback) {
-    this.shutdown(function() {
+    this.shutdown(function delete_shutdown() {
       let dbfile = FileUtils.getFile(KEY_PROFILEDIR, [FILE_DATABASE], true);
       if (dbfile.exists())
         dbfile.remove(false);
 
       if (aCallback)
         aCallback();
     });
   },
@@ -1740,42 +1740,42 @@ var AddonDatabase = {
    */
   retrieveStoredData: function AD_retrieveStoredData(aCallback) {
     let self = this;
     let addons = {};
 
     // Retrieve all data from the addon table
     function getAllAddons() {
       self.getAsyncStatement("getAllAddons").executeAsync({
-        handleResult: function(aResults) {
+        handleResult: function getAllAddons_handleResult(aResults) {
           let row = null;
           while (row = aResults.getNextRow()) {
             let internal_id = row.getResultByName("internal_id");
             addons[internal_id] = self._makeAddonFromAsyncRow(row);
           }
         },
 
         handleError: self.asyncErrorLogger,
 
-        handleCompletion: function(aReason) {
+        handleCompletion: function getAllAddons_handleCompletion(aReason) {
           if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {
             ERROR("Error retrieving add-ons from database. Returning empty results");
             aCallback({});
             return;
           }
 
           getAllDevelopers();
         }
       });
     }
 
     // Retrieve all data from the developer table
     function getAllDevelopers() {
       self.getAsyncStatement("getAllDevelopers").executeAsync({
-        handleResult: function(aResults) {
+        handleResult: function getAllDevelopers_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 a developer not linked to an add-on in database");
               continue;
             }
 
@@ -1784,32 +1784,32 @@ var AddonDatabase = {
               addon.developers = [];
 
             addon.developers.push(self._makeDeveloperFromAsyncRow(row));
           }
         },
 
         handleError: self.asyncErrorLogger,
 
-        handleCompletion: function(aReason) {
+        handleCompletion: function getAllDevelopers_handleCompletion(aReason) {
           if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {
             ERROR("Error retrieving developers from database. Returning empty results");
             aCallback({});
             return;
           }
 
           getAllScreenshots();
         }
       });
     }
 
     // Retrieve all data from the screenshot table
     function getAllScreenshots() {
       self.getAsyncStatement("getAllScreenshots").executeAsync({
-        handleResult: function(aResults) {
+        handleResult: function getAllScreenshots_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 a screenshot not linked to an add-on in database");
               continue;
             }
 
@@ -1817,31 +1817,31 @@ var AddonDatabase = {
             if (!addon.screenshots)
               addon.screenshots = [];
             addon.screenshots.push(self._makeScreenshotFromAsyncRow(row));
           }
         },
 
         handleError: self.asyncErrorLogger,
 
-        handleCompletion: function(aReason) {
+        handleCompletion: function getAllScreenshots_handleCompletion(aReason) {
           if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {
             ERROR("Error retrieving screenshots from database. Returning empty results");
             aCallback({});
             return;
           }
 
           getAllCompatOverrides();
         }
       });
     }
 
     function getAllCompatOverrides() {
       self.getAsyncStatement("getAllCompatOverrides").executeAsync({
-        handleResult: function(aResults) {
+        handleResult: function getAllCompatOverrides_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 a compatibility override not linked to an add-on in database");
               continue;
             }
 
@@ -1849,17 +1849,17 @@ var AddonDatabase = {
             if (!addon.compatibilityOverrides)
               addon.compatibilityOverrides = [];
             addon.compatibilityOverrides.push(self._makeCompatOverrideFromAsyncRow(row));
           }
         },
 
         handleError: self.asyncErrorLogger,
 
-        handleCompletion: function(aReason) {
+        handleCompletion: function getAllCompatOverrides_handleCompletion(aReason) {
           if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {
             ERROR("Error retrieving compatibility overrides from database. Returning empty results");
             aCallback({});
             return;
           }
 
           getAllIcons();
         }
@@ -1917,20 +1917,20 @@ var AddonDatabase = {
    */
   repopulate: function AD_repopulate(aAddons, aCallback) {
     let self = this;
 
     // Completely empty the database
     let stmts = [this.getAsyncStatement("emptyAddon")];
 
     this.connection.executeAsync(stmts, stmts.length, {
-      handleResult: function() {},
+      handleResult: function emptyAddon_handleResult() {},
       handleError: self.asyncErrorLogger,
 
-      handleCompletion: function(aReason) {
+      handleCompletion: function emptyAddon_handleCompletion(aReason) {
         if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED)
           ERROR("Error emptying database. Attempting to continue repopulating database");
 
         // Insert the specified add-ons
         self.insertAddons(aAddons, aCallback);
       }
     });
   },
@@ -2023,38 +2023,38 @@ var AddonDatabase = {
       // Immediately call callback if nothing to insert
       if (stmts.length == 0) {
         self.connection.commitTransaction();
         aCallback();
         return;
       }
 
       self.connection.executeAsync(stmts, stmts.length, {
-        handleResult: function() {},
+        handleResult: function insertAdditionalData_handleResult() {},
         handleError: self.asyncErrorLogger,
-        handleCompletion: function(aReason) {
+        handleCompletion: function insertAdditionalData_handleCompletion(aReason) {
           if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {
             ERROR("Error inserting additional addon metadata into database. Attempting to continue");
             self.connection.rollbackTransaction();
           }
           else {
             self.connection.commitTransaction();
           }
 
           aCallback();
         }
       });
     }
 
     // Insert add-on into database
     this._makeAddonStatement(aAddon).executeAsync({
-      handleResult: function() {},
+      handleResult: function makeAddonStatement_handleResult() {},
       handleError: self.asyncErrorLogger,
 
-      handleCompletion: function(aReason) {
+      handleCompletion: function makeAddonStatement_handleCompletion(aReason) {
         if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {
           ERROR("Error inserting add-ons into database. Attempting to continue.");
           self.connection.rollbackTransaction();
           aCallback();
           return;
         }
 
         internal_id = self.connection.lastInsertRowID;
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -41,38 +41,38 @@ const XMLURI_PARSE_ERROR = "http://www.m
 
 const VIEW_DEFAULT = "addons://discover/";
 
 var gStrings = {};
 XPCOMUtils.defineLazyServiceGetter(gStrings, "bundleSvc",
                                    "@mozilla.org/intl/stringbundle;1",
                                    "nsIStringBundleService");
 
-XPCOMUtils.defineLazyGetter(gStrings, "brand", function() {
+XPCOMUtils.defineLazyGetter(gStrings, "brand", function brandLazyGetter() {
   return this.bundleSvc.createBundle("chrome://branding/locale/brand.properties");
 });
-XPCOMUtils.defineLazyGetter(gStrings, "ext", function() {
+XPCOMUtils.defineLazyGetter(gStrings, "ext", function extLazyGetter() {
   return this.bundleSvc.createBundle("chrome://mozapps/locale/extensions/extensions.properties");
 });
-XPCOMUtils.defineLazyGetter(gStrings, "dl", function() {
+XPCOMUtils.defineLazyGetter(gStrings, "dl", function dlLazyGetter() {
   return this.bundleSvc.createBundle("chrome://mozapps/locale/downloads/downloads.properties");
 });
 
-XPCOMUtils.defineLazyGetter(gStrings, "brandShortName", function() {
+XPCOMUtils.defineLazyGetter(gStrings, "brandShortName", function brandShortNameLazyGetter() {
   return this.brand.GetStringFromName("brandShortName");
 });
-XPCOMUtils.defineLazyGetter(gStrings, "appVersion", function() {
+XPCOMUtils.defineLazyGetter(gStrings, "appVersion", function appVersionLazyGetter() {
   return Services.appinfo.version;
 });
 
 document.addEventListener("load", initialize, true);
 window.addEventListener("unload", shutdown, false);
 
 var gPendingInitializations = 1;
-__defineGetter__("gIsInitializing", function() gPendingInitializations > 0);
+__defineGetter__("gIsInitializing", function gIsInitializingGetter() gPendingInitializations > 0);
 
 function initialize(event) {
   // XXXbz this listener gets _all_ load events for all nodes in the
   // document... but relies on not being called "too early".
   if (event.target instanceof XMLStylesheetProcessingInstruction) {
     return;
   }
   document.removeEventListener("load", initialize, true);
@@ -160,37 +160,37 @@ var HTML5History = {
   },
 
   get canGoForward() {
     return window.QueryInterface(Ci.nsIInterfaceRequestor)
                  .getInterface(Ci.nsIWebNavigation)
                  .canGoForward;
   },
 
-  back: function() {
+  back: function HTML5History_back() {
     window.history.back();
     gViewController.updateCommand("cmd_back");
     gViewController.updateCommand("cmd_forward");
   },
 
-  forward: function() {
+  forward: function HTML5History_forward() {
     window.history.forward();
     gViewController.updateCommand("cmd_back");
     gViewController.updateCommand("cmd_forward");
   },
 
-  pushState: function(aState) {
+  pushState: function HTML5History_pushState(aState) {
     window.history.pushState(aState, document.title);
   },
 
-  replaceState: function(aState) {
+  replaceState: function HTML5History_replaceState(aState) {
     window.history.replaceState(aState, document.title);
   },
 
-  popState: function() {
+  popState: function HTML5History_popState() {
     function onStatePopped(aEvent) {
       window.removeEventListener("popstate", onStatePopped, true);
       // TODO To ensure we can't go forward again we put an additional entry
       // for the current state into the history. Ideally we would just strip
       // the history but there doesn't seem to be a way to do that. Bug 590661
       window.history.pushState(aEvent.state, document.title);
     }
     window.addEventListener("popstate", onStatePopped, true);
@@ -214,47 +214,47 @@ var FakeHistory = {
   get canGoBack() {
     return this.pos > 0;
   },
 
   get canGoForward() {
     return (this.pos + 1) < this.states.length;
   },
 
-  back: function() {
+  back: function FakeHistory_back() {
     if (this.pos == 0)
       throw new Error("Cannot go back from this point");
 
     this.pos--;
     gViewController.updateState(this.states[this.pos]);
     gViewController.updateCommand("cmd_back");
     gViewController.updateCommand("cmd_forward");
   },
 
-  forward: function() {
+  forward: function FakeHistory_forward() {
     if ((this.pos + 1) >= this.states.length)
       throw new Error("Cannot go forward from this point");
 
     this.pos++;
     gViewController.updateState(this.states[this.pos]);
     gViewController.updateCommand("cmd_back");
     gViewController.updateCommand("cmd_forward");
   },
 
-  pushState: function(aState) {
+  pushState: function FakeHistory_pushState(aState) {
     this.pos++;
     this.states.splice(this.pos, this.states.length);
     this.states.push(aState);
   },
 
-  replaceState: function(aState) {
+  replaceState: function FakeHistory_replaceState(aState) {
     this.states[this.pos] = aState;
   },
 
-  popState: function() {
+  popState: function FakeHistory_popState() {
     if (this.pos == 0)
       throw new Error("Cannot popState from this view");
 
     this.states.splice(this.pos, this.states.length);
     this.pos--;
 
     gViewController.updateState(this.states[this.pos]);
     gViewController.updateCommand("cmd_back");
@@ -272,45 +272,45 @@ if (window.QueryInterface(Ci.nsIInterfac
 else {
   gHistory = FakeHistory;
 }
 
 var gEventManager = {
   _listeners: {},
   _installListeners: [],
 
-  initialize: function() {
+  initialize: function gEM_initialize() {
     var self = this;
     ["onEnabling", "onEnabled", "onDisabling", "onDisabled", "onUninstalling",
      "onUninstalled", "onInstalled", "onOperationCancelled",
      "onUpdateAvailable", "onUpdateFinished", "onCompatibilityUpdateAvailable",
      "onPropertyChanged"].forEach(function(aEvent) {
-      self[aEvent] = function(...aArgs) {
+      self[aEvent] = function initialize_delegateAddonEvent(...aArgs) {
         self.delegateAddonEvent(aEvent, aArgs);
       };
     });
 
     ["onNewInstall", "onDownloadStarted", "onDownloadEnded", "onDownloadFailed",
      "onDownloadProgress", "onDownloadCancelled", "onInstallStarted",
      "onInstallEnded", "onInstallFailed", "onInstallCancelled",
      "onExternalInstall"].forEach(function(aEvent) {
-      self[aEvent] = function(...aArgs) {
+      self[aEvent] = function initialize_delegateInstallEvent(...aArgs) {
         self.delegateInstallEvent(aEvent, aArgs);
       };
     });
 
     AddonManager.addManagerListener(this);
     AddonManager.addInstallListener(this);
     AddonManager.addAddonListener(this);
 
     this.refreshGlobalWarning();
     this.refreshAutoUpdateDefault();
 
     var contextMenu = document.getElementById("addonitem-popup");
-    contextMenu.addEventListener("popupshowing", function() {
+    contextMenu.addEventListener("popupshowing", function contextMenu_onPopupshowing() {
       var addon = gViewController.currentViewObj.getSelectedAddon();
       contextMenu.setAttribute("addontype", addon.type);
       
       var menuSep = document.getElementById("addonitem-menuseparator");
       var countEnabledMenuCmds = 0;
       for (let child of contextMenu.children) {
         if (child.nodeName == "menuitem" &&
           gViewController.isCommandEnabled(child.command)) {
@@ -319,53 +319,53 @@ var gEventManager = {
       }
       
       // with only one menu item, we hide the menu separator
       menuSep.hidden = (countEnabledMenuCmds <= 1);
       
     }, false);
   },
 
-  shutdown: function() {
+  shutdown: function gEM_shutdown() {
     AddonManager.removeManagerListener(this);
     AddonManager.removeInstallListener(this);
     AddonManager.removeAddonListener(this);
   },
 
-  registerAddonListener: function(aListener, aAddonId) {
+  registerAddonListener: function gEM_registerAddonListener(aListener, aAddonId) {
     if (!(aAddonId in this._listeners))
       this._listeners[aAddonId] = [];
     else if (this._listeners[aAddonId].indexOf(aListener) != -1)
       return;
     this._listeners[aAddonId].push(aListener);
   },
 
-  unregisterAddonListener: function(aListener, aAddonId) {
+  unregisterAddonListener: function gEM_unregisterAddonListener(aListener, aAddonId) {
     if (!(aAddonId in this._listeners))
       return;
     var index = this._listeners[aAddonId].indexOf(aListener);
     if (index == -1)
       return;
     this._listeners[aAddonId].splice(index, 1);
   },
 
-  registerInstallListener: function(aListener) {
+  registerInstallListener: function gEM_registerInstallListener(aListener) {
     if (this._installListeners.indexOf(aListener) != -1)
       return;
     this._installListeners.push(aListener);
   },
 
-  unregisterInstallListener: function(aListener) {
+  unregisterInstallListener: function gEM_unregisterInstallListener(aListener) {
     var i = this._installListeners.indexOf(aListener);
     if (i == -1)
       return;
     this._installListeners.splice(i, 1);
   },
 
-  delegateAddonEvent: function(aEvent, aParams) {
+  delegateAddonEvent: function gEM_delegateAddonEvent(aEvent, aParams) {
     var addon = aParams.shift();
     if (!(addon.id in this._listeners))
       return;
 
     var listeners = this._listeners[addon.id];
     for (let listener of listeners) {
       if (!(aEvent in listener))
         continue;
@@ -373,17 +373,17 @@ var gEventManager = {
         listener[aEvent].apply(listener, aParams);
       } catch(e) {
         // this shouldn't be fatal
         Cu.reportError(e);
       }
     }
   },
 
-  delegateInstallEvent: function(aEvent, aParams) {
+  delegateInstallEvent: function gEM_delegateInstallEvent(aEvent, aParams) {
     var existingAddon = aEvent == "onExternalInstall" ? aParams[1] : aParams[0].existingAddon;
     // If the install is an update then send the event to all listeners
     // registered for the existing add-on
     if (existingAddon)
       this.delegateAddonEvent(aEvent, [existingAddon].concat(aParams));
 
     for (let listener of this._installListeners) {
       if (!(aEvent in listener))
@@ -392,17 +392,17 @@ var gEventManager = {
         listener[aEvent].apply(listener, aParams);
       } catch(e) {
         // this shouldn't be fatal
         Cu.reportError(e);
       }
     }
   },
   
-  refreshGlobalWarning: function() {
+  refreshGlobalWarning: function gEM_refreshGlobalWarning() {
     var page = document.getElementById("addons-page");
 
     if (Services.appinfo.inSafeMode) {
       page.setAttribute("warning", "safemode");
       return;
     } 
 
     if (AddonManager.checkUpdateSecurityDefault &&
@@ -414,75 +414,75 @@ var gEventManager = {
     if (!AddonManager.checkCompatibility) {
       page.setAttribute("warning", "checkcompatibility");
       return;
     }
 
     page.removeAttribute("warning");
   },
 
-  refreshAutoUpdateDefault: function() {
+  refreshAutoUpdateDefault: function gEM_refreshAutoUpdateDefault() {
     var updateEnabled = AddonManager.updateEnabled;
     var autoUpdateDefault = AddonManager.autoUpdateDefault;
 
     // The checkbox needs to reflect that both prefs need to be true
     // for updates to be checked for and applied automatically
     document.getElementById("utils-autoUpdateDefault")
             .setAttribute("checked", updateEnabled && autoUpdateDefault);
 
     document.getElementById("utils-resetAddonUpdatesToAutomatic").hidden = !autoUpdateDefault;
     document.getElementById("utils-resetAddonUpdatesToManual").hidden = autoUpdateDefault;
   },
 
-  onCompatibilityModeChanged: function() {
+  onCompatibilityModeChanged: function gEM_onCompatibilityModeChanged() {
     this.refreshGlobalWarning();
   },
 
-  onCheckUpdateSecurityChanged: function() {
+  onCheckUpdateSecurityChanged: function gEM_onCheckUpdateSecurityChanged() {
     this.refreshGlobalWarning();
   },
 
-  onUpdateModeChanged: function() {
+  onUpdateModeChanged: function gEM_onUpdateModeChanged() {
     this.refreshAutoUpdateDefault();
   }
 };
 
 
 var gViewController = {
   viewPort: null,
   currentViewId: "",
   currentViewObj: null,
   currentViewRequest: 0,
   viewObjects: {},
   viewChangeCallback: null,
   initialViewSelected: false,
   lastHistoryIndex: -1,
 
-  initialize: function() {
+  initialize: function gVC_initialize() {
     this.viewPort = document.getElementById("view-port");
 
     this.viewObjects["search"] = gSearchView;
     this.viewObjects["discover"] = gDiscoverView;
     this.viewObjects["list"] = gListView;
     this.viewObjects["detail"] = gDetailView;
     this.viewObjects["updates"] = gUpdatesView;
 
     for each (let view in this.viewObjects)
       view.initialize();
 
     window.controllers.appendController(this);
 
     window.addEventListener("popstate",
-                            function (e) {
+                            function window_onStatePopped(e) {
                               gViewController.updateState(e.state);
                             },
                             false);
   },
 
-  shutdown: function() {
+  shutdown: function gVC_shutdown() {
     if (this.currentViewObj)
       this.currentViewObj.hide();
     this.currentViewRequest = 0;
 
     for each(let view in this.viewObjects) {
       if ("shutdown" in view) {
         try {
           view.shutdown();
@@ -491,17 +491,17 @@ var gViewController = {
           Cu.reportError(e);
         }
       }
     }
 
     window.controllers.removeController(this);
   },
 
-  updateState: function(state) {
+  updateState: function gVC_updateState(state) {
     try {
       this.loadViewInternal(state.view, state.previousView, state);
       this.lastHistoryIndex = gHistory.index;
     }
     catch (e) {
       // The attempt to load the view failed, try moving further along history
       if (this.lastHistoryIndex > gHistory.index) {
         if (gHistory.canGoBack)
@@ -512,27 +512,27 @@ var gViewController = {
         if (gHistory.canGoForward)
           gHistory.forward();
         else
           gViewController.replaceView(VIEW_DEFAULT);
       }
     }
   },
 
-  parseViewId: function(aViewId) {
+  parseViewId: function gVC_parseViewId(aViewId) {
     var matchRegex = /^addons:\/\/([^\/]+)\/(.*)$/;
     var [,viewType, viewParam] = aViewId.match(matchRegex) || [];
     return {type: viewType, param: decodeURIComponent(viewParam)};
   },
 
   get isLoading() {
     return !this.currentViewObj || this.currentViewObj.node.hasAttribute("loading");
   },
 
-  loadView: function(aViewId) {
+  loadView: function gVC_loadView(aViewId) {
     var isRefresh = false;
     if (aViewId == this.currentViewId) {
       if (this.isLoading)
         return;
       if (!("refresh" in this.currentViewObj))
         return;
       if (!this.currentViewObj.canRefresh())
         return;
@@ -547,41 +547,41 @@ var gViewController = {
       gHistory.pushState(state);
       this.lastHistoryIndex = gHistory.index;
     }
     this.loadViewInternal(aViewId, this.currentViewId, state);
   },
 
   // Replaces the existing view with a new one, rewriting the current history
   // entry to match.
-  replaceView: function(aViewId) {
+  replaceView: function gVC_replaceView(aViewId) {
     if (aViewId == this.currentViewId)
       return;
 
     var state = {
       view: aViewId,
       previousView: null
     };
     gHistory.replaceState(state);
     this.loadViewInternal(aViewId, null, state);
   },
 
-  loadInitialView: function(aViewId) {
+  loadInitialView: function gVC_loadInitialView(aViewId) {
     var state = {
       view: aViewId,
       previousView: null
     };
     gHistory.replaceState(state);
 
     this.loadViewInternal(aViewId, null, state);
     this.initialViewSelected = true;
     notifyInitialized();
   },
 
-  loadViewInternal: function(aViewId, aPreviousView, aState) {
+  loadViewInternal: function gVC_loadViewInternal(aViewId, aPreviousView, aState) {
     var view = this.parseViewId(aViewId);
 
     if (!view.type || !(view.type in this.viewObjects))
       throw new Error("Invalid view: " + view.type);
 
     var viewObj = this.viewObjects[view.type];
     if (!viewObj.node)
       throw new Error("Root node doesn't exist for '" + view.type + "' view");
@@ -609,157 +609,157 @@ var gViewController = {
 
     if (aViewId == aPreviousView)
       this.currentViewObj.refresh(view.param, ++this.currentViewRequest, aState);
     else
       this.currentViewObj.show(view.param, ++this.currentViewRequest, aState);
   },
 
   // Moves back in the document history and removes the current history entry
-  popState: function(aCallback) {
+  popState: function gVC_popState(aCallback) {
     this.viewChangeCallback = aCallback;
     gHistory.popState();
   },
 
-  notifyViewChanged: function() {
+  notifyViewChanged: function gVC_notifyViewChanged() {
     this.viewPort.selectedPanel.removeAttribute("loading");
 
     if (this.viewChangeCallback) {
       this.viewChangeCallback();
       this.viewChangeCallback = null;
     }
 
     var event = document.createEvent("Events");
     event.initEvent("ViewChanged", true, true);
     this.currentViewObj.node.dispatchEvent(event);
   },
 
   commands: {
     cmd_back: {
-      isEnabled: function() {
+      isEnabled: function cmd_back_isEnabled() {
         return gHistory.canGoBack;
       },
-      doCommand: function() {
+      doCommand: function cmd_back_doCommand() {
         gHistory.back();
       }
     },
 
     cmd_forward: {
-      isEnabled: function() {
+      isEnabled: function cmd_forward_isEnabled() {
         return gHistory.canGoForward;
       },
-      doCommand: function() {
+      doCommand: function cmd_forward_doCommand() {
         gHistory.forward();
       }
     },
 
     cmd_restartApp: {
-      isEnabled: function() true,
-      doCommand: function() {
+      isEnabled: function cmd_restartApp_isEnabled() true,
+      doCommand: function cmd_restartApp_doCommand() {
         let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].
                          createInstance(Ci.nsISupportsPRBool);
         Services.obs.notifyObservers(cancelQuit, "quit-application-requested",
                                      "restart");
         if (cancelQuit.data)
           return; // somebody canceled our quit request
 
         let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].
                          getService(Ci.nsIAppStartup);
         appStartup.quit(Ci.nsIAppStartup.eAttemptQuit |  Ci.nsIAppStartup.eRestart);
       }
     },
 
     cmd_enableCheckCompatibility: {
-      isEnabled: function() true,
-      doCommand: function() {
+      isEnabled: function cmd_enableCheckCompatibility_isEnabled() true,
+      doCommand: function cmd_enableCheckCompatibility_doCommand() {
         AddonManager.checkCompatibility = true;
       }
     },
 
     cmd_enableUpdateSecurity: {
-      isEnabled: function() true,
-      doCommand: function() {
+      isEnabled: function cmd_enableUpdateSecurity_isEnabled() true,
+      doCommand: function cmd_enableUpdateSecurity_doCommand() {
         AddonManager.checkUpdateSecurity = true;
       }
     },
 
     cmd_pluginCheck: {
-      isEnabled: function() true,
-      doCommand: function() {
+      isEnabled: function cmd_pluginCheck_isEnabled() true,
+      doCommand: function cmd_pluginCheck_doCommand() {
         openURL(Services.urlFormatter.formatURLPref("plugins.update.url"));
       }
     },
 
     cmd_toggleAutoUpdateDefault: {
-      isEnabled: function() true,
-      doCommand: function() {
+      isEnabled: function cmd_toggleAutoUpdateDefault_isEnabled() true,
+      doCommand: function cmd_toggleAutoUpdateDefault_doCommand() {
         if (!AddonManager.updateEnabled || !AddonManager.autoUpdateDefault) {
           // One or both of the prefs is false, i.e. the checkbox is not checked.
           // Now toggle both to true. If the user wants us to auto-update
           // add-ons, we also need to auto-check for updates.
           AddonManager.updateEnabled = true;
           AddonManager.autoUpdateDefault = true;
         } else {
           // Both prefs are true, i.e. the checkbox is checked.
           // Toggle the auto pref to false, but don't touch the enabled check.
           AddonManager.autoUpdateDefault = false;
         }
       }
     },
 
     cmd_resetAddonAutoUpdate: {
-      isEnabled: function() true,
-      doCommand: function() {
-        AddonManager.getAllAddons(function(aAddonList) {
+      isEnabled: function cmd_resetAddonAutoUpdate_isEnabled() true,
+      doCommand: function cmd_resetAddonAutoUpdate_doCommand() {
+        AddonManager.getAllAddons(function cmd_resetAddonAutoUpdate_getAllAddons(aAddonList) {
           aAddonList.forEach(function(aAddon) {
             if ("applyBackgroundUpdates" in aAddon)
               aAddon.applyBackgroundUpdates = AddonManager.AUTOUPDATE_DEFAULT;
           });
         });
       }
     },
 
     cmd_goToDiscoverPane: {
-      isEnabled: function() {
+      isEnabled: function cmd_goToDiscoverPane_isEnabled() {
         return gDiscoverView.enabled;
       },
-      doCommand: function() {
+      doCommand: function cmd_goToDiscoverPane_doCommand() {
         gViewController.loadView("addons://discover/");
       }
     },
 
     cmd_goToRecentUpdates: {
-      isEnabled: function() true,
-      doCommand: function() {
+      isEnabled: function cmd_goToRecentUpdates_isEnabled() true,
+      doCommand: function cmd_goToRecentUpdates_doCommand() {
         gViewController.loadView("addons://updates/recent");
       }
     },
 
     cmd_goToAvailableUpdates: {
-      isEnabled: function() true,
-      doCommand: function() {
+      isEnabled: function cmd_goToAvailableUpdates_isEnabled() true,
+      doCommand: function cmd_goToAvailableUpdates_doCommand() {
         gViewController.loadView("addons://updates/available");
       }
     },
 
     cmd_showItemDetails: {
-      isEnabled: function(aAddon) {
+      isEnabled: function cmd_showItemDetails_isEnabled(aAddon) {
         return !!aAddon && (gViewController.currentViewObj != gDetailView);
       },
-      doCommand: function(aAddon, aScrollToPreferences) {
+      doCommand: function cmd_showItemDetails_doCommand(aAddon, aScrollToPreferences) {
         gViewController.loadView("addons://detail/" +
                                  encodeURIComponent(aAddon.id) +
                                  (aScrollToPreferences ? "/preferences" : ""));
       }
     },
 
     cmd_findAllUpdates: {
       inProgress: false,
-      isEnabled: function() !this.inProgress,
-      doCommand: function() {
+      isEnabled: function cmd_findAllUpdates_isEnabled() !this.inProgress,
+      doCommand: function cmd_findAllUpdates_doCommand() {
         this.inProgress = true;
         gViewController.updateCommand("cmd_findAllUpdates");
         document.getElementById("updates-noneFound").hidden = true;
         document.getElementById("updates-progress").hidden = false;
         document.getElementById("updates-manualUpdatesFound-btn").hidden = true;
 
         var pendingChecks = 0;
         var numUpdated = 0;
@@ -790,106 +790,106 @@ var gViewController = {
             document.getElementById("updates-downloaded").hidden = false;
             document.getElementById("updates-restart-btn").hidden = false;
           } else {
             document.getElementById("updates-installed").hidden = false;
           }
         }
 
         var updateInstallListener = {
-          onDownloadFailed: function() {
+          onDownloadFailed: function cmd_findAllUpdates_downloadFailed() {
             pendingChecks--;
             updateStatus();
           },
-          onInstallFailed: function() {
+          onInstallFailed: function cmd_findAllUpdates_installFailed() {
             pendingChecks--;
             updateStatus();
           },
-          onInstallEnded: function(aInstall, aAddon) {
+          onInstallEnded: function cmd_findAllUpdates_installEnded(aInstall, aAddon) {
             pendingChecks--;
             numUpdated++;
             if (isPending(aInstall.existingAddon, "upgrade"))
               restartNeeded = true;
             updateStatus();
           }
         };
 
         var updateCheckListener = {
-          onUpdateAvailable: function(aAddon, aInstall) {
+          onUpdateAvailable: function cmd_findAllUpdates_updateAvailable(aAddon, aInstall) {
             gEventManager.delegateAddonEvent("onUpdateAvailable",
                                              [aAddon, aInstall]);
             if (AddonManager.shouldAutoUpdate(aAddon)) {
               aInstall.addListener(updateInstallListener);
               aInstall.install();
             } else {
               pendingChecks--;
               numManualUpdates++;
               updateStatus();
             }
           },
-          onNoUpdateAvailable: function(aAddon) {
+          onNoUpdateAvailable: function cmd_findAllUpdates_noUpdateAvailable(aAddon) {
             pendingChecks--;
             updateStatus();
           },
-          onUpdateFinished: function(aAddon, aError) {
+          onUpdateFinished: function cmd_findAllUpdates_updateFinished(aAddon, aError) {
             gEventManager.delegateAddonEvent("onUpdateFinished",
                                              [aAddon, aError]);
           }
         };
 
-        AddonManager.getAddonsByTypes(null, function(aAddonList) {
+        AddonManager.getAddonsByTypes(null, function cmd_findAllUpdates_getAddonsByTypes(aAddonList) {
           aAddonList.forEach(function(aAddon) {
             if (aAddon.permissions & AddonManager.PERM_CAN_UPGRADE) {
               pendingChecks++;
               aAddon.findUpdates(updateCheckListener,
                                  AddonManager.UPDATE_WHEN_USER_REQUESTED);
             }
           });
 
           if (pendingChecks == 0)
             updateStatus();
         });
       }
     },
 
     cmd_findItemUpdates: {
-      isEnabled: function(aAddon) {
+      isEnabled: function cmd_findItemUpdates_isEnabled(aAddon) {
         if (!aAddon)
           return false;
         return hasPermission(aAddon, "upgrade");
       },
-      doCommand: function(aAddon) {
+      doCommand: function cmd_findItemUpdates_doCommand(aAddon) {
         var listener = {
-          onUpdateAvailable: function(aAddon, aInstall) {
+          onUpdateAvailable: function cmd_findItemUpdates_updateAvailable(aAddon, aInstall) {
             gEventManager.delegateAddonEvent("onUpdateAvailable",
                                              [aAddon, aInstall]);
             if (AddonManager.shouldAutoUpdate(aAddon))
               aInstall.install();
           },
-          onNoUpdateAvailable: function(aAddon) {
+          onNoUpdateAvailable: function cmd_findItemUpdates_noUpdateAvailable(aAddon) {
             gEventManager.delegateAddonEvent("onNoUpdateAvailable",
                                              [aAddon]);
           }
         };
         gEventManager.delegateAddonEvent("onCheckingUpdate", [aAddon]);
         aAddon.findUpdates(listener, AddonManager.UPDATE_WHEN_USER_REQUESTED);
       }
     },
 
     cmd_showItemPreferences: {
-      isEnabled: function(aAddon) {
+      isEnabled: function cmd_showItemPreferences_isEnabled(aAddon) {
         if (!aAddon || !aAddon.isActive || !aAddon.optionsURL)
           return false;
         if (gViewController.currentViewObj == gDetailView &&
             aAddon.optionsType == AddonManager.OPTIONS_TYPE_INLINE) {
           return false;
         }
         return true;
       },
-      doCommand: function(aAddon) {
+      doCommand: function cmd_showItemPreferences_doCommand(aAddon) {
         if (aAddon.optionsType == AddonManager.OPTIONS_TYPE_INLINE) {
           gViewController.commands.cmd_showItemDetails.doCommand(aAddon, true);
           return;
         }
         var optionsURL = aAddon.optionsURL;
         if (aAddon.optionsType == AddonManager.OPTIONS_TYPE_TAB &&
             openOptionsInTab(optionsURL)) {
           return;
@@ -909,134 +909,134 @@ var gViewController = {
         } catch (e) {
           features += ",modal";
         }
         openDialog(optionsURL, "", features);
       }
     },
 
     cmd_showItemAbout: {
-      isEnabled: function(aAddon) {
+      isEnabled: function cmd_showItemAbout_isEnabled(aAddon) {
         // XXXunf This may be applicable to install items too. See bug 561260
         return !!aAddon;
       },
-      doCommand: function(aAddon) {
+      doCommand: function cmd_showItemAbout_doCommand(aAddon) {
         var aboutURL = aAddon.aboutURL;
         if (aboutURL)
           openDialog(aboutURL, "", "chrome,centerscreen,modal", aAddon);
         else
           openDialog("chrome://mozapps/content/extensions/about.xul",
                      "", "chrome,centerscreen,modal", aAddon);
       }
     },
 
     cmd_enableItem: {
-      isEnabled: function(aAddon) {
+      isEnabled: function cmd_enableItem_isEnabled(aAddon) {
         if (!aAddon)
           return false;
         return hasPermission(aAddon, "enable");
       },
-      doCommand: function(aAddon) {
+      doCommand: function cmd_enableItem_doCommand(aAddon) {
         aAddon.userDisabled = false;
       },
-      getTooltip: function(aAddon) {
+      getTooltip: function cmd_enableItem_getTooltip(aAddon) {
         if (!aAddon)
           return "";
         if (aAddon.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_ENABLE)
           return gStrings.ext.GetStringFromName("enableAddonRestartRequiredTooltip");
         return gStrings.ext.GetStringFromName("enableAddonTooltip");
       }
     },
 
     cmd_disableItem: {
-      isEnabled: function(aAddon) {
+      isEnabled: function cmd_disableItem_isEnabled(aAddon) {
         if (!aAddon)
           return false;
         return hasPermission(aAddon, "disable");
       },
-      doCommand: function(aAddon) {
+      doCommand: function cmd_disableItem_doCommand(aAddon) {
         aAddon.userDisabled = true;
       },
-      getTooltip: function(aAddon) {
+      getTooltip: function cmd_disableItem_getTooltip(aAddon) {
         if (!aAddon)
           return "";
         if (aAddon.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_DISABLE)
           return gStrings.ext.GetStringFromName("disableAddonRestartRequiredTooltip");
         return gStrings.ext.GetStringFromName("disableAddonTooltip");
       }
     },
 
     cmd_installItem: {
-      isEnabled: function(aAddon) {
+      isEnabled: function cmd_installItem_isEnabled(aAddon) {
         if (!aAddon)
           return false;
         return aAddon.install && aAddon.install.state == AddonManager.STATE_AVAILABLE;
       },
-      doCommand: function(aAddon) {
+      doCommand: function cmd_installItem_doCommand(aAddon) {
         function doInstall() {
           gViewController.currentViewObj.getListItemForID(aAddon.id)._installStatus.installRemote();
         }
 
         if (gViewController.currentViewObj == gDetailView)
           gViewController.popState(doInstall);
         else
           doInstall();
       }
     },
 
     cmd_purchaseItem: {
-      isEnabled: function(aAddon) {
+      isEnabled: function cmd_purchaseItem_isEnabled(aAddon) {
         if (!aAddon)
           return false;
         return !!aAddon.purchaseURL;
       },
-      doCommand: function(aAddon) {
+      doCommand: function cmd_purchaseItem_doCommand(aAddon) {
         openURL(aAddon.purchaseURL);
       }
     },
 
     cmd_uninstallItem: {
-      isEnabled: function(aAddon) {
+      isEnabled: function cmd_uninstallItem_isEnabled(aAddon) {
         if (!aAddon)
           return false;
         return hasPermission(aAddon, "uninstall");
       },
-      doCommand: function(aAddon) {
+      doCommand: function cmd_uninstallItem_doCommand(aAddon) {
         if (gViewController.currentViewObj != gDetailView) {
           aAddon.uninstall();
           return;
         }
 
-        gViewController.popState(function() {
+        gViewController.popState(function cmd_uninstallItem_popState() {
           gViewController.currentViewObj.getListItemForID(aAddon.id).uninstall();
         });
       },
-      getTooltip: function(aAddon) {
+      getTooltip: function cmd_uninstallItem_getTooltip(aAddon) {
         if (!aAddon)
           return "";
         if (aAddon.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_UNINSTALL)
           return gStrings.ext.GetStringFromName("uninstallAddonRestartRequiredTooltip");
         return gStrings.ext.GetStringFromName("uninstallAddonTooltip");
       }
     },
 
     cmd_cancelUninstallItem: {
-      isEnabled: function(aAddon) {
+      isEnabled: function cmd_cancelUninstallItem_isEnabled(aAddon) {
         if (!aAddon)
           return false;
         return isPending(aAddon, "uninstall");
       },
-      doCommand: function(aAddon) {
+      doCommand: function cmd_cancelUninstallItem_doCommand(aAddon) {
         aAddon.cancelUninstall();
       }
     },
 
     cmd_installFromFile: {
-      isEnabled: function() true,
-      doCommand: function() {
+      isEnabled: function cmd_installFromFile_isEnabled() true,
+      doCommand: function cmd_installFromFile_doCommand() {
         const nsIFilePicker = Ci.nsIFilePicker;
         var fp = Cc["@mozilla.org/filepicker;1"]
                    .createInstance(nsIFilePicker);
         fp.init(window,
                 gStrings.ext.GetStringFromName("installFromFile.dialogTitle"),
                 nsIFilePicker.modeOpenMultiple);
         try {
           fp.appendFilter(gStrings.ext.GetStringFromName("installFromFile.filterName"),
@@ -1056,106 +1056,106 @@ var gViewController = {
               // Display the normal install confirmation for the installs
               AddonManager.installAddonsFromWebpage("application/x-xpinstall",
                                                     window, null, installs);
             }
             return;
           }
 
           var file = files.getNext();
-          AddonManager.getInstallForFile(file, function(aInstall) {
+          AddonManager.getInstallForFile(file, function cmd_installFromFile_getInstallForFile(aInstall) {
             installs.push(aInstall);
             buildNextInstall();
           });
         }
 
         buildNextInstall();
       }
     },
 
     cmd_cancelOperation: {
-      isEnabled: function(aAddon) {
+      isEnabled: function cmd_cancelOperation_isEnabled(aAddon) {
         if (!aAddon)
           return false;
         return aAddon.pendingOperations != AddonManager.PENDING_NONE;
       },
-      doCommand: function(aAddon) {
+      doCommand: function cmd_cancelOperation_doCommand(aAddon) {
         if (isPending(aAddon, "install")) {
           aAddon.install.cancel();
         } else if (isPending(aAddon, "upgrade")) {
           aAddon.pendingUpgrade.install.cancel();
         } else if (isPending(aAddon, "uninstall")) {
           aAddon.cancelUninstall();
         } else if (isPending(aAddon, "enable")) {
           aAddon.userDisabled = true;
         } else if (isPending(aAddon, "disable")) {
           aAddon.userDisabled = false;
         }
       }
     },
 
     cmd_contribute: {
-      isEnabled: function(aAddon) {
+      isEnabled: function cmd_contribute_isEnabled(aAddon) {
         if (!aAddon)
           return false;
         return ("contributionURL" in aAddon && aAddon.contributionURL);
       },
-      doCommand: function(aAddon) {
+      doCommand: function cmd_contribute_doCommand(aAddon) {
         openURL(aAddon.contributionURL);
       }
     }
   },
 
-  supportsCommand: function(aCommand) {
+  supportsCommand: function gVC_supportsCommand(aCommand) {
     return (aCommand in this.commands);
   },
 
-  isCommandEnabled: function(aCommand) {
+  isCommandEnabled: function gVC_isCommandEnabled(aCommand) {
     if (!this.supportsCommand(aCommand))
       return false;
     var addon = this.currentViewObj.getSelectedAddon();
     return this.commands[aCommand].isEnabled(addon);
   },
 
-  updateCommands: function() {
+  updateCommands: function gVC_updateCommands() {
     // wait until the view is initialized
     if (!this.currentViewObj)
       return;
     var addon = this.currentViewObj.getSelectedAddon();
     for (let commandId in this.commands)
       this.updateCommand(commandId, addon);
   },
 
-  updateCommand: function(aCommandId, aAddon) {
+  updateCommand: function gVC_updateCommand(aCommandId, aAddon) {
     if (typeof aAddon == "undefined")
       aAddon = this.currentViewObj.getSelectedAddon();
     var cmd = this.commands[aCommandId];
     var cmdElt = document.getElementById(aCommandId);
     cmdElt.setAttribute("disabled", !cmd.isEnabled(aAddon));
     if ("getTooltip" in cmd) {
       let tooltip = cmd.getTooltip(aAddon);
       if (tooltip)
         cmdElt.setAttribute("tooltiptext", tooltip);
       else
         cmdElt.removeAttribute("tooltiptext");
     }
   },
 
-  doCommand: function(aCommand, aAddon) {
+  doCommand: function gVC_doCommand(aCommand, aAddon) {
     if (!this.supportsCommand(aCommand))
       return;
     var cmd = this.commands[aCommand];
     if (!aAddon)
       aAddon = this.currentViewObj.getSelectedAddon();
     if (!cmd.isEnabled(aAddon))
       return;
     cmd.doCommand(aAddon);
   },
 
-  onEvent: function() {}
+  onEvent: function gVC_onEvent() {}
 };
 
 function openOptionsInTab(optionsURL) {
   var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
                          .getInterface(Ci.nsIWebNavigation)
                          .QueryInterface(Ci.nsIDocShellTreeItem)
                          .rootTreeItem.QueryInterface(Ci.nsIInterfaceRequestor)
                          .getInterface(Ci.nsIDOMWindow); 
@@ -1330,17 +1330,17 @@ function sortElements(aElements, aSortBy
       aSortFuncs[i] = uiStateCompare;
     else if (DATE_FIELDS.indexOf(sortBy) != -1)
       aSortFuncs[i] = dateCompare;
     else if (NUMERIC_FIELDS.indexOf(sortBy) != -1)
       aSortFuncs[i] = numberCompare;
   }
 
 
-  aElements.sort(function(a, b) {
+  aElements.sort(function elementsSort(a, b) {
     if (!aAscending)
       [a, b] = [b, a];
 
     for (let i = 0; i < aSortFuncs.length; i++) {
       var sortBy = aSortBy[i];
       var aValue = getValue(a, sortBy);
       var bValue = getValue(b, sortBy);
 
@@ -1376,25 +1376,25 @@ function sortList(aList, aSortBy, aAscen
     aList.appendChild(aElement);
   });
 }
 
 function getAddonsAndInstalls(aType, aCallback) {
   let addons = null, installs = null;
   let types = (aType != null) ? [aType] : null;
 
-  AddonManager.getAddonsByTypes(types, function(aAddonsList) {
+  AddonManager.getAddonsByTypes(types, function getAddonsAndInstalls_getAddonsByTypes(aAddonsList) {
     addons = aAddonsList;
     if (installs != null)
       aCallback(addons, installs);
   });
 
-  AddonManager.getInstallsByTypes(types, function(aInstallsList) {
+  AddonManager.getInstallsByTypes(types, function getAddonsAndInstalls_getInstallsByTypes(aInstallsList) {
     // skip over upgrade installs and non-active installs
-    installs = aInstallsList.filter(function(aInstall) {
+    installs = aInstallsList.filter(function installsFilter(aInstall) {
       return !(aInstall.existingAddon ||
                aInstall.state == AddonManager.STATE_AVAILABLE);
     });
 
     if (addons != null)
       aCallback(addons, installs)
   });
 }
@@ -1413,17 +1413,17 @@ function doPendingUninstalls(aListBox) {
 
   items.forEach(function(aAddon) { aAddon.uninstall(); });
 }
 
 var gCategories = {
   node: null,
   _search: null,
 
-  initialize: function() {
+  initialize: function gCategories_initialize() {
     this.node = document.getElementById("categories");
     this._search = this.get("addons://search/");
 
     var types = AddonManager.addonTypes;
     for (var type in types)
       this.onTypeAdded(types[type]);
 
     AddonManager.addTypeListener(this);
@@ -1434,41 +1434,41 @@ var gCategories = {
 
     // If there was no last view or no existing category matched the last view
     // then the list will default to selecting the search category and we never
     // want to show that as the first view so switch to the default category
     if (!this.node.selectedItem || this.node.selectedItem == this._search)
       this.node.value = VIEW_DEFAULT;
 
     var self = this;
-    this.node.addEventListener("select", function() {
+    this.node.addEventListener("select", function node_onSelected() {
       self.maybeHideSearch();
       gViewController.loadView(self.node.selectedItem.value);
     }, false);
 
-    this.node.addEventListener("click", function(aEvent) {
+    this.node.addEventListener("click", function node_onClicked(aEvent) {
       var selectedItem = self.node.selectedItem;
       if (aEvent.target.localName == "richlistitem" &&
           aEvent.target == selectedItem) {
         var viewId = selectedItem.value;
 
         if (gViewController.parseViewId(viewId).type == "search") {
           viewId += encodeURIComponent(gHeader.searchQuery);
         }
 
         gViewController.loadView(viewId);
       }
     }, false);
   },
 
-  shutdown: function() {
+  shutdown: function gCategories_shutdown() {
     AddonManager.removeTypeListener(this);
   },
 
-  _insertCategory: function(aId, aName, aView, aPriority, aStartHidden) {
+  _insertCategory: function gCategories_insertCategory(aId, aName, aView, aPriority, aStartHidden) {
     // If this category already exists then don't re-add it
     if (document.getElementById("category-" + aId))
       return;
 
     var category = document.createElement("richlistitem");
     category.setAttribute("id", "category-" + aId);
     category.setAttribute("value", aView);
     category.setAttribute("class", "category");
@@ -1492,29 +1492,29 @@ var gCategories = {
       // alphabetically then this is the insertion point
       if (String.localeCompare(aName, node.getAttribute("name")) < 0)
         break;
     }
 
     this.node.insertBefore(category, node);
   },
 
-  _removeCategory: function(aId) {
+  _removeCategory: function gCategories_removeCategory(aId) {
     var category = document.getElementById("category-" + aId);
     if (!category)
       return;
 
     // If this category is currently selected then switch to the default view
     if (this.node.selectedItem == category)
       gViewController.replaceView(VIEW_DEFAULT);
 
     this.node.removeChild(category);
   },
 
-  onTypeAdded: function(aType) {
+  onTypeAdded: function gCategories_onTypeAdded(aType) {
     // Ignore types that we don't have a view object for
     if (!(aType.viewType in gViewController.viewObjects))
       return;
 
     var aViewId = "addons://" + aType.viewType + "/" + aType.id;
 
     var startHidden = false;
     if (aType.flags & AddonManager.TYPE_UI_HIDE_EMPTY) {
@@ -1524,75 +1524,75 @@ var gCategories = {
       }
       catch (e) {
         // Default to hidden
         startHidden = true;
       }
 
       var self = this;
       gPendingInitializations++;
-      getAddonsAndInstalls(aType.id, function(aAddonsList, aInstallsList) {
+      getAddonsAndInstalls(aType.id, function onTypeAdded_getAddonsAndInstalls(aAddonsList, aInstallsList) {
         var hidden = (aAddonsList.length == 0 && aInstallsList.length == 0);
         var item = self.get(aViewId);
 
         // Don't load view that is becoming hidden
         if (hidden && aViewId == gViewController.currentViewId)
           gViewController.loadView(VIEW_DEFAULT);
 
         item.hidden = hidden;
         Services.prefs.setBoolPref(prefName, hidden);
 
         if (aAddonsList.length > 0 || aInstallsList.length > 0) {
           notifyInitialized();
           return;
         }
 
         gEventManager.registerInstallListener({
-          onDownloadStarted: function(aInstall) {
+          onDownloadStarted: function gCategories_onDownloadStarted(aInstall) {
             this._maybeShowCategory(aInstall);
           },
 
-          onInstallStarted: function(aInstall) {
+          onInstallStarted: function gCategories_onInstallStarted(aInstall) {
             this._maybeShowCategory(aInstall);
           },
 
-          onInstallEnded: function(aInstall, aAddon) {
+          onInstallEnded: function gCategories_onInstallEnded(aInstall, aAddon) {
             this._maybeShowCategory(aAddon);
           },
 
-          onExternalInstall: function(aAddon, aExistingAddon, aRequiresRestart) {
+          onExternalInstall: function gCategories_onExternalInstall(aAddon, aExistingAddon, aRequiresRestart) {
             this._maybeShowCategory(aAddon);
           },
 
-          _maybeShowCategory: function(aAddon) {
+          _maybeShowCategory: function gCategories_maybeShowCategory(aAddon) {
             if (aType.id == aAddon.type) {
               self.get(aViewId).hidden = false;
               Services.prefs.setBoolPref(prefName, false);
               gEventManager.unregisterInstallListener(this);
             }
           }
         });
 
         notifyInitialized();
       });
     }
 
     this._insertCategory(aType.id, aType.name, aViewId, aType.uiPriority,
                          startHidden);
   },
 
-  onTypeRemoved: function(aType) {
+  onTypeRemoved: function gCategories_onTypeRemoved(aType) {
     this._removeCategory(aType.id);
   },
 
   get selected() {
     return this.node.selectedItem ? this.node.selectedItem.value : null;
   },
 
-  select: function(aId, aPreviousView) {
+  select: function gCategories_select(aId, aPreviousView) {
     var view = gViewController.parseViewId(aId);
     if (view.type == "detail" && aPreviousView) {
       aId = aPreviousView;
       view = gViewController.parseViewId(aPreviousView);
     }
 
     Services.prefs.setCharPref(PREF_UI_LASTCATEGORY, aId);
 
@@ -1615,70 +1615,70 @@ var gCategories = {
       this.node.selectedItem = item;
       this.node.suppressOnSelect = false;
       this.node.ensureElementIsVisible(item);
 
       this.maybeHideSearch();
     }
   },
 
-  get: function(aId) {
+  get: function gCategories_get(aId) {
     var items = document.getElementsByAttribute("value", aId);
     if (items.length)
       return items[0];
     return null;
   },
 
-  setBadge: function(aId, aCount) {
+  setBadge: function gCategories_setBadge(aId, aCount) {
     let item = this.get(aId);
     if (item)
       item.badgeCount = aCount;
   },
 
-  maybeHideSearch: function() {
+  maybeHideSearch: function gCategories_maybeHideSearch() {
     var view = gViewController.parseViewId(this.node.selectedItem.value);
     this._search.disabled = view.type != "search";
   }
 };
 
 
 var gHeader = {
   _search: null,
   _dest: "",
 
-  initialize: function() {
+  initialize: function gHeader_initialize() {
     this._search = document.getElementById("header-search");
 
-    this._search.addEventListener("command", function(aEvent) {
+    this._search.addEventListener("command", function search_onCommand(aEvent) {
       var query = aEvent.target.value;
       if (query.length == 0)
         return false;
 
       gViewController.loadView("addons://search/" + encodeURIComponent(query));
     }, false);
 
     function updateNavButtonVisibility() {
       var shouldShow = gHeader.shouldShowNavButtons;
       document.getElementById("back-btn").hidden = !shouldShow;
       document.getElementById("forward-btn").hidden = !shouldShow;
     }
 
-    window.addEventListener("focus", function(aEvent) {
+    window.addEventListener("focus", function window_onFocus(aEvent) {
       if (aEvent.target == window)
         updateNavButtonVisibility();
     }, false);
 
     updateNavButtonVisibility();
   },
 
-  focusSearchBox: function() {
+  focusSearchBox: function gHeader_focusSearchBox() {
     this._search.focus();
   },
 
-  onKeyPress: function(aEvent) {
+  onKeyPress: function gHeader_onKeyPress(aEvent) {
     if (String.fromCharCode(aEvent.charCode) == "/") {
       this.focusSearchBox();
     }
   },
 
   get shouldShowNavButtons() {
     var docshellItem = window.QueryInterface(Ci.nsIInterfaceRequestor)
                              .getInterface(Ci.nsIWebNavigation)
@@ -1727,17 +1727,17 @@ var gDiscoverView = {
   // after this then it must also load the discover homepage
   loaded: false,
   _browser: null,
   _loading: null,
   _error: null,
   homepageURL: null,
   _loadListeners: [],
 
-  initialize: function() {
+  initialize: function gDiscoverView_initialize() {
     if (Services.prefs.getPrefType(PREF_DISCOVERURL) == Services.prefs.PREF_INVALID) {
       this.enabled = false;
       gCategories.get("addons://discover/").hidden = true;
       return;
     }
 
     this.node = document.getElementById("discover-view");
     this._loading = document.getElementById("discover-loading");
@@ -1775,17 +1775,17 @@ var gDiscoverView = {
     }
 
     if (Services.prefs.getBoolPref(PREF_GETADDONS_CACHE_ENABLED) == false) {
       setURL(url);
       return;
     }
 
     gPendingInitializations++;
-    AddonManager.getAllAddons(function(aAddons) {
+    AddonManager.getAllAddons(function initialize_getAllAddons(aAddons) {
       var list = {};
       aAddons.forEach(function(aAddon) {
         var prefName = PREF_GETADDONS_CACHE_ID_ENABLED.replace("%ID%",
                                                                aAddon.id);
         try {
           if (!Services.prefs.getBoolPref(prefName))
             return;
         } catch (e) { }
@@ -1798,26 +1798,26 @@ var gDiscoverView = {
           isBlocklisted: aAddon.blocklistState == Ci.nsIBlocklistService.STATE_BLOCKED
         }
       });
 
       setURL(url + "#" + JSON.stringify(list));
     });
   },
 
-  destroy: function() {
+  destroy: function gDiscoverView_destroy() {
     try {
       this._browser.removeProgressListener(this);
     }
     catch (e) {
       // Ignore the case when the listener wasn't already registered
     }
   },
 
-  show: function(aParam, aRequest, aState, aIsRefresh) {
+  show: function gDiscoverView_show(aParam, aRequest, aState, aIsRefresh) {
     gViewController.updateCommands();
 
     // If we're being told to load a specific URL then just do that
     if (aState && "url" in aState) {
       this.loaded = true;
       this._loadURL(aState.url);
     }
 
@@ -1838,51 +1838,51 @@ var gDiscoverView = {
       this._loadListeners.push(gViewController.notifyViewChanged.bind(gViewController));
       return;
     }
 
     this._loadURL(this.homepageURL.spec, aIsRefresh,
                   gViewController.notifyViewChanged.bind(gViewController));
   },
   
-  canRefresh: function() {
+  canRefresh: function gDiscoverView_canRefresh() {
     if (this._browser.currentURI &&
         this._browser.currentURI.spec == this._browser.homePage)
       return false;
     return true;
   },
 
-  refresh: function(aParam, aRequest, aState) {
+  refresh: function gDiscoverView_refresh(aParam, aRequest, aState) {
     this.show(aParam, aRequest, aState, true);
   },
 
-  hide: function() { },
-
-  showError: function() {
+  hide: function gDiscoverView_hide() { },
+
+  showError: function gDiscoverView_showError() {
     this.node.selectedPanel = this._error;
   },
 
-  _loadURL: function(aURL, aKeepHistory, aCallback) {
+  _loadURL: function gDiscoverView_loadURL(aURL, aKeepHistory, aCallback) {
     if (this._browser.currentURI.spec == aURL) {
       if (aCallback)
         aCallback();
       return;
     }
 
     if (aCallback)
       this._loadListeners.push(aCallback);
 
     var flags = 0;
     if (!aKeepHistory)
       flags |= Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY;
 
     this._browser.loadURIWithFlags(aURL, flags);
   },
 
-  onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) {
+  onLocationChange: function gDiscoverView_onLocationChange(aWebProgress, aRequest, aLocation, aFlags) {
     // Ignore the about:blank load
     if (aLocation.spec == "about:blank")
       return;
 
     // When using the real session history the inner-frame will update the
     // session history automatically, if using the fake history though it must
     // be manually updated
     if (gHistory == FakeHistory) {
@@ -1910,31 +1910,31 @@ var gDiscoverView = {
         (!this.homepageURL.schemeIs("https") || aLocation.schemeIs("https")))
       return;
 
     // Canceling the request will send an error to onStateChange which will show
     // the error page
     aRequest.cancel(Components.results.NS_BINDING_ABORTED);
   },
 
-  onSecurityChange: function(aWebProgress, aRequest, aState) {
+  onSecurityChange: function gDiscoverView_onSecurityChange(aWebProgress, aRequest, aState) {
     // Don't care about security if the page is not https
     if (!this.homepageURL.schemeIs("https"))
       return;
 
     // If the request was secure then it is ok
     if (aState & Ci.nsIWebProgressListener.STATE_IS_SECURE)
       return;
 
     // Canceling the request will send an error to onStateChange which will show
     // the error page
     aRequest.cancel(Components.results.NS_BINDING_ABORTED);
   },
 
-  onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
+  onStateChange: function gDiscoverView_onStateChange(aWebProgress, aRequest, aStateFlags, aStatus) {
     let transferStart = Ci.nsIWebProgressListener.STATE_IS_DOCUMENT |
                         Ci.nsIWebProgressListener.STATE_IS_REQUEST |
                         Ci.nsIWebProgressListener.STATE_TRANSFERRING;
     // Once transferring begins show the content
     if (aStateFlags & transferStart)
       this.node.selectedPanel = this._browser;
 
     // Only care about the network events
@@ -1969,23 +1969,23 @@ var gDiscoverView = {
     var listeners = this._loadListeners;
     this._loadListeners = [];
 
     listeners.forEach(function(aListener) {
       aListener();
     });
   },
 
-  onProgressChange: function() { },
-  onStatusChange: function() { },
+  onProgressChange: function gDiscoverView_onProgressChange() { },
+  onStatusChange: function gDiscoverView_onStatusChange() { },
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
                                          Ci.nsISupportsWeakReference]),
 
-  getSelectedAddon: function() null
+  getSelectedAddon: function gDiscoverView_getSelectedAddon() null
 };
 
 
 var gCachedAddons = {};
 
 var gSearchView = {
   node: null,
   _filter: null,
@@ -1993,49 +1993,49 @@ var gSearchView = {
   _loading: null,
   _listBox: null,
   _emptyNotice: null,
   _allResultsLink: null,
   _lastQuery: null,
   _lastRemoteTotal: 0,
   _pendingSearches: 0,
 
-  initialize: function() {
+  initialize: function gSearchView_initialize() {
     this.node = document.getElementById("search-view");
     this._filter = document.getElementById("search-filter-radiogroup");
     this._sorters = document.getElementById("search-sorters");
     this._sorters.handler = this;
     this._loading = document.getElementById("search-loading");
     this._listBox = document.getElementById("search-list");
     this._emptyNotice = document.getElementById("search-list-empty");
     this._allResultsLink = document.getElementById("search-allresults-link");
 
     var self = this;
-    this._listBox.addEventListener("keydown", function(aEvent) {
+    this._listBox.addEventListener("keydown", function listbox_onKeydown(aEvent) {
       if (aEvent.keyCode == aEvent.DOM_VK_ENTER ||
           aEvent.keyCode == aEvent.DOM_VK_RETURN) {
         var item = self._listBox.selectedItem;
         if (item)
           item.showInDetailView();
       }
     }, false);
 
-    this._filter.addEventListener("command", function() self.updateView(), false);
+    this._filter.addEventListener("command", function filter_onCommand() self.updateView(), false);
   },
 
-  shutdown: function() {
+  shutdown: function gSearchView_shutdown() {
     if (AddonRepository.isSearching)
       AddonRepository.cancelSearch();
   },
 
   get isSearching() {
     return this._pendingSearches > 0;
   },
 
-  show: function(aQuery, aRequest) {
+  show: function gSearchView_show(aQuery, aRequest) {
     gEventManager.registerInstallListener(this);
 
     this.showEmptyNotice(false);
     this.showAllResultsLink(0);
     this.showLoading(true);
     this._sorters.showprice = false;
 
     gHeader.searchQuery = aQuery;
@@ -2092,17 +2092,17 @@ var gSearchView = {
 
       self._pendingSearches--;
       self.updateView();
 
       if (!self.isSearching)
         gViewController.notifyViewChanged();
     }
 
-    getAddonsAndInstalls(null, function(aAddons, aInstalls) {
+    getAddonsAndInstalls(null, function show_getAddonsAndInstalls(aAddons, aInstalls) {
       if (gViewController && aRequest != gViewController.currentViewRequest)
         return;
 
       createSearchResults(aAddons, false, false);
       createSearchResults(aInstalls, true, false);
       finishSearch();
     });
 
@@ -2112,47 +2112,47 @@ var gSearchView = {
     } catch(e) {}
 
     if (maxRemoteResults <= 0) {
       finishSearch(0);
       return;
     }
 
     AddonRepository.searchAddons(aQuery, maxRemoteResults, {
-      searchFailed: function() {
+      searchFailed: function show_SearchFailed() {
         if (gViewController && aRequest != gViewController.currentViewRequest)
           return;
 
         self._lastRemoteTotal = 0;
 
         // XXXunf Better handling of AMO search failure. See bug 579502
         finishSearch(0); // Silently fail
       },
 
-      searchSucceeded: function(aAddonsList, aAddonCount, aTotalResults) {
+      searchSucceeded: function show_SearchSucceeded(aAddonsList, aAddonCount, aTotalResults) {
         if (gViewController && aRequest != gViewController.currentViewRequest)
           return;
 
         if (aTotalResults > maxRemoteResults)
           self._lastRemoteTotal = aTotalResults;
         else
           self._lastRemoteTotal = 0;
 
         var createdCount = createSearchResults(aAddonsList, false, true);
         finishSearch(createdCount);
       }
     });
   },
   
-  showLoading: function(aLoading) {
+  showLoading: function gSearchView_showLoading(aLoading) {
     this._loading.hidden = !aLoading;
     this._listBox.hidden = aLoading;
   },
 
-  updateView: function() {
+  updateView: function gSearchView_updateView() {
     var showLocal = this._filter.value == "local";
     this._listBox.setAttribute("local", showLocal);
     this._listBox.setAttribute("remote", !showLocal);
 
     this.showLoading(this.isSearching && !showLocal);
     if (!this.isSearching) {
       var isEmpty = true;
       var results = this._listBox.getElementsByTagName("richlistitem");
@@ -2166,31 +2166,31 @@ var gSearchView = {
 
       this.showEmptyNotice(isEmpty);
       this.showAllResultsLink(this._lastRemoteTotal);
     }
 
     gViewController.updateCommands();
   },
 
-  hide: function() {
+  hide: function gSearchView_hide() {
     gEventManager.unregisterInstallListener(this);
     doPendingUninstalls(this._listBox);
   },
 
-  getMatchScore: function(aObj, aQuery) {
+  getMatchScore: function gSearchView_getMatchScore(aObj, aQuery) {
     var score = 0;
     score += this.calculateMatchScore(aObj.name, aQuery,
                                       SEARCH_SCORE_MULTIPLIER_NAME);
     score += this.calculateMatchScore(aObj.description, aQuery,
                                       SEARCH_SCORE_MULTIPLIER_DESCRIPTION);
     return score;
   },
 
-  calculateMatchScore: function(aStr, aQuery, aMultiplier) {
+  calculateMatchScore: function gSearchView_calculateMatchScore(aStr, aQuery, aMultiplier) {
     var score = 0;
     if (!aStr || aQuery.length == 0)
       return score;
 
     aStr = aStr.trim().toLocaleLowerCase();
     var haystack = aStr.split(/\s+/);
     var needles = aQuery.split(/\s+/);
 
@@ -2212,38 +2212,38 @@ var gSearchView = {
     // give progressively higher score for longer queries, since longer queries
     // are more likely to be unique and therefore more relevant.
     if (needles.length > 1 && aStr.indexOf(aQuery) != -1)
       score += needles.length;
 
     return score * aMultiplier;
   },
 
-  showEmptyNotice: function(aShow) {
+  showEmptyNotice: function gSearchView_showEmptyNotice(aShow) {
     this._emptyNotice.hidden = !aShow;
     this._listBox.hidden = aShow;
   },
 
-  showAllResultsLink: function(aTotalResults) {
+  showAllResultsLink: function gSearchView_showAllResultsLink(aTotalResults) {
     if (aTotalResults == 0) {
       this._allResultsLink.hidden = true;
       return;
     }
 
     var linkStr = gStrings.ext.GetStringFromName("showAllSearchResults");
     linkStr = PluralForm.get(aTotalResults, linkStr);
     linkStr = linkStr.replace("#1", aTotalResults);
     this._allResultsLink.setAttribute("value", linkStr);
 
     this._allResultsLink.setAttribute("href",
                                       AddonRepository.getSearchURL(this._lastQuery));
     this._allResultsLink.hidden = false;
  },
 
-  updateListAttributes: function() {
+  updateListAttributes: function gSearchView_updateListAttributes() {
     var item = this._listBox.querySelector("richlistitem[remote='true'][first]");
     if (item)
       item.removeAttribute("first");
     item = this._listBox.querySelector("richlistitem[remote='true'][last]");
     if (item)
       item.removeAttribute("last");
     var items = this._listBox.querySelectorAll("richlistitem[remote='true']");
     if (items.length > 0) {
@@ -2260,96 +2260,96 @@ var gSearchView = {
     items = this._listBox.querySelectorAll("richlistitem:not([remote='true'])");
     if (items.length > 0) {
       items[0].setAttribute("first", true);
       items[items.length - 1].setAttribute("last", true);
     }
 
   },
 
-  onSortChanged: function(aSortBy, aAscending) {
+  onSortChanged: function gSearchView_onSortChanged(aSortBy, aAscending) {
     var footer = this._listBox.lastChild;
     this._listBox.removeChild(footer);
 
     sortList(this._listBox, aSortBy, aAscending);
     this.updateListAttributes();
 
     this._listBox.appendChild(footer);
   },
 
-  onDownloadCancelled: function(aInstall) {
+  onDownloadCancelled: function gSearchView_onDownloadCancelled(aInstall) {
     this.removeInstall(aInstall);
   },
 
-  onInstallCancelled: function(aInstall) {
+  onInstallCancelled: function gSearchView_onInstallCancelled(aInstall) {
     this.removeInstall(aInstall);
   },
 
-  removeInstall: function(aInstall) {
+  removeInstall: function gSearchView_removeInstall(aInstall) {
     for (let item of this._listBox.childNodes) {
       if (item.mInstall == aInstall) {
         this._listBox.removeChild(item);
         return;
       }
     }
   },
 
-  getSelectedAddon: function() {
+  getSelectedAddon: function gSearchView_getSelectedAddon() {
     var item = this._listBox.selectedItem;
     if (item)
       return item.mAddon;
     return null;
   },
 
-  getListItemForID: function(aId) {
+  getListItemForID: function gSearchView_getListItemForID(aId) {
     var listitem = this._listBox.firstChild;
     while (listitem) {
       if (listitem.getAttribute("status") == "installed" && listitem.mAddon.id == aId)
         return listitem;
       listitem = listitem.nextSibling;
     }
   }
 };
 
 
 var gListView = {
   node: null,
   _listBox: null,
   _emptyNotice: null,
   _type: null,
 
-  initialize: function() {
+  initialize: function gListView_initialize() {
     this.node = document.getElementById("list-view");
     this._listBox = document.getElementById("addon-list");
     this._emptyNotice = document.getElementById("addon-list-empty");
 
     var self = this;
-    this._listBox.addEventListener("keydown", function(aEvent) {
+    this._listBox.addEventListener("keydown", function listbox_onKeydown(aEvent) {
       if (aEvent.keyCode == aEvent.DOM_VK_ENTER ||
           aEvent.keyCode == aEvent.DOM_VK_RETURN) {
         var item = self._listBox.selectedItem;
         if (item)
           item.showInDetailView();
       }
     }, false);
   },
 
-  show: function(aType, aRequest) {
+  show: function gListView_show(aType, aRequest) {
     if (!(aType in AddonManager.addonTypes))
       throw new Error("Attempting to show unknown type " + aType);
 
     this._type = aType;
     this.node.setAttribute("type", aType);
     this.showEmptyNotice(false);
 
     while (this._listBox.itemCount > 0)
       this._listBox.removeItemAt(0);
 
     var self = this;
-    getAddonsAndInstalls(aType, function(aAddonsList, aInstallsList) {
+    getAddonsAndInstalls(aType, function show_getAddonsAndInstalls(aAddonsList, aInstallsList) {
       if (gViewController && aRequest != gViewController.currentViewRequest)
         return;
 
       var elements = [];
 
       for (let addonItem of aAddonsList)
         elements.push(createItem(addonItem));
 
@@ -2365,61 +2365,61 @@ var gListView = {
       }
 
       gEventManager.registerInstallListener(self);
       gViewController.updateCommands();
       gViewController.notifyViewChanged();
     });
   },
 
-  hide: function() {
+  hide: function gListView_hide() {
     gEventManager.unregisterInstallListener(this);
     doPendingUninstalls(this._listBox);
   },
 
-  showEmptyNotice: function(aShow) {
+  showEmptyNotice: function gListView_showEmptyNotice(aShow) {
     this._emptyNotice.hidden = !aShow;
   },
 
-  onSortChanged: function(aSortBy, aAscending) {
+  onSortChanged: function gListView_onSortChanged(aSortBy, aAscending) {
     sortList(this._listBox, aSortBy, aAscending);
   },
 
-  onExternalInstall: function(aAddon, aExistingAddon, aRequiresRestart) {
+  onExternalInstall: function gListView_onExternalInstall(aAddon, aExistingAddon, aRequiresRestart) {
     // The existing list item will take care of upgrade installs
     if (aExistingAddon)
       return;
 
     this.addItem(aAddon);
   },
 
-  onDownloadStarted: function(aInstall) {
+  onDownloadStarted: function gListView_onDownloadStarted(aInstall) {
     this.addItem(aInstall, true);
   },
 
-  onInstallStarted: function(aInstall) {
+  onInstallStarted: function gListView_onInstallStarted(aInstall) {
     this.addItem(aInstall, true);
   },
 
-  onDownloadCancelled: function(aInstall) {
+  onDownloadCancelled: function gListView_onDownloadCancelled(aInstall) {
     this.removeItem(aInstall, true);
   },
 
-  onInstallCancelled: function(aInstall) {
+  onInstallCancelled: function gListView_onInstallCancelled(aInstall) {
     this.removeItem(aInstall, true);
   },
 
-  onInstallEnded: function(aInstall) {
+  onInstallEnded: function gListView_onInstallEnded(aInstall) {
     // Remove any install entries for upgrades, their status will appear against
     // the existing item
     if (aInstall.existingAddon)
       this.removeItem(aInstall, true);
   },
 
-  addItem: function(aObj, aIsInstall) {
+  addItem: function gListView_addItem(aObj, aIsInstall) {
     if (aObj.type != this._type)
       return;
 
     if (aIsInstall && aObj.existingAddon)
       return;
 
     let prop = aIsInstall ? "mInstall" : "mAddon";
     for (let i = 0; i < this._listBox.itemCount; i++) {
@@ -2428,73 +2428,73 @@ var gListView = {
         return;
     }
 
     let item = createItem(aObj, aIsInstall);
     this._listBox.insertBefore(item, this._listBox.firstChild);
     this.showEmptyNotice(false);
   },
 
-  removeItem: function(aObj, aIsInstall) {
+  removeItem: function gListView_removeItem(aObj, aIsInstall) {
     let prop = aIsInstall ? "mInstall" : "mAddon";
 
     for (let i = 0; i < this._listBox.itemCount; i++) {
       let item = this._listBox.childNodes[i];
       if (item[prop] == aObj) {
         this._listBox.removeChild(item);
         this.showEmptyNotice(this._listBox.itemCount == 0);
         return;
       }
     }
   },
 
-  getSelectedAddon: function() {
+  getSelectedAddon: function gListView_getSelectedAddon() {
     var item = this._listBox.selectedItem;
     if (item)
       return item.mAddon;
     return null;
   },
 
-  getListItemForID: function(aId) {
+  getListItemForID: function gListView_getListItemForID(aId) {
     var listitem = this._listBox.firstChild;
     while (listitem) {
       if (listitem.getAttribute("status") == "installed" && listitem.mAddon.id == aId)
         return listitem;
       listitem = listitem.nextSibling;
     }
   }
 };
 
 
 var gDetailView = {
   node: null,
   _addon: null,
   _loadingTimer: null,
   _autoUpdate: null,
 
-  initialize: function() {
+  initialize: function gDetailView_initialize() {
     this.node = document.getElementById("detail-view");
 
     this._autoUpdate = document.getElementById("detail-autoUpdate");
 
     var self = this;
-    this._autoUpdate.addEventListener("command", function() {
+    this._autoUpdate.addEventListener("command", function autoUpdate_onCommand() {
       self._addon.applyBackgroundUpdates = self._autoUpdate.value;
     }, true);
   },
   
-  shutdown: function() {
+  shutdown: function gDetailView_shutdown() {
     AddonManager.removeManagerListener(this);
   },
 
-  onUpdateModeChanged: function() {
+  onUpdateModeChanged: function gDetailView_onUpdateModeChanged() {
     this.onPropertyChanged(["applyBackgroundUpdates"]);
   },
 
-  _updateView: function(aAddon, aIsRemote, aScrollToPreferences) {
+  _updateView: function gDetailView_updateView(aAddon, aIsRemote, aScrollToPreferences) {
     AddonManager.addManagerListener(this);
     this.clearLoading();
 
     this._addon = aAddon;
     gEventManager.registerAddonListener(this, aAddon.id);
     gEventManager.registerInstallListener(this);
 
     this.node.setAttribute("type", aAddon.type);
@@ -2665,42 +2665,42 @@ var gDetailView = {
     this.fillSettingsRows(aScrollToPreferences);
 
     this.updateState();
 
     gViewController.updateCommands();
     gViewController.notifyViewChanged();
   },
 
-  show: function(aAddonId, aRequest) {
+  show: function gDetailView_show(aAddonId, aRequest) {
     let index = aAddonId.indexOf("/preferences");
     let scrollToPreferences = false;
     if (index >= 0) {
       aAddonId = aAddonId.substring(0, index);
       scrollToPreferences = true;
     }
 
     var self = this;
-    this._loadingTimer = setTimeout(function() {
+    this._loadingTimer = setTimeout(function loadTimeOutTimer() {
       self.node.setAttribute("loading-extended", true);
     }, LOADING_MSG_DELAY);
 
     var view = gViewController.currentViewId;
 
-    AddonManager.getAddonByID(aAddonId, function(aAddon) {
+    AddonManager.getAddonByID(aAddonId, function show_getAddonByID(aAddon) {
       if (gViewController && aRequest != gViewController.currentViewRequest)
         return;
 
       if (aAddon) {
         self._updateView(aAddon, false, scrollToPreferences);
         return;
       }
 
       // Look for an add-on pending install
-      AddonManager.getAllInstalls(function(aInstalls) {
+      AddonManager.getAllInstalls(function show_getAllInstalls(aInstalls) {
         for (let install of aInstalls) {
           if (install.state == AddonManager.STATE_INSTALLED &&
               install.addon.id == aAddonId) {
             self._updateView(install.addon, false);
             return;
           }
         }
 
@@ -2712,17 +2712,17 @@ var gDetailView = {
         // This might happen due to session restore restoring us back to an
         // add-on that doesn't exist but otherwise shouldn't normally happen.
         // Either way just revert to the default view.
         gViewController.replaceView(VIEW_DEFAULT);
       });
     });
   },
 
-  hide: function() {
+  hide: function gDetailView_hide() {
     AddonManager.removeManagerListener(this);
     this.clearLoading();
     if (this._addon) {
       if (this._addon.optionsType == AddonManager.OPTIONS_TYPE_INLINE) {
         Services.obs.notifyObservers(document,
                                      "addon-options-hidden",
                                      this._addon.id);
       }
@@ -2732,17 +2732,17 @@ var gDetailView = {
       this._addon = null;
 
       // Flush the preferences to disk so they survive any crash
       if (this.node.getElementsByTagName("setting").length)
         Services.prefs.savePrefFile(null);
     }
   },
 
-  updateState: function() {
+  updateState: function gDetailView_updateState() {
     gViewController.updateCommands();
 
     var pending = this._addon.pendingOperations;
     if (pending != AddonManager.PENDING_NONE) {
       this.node.removeAttribute("notification");
 
       var pending = null;
       ["enable", "disable", "install", "uninstall", "upgrade"].forEach(function(aOp) {
@@ -2798,33 +2798,33 @@ var gDetailView = {
       } else {
         this.node.removeAttribute("notification");
       }
     }
 
     this.node.setAttribute("active", this._addon.isActive);
   },
 
-  clearLoading: function() {
+  clearLoading: function gDetailView_clearLoading() {
     if (this._loadingTimer) {
       clearTimeout(this._loadingTimer);
       this._loadingTimer = null;
     }
 
     this.node.removeAttribute("loading-extended");
   },
 
-  emptySettingsRows: function () {
+  emptySettingsRows: function gDetailView_emptySettingsRows() {
     var lastRow = document.getElementById("detail-downloads");
     var rows = lastRow.parentNode;
     while (lastRow.nextSibling)
       rows.removeChild(rows.lastChild);
   },
 
-  fillSettingsRows: function (aScrollToPreferences) {
+  fillSettingsRows: function gDetailView_fillSettingsRows(aScrollToPreferences) {
     this.emptySettingsRows();
     if (this._addon.optionsType != AddonManager.OPTIONS_TYPE_INLINE)
       return;
 
     // This function removes and returns the text content of aNode without
     // removing any child elements. Removing the text nodes ensures any XBL
     // bindings apply properly.
     function stripTextNodes(aNode) {
@@ -2883,158 +2883,158 @@ var gDetailView = {
       if (firstSetting)
         firstSetting.clientTop;
       Services.obs.notifyObservers(document, "addon-options-displayed", this._addon.id);
       if (aScrollToPreferences)
         gDetailView.scrollToPreferencesRows();
     }
   },
 
-  scrollToPreferencesRows: function() {
+  scrollToPreferencesRows: function gDetailView_scrollToPreferencesRows() {
     // We find this row, rather than remembering it from above,
     // in case it has been changed by the observers.
     let firstRow = gDetailView.node.querySelector('setting[first-row="true"]');
     if (firstRow) {
       let top = firstRow.boxObject.y;
       top -= parseInt(window.getComputedStyle(firstRow, null).getPropertyValue("margin-top"));
       
       let detailViewBoxObject = gDetailView.node.boxObject;
       top -= detailViewBoxObject.y;
 
       detailViewBoxObject.QueryInterface(Ci.nsIScrollBoxObject);
       detailViewBoxObject.scrollTo(0, top);
     }
   },
 
-  getSelectedAddon: function() {
+  getSelectedAddon: function gDetailView_getSelectedAddon() {
     return this._addon;
   },
 
-  onEnabling: function() {
+  onEnabling: function gDetailView_onEnabling() {
     this.updateState();
   },
 
-  onEnabled: function() {
+  onEnabled: function gDetailView_onEnabled() {
     this.updateState();
     this.fillSettingsRows();
   },
 
-  onDisabling: function(aNeedsRestart) {
+  onDisabling: function gDetailView_onDisabling(aNeedsRestart) {
     this.updateState();
     if (!aNeedsRestart &&
         this._addon.optionsType == AddonManager.OPTIONS_TYPE_INLINE) {
       Services.obs.notifyObservers(document,
                                    "addon-options-hidden",
                                    this._addon.id);
     }
   },
 
-  onDisabled: function() {
+  onDisabled: function gDetailView_onDisabled() {
     this.updateState();
     this.emptySettingsRows();
   },
 
-  onUninstalling: function() {
+  onUninstalling: function gDetailView_onUninstalling() {
     this.updateState();
   },
 
-  onUninstalled: function() {
+  onUninstalled: function gDetailView_onUninstalled() {
     gViewController.popState();
   },
 
-  onOperationCancelled: function() {
+  onOperationCancelled: function gDetailView_onOperationCancelled() {
     this.updateState();
   },
 
-  onPropertyChanged: function(aProperties) {
+  onPropertyChanged: function gDetailView_onPropertyChanged(aProperties) {
     if (aProperties.indexOf("applyBackgroundUpdates") != -1) {
       this._autoUpdate.value = this._addon.applyBackgroundUpdates;
       let hideFindUpdates = AddonManager.shouldAutoUpdate(this._addon);
       document.getElementById("detail-findUpdates-btn").hidden = hideFindUpdates;
     }
 
     if (aProperties.indexOf("appDisabled") != -1)
       this.updateState();
   },
 
-  onExternalInstall: function(aAddon, aExistingAddon, aNeedsRestart) {
+  onExternalInstall: function gDetailView_onExternalInstall(aAddon, aExistingAddon, aNeedsRestart) {
     // Only care about upgrades for the currently displayed add-on
     if (!aExistingAddon || aExistingAddon.id != this._addon.id)
       return;
 
     if (!aNeedsRestart)
       this._updateView(aAddon, false);
     else
       this.updateState();
   },
 
-  onInstallCancelled: function(aInstall) {
+  onInstallCancelled: function gDetailView_onInstallCancelled(aInstall) {
     if (aInstall.addon.id == this._addon.id)
       gViewController.popState();
   }
 };
 
 
 var gUpdatesView = {
   node: null,
   _listBox: null,
   _emptyNotice: null,
   _sorters: null,
   _updateSelected: null,
   _categoryItem: null,
 
-  initialize: function() {
+  initialize: function gUpdatesView_initialize() {
     this.node = document.getElementById("updates-view");
     this._listBox = document.getElementById("updates-list");
     this._emptyNotice = document.getElementById("updates-list-empty");
     this._sorters = document.getElementById("updates-sorters");
     this._sorters.handler = this;
 
     this._categoryItem = gCategories.get("addons://updates/available");
 
     this._updateSelected = document.getElementById("update-selected-btn");
-    this._updateSelected.addEventListener("command", function() {
+    this._updateSelected.addEventListener("command", function updateSelected_onCommand() {
       gUpdatesView.installSelected();
     }, false);
 
     this.updateAvailableCount(true);
 
     AddonManager.addAddonListener(this);
     AddonManager.addInstallListener(this);
   },
 
-  shutdown: function() {
+  shutdown: function gUpdatesView_shutdown() {
     AddonManager.removeAddonListener(this);
     AddonManager.removeInstallListener(this);
   },
 
-  show: function(aType, aRequest) {
+  show: function gUpdatesView_show(aType, aRequest) {
     document.getElementById("empty-availableUpdates-msg").hidden = aType != "available";
     document.getElementById("empty-recentUpdates-msg").hidden = aType != "recent";
     this.showEmptyNotice(false);
 
     while (this._listBox.itemCount > 0)
       this._listBox.removeItemAt(0);
 
     this.node.setAttribute("updatetype", aType);
     if (aType == "recent")
       this._showRecentUpdates(aRequest);
     else
       this._showAvailableUpdates(false, aRequest);
   },
 
-  hide: function() {
+  hide: function gUpdatesView_hide() {
     this._updateSelected.hidden = true;
     this._categoryItem.disabled = this._categoryItem.badgeCount == 0;
     doPendingUninstalls(this._listBox);
   },
 
-  _showRecentUpdates: function(aRequest) {
+  _showRecentUpdates: function gUpdatesView_showRecentUpdates(aRequest) {
     var self = this;
-    AddonManager.getAllAddons(function(aAddonsList) {
+    AddonManager.getAllAddons(function showRecentUpdates_getAllAddons(aAddonsList) {
       if (gViewController && aRequest != gViewController.currentViewRequest)
         return;
 
       var elements = [];
       let threshold = Date.now() - UPDATES_RECENT_TIMESPAN;
       aAddonsList.forEach(function(aAddon) {
         if (!aAddon.updateDate || aAddon.updateDate.getTime() < threshold)
           return;
@@ -3049,24 +3049,24 @@ var gUpdatesView = {
           self._listBox.appendChild(aElement);
         });
       }
 
       gViewController.notifyViewChanged();
     });
   },
 
-  _showAvailableUpdates: function(aIsRefresh, aRequest) {
+  _showAvailableUpdates: function gUpdatesView_showAvailableUpdates(aIsRefresh, aRequest) {
     /* Disable the Update Selected button so it can't get clicked
        before everything is initialized asynchronously.
        It will get re-enabled by maybeDisableUpdateSelected(). */
     this._updateSelected.disabled = true;
 
     var self = this;
-    AddonManager.getAllInstalls(function(aInstallsList) {
+    AddonManager.getAllInstalls(function showAvailableUpdates_getAllInstalls(aInstallsList) {
       if (!aIsRefresh && gViewController && aRequest &&
           aRequest != gViewController.currentViewRequest)
         return;
 
       if (aIsRefresh) {
         self.showEmptyNotice(false);
         self._updateSelected.hidden = true;
 
@@ -3077,17 +3077,17 @@ var gUpdatesView = {
       var elements = [];
 
       aInstallsList.forEach(function(aInstall) {
         if (!self.isManualUpdate(aInstall))
           return;
 
         let item = createItem(aInstall.existingAddon);
         item.setAttribute("upgrade", true);
-        item.addEventListener("IncludeUpdateChanged", function() {
+        item.addEventListener("IncludeUpdateChanged", function item_onIncludeUpdateChanged() {
           self.maybeDisableUpdateSelected();
         }, false);
         elements.push(item);
       });
 
       self.showEmptyNotice(elements.length == 0);
       if (elements.length > 0) {
         self._updateSelected.hidden = false;
@@ -3099,123 +3099,123 @@ var gUpdatesView = {
 
       // ensure badge count is in sync
       self._categoryItem.badgeCount = self._listBox.itemCount;
 
       gViewController.notifyViewChanged();
     });
   },
 
-  showEmptyNotice: function(aShow) {
+  showEmptyNotice: function gUpdatesView_showEmptyNotice(aShow) {
     this._emptyNotice.hidden = !aShow;
   },
 
-  isManualUpdate: function(aInstall, aOnlyAvailable) {
+  isManualUpdate: function gUpdatesView_isManualUpdate(aInstall, aOnlyAvailable) {
     var isManual = aInstall.existingAddon &&
                    !AddonManager.shouldAutoUpdate(aInstall.existingAddon);
     if (isManual && aOnlyAvailable)
       return isInState(aInstall, "available");
     return isManual;
   },
 
-  maybeRefresh: function() {
+  maybeRefresh: function gUpdatesView_maybeRefresh() {
     if (gViewController.currentViewId == "addons://updates/available")
       this._showAvailableUpdates(true);
     this.updateAvailableCount();
   },
 
-  updateAvailableCount: function(aInitializing) {
+  updateAvailableCount: function gUpdatesView_updateAvailableCount(aInitializing) {
     if (aInitializing)
       gPendingInitializations++;
     var self = this;
-    AddonManager.getAllInstalls(function(aInstallsList) {
-      var count = aInstallsList.filter(function(aInstall) {
+    AddonManager.getAllInstalls(function updateAvailableCount_getAllInstalls(aInstallsList) {
+      var count = aInstallsList.filter(function installListFilter(aInstall) {
         return self.isManualUpdate(aInstall, true);
       }).length;
       self._categoryItem.disabled = gViewController.currentViewId != "addons://updates/available" &&
                                     count == 0;
       self._categoryItem.badgeCount = count;
       if (aInitializing)
         notifyInitialized();
     });
   },
   
-  maybeDisableUpdateSelected: function() {
+  maybeDisableUpdateSelected: function gUpdatesView_maybeDisableUpdateSelected() {
     for (let item of this._listBox.childNodes) {
       if (item.includeUpdate) {
         this._updateSelected.disabled = false;
         return;
       }
     }
     this._updateSelected.disabled = true;
   },
 
-  installSelected: function() {
+  installSelected: function gUpdatesView_installSelected() {
     for (let item of this._listBox.childNodes) {
       if (item.includeUpdate)
         item.upgrade();
     }
 
     this._updateSelected.disabled = true;
   },
 
-  getSelectedAddon: function() {
+  getSelectedAddon: function gUpdatesView_getSelectedAddon() {
     var item = this._listBox.selectedItem;
     if (item)
       return item.mAddon;
     return null;
   },
 
-  getListItemForID: function(aId) {
+  getListItemForID: function gUpdatesView_getListItemForID(aId) {
     var listitem = this._listBox.firstChild;
     while (listitem) {
       if (listitem.mAddon.id == aId)
         return listitem;
       listitem = listitem.nextSibling;
     }
     return null;
   },
 
-  onSortChanged: function(aSortBy, aAscending) {
+  onSortChanged: function gUpdatesView_onSortChanged(aSortBy, aAscending) {
     sortList(this._listBox, aSortBy, aAscending);
   },
 
-  onNewInstall: function(aInstall) {
+  onNewInstall: function gUpdatesView_onNewInstall(aInstall) {
     if (!this.isManualUpdate(aInstall))
       return;
     this.maybeRefresh();
   },
 
-  onInstallStarted: function(aInstall) {
+  onInstallStarted: function gUpdatesView_onInstallStarted(aInstall) {
     this.updateAvailableCount();
   },
 
-  onInstallCancelled: function(aInstall) {
+  onInstallCancelled: function gUpdatesView_onInstallCancelled(aInstall) {
     if (!this.isManualUpdate(aInstall))
       return;
     this.maybeRefresh();
   },
 
-  onPropertyChanged: function(aAddon, aProperties) {
+  onPropertyChanged: function gUpdatesView_onPropertyChanged(aAddon, aProperties) {
     if (aProperties.indexOf("applyBackgroundUpdates") != -1)
       this.updateAvailableCount();
   }
 };
 
 
 var gDragDrop = {
-  onDragOver: function(aEvent) {
+  onDragOver: function gDragDrop_onDragOver(aEvent) {
     var types = aEvent.dataTransfer.types;
     if (types.contains("text/uri-list") ||
         types.contains("text/x-moz-url") ||
         types.contains("application/x-moz-file"))
       aEvent.preventDefault();
   },
 
-  onDrop: function(aEvent) {
+  onDrop: function gDragDrop_onDrop(aEvent) {
     var dataTransfer = aEvent.dataTransfer;
     var urls = [];
 
     // Convert every dropped item into a url
     for (var i = 0; i < dataTransfer.mozItemCount; i++) {
       var url = dataTransfer.mozGetDataAt("text/uri-list", i);
       if (url) {
         urls.push(url);
@@ -3243,17 +3243,17 @@ var gDragDrop = {
         if (installs.length > 0) {
           // Display the normal install confirmation for the installs
           AddonManager.installAddonsFromWebpage("application/x-xpinstall",
                                                 window, null, installs);
         }
         return;
       }
 
-      AddonManager.getInstallForURL(urls[pos++], function(aInstall) {
+      AddonManager.getInstallForURL(urls[pos++], function onDrop_getInstallForURL(aInstall) {
         installs.push(aInstall);
         buildNextInstall();
       }, "application/x-xpinstall");
     }
 
     buildNextInstall();
 
     aEvent.preventDefault();