merge m-c to fx-team
authorTim Taubert <ttaubert@mozilla.com>
Thu, 25 Oct 2012 21:23:58 +0200
changeset 111487 55658b5ed234a850c6cfed297fe8f79b4cd23776
parent 111472 b3b871ca74803c4c0e5f9023c53f222a1320ec7f (current diff)
parent 111486 8116fd47e9d81e9f7bf17e2a11018ba5f8ee9cc5 (diff)
child 111488 3b506ada9ef9830a98904af49279020b63e87a4a
child 111636 6169f0ad125b981662f9572c0e08e597ededaf8d
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
milestone19.0a1
merge m-c to fx-team
b2g/chrome/content/forms.js
dom/base/nsDOMClassInfo.cpp
dom/base/nsGlobalWindow.h
security/manager/ssl/src/nsNSSComponent.cpp
--- a/b2g/chrome/content/forms.js
+++ b/b2g/chrome/content/forms.js
@@ -33,20 +33,32 @@ let FormAssistant = {
     addMessageListener("Forms:Select:Choice", this);
     addMessageListener("Forms:Input:Value", this);
     addMessageListener("Forms:Select:Blur", this);
     Services.obs.addObserver(this, "ime-enabled-state-changed", false);
     Services.obs.addObserver(this, "xpcom-shutdown", false);
   },
 
   isKeyboardOpened: false,
-  focusedElement : null,
   selectionStart: 0,
   selectionEnd: 0,
 
+  _focusedElement: null,
+
+  get focusedElement() {
+    if (this._focusedElement && Cu.isDeadWrapper(this._focusedElement))
+      this._focusedElement = null;
+
+    return this._focusedElement;
+  },
+
+  set focusedElement(val) {
+    this._focusedElement = val;
+  },
+
   setFocusedElement: function fa_setFocusedElement(element) {
     if (element === this.focusedElement)
       return;
 
     if (this.focusedElement) {
       this.focusedElement.removeEventListener('mousedown', this);
       this.focusedElement.removeEventListener('mouseup', this);
       if (!element) {
--- a/browser/devtools/scratchpad/scratchpad.js
+++ b/browser/devtools/scratchpad/scratchpad.js
@@ -125,22 +125,23 @@ var Scratchpad = {
   },
 
   /**
    * Update the Scratchpad window title based on the current state.
    * @private
    */
   _updateTitle: function SP__updateTitle()
   {
-    if (this.filename) {
-      document.title = (this.editor && this.editor.dirty ? "*" : "") +
-                       this.filename;
-    } else {
-      document.title = this._initialWindowTitle;
+    let title = this.filename || this._initialWindowTitle;
+
+    if (this.editor && this.editor.dirty) {
+      title = "*" + title;
     }
+
+    document.title = title;
   },
 
   /**
    * Get the current state of the scratchpad. Called by the
    * Scratchpad Manager for session storing.
    *
    * @return object
    *        An object with 3 properties: filename, text, and
@@ -1262,17 +1263,17 @@ var Scratchpad = {
    *          - saved (boolen) - tells if the file has been saved.
    *          - status (number) - the file save status result (if the file was
    *          saved).
    * @return boolean
    *         Whether the window should be closed
    */
   promptSave: function SP_promptSave(aCallback)
   {
-    if (this.filename && this.editor.dirty) {
+    if (this.editor.dirty) {
       let ps = Services.prompt;
       let flags = ps.BUTTON_POS_0 * ps.BUTTON_TITLE_SAVE +
                   ps.BUTTON_POS_1 * ps.BUTTON_TITLE_CANCEL +
                   ps.BUTTON_POS_2 * ps.BUTTON_TITLE_DONT_SAVE;
 
       let button = ps.confirmEx(window,
                           this.strings.GetStringFromName("confirmClose.title"),
                           this.strings.GetStringFromName("confirmClose"),
--- a/browser/devtools/scratchpad/test/browser_scratchpad_bug_653427_confirm_close.js
+++ b/browser/devtools/scratchpad/test/browser_scratchpad_bug_653427_confirm_close.js
@@ -4,17 +4,17 @@
 
 let tempScope = {};
 Cu.import("resource://gre/modules/NetUtil.jsm", tempScope);
 Cu.import("resource://gre/modules/FileUtils.jsm", tempScope);
 let NetUtil = tempScope.NetUtil;
 let FileUtils = tempScope.FileUtils;
 
 // only finish() when correct number of tests are done
-const expected = 6;
+const expected = 9;
 var count = 0;
 function done()
 {
   if (++count == expected) {
     cleanup();
     finish();
   }
 }
@@ -63,26 +63,52 @@ function testSavedFile()
       ok(win.closed, "scratchpad from file with no changes should close")
       done();
     });
   }, {noFocus: true});
 }
 
 function testUnsaved()
 {
-  testUnsavedFileCancel();
+  function setFilename(aScratchpad, aFile) {
+    aScratchpad.setFilename(aFile);
+  }
+
+  testUnsavedFileCancel(setFilename);
+  testUnsavedFileSave(setFilename);
+  testUnsavedFileDontSave(setFilename);
   testCancelAfterLoad();
-  testUnsavedFileSave();
+
+  function mockSaveFile(aScratchpad) {
+    let SaveFileStub = function (aCallback) {
+      /*
+       * An argument for aCallback must pass Components.isSuccessCode
+       *
+       * A version of isSuccessCode in JavaScript:
+       *  function isSuccessCode(returnCode) {
+       *    return (returnCode & 0x80000000) == 0;
+       *  }
+       */
+      aCallback(1);
+    };
+
+    aScratchpad.saveFile = SaveFileStub;
+  }
+
+  // Run these tests again but this time without setting a filename to
+  // test that Scratchpad always asks for confirmation on dirty editor.
+  testUnsavedFileCancel(mockSaveFile);
+  testUnsavedFileSave(mockSaveFile);
   testUnsavedFileDontSave();
 }
 
-function testUnsavedFileCancel()
+function testUnsavedFileCancel(aCallback=function () {})
 {
   openScratchpad(function(win) {
-    win.Scratchpad.setFilename("test.js");
+    aCallback(win.Scratchpad, "test.js");
     win.Scratchpad.editor.dirty = true;
 
     promptButton = win.BUTTON_POSITION_CANCEL;
 
     win.Scratchpad.close(function() {
       ok(!win.closed, "cancelling dialog shouldn't close scratchpad");
       win.close();
       done();
@@ -113,21 +139,21 @@ function testCancelAfterLoad()
 
       win.Scratchpad.editor.dirty = false;
       win.close();
       done();
     });
   }, {noFocus: true});
 }
 
-function testUnsavedFileSave()
+function testUnsavedFileSave(aCallback=function () {})
 {
   openScratchpad(function(win) {
     win.Scratchpad.importFromFile(gFile, true, function(status, content) {
-      win.Scratchpad.setFilename(gFile.path);
+      aCallback(win.Scratchpad, gFile.path);
 
       let text = "new text";
       win.Scratchpad.setText(text);
 
       promptButton = win.BUTTON_POSITION_SAVE;
 
       win.Scratchpad.close(function() {
         ok(win.closed, 'pressing "Save" in dialog should close scratchpad');
@@ -135,20 +161,20 @@ function testUnsavedFileSave()
           is(savedContent, text, 'prompted "Save" worked when closing scratchpad');
           done();
         });
       });
     });
   }, {noFocus: true});
 }
 
-function testUnsavedFileDontSave()
+function testUnsavedFileDontSave(aCallback=function () {})
 {
   openScratchpad(function(win) {
-    win.Scratchpad.setFilename(gFile.path);
+    aCallback(win.Scratchpad, gFile.path);
     win.Scratchpad.editor.dirty = true;
 
     promptButton = win.BUTTON_POSITION_DONT_SAVE;
 
     win.Scratchpad.close(function() {
       ok(win.closed, 'pressing "Don\'t Save" in dialog should close scratchpad');
       done();
     });
--- a/browser/devtools/scratchpad/test/browser_scratchpad_bug_669612_unsaved.js
+++ b/browser/devtools/scratchpad/test/browser_scratchpad_bug_669612_unsaved.js
@@ -1,11 +1,11 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */  
+   http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // only finish() when correct number of tests are done
 const expected = 4;
 var count = 0;
 function done()
 {
   if (++count == expected) {
     finish();
@@ -13,31 +13,31 @@ function done()
 }
 
 var ScratchpadManager = Scratchpad.ScratchpadManager;
 
 
 function test()
 {
   waitForExplicitFinish();
-  
+
   testListeners();
   testRestoreNotFromFile();
   testRestoreFromFileSaved();
   testRestoreFromFileUnsaved();
 
   gBrowser.selectedTab = gBrowser.addTab();
   content.location = "data:text/html,<p>test star* UI for unsaved file changes";
 }
 
 function testListeners()
 {
   openScratchpad(function(aWin, aScratchpad) {
     aScratchpad.setText("new text");
-    ok(!isStar(aWin), "no star if scratchpad isn't from a file");
+    ok(isStar(aWin), "show start if scratchpad text changes");
 
     aScratchpad.editor.dirty = false;
     ok(!isStar(aWin), "no star before changing text");
 
     aScratchpad.setFilename("foo.js");
     aScratchpad.setText("new text2");
     ok(isStar(aWin), "shows star if scratchpad text changes");
 
@@ -63,17 +63,17 @@ function testRestoreNotFromFile()
   let session = [{
     text: "test1",
     executionContext: 1
   }];
 
   let [win] = ScratchpadManager.restoreSession(session);
   openScratchpad(function(aWin, aScratchpad) {
     aScratchpad.setText("new text");
-    ok(!isStar(win), "no star if restored scratchpad isn't from a file");
+    ok(isStar(win), "show star if restored scratchpad isn't from a file");
 
     win.close();
     done();
   }, {window: win, noFocus: true});
 }
 
 function testRestoreFromFileSaved()
 {
--- a/browser/devtools/webconsole/test/browser_webconsole_bug_737873_mixedcontent.js
+++ b/browser/devtools/webconsole/test/browser_webconsole_bug_737873_mixedcontent.js
@@ -24,16 +24,17 @@ function onLoad(aEvent) {
 
 function testMixedContent(hud) {
   content.location = TEST_HTTPS_URI;
   var aOutputNode = hud.outputNode;
 
   waitForSuccess(
     {
       name: "mixed content warning displayed successfully",
+      timeout: 20000,
       validatorFn: function() {
         return ( aOutputNode.querySelector(".webconsole-mixed-content") );
       },
 
       successFn: function() {
 
         //tests on the urlnode
         let node = aOutputNode.querySelector(".webconsole-mixed-content");
--- a/browser/devtools/webconsole/test/browser_webconsole_bug_782653_CSS_links_in_Style_Editor.js
+++ b/browser/devtools/webconsole/test/browser_webconsole_bug_782653_CSS_links_in_Style_Editor.js
@@ -37,109 +37,120 @@ function testViewSource(hud) {
     },
     failureFn: finishTest,
   });
 }
 
 function checkStyleEditorForSheetAndLine(aStyleSheetIndex, aLine, aCallback) {
 
   function doCheck(aEditor) {
-    if (aEditor.styleSheetIndex != aStyleSheetIndex) {
-      ok(false, "Correct Style Sheet was not selected.");
+    function checkLineAndCallback() {
+      info("In checkLineAndCallback()");
+      ok(aEditor.sourceEditor != null, "sourceeditor not null");
+      ok(aEditor.sourceEditor.getCaretPosition() != null, "position not null");
+      ok(aEditor.sourceEditor.getCaretPosition().line != null, "line not null");
+      is(aEditor.sourceEditor.getCaretPosition().line, aLine,
+         "Correct line is selected");
       if (aCallback) {
-        executeSoon(aCallback);
+        aCallback();
       }
+    }
+
+    ok(aEditor, "aEditor is defined.");
+
+    // Source-editor is already loaded, check the current line of caret.
+    if (aEditor.sourceEditor) {
+      if (aEditor.styleSheetIndex != SEC.selectedStyleSheetIndex) {
+        ok(false, "Correct Style Sheet was not selected.");
+        if (aCallback) {
+          executeSoon(aCallback);
+        }
+        return;
+      }
+
+      info("Correct Style Sheet is selected in the editor");
+      info("Editor is already loaded, check the current line of caret");
+      executeSoon(checkLineAndCallback);
       return;
     }
 
-    ok(true, "Correct Style Sheet is selected in the editor");
-
-    // Editor is already loaded, check the current line of caret.
-    if (aEditor.sourceEditor) {
-      ok(true, "Editor is already loaded, check the current line of caret");
-      executeSoon(function() {
-        ok(true, "Execute soon occured");
-        ok(aEditor.sourceEditor != null, "sourceeditor not null");
-        ok(aEditor.sourceEditor.getCaretPosition() != null, "position not null");
-        ok(aEditor.sourceEditor.getCaretPosition().line != null, "line not null");
-        is(aEditor.sourceEditor.getCaretPosition().line, aLine,
-           "Correct line is selected");
-        if (aCallback) {
-          aCallback();
-        }
-      });
-      return;
-    }
-
-    ok(true, "Editor is not loaded, waiting for it.");
-    ok(aEditor, "aEditor is defined.");
+    info("source editor is not loaded, waiting for it.");
     // Wait for source editor to be loaded.
     aEditor.addActionListener({
       onAttach: function onAttach() {
-        ok(true, "on attach happened");
+        info("on attach happened");
         aEditor.removeActionListener(this);
-        ok(true, "this removed");
+        info("this removed");
         executeSoon(function() {
-          ok(true, "execute soon");
-          ok(aEditor.sourceEditor != null, "sourceeditor not null");
-          ok(aEditor.sourceEditor.getCaretPosition() != null, "position not null");
-          ok(aEditor.sourceEditor.getCaretPosition().line != null, "line not null");
-          is(aEditor.sourceEditor.getCaretPosition().line, aLine,
-             "Correct line is selected");
-          if (aCallback) {
-            aCallback();
+          if (aEditor.styleSheetIndex != SEC.selectedStyleSheetIndex) {
+            ok(false, "Correct Style Sheet was not selected.");
+            if (aCallback) {
+              aCallback();
+            }
+            return;
           }
+          checkLineAndCallback()
         });
       }
     });
   }
 
   let SEC = styleEditorWin.styleEditorChrome;
   ok(SEC, "Syle Editor Chrome is defined properly while calling for [" +
           aStyleSheetIndex + ", " + aLine + "]");
 
   // Editors are not ready, so wait for them.
   if (!SEC.editors.length) {
+    info("Editor is not ready, waiting before doing check.");
     SEC.addChromeListener({
       onEditorAdded: function onEditorAdded(aChrome, aEditor) {
+        info("Editor loaded now. Removing listener and doing check.");
         aChrome.removeChromeListener(this);
-        doCheck(aEditor);
+        executeSoon(function() {
+          doCheck(aEditor);
+        });
       }
     });
   }
   // Execute soon so that selectedStyleSheetIndex has correct value.
   else {
-    executeSoon(function() {
-      let aEditor = SEC.editors[SEC.selectedStyleSheetIndex];
-      doCheck(aEditor);
-    });
+    info("Editor is defined, opening the desired editor for now and " +
+         "checking later if it is correct");
+    for (let aEditor of SEC.editors) {
+      if (aEditor.styleSheetIndex == aStyleSheetIndex) {
+        doCheck(aEditor);
+        break;
+      }
+    }
   }
 }
 
 let observer = {
   observe: function(aSubject, aTopic, aData) {
     if (aTopic != "domwindowopened") {
       return;
     }
     Services.ww.unregisterNotification(observer);
-    ok(true, "Style Editor window was opened in response to clicking " +
-             "the location node");
+    info("Style Editor window was opened in response to clicking " +
+         "the location node");
 
     executeSoon(function() {
       styleEditorWin = window.StyleEditor
                              .StyleEditorManager
                              .getEditorForWindow(content.window);
       ok(styleEditorWin, "Style Editor Window is defined");
-      styleEditorWin.addEventListener("load", function onStyleEditorWinLoad() {
-        styleEditorWin.removeEventListener("load", onStyleEditorWinLoad);
+      waitForFocus(function() {
+        //styleEditorWin.addEventListener("load", function onStyleEditorWinLoad() {
+          //styleEditorWin.removeEventListener("load", onStyleEditorWinLoad);
 
-        checkStyleEditorForSheetAndLine(0, 7, function() {
-          checkStyleEditorForSheetAndLine(1, 6, function() {
-            window.StyleEditor.toggle();
-            styleEditorWin = null;
-            finishTest();
+          checkStyleEditorForSheetAndLine(0, 7, function() {
+            checkStyleEditorForSheetAndLine(1, 6, function() {
+              window.StyleEditor.toggle();
+              styleEditorWin = null;
+              finishTest();
+            });
+            EventUtils.sendMouseEvent({ type: "click" }, nodes[1]);
           });
-          EventUtils.sendMouseEvent({ type: "click" }, nodes[1]);
-        });
-      });
+        //});
+      }, styleEditorWin);
     });
   }
 };
--- a/browser/locales/en-US/chrome/browser/devtools/debugger.dtd
+++ b/browser/locales/en-US/chrome/browser/devtools/debugger.dtd
@@ -11,17 +11,17 @@
   - A good criteria is the language in which you'd find the best
   - documentation on web development on the web. -->
 
 <!-- LOCALIZATION NOTE (debuggerMenu.label): This is the label for the
   -  application menu item that opens the debugger UI. -->
 <!ENTITY debuggerMenu.label2            "Debugger">
 
 <!-- LOCALIZATION NOTE (debuggerMenu.accesskey): This is accesskey for the
-  -  Tools meny entry of Debugger that opens the debugger UI. -->
+  -  Tools menu entry of Debugger that opens the debugger UI. -->
 <!ENTITY debuggerMenu.accesskey         "D">
 
 <!-- LOCALIZATION NOTE (remoteDebuggerMenu.label): This is the label for the
   -  application menu item that opens the remote debugger UI. -->
 <!ENTITY remoteDebuggerMenu.label       "Remote Debugger">
 
 <!-- LOCALIZATION NOTE (chromeDebuggerMenu.label): This is the label for the
   -  application menu item that opens the browser debugger UI. -->
--- a/browser/locales/en-US/chrome/browser/devtools/debugger.properties
+++ b/browser/locales/en-US/chrome/browser/devtools/debugger.properties
@@ -111,17 +111,17 @@ breakpointMenuItem.deleteSelf=Remove bre
 breakpointMenuItem.enableOthers=Enable others
 breakpointMenuItem.disableOthers=Disable others
 breakpointMenuItem.deleteOthers=Remove others
 breakpointMenuItem.enableAll=Enable all breakpoints
 breakpointMenuItem.disableAll=Disable all breakpoints
 breakpointMenuItem.deleteAll=Remove all breakpoints
 
 # LOCALIZATION NOTE (loadingText): The text that is displayed in the script
-# editor when the laoding process has started but there is no file to display
+# editor when the loading process has started but there is no file to display
 # yet.
 loadingText=Loading\u2026
 
 # LOCALIZATION NOTE (loadingError):
 # This is the error message that is displayed on failed attempts to load an
 # external resource file.
 # %1$S=URL, %2$S=status code
 loadingError=Error loading %1$S: %2$S
--- a/browser/locales/en-US/chrome/browser/devtools/gclicommands.properties
+++ b/browser/locales/en-US/chrome/browser/devtools/gclicommands.properties
@@ -99,23 +99,23 @@ screenshotDelayManual=The time to wait (
 # a dialog when the user is using this command.
 screenshotFullPageDesc=Entire webpage? (true/false)
 
 # LOCALIZATION NOTE (screenshotFullscreenManual) A fuller description of the
 # 'fullscreen' parameter to the 'screenshot' command, displayed when the user
 # asks for help on what it does.
 screenshotFullPageManual=True if the screenshot should also include parts of the webpage which are outside the current scrolled bounds.
 
-# LOCALIZATION NOTE (screenshotSelectorChromeConflict) Exception thwon when user
+# LOCALIZATION NOTE (screenshotSelectorChromeConflict) Exception thrown when user
 # tries to use 'selector' option along with 'chrome' option of the screenshot
 # command. Refer: https://bugzilla.mozilla.org/show_bug.cgi?id=659268#c7
 screenshotSelectorChromeConflict=selector option is not supported when chrome option is true
 
 # LOCALIZATION NOTE (screenshotGeneratedFilename) The auto generated filename
-# when no file name is provided. the first argument (%1$S) is the date string
+# when no file name is provided. The first argument (%1$S) is the date string
 # in yyyy-mm-dd format and the second argument (%2$S) is the time string
 # in HH.MM.SS format. Please don't add the extension here.
 screenshotGeneratedFilename=Screen Shot %1$S at %2$S
 
 # LOCALIZATION NOTE (screenshotErrorSavingToFile) Text displayed to user upon
 # encountering error while saving the screenshot to the file specified.
 screenshotErrorSavingToFile=Error saving to
 
@@ -136,21 +136,21 @@ screenshotCopied=Copied to clipboard.
 # command name, which is why it should be as short as possible.
 restartFirefoxDesc=Restart Firefox
 
 # LOCALIZATION NOTE (restartFirefoxNocacheDesc) A very short string to
 # describe the 'nocache' parameter to the 'restart' command, which is
 # displayed in a dialog when the user is using this command.
 restartFirefoxNocacheDesc=Disables loading content from cache upon restart
 
-# LOCALIZATION NOTE (restartFirefoxRequestCancelled) A string dispalyed to the
+# LOCALIZATION NOTE (restartFirefoxRequestCancelled) A string displayed to the
 # user when a scheduled restart has been aborted by the user.
 restartFirefoxRequestCancelled=Restart request cancelled by user.
 
-# LOCALIZATION NOTE (restartFirefoxRestarting) A string dispalyed to the
+# LOCALIZATION NOTE (restartFirefoxRestarting) A string displayed to the
 # user when a restart has been initiated without a delay.
 restartFirefoxRestarting=Restarting Firefox...
 
 # LOCALIZATION NOTE (inspectDesc) A very short description of the 'inspect'
 # command. See inspectManual for a fuller description of what it does. This
 # string is designed to be shown in a menu alongside the command name, which
 # is why it should be as short as possible.
 inspectDesc=Inspect a node
--- a/browser/locales/en-US/chrome/browser/devtools/webconsole.properties
+++ b/browser/locales/en-US/chrome/browser/devtools/webconsole.properties
@@ -58,17 +58,17 @@ jsPropertyInspectTitle=Inspect: %S
 # %2$02S = minutes, %3$02S = seconds, %4$03S = milliseconds.
 timestampFormat=%02S:%02S:%02S.%03S
 
 helperFuncUnsupportedTypeError=Can't call pprint on this type of object.
 NetworkPanel.label=Inspect Network Request
 # LOCALIZATION NOTE (NetworkPanel.deltaDurationMS):
 #
 # This string is used to show the duration between two network events (e.g
-# request and respones header or response header and response body).
+# request and response header or response header and response body).
 NetworkPanel.durationMS=%Sms
 # LOCALIZATION NOTE (NetworkPanel.imageSizeDeltaDurationMS):
 # This string is used to show the duration between the response header and the
 # response body event. It also shows the size of the received or cached image.
 #
 # The first %S is replace by the width of the inspected image.
 # The second %S is replaced by the height of the inspected image.
 # The third %S is replaced by the duration between the response header and the
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -557,16 +557,22 @@ using mozilla::dom::indexedDB::IDBWrappe
 using namespace mozilla;
 using namespace mozilla::dom;
 
 static NS_DEFINE_CID(kDOMSOF_CID, NS_DOM_SCRIPT_OBJECT_FACTORY_CID);
 
 static const char kDOMStringBundleURL[] =
   "chrome://global/locale/dom/dom.properties";
 
+#ifdef MOZ_DISABLE_DOMCRYPTO
+  static const bool domCryptoEnabled = false;
+#else
+  static const bool domCryptoEnabled = true;
+#endif
+
 // NOTE: DEFAULT_SCRIPTABLE_FLAGS and DOM_DEFAULT_SCRIPTABLE_FLAGS
 //       are defined in nsIDOMClassInfo.h.
 
 #define WINDOW_SCRIPTABLE_FLAGS                                               \
  (nsIXPCScriptable::WANT_GETPROPERTY |                                        \
   nsIXPCScriptable::WANT_PRECREATE |                                          \
   nsIXPCScriptable::WANT_FINALIZE |                                           \
   nsIXPCScriptable::WANT_ENUMERATE |                                          \
@@ -2365,17 +2371,18 @@ nsDOMClassInfo::RegisterExternalClasses(
   DOM_CLASSINFO_MAP_ENTRY(nsIDOMJSWindow)                                      \
   DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)                                   \
   DOM_CLASSINFO_MAP_ENTRY(nsIInlineEventHandlers)                              \
   DOM_CLASSINFO_MAP_CONDITIONAL_ENTRY(nsIDOMStorageIndexedDB,                  \
                                       _support_indexed_db)                     \
   DOM_CLASSINFO_MAP_CONDITIONAL_ENTRY(nsIDOMWindowPerformance,                 \
                                       nsGlobalWindow::HasPerformanceSupport()) \
   DOM_CLASSINFO_MAP_CONDITIONAL_ENTRY(nsITouchEventReceiver,                   \
-                                      nsDOMTouchEvent::PrefEnabled())
+                                      nsDOMTouchEvent::PrefEnabled())          \
+  DOM_CLASSINFO_MAP_CONDITIONAL_ENTRY(nsIWindowCrypto, domCryptoEnabled)
 
 nsresult
 nsDOMClassInfo::Init()
 {
   /* Errors that can trigger early returns are done first,
      otherwise nsDOMClassInfo is left in a half inited state. */
   MOZ_STATIC_ASSERT(sizeof(uintptr_t) == sizeof(void*),
                     "BAD! You'll need to adjust the size of uintptr_t to the "
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -1240,16 +1240,17 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget)
   NS_INTERFACE_MAP_ENTRY(nsPIDOMWindow)
   NS_INTERFACE_MAP_ENTRY(nsIDOMStorageIndexedDB)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
   NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
   NS_INTERFACE_MAP_ENTRY(nsIDOMWindowPerformance)
   NS_INTERFACE_MAP_ENTRY(nsITouchEventReceiver)
   NS_INTERFACE_MAP_ENTRY(nsIInlineEventHandlers)
+  NS_INTERFACE_MAP_ENTRY(nsIWindowCrypto)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Window)
   OUTER_WINDOW_ONLY
     NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   END_OUTER_WINDOW_ONLY
 NS_INTERFACE_MAP_END
 
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsGlobalWindow)
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -265,17 +265,18 @@ class nsGlobalWindow : public nsPIDOMWin
                        public nsIDOMEventTarget,
                        public nsIDOMStorageIndexedDB,
                        public nsSupportsWeakReference,
                        public nsIInterfaceRequestor,
                        public nsWrapperCache,
                        public PRCListStr,
                        public nsIDOMWindowPerformance,
                        public nsITouchEventReceiver,
-                       public nsIInlineEventHandlers
+                       public nsIInlineEventHandlers,
+                       public nsIWindowCrypto
 {
 public:
   friend class nsDOMMozURLProperty;
 
   typedef mozilla::TimeStamp TimeStamp;
   typedef mozilla::TimeDuration TimeDuration;
   typedef mozilla::dom::Navigator Navigator;
   typedef nsDataHashtable<nsUint64HashKey, nsGlobalWindow*> WindowByIdTable;
@@ -330,16 +331,19 @@ public:
   NS_DECL_NSIDOMEVENTTARGET
 
   // nsITouchEventReceiver
   NS_DECL_NSITOUCHEVENTRECEIVER
 
   // nsIInlineEventHandlers
   NS_DECL_NSIINLINEEVENTHANDLERS
 
+  // nsIWindowCrypto
+  NS_DECL_NSIWINDOWCRYPTO
+
   // nsPIDOMWindow
   virtual NS_HIDDEN_(nsPIDOMWindow*) GetPrivateRoot();
   virtual NS_HIDDEN_(void) ActivateOrDeactivate(bool aActivate);
   virtual NS_HIDDEN_(void) SetActive(bool aActive);
   virtual NS_HIDDEN_(void) SetIsBackground(bool aIsBackground);
   virtual NS_HIDDEN_(void) SetChromeEventHandler(nsIDOMEventTarget* aChromeEventHandler);
 
   virtual NS_HIDDEN_(void) SetInitialPrincipalToSubject();
--- a/dom/interfaces/base/nsIDOMWindow.idl
+++ b/dom/interfaces/base/nsIDOMWindow.idl
@@ -27,17 +27,17 @@ interface nsIDOMMozURLProperty : nsISupp
  * The nsIDOMWindow interface is the primary interface for a DOM
  * window object. It represents a single window object that may
  * contain child windows if the document in the window contains a
  * HTML frameset document or if the document contains iframe elements.
  *
  * @see <http://www.whatwg.org/html/#window>
  */
 
-[scriptable, uuid(43933989-912e-4b6a-b889-3c9fc9dd9ed4)]
+[scriptable, uuid(148ab425-5d38-40fd-9fe0-0eae9fed81df)]
 interface nsIDOMWindow : nsISupports
 {
   // the current browsing context
   readonly attribute nsIDOMWindow                       window;
 
   /* [replaceable] self */
   readonly attribute nsIDOMWindow                       self;
 
@@ -360,19 +360,16 @@ interface nsIDOMWindow : nsISupports
 
   /* [replaceable] content */
   readonly attribute nsIDOMWindow                       content;
 
   /* [replaceable] prompter */
   [noscript] readonly attribute nsIPrompt               prompter;
 
   readonly attribute boolean                            closed;
-  // http://wiki.whatwg.org/wiki/Crypto
-  readonly attribute nsIDOMCrypto                       crypto;
-  readonly attribute nsIDOMPkcs11                       pkcs11;
 
   // XXX Shouldn't this be in nsIDOMChromeWindow?
   /* [replaceable] controllers */
   readonly attribute nsIControllers                     controllers;
 
            attribute DOMString                          defaultStatus;
 
   readonly attribute float                              mozInnerScreenX;
@@ -512,14 +509,25 @@ interface nsIDOMWindow : nsISupports
 interface nsIDOMWindowPerformance : nsISupports
 {
   /**
    * A namespace to hold performance related data and statistics.
    */
   readonly attribute nsISupports performance;
 };
 
+[scriptable, uuid(2ed9ace1-172c-443f-b92f-c4f74bf8f2c5)]
+interface nsIWindowCrypto : nsISupports
+{
+  /**
+   * A namespace to hold crypto related data and statistics.
+   * http://wiki.whatwg.org/wiki/Crypto
+   */
+  readonly attribute nsIDOMCrypto                       crypto;
+  readonly attribute nsIDOMPkcs11                       pkcs11;
+};
+
 /**
  * Empty interface for compatibility with older versions.
  * @deprecated Use nsIDOMWindow instead
  */
 [scriptable, uuid(8da641ab-906a-456e-97f2-b77df4ca2d95)]
 interface nsIDOMWindowInternal : nsIDOMWindow {};
--- a/security/manager/ssl/src/nsNSSComponent.cpp
+++ b/security/manager/ssl/src/nsNSSComponent.cpp
@@ -479,17 +479,17 @@ nsNSSComponent::DispatchEventToWindow(ns
       DispatchEventToWindow(childWin, eventType, tokenName);
     }
   }
 
   // check if we've enabled smart card events on this window
   // NOTE: it's not an error to say that we aren't going to dispatch
   // the event.
   {
-    nsCOMPtr<nsIDOMWindow> domWindow = domWin;
+    nsCOMPtr<nsIWindowCrypto> domWindow = do_QueryInterface(domWin);
     if (!domWindow) {
       return NS_OK; // nope, it's not an internal window
     }
 
     nsCOMPtr<nsIDOMCrypto> crypto;
     domWindow->GetCrypto(getter_AddRefs(crypto));
     if (!crypto) {
       return NS_OK; // nope, it doesn't have a crypto property
--- a/toolkit/content/Troubleshoot.jsm
+++ b/toolkit/content/Troubleshoot.jsm
@@ -177,17 +177,17 @@ let dataProviders = {
   },
 
   graphics: function graphics(done) {
     function statusMsgForFeature(feature) {
       // We return an array because in the tryNewerDriver case we need to
       // include the suggested version, which the consumer likely needs to plug
       // into a format string from a localization file.  Rather than returning
       // a string in some cases and an array in others, return an array always.
-      let msg = ["no information"];
+      let msg = [""];
       try {
         var status = gfxInfo.getFeatureStatus(feature);
       }
       catch (e) {}
       switch (status) {
       case Ci.nsIGfxInfo.FEATURE_BLOCKED_DEVICE:
       case Ci.nsIGfxInfo.FEATURE_DISCOURAGED:
         msg = ["blockedGfxCard"];
@@ -284,21 +284,35 @@ let dataProviders = {
       }
       catch (e) {}
     }
 
     if (("direct2DEnabled" in data) && !data.direct2DEnabled)
       data.direct2DEnabledMessage =
         statusMsgForFeature(Ci.nsIGfxInfo.FEATURE_DIRECT2D);
 
+    let doc =
+      Cc["@mozilla.org/xmlextras/domparser;1"]
+      .createInstance(Ci.nsIDOMParser)
+      .parseFromString("<html/>", "text/html");
+
+    let canvas = doc.createElement("canvas");
+
+    let gl;
     try {
-      data.webglRenderer = gfxInfo.getWebGLParameter("full-renderer");
-    }
-    catch (e) {}
-    if (!("webglRenderer" in data)) {
+      gl = canvas.getContext("experimental-webgl");
+    } catch(e) {}
+
+    if (gl) {
+      let ext = gl.getExtension("WEBGL_debug_renderer_info");
+      // this extension is unconditionally available to chrome. No need to check.
+      data.webglRenderer = gl.getParameter(ext.UNMASKED_VENDOR_WEBGL)
+                           + " -- "
+                           + gl.getParameter(ext.UNMASKED_RENDERER_WEBGL);
+    } else {
       let feature =
 #ifdef XP_WIN
         // If ANGLE is not available but OpenGL is, we want to report on the
         // OpenGL feature, because that's what's going to get used.  In all
         // other cases we want to report on the ANGLE feature.
         gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_WEBGL_ANGLE) !=
           Ci.nsIGfxInfo.FEATURE_NO_INFO &&
         gfxInfo.getFeatureStatus(Ci.nsIGfxInfo.FEATURE_WEBGL_OPENGL) ==
--- a/toolkit/devtools/webconsole/test/test_cached_messages.html
+++ b/toolkit/devtools/webconsole/test/test_cached_messages.html
@@ -10,17 +10,18 @@
 </head>
 <body>
 <p>Test for cached messages</p>
 
 <script class="testbody" type="application/javascript;version=1.8">
 let expectedConsoleCalls = [];
 let expectedPageErrors = [];
 
-(function() {
+function doPageErrors()
+{
   Services.console.reset();
 
   expectedPageErrors = [
     {
       _type: "PageError",
       errorMessage: /fooColor/,
       sourceName: /.+/,
       category: "CSS Parser",
@@ -48,17 +49,17 @@ let expectedPageErrors = [];
   body.appendChild(container);
   container.textContent = "document.documentElement.style.color = 'fooColor';";
   body.removeChild(container);
 
   container = top.document.createElementNS(XHTML_NS, "script");
   body.appendChild(container);
   container.textContent = "document.doTheImpossible();";
   body.removeChild(container);
-})();
+}
 
 function doConsoleCalls()
 {
   top.console.log("foobarBaz-log", undefined);
   top.console.info("foobarBaz-info", null);
   top.console.warn("foobarBaz-warn", document.body);
 
   expectedConsoleCalls = [
@@ -88,28 +89,36 @@ function doConsoleCalls()
     },
   ];
 }
 </script>
 
 <script class="testbody" type="text/javascript;version=1.8">
 SimpleTest.waitForExplicitFinish();
 
-let consoleAPIListener;
-
+let consoleAPIListener, pageErrorListener;
 let consoleAPICalls = 0;
+let pageErrors = 0;
 
 let handlers = {
   onConsoleAPICall: function onConsoleAPICall()
   {
     consoleAPICalls++;
     if (consoleAPICalls == expectedConsoleCalls.length) {
       checkConsoleAPICache();
     }
   },
+
+  onPageError: function onPageError()
+  {
+    pageErrors++;
+    if (pageErrors == expectedPageErrors.length) {
+      testPageErrors();
+    }
+  },
 };
 
 function startTest()
 {
   removeEventListener("load", startTest);
 
   consoleAPIListener = new ConsoleAPIListener(top, handlers);
   consoleAPIListener.init();
@@ -137,21 +146,27 @@ function onCachedConsoleAPI(aState, aRes
   is(msgs.length, expectedConsoleCalls.length,
      "number of cached console messages");
 
   expectedConsoleCalls.forEach(function(aMessage, aIndex) {
     info("checking received cached message #" + aIndex);
     checkConsoleAPICall(msgs[aIndex], expectedConsoleCalls[aIndex]);
   });
 
-  closeDebugger(aState, testPageErrors);
+  closeDebugger(aState, function() {
+    pageErrorListener = new PageErrorListener(null, handlers);
+    pageErrorListener.init();
+    doPageErrors();
+  });
 }
 
 function testPageErrors()
 {
+  pageErrorListener.destroy();
+  pageErrorListener = null;
   attachConsole(["PageError"], onAttach2);
 }
 
 function onAttach2(aState, aResponse)
 {
   aState.client.getCachedMessages(["PageError"],
                                   onCachedPageErrors.bind(null, aState));
 }
--- a/toolkit/devtools/webconsole/test/test_file_uri.html
+++ b/toolkit/devtools/webconsole/test/test_file_uri.html
@@ -64,26 +64,29 @@ function onAttach(aState, aResponse)
 }
 
 function onFileActivity(aType, aPacket)
 {
   is(aPacket.from, gState.actor, "fileActivity actor");
 
   gState.dbgClient.removeListener("fileActivity", onFileActivity);
 
+  info("aPacket.uri: " + aPacket.uri);
   ok(/bug798764\.html$/.test(aPacket.uri), "file URI match");
 
   testEnd();
 }
 
 function testEnd()
 {
   if (gTmpFile) {
-    gTmpFile.remove(false);
-    gTmpFile = null;
+    SimpleTest.executeSoon(function() {
+      gTmpFile.remove(false);
+      gTmpFile = null;
+    });
   }
 
   if (gState) {
     closeDebugger(gState, function() {
       gState = null;
       SimpleTest.finish();
     });
   } else {
--- a/toolkit/mozapps/extensions/AddonLogging.jsm
+++ b/toolkit/mozapps/extensions/AddonLogging.jsm
@@ -64,17 +64,17 @@ function getStackDetails(aException) {
 
 function AddonLogger(aName) {
   this.name = aName;
 }
 
 AddonLogger.prototype = {
   name: null,
 
-  error: function(aStr, aException) {
+  error: function AddonLogger_error(aStr, aException) {
     let message = formatLogMessage("error", this.name, aStr, aException);
 
     let stack = getStackDetails(aException);
 
     let consoleMessage = Cc["@mozilla.org/scripterror;1"].
                          createInstance(Ci.nsIScriptError);
     consoleMessage.init(message, stack.sourceName, null, stack.lineNumber, 0,
                         Ci.nsIScriptError.errorFlag, "component javascript");
@@ -95,66 +95,66 @@ AddonLogger.prototype = {
       writer.writeString(tstamp.toLocaleFormat("%Y-%m-%d %H:%M:%S ") +
                          message + " at " + stack.sourceName + ":" +
                          stack.lineNumber + "\n");
       writer.close();
     }
     catch (e) { }
   },
 
-  warn: function(aStr, aException) {
+  warn: function AddonLogger_warn(aStr, aException) {
     let message = formatLogMessage("warn", this.name, aStr, aException);
 
     let stack = getStackDetails(aException);
 
     let consoleMessage = Cc["@mozilla.org/scripterror;1"].
                          createInstance(Ci.nsIScriptError);
     consoleMessage.init(message, stack.sourceName, null, stack.lineNumber, 0,
                         Ci.nsIScriptError.warningFlag, "component javascript");
     Services.console.logMessage(consoleMessage);
 
     if (gDebugLogEnabled)
       dump("*** " + message + "\n");
   },
 
-  log: function(aStr, aException) {
+  log: function AddonLogger_log(aStr, aException) {
     if (gDebugLogEnabled) {
       let message = formatLogMessage("log", this.name, aStr, aException);
       dump("*** " + message + "\n");
       Services.console.logStringMessage(message);
     }
   }
 };
 
 var LogManager = {
-  getLogger: function(aName, aTarget) {
+  getLogger: function LogManager_getLogger(aName, aTarget) {
     let logger = new AddonLogger(aName);
 
     if (aTarget) {
       ["error", "warn", "log"].forEach(function(name) {
         let fname = name.toUpperCase();
         delete aTarget[fname];
-        aTarget[fname] = function(aStr, aException) {
+        aTarget[fname] = function LogManager_targetName(aStr, aException) {
           logger[name](aStr, aException);
         };
       });
     }
 
     return logger;
   }
 };
 
 var PrefObserver = {
-  init: function() {
+  init: function PrefObserver_init() {
     Services.prefs.addObserver(PREF_LOGGING_ENABLED, this, false);
     Services.obs.addObserver(this, "xpcom-shutdown", false);
     this.observe(null, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, PREF_LOGGING_ENABLED);
   },
 
-  observe: function(aSubject, aTopic, aData) {
+  observe: function PrefObserver_observe(aSubject, aTopic, aData) {
     if (aTopic == "xpcom-shutdown") {
       Services.prefs.removeObserver(PREF_LOGGING_ENABLED, this);
       Services.obs.removeObserver(this, "xpcom-shutdown");
     }
     else if (aTopic == NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) {
       try {
         gDebugLogEnabled = Services.prefs.getBoolPref(PREF_LOGGING_ENABLED);
       }
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -39,17 +39,17 @@ var PREF_EM_CHECK_COMPATIBILITY;
 
 const TOOLKIT_ID                      = "toolkit@mozilla.org";
 
 const VALID_TYPES_REGEXP = /^[\w\-]+$/;
 
 Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
-XPCOMUtils.defineLazyGetter(this, "CertUtils", function() {
+XPCOMUtils.defineLazyGetter(this, "CertUtils", function certUtilsLazyGetter() {
   let certUtils = {};
   Components.utils.import("resource://gre/modules/CertUtils.jsm", certUtils);
   return certUtils;
 });
 
 
 var EXPORTED_SYMBOLS = [ "AddonManager", "AddonManagerPrivate" ];
 
@@ -57,17 +57,17 @@ const CATEGORY_PROVIDER_MODULE = "addon-
 
 // A list of providers to load by default
 const DEFAULT_PROVIDERS = [
   "resource://gre/modules/XPIProvider.jsm",
   "resource://gre/modules/LightweightThemeManager.jsm"
 ];
 
 ["LOG", "WARN", "ERROR"].forEach(function(aName) {
-  this.__defineGetter__(aName, function() {
+  this.__defineGetter__(aName, function logFuncGetter() {
     Components.utils.import("resource://gre/modules/AddonLogging.jsm");
 
     LogManager.getLogger("addons.manager", this);
     return this[aName];
   });
 }, this);
 
 /**
@@ -199,17 +199,17 @@ function AddonAuthor(aName, aURL) {
   this.url = aURL;
 }
 
 AddonAuthor.prototype = {
   name: null,
   url: null,
 
   // Returns the author's name, defaulting to the empty string
-  toString: function() {
+  toString: function AddonAuthor_toString() {
     return this.name || "";
   }
 }
 
 /**
  * This represents an screenshot for an add-on
  *
  * @param  aURL
@@ -243,17 +243,17 @@ AddonScreenshot.prototype = {
   width: null,
   height: null,
   thumbnailURL: null,
   thumbnailWidth: null,
   thumbnailHeight: null,
   caption: null,
 
   // Returns the screenshot URL, defaulting to the empty string
-  toString: function() {
+  toString: function AddonScreenshot_toString() {
     return this.url || "";
   }
 }
 
 
 /**
  * This represents a compatibility override for an addon.
  *
@@ -349,17 +349,17 @@ function AddonType(aID, aLocaleURI, aLoc
                                Cr.NS_ERROR_INVALID_ARG);
 
   this.id = aID;
   this.uiPriority = aUIPriority;
   this.viewType = aViewType;
   this.flags = aFlags;
 
   if (aLocaleURI) {
-    this.__defineGetter__("name", function() {
+    this.__defineGetter__("name", function nameGetter() {
       delete this.name;
       let bundle = Services.strings.createBundle(aLocaleURI);
       this.name = bundle.GetStringFromName(aLocaleKey.replace("%ID%", aID));
       return this.name;
     });
   }
   else {
     this.name = aLocaleKey;
@@ -386,56 +386,56 @@ var AddonManagerInternal = {
   addonListeners: [],
   typeListeners: [],
   providers: [],
   types: {},
   startupChanges: {},
 
   // A read-only wrapper around the types dictionary
   typesProxy: Proxy.create({
-    getOwnPropertyDescriptor: function(aName) {
+    getOwnPropertyDescriptor: function typesProxy_getOwnPropertyDescriptor(aName) {
       if (!(aName in AddonManagerInternal.types))
         return undefined;
 
       return {
         value: AddonManagerInternal.types[aName].type,
         writable: false,
         configurable: false,
         enumerable: true
       }
     },
 
-    getPropertyDescriptor: function(aName) {
+    getPropertyDescriptor: function typesProxy_getPropertyDescriptor(aName) {
       return this.getOwnPropertyDescriptor(aName);
     },
 
-    getOwnPropertyNames: function() {
+    getOwnPropertyNames: function typesProxy_getOwnPropertyNames() {
       return Object.keys(AddonManagerInternal.types);
     },
 
-    getPropertyNames: function() {
+    getPropertyNames: function typesProxy_getPropertyNames() {
       return this.getOwnPropertyNames();
     },
 
-    delete: function(aName) {
+    delete: function typesProxy_delete(aName) {
       // Not allowed to delete properties
       return false;
     },
 
-    defineProperty: function(aName, aProperty) {
+    defineProperty: function typesProxy_defineProperty(aName, aProperty) {
       // Ignore attempts to define properties
     },
 
-    fix: function() {
+    fix: function typesProxy_fix(){
       return undefined;
     },
 
     // Despite MDC's claims to the contrary, it is required that this trap
     // be defined
-    enumerate: function() {
+    enumerate: function typesProxy_enumerate() {
       // All properties are enumerable
       return this.getPropertyNames();
     }
   }),
 
   /**
    * Initializes the AddonManager, loading any known providers and initializing
    * them.
@@ -582,17 +582,17 @@ var AddonManagerInternal = {
 
           this.types[aType.id] = {
             type: aType,
             providers: [aProvider]
           };
 
           let typeListeners = this.typeListeners.slice(0);
           for (let listener of typeListeners) {
-            safeCall(function() {
+            safeCall(function listenerSafeCall() {
               listener.onTypeAdded(aType);
             });
           }
         }
         else {
           this.types[aType.id].providers.push(aProvider);
         }
       }, this);
@@ -618,24 +618,24 @@ var AddonManagerInternal = {
     while (pos < this.providers.length) {
       if (this.providers[pos] == aProvider)
         this.providers.splice(pos, 1);
       else
         pos++;
     }
 
     for (let type in this.types) {
-      this.types[type].providers = this.types[type].providers.filter(function(p) p != aProvider);
+      this.types[type].providers = this.types[type].providers.filter(function filterProvider(p) p != aProvider);
       if (this.types[type].providers.length == 0) {
         let oldType = this.types[type].type;
         delete this.types[type];
 
         let typeListeners = this.typeListeners.slice(0);
         for (let listener of typeListeners) {
-          safeCall(function() {
+          safeCall(function listenerSafeCall() {
             listener.onTypeRemoved(oldType);
           });
         }
       }
     }
 
     // If we're unregistering after startup call this provider's shutdown.
     if (gStarted)
@@ -839,17 +839,17 @@ var AddonManagerInternal = {
     uri = uri.replace(/%APP_OS%/g, Services.appinfo.OS);
     uri = uri.replace(/%APP_ABI%/g, xpcomABI);
     uri = uri.replace(/%APP_LOCALE%/g, getLocale());
     uri = uri.replace(/%CURRENT_APP_VERSION%/g, Services.appinfo.version);
 
     // Replace custom parameters (names of custom parameters must have at
     // least 3 characters to prevent lookups for something like %D0%C8)
     var catMan = null;
-    uri = uri.replace(/%(\w{3,})%/g, function(aMatch, aParam) {
+    uri = uri.replace(/%(\w{3,})%/g, function parameterReplace(aMatch, aParam) {
       if (!catMan) {
         catMan = Cc["@mozilla.org/categorymanager;1"].
                  getService(Ci.nsICategoryManager);
       }
 
       try {
         var contractID = catMan.getCategoryEntry(CATEGORY_UPDATE_PARAMS, aParam);
         var paramHandler = Cc[contractID].getService(Ci.nsIPropertyBag2);
@@ -906,18 +906,20 @@ var AddonManagerInternal = {
 
       pendingUpdates++;
       this.getAllAddons(function getAddonsCallback(aAddons) {
         // If there is a known hotfix then exclude it from the list of add-ons to update.
         var ids = [a.id for each (a in aAddons) if (a.id != hotfixID)];
 
         // Repopulate repository cache first, to ensure compatibility overrides
         // are up to date before checking for addon updates.
-        scope.AddonRepository.backgroundUpdateCheck(ids, function BUC_backgroundUpdateCheckCallback() {
-          AddonManagerInternal.updateAddonRepositoryData(function BUC_updateAddonCallback() {
+        scope.AddonRepository.backgroundUpdateCheck(
+                     ids, function BUC_backgroundUpdateCheckCallback() {
+          AddonManagerInternal.updateAddonRepositoryData(
+                                    function BUC_updateAddonCallback() {
 
             pendingUpdates += aAddons.length;
             aAddons.forEach(function BUC_forEachCallback(aAddon) {
               if (aAddon.id == hotfixID) {
                 notifyComplete();
                 return;
               }
 
@@ -961,35 +963,36 @@ var AddonManagerInternal = {
         id: hotfixID,
         version: hotfixVersion,
         userDisabled: false,
         appDisabled: false
       }, url);
 
       pendingUpdates++;
       Components.utils.import("resource://gre/modules/AddonUpdateChecker.jsm");
-      AddonUpdateChecker.checkForUpdates(hotfixID, "extension", null, url, {
-        onUpdateCheckComplete: function(aUpdates) {
+      AddonUpdateChecker.checkForUpdates(hotfixID, null, url, {
+        onUpdateCheckComplete: function BUC_onUpdateCheckComplete(aUpdates) {
           let update = AddonUpdateChecker.getNewestCompatibleUpdate(aUpdates);
           if (!update) {
             notifyComplete();
             return;
           }
 
           // If the available version isn't newer than the last installed
           // version then ignore it.
           if (Services.vc.compare(hotfixVersion, update.version) >= 0) {
             notifyComplete();
             return;
           }
 
           LOG("Downloading hotfix version " + update.version);
-          AddonManager.getInstallForURL(update.updateURL, function(aInstall) {
+          AddonManager.getInstallForURL(update.updateURL,
+                                       function BUC_getInstallForURL(aInstall) {
             aInstall.addListener({
-              onDownloadEnded: function(aInstall) {
+              onDownloadEnded: function BUC_onDownloadEnded(aInstall) {
                 try {
                   if (!Services.prefs.getBoolPref(PREF_EM_CERT_CHECKATTRIBUTES))
                     return;
                 }
                 catch (e) {
                   // By default don't do certificate checks.
                   return;
                 }
@@ -1000,23 +1003,23 @@ var AddonManagerInternal = {
                 }
                 catch (e) {
                   WARN("The hotfix add-on was not signed by the expected " +
                        "certificate and so will not be installed.");
                   aInstall.cancel();
                 }
               },
 
-              onInstallEnded: function(aInstall) {
+              onInstallEnded: function BUC_onInstallEnded(aInstall) {
                 // Remember the last successfully installed version.
                 Services.prefs.setCharPref(PREF_EM_HOTFIX_LASTVERSION,
                                            aInstall.version);
               },
 
-              onInstallCancelled: function(aInstall) {
+              onInstallCancelled: function BUC_onInstallCancelled(aInstall) {
                 // Revert to the previous version if the installation was
                 // cancelled.
                 Services.prefs.setCharPref(PREF_EM_HOTFIX_LASTVERSION,
                                            hotfixVersion);
               }
             });
 
             aInstall.install();
@@ -1084,17 +1087,18 @@ var AddonManagerInternal = {
                                  Cr.NS_ERROR_INVALID_ARG);
 
     if (gStartupComplete)
       return;
 
     if (!(aType in this.startupChanges))
       return;
 
-    this.startupChanges[aType] = this.startupChanges[aType].filter(function(aItem) aItem != aID);
+    this.startupChanges[aType] = this.startupChanges[aType].filter(
+                                 function filterItem(aItem) aItem != aID);
   },
 
   /**
    * Calls all registered AddonManagerListeners with an event. Any parameters
    * after the method parameter are passed to the listener.
    *
    * @param  aMethod
    *         The method on the listeners to call
@@ -1125,17 +1129,18 @@ var AddonManagerInternal = {
    * the extraListeners parameter are passed to the listener.
    *
    * @param  aMethod
    *         The method on the listeners to call
    * @param  aExtraListeners
    *         An optional array of extra InstallListeners to also call
    * @return false if any of the listeners returned false, true otherwise
    */
-  callInstallListeners: function AMI_callInstallListeners(aMethod, aExtraListeners, ...aArgs) {
+  callInstallListeners: function AMI_callInstallListeners(aMethod, 
+                                 aExtraListeners, ...aArgs) {
     if (!gStarted)
       throw Components.Exception("AddonManager is not initialized",
                                  Cr.NS_ERROR_NOT_INITIALIZED);
 
     if (!aMethod || typeof aMethod != "string")
       throw Components.Exception("aMethod must be a non-empty string",
                                  Cr.NS_ERROR_INVALID_ARG);
 
@@ -1246,23 +1251,23 @@ var AddonManagerInternal = {
       throw Components.Exception("AddonManager is not initialized",
                                  Cr.NS_ERROR_NOT_INITIALIZED);
 
     if (typeof aCallback != "function")
       throw Components.Exception("aCallback must be a function",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     new AsyncObjectCaller(this.providers, "updateAddonRepositoryData", {
-      nextObject: function(aCaller, aProvider) {
+      nextObject: function updateAddonRepositoryData_nextObject(aCaller, aProvider) {
         callProvider(aProvider,
                      "updateAddonRepositoryData",
                      null,
                      aCaller.callNext.bind(aCaller));
       },
-      noMoreObjects: function(aCaller) {
+      noMoreObjects: function updateAddonRepositoryData_noMoreObjects(aCaller) {
         safeCall(aCallback);
       }
     });
   },
 
   /**
    * Asynchronously gets an AddonInstall for a URL.
    *
@@ -1329,17 +1334,17 @@ var AddonManagerInternal = {
       throw Components.Exception("aLoadGroup must be a nsILoadGroup or null",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     let providers = this.providers.slice(0);
     for (let provider of providers) {
       if (callProvider(provider, "supportsMimetype", false, aMimetype)) {
         callProvider(provider, "getInstallForURL", null,
                      aUrl, aHash, aName, aIcons, aVersion, aLoadGroup,
-                     function(aInstall) {
+                     function  getInstallForURL_safeCall(aInstall) {
           safeCall(aCallback, aInstall);
         });
         return;
       }
     }
     safeCall(aCallback, null);
   },
 
@@ -1367,27 +1372,27 @@ var AddonManagerInternal = {
       throw Components.Exception("aCallback must be a function",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     if (aMimetype && typeof aMimetype != "string")
       throw Components.Exception("aMimetype must be a string or null",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     new AsyncObjectCaller(this.providers, "getInstallForFile", {
-      nextObject: function(aCaller, aProvider) {
+      nextObject: function getInstallForFile_nextObject(aCaller, aProvider) {
         callProvider(aProvider, "getInstallForFile", null, aFile,
-                     function(aInstall) {
+                     function getInstallForFile_safeCall(aInstall) {
           if (aInstall)
             safeCall(aCallback, aInstall);
           else
             aCaller.callNext();
         });
       },
 
-      noMoreObjects: function(aCaller) {
+      noMoreObjects: function getInstallForFile_noMoreObjects(aCaller) {
         safeCall(aCallback, null);
       }
     });
   },
 
   /**
    * Asynchronously gets all current AddonInstalls optionally limiting to a list
    * of types.
@@ -1409,25 +1414,25 @@ var AddonManagerInternal = {
 
     if (typeof aCallback != "function")
       throw Components.Exception("aCallback must be a function",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     let installs = [];
 
     new AsyncObjectCaller(this.providers, "getInstallsByTypes", {
-      nextObject: function(aCaller, aProvider) {
+      nextObject: function getInstallsByTypes_nextObject(aCaller, aProvider) {
         callProvider(aProvider, "getInstallsByTypes", null, aTypes,
-                     function(aProviderInstalls) {
+                     function getInstallsByTypes_safeCall(aProviderInstalls) {
           installs = installs.concat(aProviderInstalls);
           aCaller.callNext();
         });
       },
 
-      noMoreObjects: function(aCaller) {
+      noMoreObjects: function getInstallsByTypes_noMoreObjects(aCaller) {
         safeCall(aCallback, installs);
       }
     });
   },
 
   /**
    * Asynchronously gets all current AddonInstalls.
    *
@@ -1584,17 +1589,18 @@ var AddonManagerInternal = {
    * @param  aListener
    *         The InstallListener to add
    */
   addInstallListener: function AMI_addInstallListener(aListener) {
     if (!aListener || typeof aListener != "object")
       throw Components.Exception("aListener must be a InstallListener object",
                                  Cr.NS_ERROR_INVALID_ARG);
     
-    if (!this.installListeners.some(function(i) { return i == aListener; }))
+    if (!this.installListeners.some(function addInstallListener_matchListener(i) {
+      return i == aListener; }))
       this.installListeners.push(aListener);
   },
 
   /**
    * Removes an InstallListener if the listener is registered.
    *
    * @param  aListener
    *         The InstallListener to remove
@@ -1631,26 +1637,27 @@ var AddonManagerInternal = {
       throw Components.Exception("aID must be a non-empty string",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     if (typeof aCallback != "function")
       throw Components.Exception("aCallback must be a function",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     new AsyncObjectCaller(this.providers, "getAddonByID", {
-      nextObject: function(aCaller, aProvider) {
-        callProvider(aProvider, "getAddonByID", null, aID, function(aAddon) {
+      nextObject: function getAddonByID_nextObject(aCaller, aProvider) {
+        callProvider(aProvider, "getAddonByID", null, aID,
+                    function getAddonByID_safeCall(aAddon) {
           if (aAddon)
             safeCall(aCallback, aAddon);
           else
             aCaller.callNext();
         });
       },
 
-      noMoreObjects: function(aCaller) {
+      noMoreObjects: function getAddonByID_noMoreObjects(aCaller) {
         safeCall(aCallback, null);
       }
     });
   },
 
   /**
    * Asynchronously get an add-on with a specific Sync GUID.
    *
@@ -1669,27 +1676,28 @@ var AddonManagerInternal = {
       throw Components.Exception("aGUID must be a non-empty string",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     if (typeof aCallback != "function")
       throw Components.Exception("aCallback must be a function",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     new AsyncObjectCaller(this.providers, "getAddonBySyncGUID", {
-      nextObject: function(aCaller, aProvider) {
-        callProvider(aProvider, "getAddonBySyncGUID", null, aGUID, function(aAddon) {
+      nextObject: function getAddonBySyncGUID_nextObject(aCaller, aProvider) {
+        callProvider(aProvider, "getAddonBySyncGUID", null, aGUID,
+                    function getAddonBySyncGUID_safeCall(aAddon) {
           if (aAddon) {
             safeCall(aCallback, aAddon);
           } else {
             aCaller.callNext();
           }
         });
       },
 
-      noMoreObjects: function(aCaller) {
+      noMoreObjects: function getAddonBySyncGUID_noMoreObjects(aCaller) {
         safeCall(aCallback, null);
       }
     });
   },
 
   /**
    * Asynchronously gets an array of add-ons.
    *
@@ -1710,24 +1718,25 @@ var AddonManagerInternal = {
 
     if (typeof aCallback != "function")
       throw Components.Exception("aCallback must be a function",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     let addons = [];
 
     new AsyncObjectCaller(aIDs, null, {
-      nextObject: function(aCaller, aID) {
-        AddonManagerInternal.getAddonByID(aID, function(aAddon) {
+      nextObject: function getAddonsByIDs_nextObject(aCaller, aID) {
+        AddonManagerInternal.getAddonByID(aID, 
+                             function getAddonsByIDs_getAddonByID(aAddon) {
           addons.push(aAddon);
           aCaller.callNext();
         });
       },
 
-      noMoreObjects: function(aCaller) {
+      noMoreObjects: function getAddonsByIDs_noMoreObjects(aCaller) {
         safeCall(aCallback, addons);
       }
     });
   },
 
   /**
    * Asynchronously gets add-ons of specific types.
    *
@@ -1748,25 +1757,25 @@ var AddonManagerInternal = {
 
     if (typeof aCallback != "function")
       throw Components.Exception("aCallback must be a function",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     let addons = [];
 
     new AsyncObjectCaller(this.providers, "getAddonsByTypes", {
-      nextObject: function(aCaller, aProvider) {
+      nextObject: function getAddonsByTypes_nextObject(aCaller, aProvider) {
         callProvider(aProvider, "getAddonsByTypes", null, aTypes,
-                     function(aProviderAddons) {
+                     function getAddonsByTypes_concatAddons(aProviderAddons) {
           addons = addons.concat(aProviderAddons);
           aCaller.callNext();
         });
       },
 
-      noMoreObjects: function(aCaller) {
+      noMoreObjects: function getAddonsByTypes_noMoreObjects(aCaller) {
         safeCall(aCallback, addons);
       }
     });
   },
 
   /**
    * Asynchronously gets all installed add-ons.
    *
@@ -1807,42 +1816,45 @@ var AddonManagerInternal = {
 
     if (typeof aCallback != "function")
       throw Components.Exception("aCallback must be a function",
                                  Cr.NS_ERROR_INVALID_ARG);
 
     let addons = [];
 
     new AsyncObjectCaller(this.providers, "getAddonsWithOperationsByTypes", {
-      nextObject: function(aCaller, aProvider) {
+      nextObject: function getAddonsWithOperationsByTypes_nextObject
+                           (aCaller, aProvider) {
         callProvider(aProvider, "getAddonsWithOperationsByTypes", null, aTypes,
-                     function(aProviderAddons) {
+                     function getAddonsWithOperationsByTypes_concatAddons
+                              (aProviderAddons) {
           addons = addons.concat(aProviderAddons);
           aCaller.callNext();
         });
       },
 
-      noMoreObjects: function(caller) {
+      noMoreObjects: function getAddonsWithOperationsByTypes_noMoreObjects(caller) {
         safeCall(aCallback, addons);
       }
     });
   },
 
   /**
    * Adds a new AddonManagerListener if the listener is not already registered.
    *
    * @param  aListener
    *         The listener to add
    */
   addManagerListener: function AMI_addManagerListener(aListener) {
     if (!aListener || typeof aListener != "object")
       throw Components.Exception("aListener must be an AddonManagerListener object",
                                  Cr.NS_ERROR_INVALID_ARG);
 
-    if (!this.managerListeners.some(function(i) { return i == aListener; }))
+    if (!this.managerListeners.some(function addManagerListener_matchListener(i) {
+      return i == aListener; }))
       this.managerListeners.push(aListener);
   },
 
   /**
    * Removes an AddonManagerListener if the listener is registered.
    *
    * @param  aListener
    *         The listener to remove
@@ -1867,17 +1879,18 @@ var AddonManagerInternal = {
    * @param  aListener
    *         The AddonListener to add
    */
   addAddonListener: function AMI_addAddonListener(aListener) {
     if (!aListener || typeof aListener != "object")
       throw Components.Exception("aListener must be an AddonListener object",
                                  Cr.NS_ERROR_INVALID_ARG);
 
-    if (!this.addonListeners.some(function(i) { return i == aListener; }))
+    if (!this.addonListeners.some(function addAddonListener_matchListener(i) {
+      return i == aListener; }))
       this.addonListeners.push(aListener);
   },
 
   /**
    * Removes an AddonListener if the listener is registered.
    *
    * @param  aListener
    *         The AddonListener to remove
@@ -1902,17 +1915,18 @@ var AddonManagerInternal = {
    * @param  aListener
    *         The TypeListener to add
    */
   addTypeListener: function AMI_addTypeListener(aListener) {
     if (!aListener || typeof aListener != "object")
       throw Components.Exception("aListener must be a TypeListener object",
                                  Cr.NS_ERROR_INVALID_ARG);
 
-    if (!this.typeListeners.some(function(i) { return i == aListener; }))
+    if (!this.typeListeners.some(function addTypeListener_matchListener(i) {
+      return i == aListener; }))
       this.typeListeners.push(aListener);
   },
 
   /**
    * Removes an TypeListener if the listener is registered.
    *
    * @param  aListener
    *         The TypeListener to remove
--- a/toolkit/mozapps/extensions/AddonRepository.jsm
+++ b/toolkit/mozapps/extensions/AddonRepository.jsm
@@ -1864,17 +1864,17 @@ var AddonDatabase = {
 
           getAllIcons();
         }
       });
     }
 
     function getAllIcons() {
       self.getAsyncStatement("getAllIcons").executeAsync({
-        handleResult: function(aResults) {
+        handleResult: function getAllIcons_handleResult(aResults) {
           let row = null;
           while (row = aResults.getNextRow()) {
             let addon_internal_id = row.getResultByName("addon_internal_id");
             if (!(addon_internal_id in addons)) {
               WARN("Found an icon not linked to an add-on in database");
               continue;
             }
 
@@ -1883,17 +1883,17 @@ var AddonDatabase = {
             addon.icons[size] = url;
             if (size == 32)
               addon.iconURL = url;
           }
         },
 
         handleError: self.asyncErrorLogger,
 
-        handleCompletion: function(aReason) {
+        handleCompletion: function getAllIcons_handleCompletion(aReason) {
           if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {
             ERROR("Error retrieving icons from database. Returning empty results");
             aCallback({});
             return;
           }
 
           let returnedAddons = {};
           for each (let addon in addons)
--- a/toolkit/mozapps/extensions/AddonUpdateChecker.jsm
+++ b/toolkit/mozapps/extensions/AddonUpdateChecker.jsm
@@ -30,27 +30,27 @@ Components.utils.import("resource://gre/
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
                                   "resource://gre/modules/AddonManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
                                   "resource://gre/modules/AddonRepository.jsm");
 
 // Shared code for suppressing bad cert dialogs.
-XPCOMUtils.defineLazyGetter(this, "CertUtils", function() {
+XPCOMUtils.defineLazyGetter(this, "CertUtils", function certUtilsLazyGetter() {
   let certUtils = {};
   Components.utils.import("resource://gre/modules/CertUtils.jsm", certUtils);
   return certUtils;
 });
 
 var gRDF = Cc["@mozilla.org/rdf/rdf-service;1"].
            getService(Ci.nsIRDFService);
 
 ["LOG", "WARN", "ERROR"].forEach(function(aName) {
-  this.__defineGetter__(aName, function() {
+  this.__defineGetter__(aName, function logFuncGetter() {
     Components.utils.import("resource://gre/modules/AddonLogging.jsm");
 
     LogManager.getLogger("addons.updates", this);
     return this[aName];
   });
 }, this);
 
 
@@ -220,26 +220,24 @@ RDFSerializer.prototype = {
   }
 }
 
 /**
  * Parses an RDF style update manifest into an array of update objects.
  *
  * @param  aId
  *         The ID of the add-on being checked for updates
- * @param  aType
- *         The type of the add-on being checked for updates
  * @param  aUpdateKey
  *         An optional update key for the add-on
  * @param  aRequest
  *         The XMLHttpRequest that has retrieved the update manifest
  * @return an array of update objects
  * @throws if the update manifest is invalid in any way
  */
-function parseRDFManifest(aId, aType, aUpdateKey, aRequest) {
+function parseRDFManifest(aId, aUpdateKey, aRequest) {
   function EM_R(aProp) {
     return gRDF.GetResource(PREFIX_NS_EM + aProp);
   }
 
   function getValue(aLiteral) {
     if (aLiteral instanceof Ci.nsIRDFLiteral)
       return aLiteral.Value;
     if (aLiteral instanceof Ci.nsIRDFResource)
@@ -378,28 +376,25 @@ function parseRDFManifest(aId, aType, aU
 }
 
 /**
  * Starts downloading an update manifest and then passes it to an appropriate
  * parser to convert to an array of update objects
  *
  * @param  aId
  *         The ID of the add-on being checked for updates
- * @param  aType
- *         The type of add-on being checked for updates
  * @param  aUpdateKey
  *         An optional update key for the add-on
  * @param  aUrl
  *         The URL of the update manifest
  * @param  aObserver
  *         An observer to pass results to
  */
-function UpdateParser(aId, aType, aUpdateKey, aUrl, aObserver) {
+function UpdateParser(aId, aUpdateKey, aUrl, aObserver) {
   this.id = aId;
-  this.type = aType;
   this.updateKey = aUpdateKey;
   this.observer = aObserver;
 
   this.timer = Cc["@mozilla.org/timer;1"].
                createInstance(Ci.nsITimer);
   this.timer.initWithCallback(this, TIMEOUT, Ci.nsITimer.TYPE_ONE_SHOT);
 
   let requireBuiltIn = true;
@@ -413,28 +408,27 @@ function UpdateParser(aId, aType, aUpdat
   try {
     this.request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].
                    createInstance(Ci.nsIXMLHttpRequest);
     this.request.open("GET", aUrl, true);
     this.request.channel.notificationCallbacks = new CertUtils.BadCertHandler(!requireBuiltIn);
     this.request.channel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
     this.request.overrideMimeType("text/xml");
     var self = this;
-    this.request.addEventListener("load", function(event) { self.onLoad() }, false);
-    this.request.addEventListener("error", function(event) { self.onError() }, false);
+    this.request.addEventListener("load", function loadEventListener(event) { self.onLoad() }, false);
+    this.request.addEventListener("error", function errorEventListener(event) { self.onError() }, false);
     this.request.send(null);
   }
   catch (e) {
     ERROR("Failed to request update manifest", e);
   }
 }
 
 UpdateParser.prototype = {
   id: null,
-  type: null,
   updateKey: null,
   observer: null,
   request: null,
   timer: null,
 
   /**
    * Called when the manifest has been successfully loaded.
    */
@@ -479,17 +473,17 @@ UpdateParser.prototype = {
       return;
     }
 
     // We currently only know about RDF update manifests
     if (xml.documentElement.namespaceURI == PREFIX_NS_RDF) {
       let results = null;
 
       try {
-        results = parseRDFManifest(this.id, this.type, this.updateKey, request);
+        results = parseRDFManifest(this.id, this.updateKey, request);
       }
       catch (e) {
         WARN(e);
         this.notifyError(AddonUpdateChecker.ERROR_PARSE_ERROR);
         return;
       }
       if ("onUpdateCheckComplete" in this.observer)
         this.observer.onUpdateCheckComplete(results);
@@ -710,22 +704,20 @@ var AddonUpdateChecker = {
     return newest;
   },
 
   /**
    * Starts an update check.
    *
    * @param  aId
    *         The ID of the add-on being checked for updates
-   * @param  aType
-   *         The type of add-on being checked for updates
    * @param  aUpdateKey
    *         An optional update key for the add-on
    * @param  aUrl
    *         The URL of the add-on's update manifest
    * @param  aObserver
    *         An observer to notify of results
    */
-  checkForUpdates: function AUC_checkForUpdates(aId, aType, aUpdateKey, aUrl,
+  checkForUpdates: function AUC_checkForUpdates(aId, aUpdateKey, aUrl,
                                                 aObserver) {
-    new UpdateParser(aId, aType, aUpdateKey, aUrl, aObserver);
+    new UpdateParser(aId, aUpdateKey, aUrl, aObserver);
   }
 };
--- a/toolkit/mozapps/extensions/ChromeManifestParser.jsm
+++ b/toolkit/mozapps/extensions/ChromeManifestParser.jsm
@@ -147,13 +147,13 @@ var ChromeManifestParser = {
   *
   * @param  aManifest
   *         Manifest data, as returned by ChromeManifestParser.parseSync().
   * @param  aType
   *         Instruction type to filter by.
   * @return True if any matching instructions were found in the manifest.
   */
   hasType: function CMP_hasType(aManifest, aType) {
-    return aManifest.some(function(aEntry) {
+    return aManifest.some(function hasType_matchEntryType(aEntry) {
       return aEntry.type == aType;
     });
   }
 };
--- a/toolkit/mozapps/extensions/LightweightThemeImageOptimizer.jsm
+++ b/toolkit/mozapps/extensions/LightweightThemeImageOptimizer.jsm
@@ -92,17 +92,17 @@ let ImageCropper = {
   _crop: function ImageCropper_crop(aURI, aTargetFile, aScreen, aOrigin) {
     let inProgress = this._inProgress;
     inProgress[aTargetFile.path] = true;
 
     function resetInProgress() {
       delete inProgress[aTargetFile.path];
     }
 
-    ImageFile.read(aURI, function (aInputStream, aContentType) {
+    ImageFile.read(aURI, function crop_readImageFile(aInputStream, aContentType) {
       if (aInputStream && aContentType) {
         let image = ImageTools.decode(aInputStream, aContentType);
         if (image && image.width && image.height) {
           let stream = ImageTools.encode(image, aScreen, aOrigin, aContentType);
           if (stream) {
             ImageFile.write(aTargetFile, stream, resetInProgress);
             return;
           }
@@ -111,29 +111,29 @@ let ImageCropper = {
 
       resetInProgress();
     });
   }
 };
 
 let ImageFile = {
   read: function ImageFile_read(aURI, aCallback) {
-    this._netUtil.asyncFetch(aURI, function (aInputStream, aStatus, aRequest) {
+    this._netUtil.asyncFetch(aURI, function read_asyncFetch(aInputStream, aStatus, aRequest) {
       if (Components.isSuccessCode(aStatus) && aRequest instanceof Ci.nsIChannel) {
         let channel = aRequest.QueryInterface(Ci.nsIChannel);
         aCallback(aInputStream, channel.contentType);
       } else {
         aCallback();
       }
     });
   },
 
   write: function ImageFile_write(aFile, aInputStream, aCallback) {
     let fos = FileUtils.openSafeFileOutputStream(aFile);
-    this._netUtil.asyncCopy(aInputStream, fos, function (aResult) {
+    this._netUtil.asyncCopy(aInputStream, fos, function write_asyncCopy(aResult) {
       FileUtils.closeSafeFileOutputStream(fos);
 
       // Remove the file if writing was not successful.
       if (!Components.isSuccessCode(aResult)) {
         try {
           aFile.remove(false);
         } catch (e) {}
       }
--- a/toolkit/mozapps/extensions/LightweightThemeManager.jsm
+++ b/toolkit/mozapps/extensions/LightweightThemeManager.jsm
@@ -37,33 +37,33 @@ const PERSIST_BYPASS_CACHE = false;
 const PERSIST_FILES = {
   headerURL: "lightweighttheme-header",
   footerURL: "lightweighttheme-footer"
 };
 
 XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer",
   "resource://gre/modules/LightweightThemeImageOptimizer.jsm");
 
-__defineGetter__("_prefs", function () {
+__defineGetter__("_prefs", function prefsGetter() {
   delete this._prefs;
   return this._prefs = Services.prefs.getBranch("lightweightThemes.");
 });
 
-__defineGetter__("_maxUsedThemes", function() {
+__defineGetter__("_maxUsedThemes", function maxUsedThemesGetter() {
   delete this._maxUsedThemes;
   try {
     this._maxUsedThemes = _prefs.getIntPref("maxUsedThemes");
   }
   catch (e) {
     this._maxUsedThemes = DEFAULT_MAX_USED_THEMES_COUNT;
   }
   return this._maxUsedThemes;
 });
 
-__defineSetter__("_maxUsedThemes", function(aVal) {
+__defineSetter__("_maxUsedThemes", function maxUsedThemesSetter(aVal) {
   delete this._maxUsedThemes;
   return this._maxUsedThemes = aVal;
 });
 
 // Holds the ID of the theme being enabled or disabled while sending out the
 // events so cached AddonWrapper instances can return correct values for
 // permissions and pendingOperations
 var _themeIDBeingEnabled = null;
@@ -103,30 +103,30 @@ var LightweightThemeManager = {
 
     return data;
   },
 
   set currentTheme (aData) {
     return _setCurrentTheme(aData, false);
   },
 
-  setLocalTheme: function (aData) {
+  setLocalTheme: function LightweightThemeManager_setLocalTheme(aData) {
     _setCurrentTheme(aData, true);
   },
 
-  getUsedTheme: function (aId) {
+  getUsedTheme: function LightweightThemeManager_getUsedTheme(aId) {
     var usedThemes = this.usedThemes;
     for (let usedTheme of usedThemes) {
       if (usedTheme.id == aId)
         return usedTheme;
     }
     return null;
   },
 
-  forgetUsedTheme: function (aId) {
+  forgetUsedTheme: function LightweightThemeManager_forgetUsedTheme(aId) {
     let theme = this.getUsedTheme(aId);
     if (!theme)
       return;
 
     let wrapper = new AddonWrapper(theme);
     AddonManagerPrivate.callAddonListeners("onUninstalling", wrapper, false);
 
     var currentTheme = this.currentTheme;
@@ -134,17 +134,17 @@ var LightweightThemeManager = {
       this.themeChanged(null);
       AddonManagerPrivate.notifyAddonChanged(null, ADDON_TYPE, false);
     }
 
     _updateUsedThemes(_usedThemesExceptId(aId));
     AddonManagerPrivate.callAddonListeners("onUninstalled", wrapper);
   },
 
-  previewTheme: function (aData) {
+  previewTheme: function LightweightThemeManager_previewTheme(aData) {
     if (!aData)
       return;
 
     let cancel = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
     cancel.data = false;
     Services.obs.notifyObservers(cancel, "lightweight-theme-preview-requested",
                                  JSON.stringify(aData));
     if (cancel.data)
@@ -156,33 +156,33 @@ var LightweightThemeManager = {
       _previewTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
     _previewTimer.initWithCallback(_previewTimerCallback,
                                    MAX_PREVIEW_SECONDS * 1000,
                                    _previewTimer.TYPE_ONE_SHOT);
 
     _notifyWindows(aData);
   },
 
-  resetPreview: function () {
+  resetPreview: function LightweightThemeManager_resetPreview() {
     if (_previewTimer) {
       _previewTimer.cancel();
       _previewTimer = null;
       _notifyWindows(this.currentThemeForDisplay);
     }
   },
 
-  parseTheme: function (aString, aBaseURI) {
+  parseTheme: function LightweightThemeManager_parseTheme(aString, aBaseURI) {
     try {
       return _sanitizeTheme(JSON.parse(aString), aBaseURI, false);
     } catch (e) {
       return null;
     }
   },
 
-  updateCurrentTheme: function () {
+  updateCurrentTheme: function LightweightThemeManager_updateCurrentTheme() {
     try {
       if (!_prefs.getBoolPref("update.enabled"))
         return;
     } catch (e) {
       return;
     }
 
     var theme = this.currentTheme;
@@ -192,17 +192,17 @@ var LightweightThemeManager = {
     var req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
                 .createInstance(Ci.nsIXMLHttpRequest);
 
     req.mozBackgroundRequest = true;
     req.overrideMimeType("text/plain");
     req.open("GET", theme.updateURL, true);
 
     var self = this;
-    req.addEventListener("load", function () {
+    req.addEventListener("load", function loadEventListener() {
       if (req.status != 200)
         return;
 
       let newData = self.parseTheme(req.responseText, theme.updateURL);
       if (!newData ||
           newData.id != theme.id ||
           _version(newData) == _version(theme))
         return;
@@ -216,76 +216,76 @@ var LightweightThemeManager = {
   },
 
   /**
    * Switches to a new lightweight theme.
    *
    * @param  aData
    *         The lightweight theme to switch to
    */
-  themeChanged: function(aData) {
+  themeChanged: function LightweightThemeManager_themeChanged(aData) {
     if (_previewTimer) {
       _previewTimer.cancel();
       _previewTimer = null;
     }
 
     if (aData) {
       let usedThemes = _usedThemesExceptId(aData.id);
       usedThemes.unshift(aData);
       _updateUsedThemes(usedThemes);
       if (PERSIST_ENABLED) {
         LightweightThemeImageOptimizer.purge();
-        _persistImages(aData, function () {
+        _persistImages(aData, function themeChanged_persistImages() {
           _notifyWindows(this.currentThemeForDisplay);
         }.bind(this));
       }
     }
 
     _prefs.setBoolPref("isThemeSelected", aData != null);
     _notifyWindows(aData);
     Services.obs.notifyObservers(null, "lightweight-theme-changed", null);
   },
 
   /**
    * Starts the Addons provider and enables the new lightweight theme if
    * necessary.
    */
-  startup: function() {
+  startup: function LightweightThemeManager_startup() {
     if (Services.prefs.prefHasUserValue(PREF_LWTHEME_TO_SELECT)) {
       let id = Services.prefs.getCharPref(PREF_LWTHEME_TO_SELECT);
       if (id)
         this.themeChanged(this.getUsedTheme(id));
       else
         this.themeChanged(null);
       Services.prefs.clearUserPref(PREF_LWTHEME_TO_SELECT);
     }
 
     _prefs.addObserver("", _prefObserver, false);
   },
 
   /**
    * Shuts down the provider.
    */
-  shutdown: function() {
+  shutdown: function LightweightThemeManager_shutdown() {
     _prefs.removeObserver("", _prefObserver);
   },
 
   /**
    * Called when a new add-on has been enabled when only one add-on of that type
    * can be enabled.
    *
    * @param  aId
    *         The ID of the newly enabled add-on
    * @param  aType
    *         The type of the newly enabled add-on
    * @param  aPendingRestart
    *         true if the newly enabled add-on will only become enabled after a
    *         restart
    */
-  addonChanged: function(aId, aType, aPendingRestart) {
+  addonChanged: function LightweightThemeManager_addonChanged(aId, aType, aPendingRestart) {
     if (aType != ADDON_TYPE)
       return;
 
     let id = _getInternalID(aId);
     let current = this.currentTheme;
 
     try {
       let next = Services.prefs.getCharPref(PREF_LWTHEME_TO_SELECT);
@@ -348,17 +348,17 @@ var LightweightThemeManager = {
   /**
    * Called to get an Addon with a particular ID.
    *
    * @param  aId
    *         The ID of the add-on to retrieve
    * @param  aCallback
    *         A callback to pass the Addon to
    */
-  getAddonByID: function(aId, aCallback) {
+  getAddonByID: function LightweightThemeManager_getAddonByID(aId, aCallback) {
     let id = _getInternalID(aId);
     if (!id) {
       aCallback(null);
       return;
      }
 
     let theme = this.getUsedTheme(id);
     if (!theme) {
@@ -372,141 +372,143 @@ var LightweightThemeManager = {
   /**
    * Called to get Addons of a particular type.
    *
    * @param  aTypes
    *         An array of types to fetch. Can be null to get all types.
    * @param  aCallback
    *         A callback to pass an array of Addons to
    */
-  getAddonsByTypes: function(aTypes, aCallback) {
+  getAddonsByTypes: function LightweightThemeManager_getAddonsByTypes(aTypes, aCallback) {
     if (aTypes && aTypes.indexOf(ADDON_TYPE) == -1) {
       aCallback([]);
       return;
     }
 
     aCallback([new AddonWrapper(a) for each (a in this.usedThemes)]);
   },
 };
 
 /**
  * The AddonWrapper wraps lightweight theme to provide the data visible to
  * consumers of the AddonManager API.
  */
 function AddonWrapper(aTheme) {
-  this.__defineGetter__("id", function() aTheme.id + ID_SUFFIX);
-  this.__defineGetter__("type", function() ADDON_TYPE);
-  this.__defineGetter__("isActive", function() {
+  this.__defineGetter__("id", function AddonWrapper_idGetter() aTheme.id + ID_SUFFIX);
+  this.__defineGetter__("type", function AddonWrapper_typeGetter() ADDON_TYPE);
+  this.__defineGetter__("isActive", function AddonWrapper_isActiveGetter() {
     let current = LightweightThemeManager.currentTheme;
     if (current)
       return aTheme.id == current.id;
     return false;
   });
 
-  this.__defineGetter__("name", function() aTheme.name);
-  this.__defineGetter__("version", function() {
+  this.__defineGetter__("name", function AddonWrapper_nameGetter() aTheme.name);
+  this.__defineGetter__("version", function AddonWrapper_versionGetter() {
     return "version" in aTheme ? aTheme.version : "";
   });
 
   ["description", "homepageURL", "iconURL"].forEach(function(prop) {
-    this.__defineGetter__(prop, function() {
+    this.__defineGetter__(prop, function AddonWrapper_optionalPropGetter() {
       return prop in aTheme ? aTheme[prop] : null;
     });
   }, this);
 
   ["installDate", "updateDate"].forEach(function(prop) {
-    this.__defineGetter__(prop, function() {
+    this.__defineGetter__(prop, function AddonWrapper_datePropGetter() {
       return prop in aTheme ? new Date(aTheme[prop]) : null;
     });
   }, this);
 
-  this.__defineGetter__("creator", function() {
+  this.__defineGetter__("creator", function AddonWrapper_creatorGetter() {
     return new AddonManagerPrivate.AddonAuthor(aTheme.author);
   });
 
-  this.__defineGetter__("screenshots", function() {
+  this.__defineGetter__("screenshots", function AddonWrapper_screenshotsGetter() {
     let url = aTheme.previewURL;
     return [new AddonManagerPrivate.AddonScreenshot(url)];
   });
 
-  this.__defineGetter__("pendingOperations", function() {
+  this.__defineGetter__("pendingOperations",
+                       function AddonWrapper_pendingOperationsGetter() {
     let pending = AddonManager.PENDING_NONE;
     if (this.isActive == this.userDisabled)
       pending |= this.isActive ? AddonManager.PENDING_DISABLE : AddonManager.PENDING_ENABLE;
     return pending;
   });
 
-  this.__defineGetter__("operationsRequiringRestart", function() {
+  this.__defineGetter__("operationsRequiringRestart", 
+               function AddonWrapper_operationsRequiringRestartGetter() {
     // If a non-default theme is in use then a restart will be required to
     // enable lightweight themes unless dynamic theme switching is enabled
     if (Services.prefs.prefHasUserValue(PREF_GENERAL_SKINS_SELECTEDSKIN)) {
       try {
         if (Services.prefs.getBoolPref(PREF_EM_DSS_ENABLED))
           return AddonManager.OP_NEEDS_RESTART_NONE;
       }
       catch (e) {
       }
       return AddonManager.OP_NEEDS_RESTART_ENABLE;
     }
 
     return AddonManager.OP_NEEDS_RESTART_NONE;
   });
 
-  this.__defineGetter__("size", function() {
+  this.__defineGetter__("size", function AddonWrapper_sizeGetter() {
     // The size changes depending on whether the theme is in use or not, this is
     // probably not worth exposing.
     return null;
   });
 
-  this.__defineGetter__("permissions", function() {
+  this.__defineGetter__("permissions", function AddonWrapper_permissionsGetter() {
     let permissions = AddonManager.PERM_CAN_UNINSTALL;
     if (this.userDisabled)
       permissions |= AddonManager.PERM_CAN_ENABLE;
     else
       permissions |= AddonManager.PERM_CAN_DISABLE;
     return permissions;
   });
 
-  this.__defineGetter__("userDisabled", function() {
+  this.__defineGetter__("userDisabled", function AddonWrapper_userDisabledGetter() {
     if (_themeIDBeingEnabled == aTheme.id)
       return false;
     if (_themeIDBeingDisbled == aTheme.id)
       return true;
 
     try {
       let toSelect = Services.prefs.getCharPref(PREF_LWTHEME_TO_SELECT);
       return aTheme.id != toSelect;
     }
     catch (e) {
       let current = LightweightThemeManager.currentTheme;
       return !current || current.id != aTheme.id;
     }
   });
 
-  this.__defineSetter__("userDisabled", function(val) {
+  this.__defineSetter__("userDisabled", function AddonWrapper_userDisabledSetter(val) {
     if (val == this.userDisabled)
       return val;
 
     if (val)
       LightweightThemeManager.currentTheme = null;
     else
       LightweightThemeManager.currentTheme = aTheme;
 
     return val;
   });
 
-  this.uninstall = function() {
+  this.uninstall = function AddonWrapper_uninstall() {
     LightweightThemeManager.forgetUsedTheme(aTheme.id);
   };
 
-  this.cancelUninstall = function() {
+  this.cancelUninstall = function AddonWrapper_cancelUninstall() {
     throw new Error("Theme is not marked to be uninstalled");
   };
 
-  this.findUpdates = function(listener, reason, appVersion, platformVersion) {
+  this.findUpdates = function AddonWrapper_findUpdates(listener, reason, appVersion, platformVersion) {
     if ("onNoCompatibilityUpdateAvailable" in listener)
       listener.onNoCompatibilityUpdateAvailable(this);
     if ("onNoUpdateAvailable" in listener)
       listener.onNoUpdateAvailable(this);
     if ("onUpdateFinished" in listener)
       listener.onUpdateFinished(this);
   };
 }
@@ -530,17 +532,17 @@ AddonWrapper.prototype = {
     return AddonManager.SCOPE_PROFILE;
   },
 
   get foreignInstall() {
     return false;
   },
 
   // Lightweight themes are always compatible
-  isCompatibleWith: function(appVersion, platformVersion) {
+  isCompatibleWith: function AddonWrapper_isCompatibleWith(appVersion, platformVersion) {
     return true;
   },
 
   // Lightweight themes are always securely updated
   get providesUpdatesSecurely() {
     return true;
   },
 
@@ -664,17 +666,18 @@ function _sanitizeTheme(aData, aBaseURI,
       continue;
     result[optionalProperty] = val;
   }
 
   return result;
 }
 
 function _usedThemesExceptId(aId)
-  LightweightThemeManager.usedThemes.filter(function (t) "id" in t && t.id != aId);
+  LightweightThemeManager.usedThemes.filter(
+       function usedThemesExceptId_filterID(t) "id" in t && t.id != aId);
 
 function _version(aThemeData)
   aThemeData.version || "";
 
 function _makeURI(aURL, aBaseURI)
   Services.io.newURI(aURL, null, aBaseURI);
 
 function _updateUsedThemes(aList) {
@@ -696,17 +699,17 @@ function _updateUsedThemes(aList) {
 
 function _notifyWindows(aThemeData) {
   Services.obs.notifyObservers(null, "lightweight-theme-styling-update",
                                JSON.stringify(aThemeData));
 }
 
 var _previewTimer;
 var _previewTimerCallback = {
-  notify: function () {
+  notify: function _previewTimerCallback_notify() {
     LightweightThemeManager.resetPreview();
   }
 };
 
 /**
  * Called when any of the lightweightThemes preferences are changed.
  */
 function _prefObserver(aSubject, aTopic, aData) {
@@ -769,21 +772,21 @@ function _persistImage(sourceURL, localF
        Ci.nsIWebBrowserPersist.PERSIST_FLAGS_FROM_CACHE);
 
   persist.progressListener = new _persistProgressListener(successCallback);
 
   persist.saveURI(sourceURI, null, null, null, null, targetURI, null);
 }
 
 function _persistProgressListener(successCallback) {
-  this.onLocationChange = function () {};
-  this.onProgressChange = function () {};
-  this.onStatusChange   = function () {};
-  this.onSecurityChange = function () {};
-  this.onStateChange    = function (aWebProgress, aRequest, aStateFlags, aStatus) {
+  this.onLocationChange = function persistProgressListener_onLocationChange() {};
+  this.onProgressChange = function persistProgressListener_onProgressChange() {};
+  this.onStatusChange   = function persistProgressListener_onStatusChange() {};
+  this.onSecurityChange = function persistProgressListener_onSecurityChange() {};
+  this.onStateChange    = function persistProgressListener_onStateChange(aWebProgress, aRequest, aStateFlags, aStatus) {
     if (aRequest &&
         aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK &&
         aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) {
       try {
         if (aRequest.QueryInterface(Ci.nsIHttpChannel).requestSucceeded) {
           // success
           successCallback();
           return;
--- a/toolkit/mozapps/extensions/Makefile.in
+++ b/toolkit/mozapps/extensions/Makefile.in
@@ -10,17 +10,17 @@ VPATH     = @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 ifeq (,$(filter aurora beta release esr,$(MOZ_UPDATE_CHANNEL)))
 DEFINES += -DMOZ_COMPATIBILITY_NIGHTLY=1
 endif
 
 # This is used in multiple places, so is defined here to avoid it getting
 # out of sync.
-DEFINES += -DMOZ_EXTENSIONS_DB_SCHEMA=13
+DEFINES += -DMOZ_EXTENSIONS_DB_SCHEMA=14
 
 # Additional debugging info is exposed in debug builds, or by setting the
 # MOZ_EM_DEBUG environment variable when building.
 ifneq (,$(MOZ_EM_DEBUG))
 DEFINES += -DMOZ_EM_DEBUG=1
 else ifdef MOZ_DEBUG
 DEFINES += -DMOZ_EM_DEBUG=1
 endif
--- a/toolkit/mozapps/extensions/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/XPIProvider.jsm
@@ -105,16 +105,25 @@ const PROP_TARGETAPP     = ["id", "minVe
 
 // Properties that should be migrated where possible from an old database. These
 // shouldn't include properties that can be read directly from install.rdf files
 // or calculated
 const DB_MIGRATE_METADATA= ["installDate", "userDisabled", "softDisabled",
                             "sourceURI", "applyBackgroundUpdates",
                             "releaseNotesURI", "isForeignInstall", "syncGUID"];
 
+// Note: When adding/changing/removing items here, remember to change the
+// DB schema version to ensure changes are picked up ASAP.
+const STATIC_BLOCKLIST_PATTERNS = [
+  { creator: "Mozilla Corp.",
+    level: Ci.nsIBlocklistService.STATE_BLOCKED,
+    blockID: "i162" }
+];
+
+
 const BOOTSTRAP_REASONS = {
   APP_STARTUP     : 1,
   APP_SHUTDOWN    : 2,
   ADDON_ENABLE    : 3,
   ADDON_DISABLE   : 4,
   ADDON_INSTALL   : 5,
   ADDON_UNINSTALL : 6,
   ADDON_UPGRADE   : 7,
@@ -175,16 +184,29 @@ function loadLazyObjects() {
 for (let name of LAZY_OBJECTS) {
   gGlobalScope.__defineGetter__(name, function lazyObjectGetter() {
     let objs = loadLazyObjects();
     return objs[name];
   });
 }
 
 
+function findMatchingStaticBlocklistItem(aAddon) {
+  for (let item of STATIC_BLOCKLIST_PATTERNS) {
+    if ("creator" in item && typeof item.creator == "string") {
+      if ((aAddon.defaultLocale && aAddon.defaultLocale.creator == item.creator) ||
+          (aAddon.selectedLocale && aAddon.selectedLocale.creator == item.creator)) {
+        return item;
+      }
+    }
+  }
+  return null;
+}
+
+
 /**
  * Sets permissions on a file
  *
  * @param  aFile
  *         The file or directory to operate on.
  * @param  aPermissions
  *         The permisions to set
  */
@@ -5303,17 +5325,17 @@ function UpdateChecker(aAddon, aListener
   const UPDATE_TYPE_COMPATIBILITY = 32;
   const UPDATE_TYPE_NEWVERSION = 64;
 
   aReason |= UPDATE_TYPE_COMPATIBILITY;
   if ("onUpdateAvailable" in this.listener)
     aReason |= UPDATE_TYPE_NEWVERSION;
 
   let url = escapeAddonURI(aAddon, updateURL, aReason, aAppVersion);
-  AddonUpdateChecker.checkForUpdates(aAddon.id, aAddon.type, aAddon.updateKey,
+  AddonUpdateChecker.checkForUpdates(aAddon.id, aAddon.updateKey,
                                      url, this);
 }
 
 UpdateChecker.prototype = {
   addon: null,
   listener: null,
   appVersion: null,
   platformVersion: null,
@@ -5585,22 +5607,32 @@ AddonInternal.prototype = {
         return targetApp;
       if (targetApp.id == TOOLKIT_ID)
         app = targetApp;
     }
     return app;
   },
 
   get blocklistState() {
+    let staticItem = findMatchingStaticBlocklistItem(this);
+    if (staticItem)
+      return staticItem.level;
+
     let bs = Cc["@mozilla.org/extensions/blocklist;1"].
              getService(Ci.nsIBlocklistService);
     return bs.getAddonBlocklistState(this.id, this.version);
   },
 
   get blocklistURL() {
+    let staticItem = findMatchingStaticBlocklistItem(this);
+    if (staticItem) {
+      let url = Services.urlFormatter.formatURLPref("extensions.blocklist.itemURL");
+      return url.replace(/%blockID%/g, staticItem.blockID);
+    }
+
     let bs = Cc["@mozilla.org/extensions/blocklist;1"].
              getService(Ci.nsIBlocklistService);
     return bs.getAddonBlocklistURL(this.id, this.version);
   },
 
   applyCompatibilityUpdate: function AddonInternal_applyCompatibilityUpdate(aUpdate, aSyncCompatibility) {
     this.targetApplications.forEach(function(aTargetApp) {
       aUpdate.targetApplications.forEach(function(aUpdateTarget) {
--- a/toolkit/mozapps/extensions/XPIProviderUtils.js
+++ b/toolkit/mozapps/extensions/XPIProviderUtils.js
@@ -13,17 +13,17 @@ Components.utils.import("resource://gre/
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
                                   "resource://gre/modules/AddonRepository.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 
 
 ["LOG", "WARN", "ERROR"].forEach(function(aName) {
-  this.__defineGetter__(aName, function() {
+  this.__defineGetter__(aName, function logFuncGetter () {
     Components.utils.import("resource://gre/modules/AddonLogging.jsm");
 
     LogManager.getLogger("addons.xpi-utils", this);
     return this[aName];
   })
 }, this);
 
 
@@ -77,17 +77,17 @@ const PROP_TARGETAPP     = ["id", "minVe
 const PREFIX_ITEM_URI                 = "urn:mozilla:item:";
 const RDFURI_ITEM_ROOT                = "urn:mozilla:item:root"
 const PREFIX_NS_EM                    = "http://www.mozilla.org/2004/em-rdf#";
 
 
 var XPIProvider;
 
 
-this.__defineGetter__("gRDF", function() {
+this.__defineGetter__("gRDF", function gRDFGetter() {
   delete this.gRDF;
   return this.gRDF = Cc["@mozilla.org/rdf/rdf-service;1"].
                      getService(Ci.nsIRDFService);
 });
 
 function EM_R(aProperty) {
   return gRDF.GetResource(PREFIX_NS_EM + aProperty);
 }
@@ -140,22 +140,22 @@ function AsyncAddonListCallback(aCallbac
 }
 
 AsyncAddonListCallback.prototype = {
   callback: null,
   complete: false,
   count: 0,
   addons: null,
 
-  handleResult: function(aResults) {
+  handleResult: function AsyncAddonListCallback_handleResult(aResults) {
     let row = null;
     while ((row = aResults.getNextRow())) {
       this.count++;
       let self = this;
-      XPIDatabase.makeAddonFromRowAsync(row, function(aAddon) {
+      XPIDatabase.makeAddonFromRowAsync(row, function handleResult_makeAddonFromRowAsync(aAddon) {
         function completeAddon(aRepositoryAddon) {
           aAddon._repositoryAddon = aRepositoryAddon;
           aAddon.compatibilityOverrides = aRepositoryAddon ?
                                             aRepositoryAddon.compatibilityOverrides :
                                             null;
           self.addons.push(aAddon);
           if (self.complete && self.addons.length == self.count)
            self.callback(self.addons);
@@ -166,17 +166,17 @@ AsyncAddonListCallback.prototype = {
         else
           completeAddon(null);
       });
     }
   },
 
   handleError: asyncErrorLogger,
 
-  handleCompletion: function(aReason) {
+  handleCompletion: function AsyncAddonListCallback_handleCompletion(aReason) {
     this.complete = true;
     if (this.addons.length == this.count)
       this.callback(this.addons);
   }
 };
 
 
 /**
@@ -851,22 +851,22 @@ var XPIDatabase = {
         Services.prefs.setBoolPref(PREF_PENDING_OPERATIONS, true);
 
       this.initialized = false;
       let connection = this.connection;
       delete this.connection;
 
       // Re-create the connection smart getter to allow the database to be
       // re-loaded during testing.
-      this.__defineGetter__("connection", function() {
+      this.__defineGetter__("connection", function connectionGetter() {
         this.openConnection(true);
         return this.connection;
       });
 
-      connection.asyncClose(function() {
+      connection.asyncClose(function shutdown_asyncClose() {
         LOG("Database closed");
         aCallback();
       });
     }
     else {
       if (aCallback)
         aCallback();
     }
@@ -1116,49 +1116,49 @@ var XPIDatabase = {
    *         The callback to call when the metadata is completely retrieved
    */
   fetchAddonMetadata: function XPIDB_fetchAddonMetadata(aAddon) {
     function readLocaleStrings(aLocale, aCallback) {
       let stmt = XPIDatabase.getStatement("_readLocaleStrings");
 
       stmt.params.id = aLocale.id;
       stmt.executeAsync({
-        handleResult: function(aResults) {
+        handleResult: function readLocaleStrings_handleResult(aResults) {
           let row = null;
           while ((row = aResults.getNextRow())) {
             let type = row.getResultByName("type");
             if (!(type in aLocale))
               aLocale[type] = [];
             aLocale[type].push(row.getResultByName("value"));
           }
         },
 
         handleError: asyncErrorLogger,
 
-        handleCompletion: function(aReason) {
+        handleCompletion: function readLocaleStrings_handleCompletion(aReason) {
           aCallback();
         }
       });
     }
 
     function readDefaultLocale() {
       delete aAddon.defaultLocale;
       let stmt = XPIDatabase.getStatement("_getDefaultLocale");
 
       stmt.params.id = aAddon._defaultLocale;
       stmt.executeAsync({
-        handleResult: function(aResults) {
+        handleResult: function readDefaultLocale_handleResult(aResults) {
           aAddon.defaultLocale = copyRowProperties(aResults.getNextRow(),
                                                    PROP_LOCALE_SINGLE);
           aAddon.defaultLocale.id = aAddon._defaultLocale;
         },
 
         handleError: asyncErrorLogger,
 
-        handleCompletion: function(aReason) {
+        handleCompletion: function readDefaultLocale_handleCompletion(aReason) {
           if (aAddon.defaultLocale) {
             readLocaleStrings(aAddon.defaultLocale, readLocales);
           }
           else {
             ERROR("Missing default locale for " + aAddon.id);
             readLocales();
           }
         }
@@ -1167,31 +1167,31 @@ var XPIDatabase = {
 
     function readLocales() {
       delete aAddon.locales;
       aAddon.locales = [];
       let stmt = XPIDatabase.getStatement("_getLocales");
 
       stmt.params.internal_id = aAddon._internal_id;
       stmt.executeAsync({
-        handleResult: function(aResults) {
+        handleResult: function readLocales_handleResult(aResults) {
           let row = null;
           while ((row = aResults.getNextRow())) {
             let locale = {
               id: row.getResultByName("id"),
               locales: [row.getResultByName("locale")]
             };
             copyRowProperties(row, PROP_LOCALE_SINGLE, locale);
             aAddon.locales.push(locale);
           }
         },
 
         handleError: asyncErrorLogger,
 
-        handleCompletion: function(aReason) {
+        handleCompletion: function readLocales_handleCompletion(aReason) {
           let pos = 0;
           function readNextLocale() {
             if (pos < aAddon.locales.length)
               readLocaleStrings(aAddon.locales[pos++], readNextLocale);
             else
               readTargetApplications();
           }
 
@@ -1202,46 +1202,46 @@ var XPIDatabase = {
 
     function readTargetApplications() {
       delete aAddon.targetApplications;
       aAddon.targetApplications = [];
       let stmt = XPIDatabase.getStatement("_getTargetApplications");
 
       stmt.params.internal_id = aAddon._internal_id;
       stmt.executeAsync({
-        handleResult: function(aResults) {
+        handleResult: function readTargetApplications_handleResult(aResults) {
           let row = null;
           while ((row = aResults.getNextRow()))
             aAddon.targetApplications.push(copyRowProperties(row, PROP_TARGETAPP));
         },
 
         handleError: asyncErrorLogger,
 
-        handleCompletion: function(aReason) {
+        handleCompletion: function readTargetApplications_handleCompletion(aReason) {
           readTargetPlatforms();
         }
       });
     }
 
     function readTargetPlatforms() {
       delete aAddon.targetPlatforms;
       aAddon.targetPlatforms = [];
       let stmt = XPIDatabase.getStatement("_getTargetPlatforms");
 
       stmt.params.internal_id = aAddon._internal_id;
       stmt.executeAsync({
-        handleResult: function(aResults) {
+        handleResult: function readTargetPlatforms_handleResult(aResults) {
           let row = null;
           while ((row = aResults.getNextRow()))
             aAddon.targetPlatforms.push(copyRowProperties(row, ["os", "abi"]));
         },
 
         handleError: asyncErrorLogger,
 
-        handleCompletion: function(aReason) {
+        handleCompletion: function readTargetPlatforms_handleCompletion(aReason) {
           let callbacks = aAddon._pendingCallbacks;
           delete aAddon._pendingCallbacks;
           callbacks.forEach(function(aCallback) {
             aCallback(aAddon);
           });
         }
       });
     }
@@ -1348,17 +1348,17 @@ var XPIDatabase = {
       aCallback(null);
       return;
     }
 
     let stmt = this.getStatement("getAddonInLocation");
 
     stmt.params.id = aId;
     stmt.params.location = aLocation;
-    stmt.executeAsync(new AsyncAddonListCallback(function(aAddons) {
+    stmt.executeAsync(new AsyncAddonListCallback(function getAddonInLocation_executeAsync(aAddons) {
       if (aAddons.length == 0) {
         aCallback(null);
         return;
       }
       // This should never happen but indicates invalid data in the database if
       // it does
       if (aAddons.length > 1)
         ERROR("Multiple addons with ID " + aId + " found in location " + aLocation);
@@ -1378,17 +1378,17 @@ var XPIDatabase = {
     if (!this.connection) {
       aCallback(null);
       return;
     }
 
     let stmt = this.getStatement("getVisibleAddonForID");
 
     stmt.params.id = aId;
-    stmt.executeAsync(new AsyncAddonListCallback(function(aAddons) {
+    stmt.executeAsync(new AsyncAddonListCallback(function getVisibleAddonForID_executeAsync(aAddons) {
       if (aAddons.length == 0) {
         aCallback(null);
         return;
       }
       // This should never happen but indicates invalid data in the database if
       // it does
       if (aAddons.length > 1)
         ERROR("Multiple visible addons with ID " + aId + " found");
@@ -1522,17 +1522,17 @@ var XPIDatabase = {
    *         A callback to pass the DBAddonInternal record to. Receives null
    *         if no add-on with that GUID is found.
    *
    */
   getAddonBySyncGUID: function XPIDB_getAddonBySyncGUID(aGUID, aCallback) {
     let stmt = this.getStatement("getAddonBySyncGUID");
     stmt.params.syncGUID = aGUID;
 
-    stmt.executeAsync(new AsyncAddonListCallback(function(aAddons) {
+    stmt.executeAsync(new AsyncAddonListCallback(function getAddonBySyncGUID_executeAsync(aAddons) {
       if (aAddons.length == 0) {
         aCallback(null);
         return;
       }
       aCallback(aAddons[0]);
     }));
   },
 
--- a/toolkit/mozapps/extensions/addonManager.js
+++ b/toolkit/mozapps/extensions/addonManager.js
@@ -89,46 +89,46 @@ amManager.prototype = {
 
     let installs = [];
     function buildNextInstall() {
       if (aUris.length == 0) {
         AddonManager.installAddonsFromWebpage(aMimetype, aWindow, aReferer, installs);
         return;
       }
       let uri = aUris.shift();
-      AddonManager.getInstallForURL(uri, function(aInstall) {
+      AddonManager.getInstallForURL(uri, function buildNextInstall_getInstallForURL(aInstall) {
         function callCallback(aUri, aStatus) {
           try {
             aCallback.onInstallEnded(aUri, aStatus);
           }
           catch (e) {
             Components.utils.reportError(e);
           }
         }
 
         if (aInstall) {
           installs.push(aInstall);
           if (aCallback) {
             aInstall.addListener({
-              onDownloadCancelled: function(aInstall) {
+              onDownloadCancelled: function buildNextInstall_onDownloadCancelled(aInstall) {
                 callCallback(uri, USER_CANCELLED);
               },
 
-              onDownloadFailed: function(aInstall) {
+              onDownloadFailed: function buildNextInstall_onDownloadFailed(aInstall) {
                 if (aInstall.error == AddonManager.ERROR_CORRUPT_FILE)
                   callCallback(uri, CANT_READ_ARCHIVE);
                 else
                   callCallback(uri, DOWNLOAD_ERROR);
               },
 
-              onInstallFailed: function(aInstall) {
+              onInstallFailed: function buildNextInstall_onInstallFailed(aInstall) {
                 callCallback(uri, EXECUTION_ERROR);
               },
 
-              onInstallEnded: function(aInstall, aStatus) {
+              onInstallEnded: function buildNextInstall_onInstallEnded(aInstall, aStatus) {
                 callCallback(uri, SUCCESS);
               }
             });
           }
         }
         else if (aCallback) {
           aCallback.onInstallEnded(uri, UNSUPPORTED_TYPE);
         }
@@ -145,17 +145,17 @@ amManager.prototype = {
   },
 
   /**
    * messageManager callback function.
    *
    * Listens to requests from child processes for InstallTrigger
    * activity, and sends back callbacks.
    */
-  receiveMessage: function(aMessage) {
+  receiveMessage: function AMC_receiveMessage(aMessage) {
     var payload = aMessage.json;
     var referer = Services.io.newURI(payload.referer, null, null);
     switch (aMessage.name) {
       case MSG_INSTALL_ENABLED:
         return this.isInstallEnabled(payload.mimetype, referer);
 
       case MSG_INSTALL_ADDONS:
         var callback = null;
@@ -186,17 +186,17 @@ amManager.prototype = {
         return this.installAddonsFromWebpage(payload.mimetype,
           window, referer, payload.uris, payload.hashes, payload.names,
           payload.icons, callback, payload.uris.length);
     }
   },
 
   classID: Components.ID("{4399533d-08d1-458c-a87a-235f74451cfa}"),
   _xpcom_factory: {
-    createInstance: function(aOuter, aIid) {
+    createInstance: function AMC_createInstance(aOuter, aIid) {
       if (aOuter != null)
         throw Components.Exception("Component does not support aggregation",
                                    Cr.NS_ERROR_NO_AGGREGATION);
   
       if (!gSingleton)
         gSingleton = new amManager();
       return gSingleton.QueryInterface(aIid);
     }
--- a/toolkit/mozapps/extensions/amContentHandler.js
+++ b/toolkit/mozapps/extensions/amContentHandler.js
@@ -71,17 +71,17 @@ amContentHandler.prototype = {
       manager.installAddonsFromWebpage(aMimetype, window, referer, [uri.spec],
                                        [null], [null], [null], null, 1);
     }
   },
 
   classID: Components.ID("{7beb3ba8-6ec3-41b4-b67c-da89b8518922}"),
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentHandler]),
 
-  log : function(aMsg) {
+  log : function XCH_log(aMsg) {
     let msg = "amContentHandler.js: " + (aMsg.join ? aMsg.join("") : aMsg);
     Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService).
       logStringMessage(msg);
     dump(msg + "\n");
   }
 };
 
 var NSGetFactory = XPCOMUtils.generateNSGetFactory([amContentHandler]);
--- a/toolkit/mozapps/extensions/amWebInstallListener.js
+++ b/toolkit/mozapps/extensions/amWebInstallListener.js
@@ -25,17 +25,17 @@ const URI_XPINSTALL_DIALOG = "chrome://m
 const READY_STATES = [
   AddonManager.STATE_AVAILABLE,
   AddonManager.STATE_DOWNLOAD_FAILED,
   AddonManager.STATE_INSTALL_FAILED,
   AddonManager.STATE_CANCELLED
 ];
 
 ["LOG", "WARN", "ERROR"].forEach(function(aName) {
-  this.__defineGetter__(aName, function() {
+  this.__defineGetter__(aName, function logFuncGetter() {
     Components.utils.import("resource://gre/modules/AddonLogging.jsm");
 
     LogManager.getLogger("addons.weblistener", this);
     return this[aName];
   });
 }, this);
 
 function notifyObservers(aTopic, aWindow, aUri, aInstalls) {
@@ -83,17 +83,17 @@ Installer.prototype = {
   window: null,
   downloads: null,
   installed: null,
   isDownloading: true,
 
   /**
    * Checks if all downloads are now complete and if so prompts to install.
    */
-  checkAllDownloaded: function() {
+  checkAllDownloaded: function Installer_checkAllDownloaded() {
     // Prevent re-entrancy caused by the confirmation dialog cancelling unwanted
     // installs.
     if (!this.isDownloading)
       return;
 
     var failed = [];
     var installs = [];
 
@@ -187,17 +187,17 @@ Installer.prototype = {
       notifyObservers("addon-install-cancelled", this.window, this.url,
                       this.downloads);
     }
   },
 
   /**
    * Checks if all installs are now complete and if so notifies observers.
    */
-  checkAllInstalled: function() {
+  checkAllInstalled: function Installer_checkAllInstalled() {
     var failed = [];
 
     for (let install of this.downloads) {
       switch(install.state) {
       case AddonManager.STATE_DOWNLOADED:
       case AddonManager.STATE_INSTALLING:
         // Exit early if any add-ons haven't started installing yet or are
         // still installing
@@ -213,42 +213,42 @@ Installer.prototype = {
     if (failed.length > 0)
       notifyObservers("addon-install-failed", this.window, this.url, failed);
 
     if (this.installed.length > 0)
       notifyObservers("addon-install-complete", this.window, this.url, this.installed);
     this.installed = null;
   },
 
-  onDownloadCancelled: function(aInstall) {
+  onDownloadCancelled: function Installer_onDownloadCancelled(aInstall) {
     aInstall.removeListener(this);
     this.checkAllDownloaded();
   },
 
-  onDownloadFailed: function(aInstall) {
+  onDownloadFailed: function Installer_onDownloadFailed(aInstall) {
     aInstall.removeListener(this);
     this.checkAllDownloaded();
   },
 
-  onDownloadEnded: function(aInstall) {
+  onDownloadEnded: function Installer_onDownloadEnded(aInstall) {
     this.checkAllDownloaded();
     return false;
   },
 
-  onInstallCancelled: function(aInstall) {
+  onInstallCancelled: function Installer_onInstallCancelled(aInstall) {
     aInstall.removeListener(this);
     this.checkAllInstalled();
   },
 
-  onInstallFailed: function(aInstall) {
+  onInstallFailed: function Installer_onInstallFailed(aInstall) {
     aInstall.removeListener(this);
     this.checkAllInstalled();
   },
 
-  onInstallEnded: function(aInstall) {
+  onInstallEnded: function Installer_onInstallEnded(aInstall) {
     aInstall.removeListener(this);
     this.installed.push(aInstall);
 
     // If installing a theme that is disabled and can be enabled then enable it
     if (aInstall.addon.type == "theme" &&
         aInstall.addon.userDisabled == true &&
         aInstall.addon.appDisabled == false) {
       aInstall.addon.userDisabled = false;
@@ -260,51 +260,51 @@ Installer.prototype = {
 
 function extWebInstallListener() {
 }
 
 extWebInstallListener.prototype = {
   /**
    * @see amIWebInstallListener.idl
    */
-  onWebInstallDisabled: function(aWindow, aUri, aInstalls) {
+  onWebInstallDisabled: function extWebInstallListener_onWebInstallDisabled(aWindow, aUri, aInstalls) {
     let info = {
       originatingWindow: aWindow,
       originatingURI: aUri,
       installs: aInstalls,
 
       QueryInterface: XPCOMUtils.generateQI([Ci.amIWebInstallInfo])
     };
     Services.obs.notifyObservers(info, "addon-install-disabled", null);
   },
 
   /**
    * @see amIWebInstallListener.idl
    */
-  onWebInstallBlocked: function(aWindow, aUri, aInstalls) {
+  onWebInstallBlocked: function extWebInstallListener_onWebInstallBlocked(aWindow, aUri, aInstalls) {
     let info = {
       originatingWindow: aWindow,
       originatingURI: aUri,
       installs: aInstalls,
 
-      install: function() {
+      install: function onWebInstallBlocked_install() {
         new Installer(this.originatingWindow, this.originatingURI, this.installs);
       },
 
       QueryInterface: XPCOMUtils.generateQI([Ci.amIWebInstallInfo])
     };
     Services.obs.notifyObservers(info, "addon-install-blocked", null);
 
     return false;
   },
 
   /**
    * @see amIWebInstallListener.idl
    */
-  onWebInstallRequested: function(aWindow, aUri, aInstalls) {
+  onWebInstallRequested: function extWebInstallListener_onWebInstallRequested(aWindow, aUri, aInstalls) {
     new Installer(aWindow, aUri, aInstalls);
 
     // We start the installs ourself
     return false;
   },
 
   classDescription: "XPI Install Handler",
   contractID: "@mozilla.org/addons/web-install-listener;1",
--- a/toolkit/mozapps/extensions/content/blocklist.js
+++ b/toolkit/mozapps/extensions/content/blocklist.js
@@ -21,17 +21,17 @@ function init() {
               createBundle("chrome://mozapps/locale/update/updates.properties");
   let cancelButton = document.documentElement.getButton("cancel");
   cancelButton.setAttribute("label", bundle.GetStringFromName("restartLaterButton"));
   cancelButton.setAttribute("accesskey",
                             bundle.GetStringFromName("restartLaterButton.accesskey"));
 
   var richlist = document.getElementById("addonList");
   var list = gArgs.list;
-  list.sort(function(a, b) { return String.localeCompare(a.name, b.name); });
+  list.sort(function listSort(a, b) { return String.localeCompare(a.name, b.name); });
   for (let listItem of list) {
     let item = document.createElement("richlistitem");
     item.setAttribute("name", listItem.name);
     item.setAttribute("version", listItem.version);
     item.setAttribute("icon", listItem.icon);
     if (listItem.blocked) {
       item.setAttribute("class", "hardBlockedAddon");
       hasHardBlocks = true;
--- a/toolkit/mozapps/extensions/content/extensions-content.js
+++ b/toolkit/mozapps/extensions/content/extensions-content.js
@@ -43,33 +43,33 @@ function createInstallTrigger(window) {
     SKIN: Ci.amIInstallTrigger.SKIN,
     LOCALE: Ci.amIInstallTrigger.LOCALE,
     CONTENT: Ci.amIInstallTrigger.CONTENT,
     PACKAGE: Ci.amIInstallTrigger.PACKAGE,
 
     /**
      * @see amIInstallTriggerInstaller.idl
      */
-    enabled: function() {
+    enabled: function createInstallTrigger_enabled() {
       return sendSyncMessage(MSG_INSTALL_ENABLED, {
         mimetype: "application/x-xpinstall", referer: this.url.spec
       })[0];
     },
 
     /**
      * @see amIInstallTriggerInstaller.idl
      */
-    updateEnabled: function() {
+    updateEnabled: function createInstallTrigger_updateEnabled() {
       return this.enabled();
     },
 
     /**
      * @see amIInstallTriggerInstaller.idl
      */
-    install: function(aArgs, aCallback) {
+    install: function createInstallTrigger_install(aArgs, aCallback) {
       if (!aArgs || typeof aArgs != "object")
         throw Components.Exception("Incorrect arguments passed to InstallTrigger.install()",
                                    Cr.NS_ERROR_INVALID_ARGS);
 
       var params = {
         installerId: this.installerId,
         mimetype: "application/x-xpinstall",
         referer: this.url.spec,
@@ -108,50 +108,50 @@ function createInstallTrigger(window) {
       params.callbackId = manager.addCallback(aCallback, params.uris);
       // Send message
       return sendSyncMessage(MSG_INSTALL_ADDONS, params)[0];
     },
 
     /**
      * @see amIInstallTriggerInstaller.idl
      */
-    startSoftwareUpdate: function(aUrl, aFlags) {
+    startSoftwareUpdate: function createInstallTrigger_startSoftwareUpdate(aUrl, aFlags) {
       var url = gIoService.newURI(aUrl, null, null)
                           .QueryInterface(Ci.nsIURL).filename;
       var object = {};
       object[url] = { "URL": aUrl };
       return this.install(object);
     },
 
     /**
      * @see amIInstallTriggerInstaller.idl
      */
-    installChrome: function(aType, aUrl, aSkin) {
+    installChrome: function createInstallTrigger_installChrome(aType, aUrl, aSkin) {
       return this.startSoftwareUpdate(aUrl);
     },
 
     /**
      * Resolves a URL in the context of our current window. We need to do
      * this before sending URLs to the parent process.
      *
      * @param  aUrl
      *         The url to resolve.
      *
      * @return A resolved, absolute nsURI object.
      */
-    resolveURL: function(aUrl) {
+    resolveURL: function createInstallTrigger_resolveURL(aUrl) {
       return gIoService.newURI(aUrl, null, this.url);
     },
 
     /**
      * @see amInstallTrigger.cpp
      * TODO: When e10s lands on m-c, consider removing amInstallTrigger.cpp
      *       See bug 571166
      */
-    checkLoadURIFromScript: function(aUri) {
+    checkLoadURIFromScript: function createInstallTrigger_checkLoadURIFromScript(aUri) {
       var secman = Cc["@mozilla.org/scriptsecuritymanager;1"].
                    getService(Ci.nsIScriptSecurityManager);
       var principal = this.window.document.nodePrincipal;
       try {
         secman.checkLoadURIWithPrincipal(principal, aUri,
           Ci.nsIScriptSecurityManager.DISALLOW_INHERIT_PRINCIPAL);
         return true;
       }
@@ -199,41 +199,41 @@ function InstallTriggerManager() {
   this.callbacks = {};
 
   addMessageListener(MSG_INSTALL_CALLBACK, this);
 
   try {
     // only if we live in a child process...
     if (Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).processType !== Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
       // ... propagate JAR cache flush notifications across process boundaries
-      addMessageListener(MSG_JAR_FLUSH, function(msg) {
+      addMessageListener(MSG_JAR_FLUSH, function jar_flushMessageListener(msg) {
         let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
         file.initWithPath(msg.json);
         Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService)
           .notifyObservers(file, "flush-cache-entry", null);
       });
     }
   } catch(e) {
     Cu.reportError(e);
   }
     
   addEventListener("DOMWindowCreated", this, false);
 
   var self = this;
-  addEventListener("unload", function() {
+  addEventListener("unload", function unloadEventListener() {
     // Clean up all references, to help gc work quickly
     self.callbacks = null;
   }, false);
 }
 
 InstallTriggerManager.prototype = {
-  handleEvent: function handleEvent(aEvent) {
+  handleEvent: function ITM_handleEvent(aEvent) {
     var window = aEvent.target.defaultView;
 
-    window.wrappedJSObject.__defineGetter__("InstallTrigger", function() {
+    window.wrappedJSObject.__defineGetter__("InstallTrigger", function installTriggerGetter() {
       // We do this in a getter, so that we create these objects
       // only on demand (this is a potential concern, since
       // otherwise we might add one per iframe, and keep them
       // alive for as long as the tab is alive).
 
       delete window.wrappedJSObject.InstallTrigger;
       var installTrigger = createInstallTrigger(window);
       window.wrappedJSObject.InstallTrigger = installTrigger;
@@ -250,17 +250,17 @@ InstallTriggerManager.prototype = {
    *         The callback function
    * @param  urls
    *         The urls this callback function will receive responses for.
    *         After all the callbacks have arrived, we can forget about the
    *         callback.
    *
    * @return The callback ID, an integer identifying this callback.
    */
-  addCallback: function(aCallback, aUrls) {
+  addCallback: function ITM_addCallback(aCallback, aUrls) {
     if (!aCallback || typeof aCallback != "function")
       return -1;
     var callbackId = 0;
     while (callbackId in this.callbacks)
       callbackId++;
     this.callbacks[callbackId] = {
       callback: aCallback,
       urls: aUrls.slice(0), // Clone the urls for our own use (it lets
@@ -274,17 +274,17 @@ InstallTriggerManager.prototype = {
    * Receives a message about a callback. Performs the actual callback
    * (for the callback with the ID we are given). When
    * all URLs are exhausted, can free the callbackId and linked stuff.
    *
    * @param  message
    *         The IPC message. Contains the callback ID.
    *
    */
-  receiveMessage: function(aMessage) {
+  receiveMessage: function ITM_receiveMessage(aMessage) {
     var payload = aMessage.json;
     var callbackId = payload.callbackId;
     var url = payload.url;
     var status = payload.status;
     var callbackObj = this.callbacks[callbackId];
     if (!callbackObj)
       return;
     try {
--- a/toolkit/mozapps/extensions/content/newaddon.js
+++ b/toolkit/mozapps/extensions/content/newaddon.js
@@ -8,17 +8,17 @@ const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/AddonManager.jsm");
 
 var gAddon = null;
 
 // If the user enables the add-on through some other UI close this window
 var EnableListener = {
-  onEnabling: function(aAddon) {
+  onEnabling: function EnableListener_onEnabling(aAddon) {
     if (aAddon.id == gAddon.id)
       window.close();
   }
 }
 AddonManager.addAddonListener(EnableListener);
 
 function initialize() {
   // About URIs don't implement nsIURL so we have to find the query string
@@ -33,17 +33,17 @@ function initialize() {
   let id = query.substring(3);
   if (!id) {
     window.location = "about:blank";
     return;
   }
 
   let bundle = Services.strings.createBundle("chrome://mozapps/locale/extensions/newaddon.properties");
 
-  AddonManager.getAddonByID(id, function(aAddon) {
+  AddonManager.getAddonByID(id, function initialize_getAddonByID(aAddon) {
     // If the add-on doesn't exist or it is already enabled or it cannot be
     // enabled then this UI is useless, just close it. This shouldn't normally
     // happen unless session restore restores the tab
     if (!aAddon || !aAddon.userDisabled ||
         !(aAddon.permissions & AddonManager.PERM_CAN_ENABLE)) {
       window.close();
       return;
     }
--- a/toolkit/mozapps/extensions/content/selectAddons.js
+++ b/toolkit/mozapps/extensions/content/selectAddons.js
@@ -57,28 +57,28 @@ var gAddons = {};
 
 var gChecking = {
   nodeID: "checking",
 
   _progress: null,
   _addonCount: 0,
   _completeCount: 0,
 
-  show: function() {
+  show: function gChecking_show() {
     showButtons(true, false, false, false);
     this._progress = document.getElementById("checking-progress");
 
     let self = this;
-    AddonManager.getAllAddons(function(aAddons) {
+    AddonManager.getAllAddons(function gChecking_getAllAddons(aAddons) {
       if (aAddons.length == 0) {
         window.close();
         return;
       }
 
-      aAddons = aAddons.filter(function(aAddon) {
+      aAddons = aAddons.filter(function gChecking_filterAddons(aAddon) {
         if (aAddon.type == "plugin")
           return false;
 
         if (aAddon.type == "theme") {
           // Don't show application shipped themes
           if (aAddon.scope == AddonManager.SCOPE_APPLICATION)
             return false;
           // Don't show already disabled themes
@@ -92,18 +92,18 @@ var gChecking = {
       self._addonCount = aAddons.length;
       self._progress.value = 0;
       self._progress.max = aAddons.length;
       self._progress.mode = "determined";
 
       // Ensure compatibility overrides are up to date before checking for
       // individual addon updates.
       let ids = [addon.id for each (addon in aAddons)];
-      AddonRepository.repopulateCache(ids, function() {
-        AddonManagerPrivate.updateAddonRepositoryData(function() {
+      AddonRepository.repopulateCache(ids, function gChecking_repopulateCache() {
+        AddonManagerPrivate.updateAddonRepositoryData(function gChecking_updateAddonRepositoryData() {
 
           for (let addonItem of aAddons) {
             // Ignore disabled themes
             if (addonItem.type != "theme" || !addonItem.userDisabled) {
               gAddons[addonItem.id] = {
                 addon: addonItem,
                 install: null,
                 wasActive: addonItem.isActive
@@ -112,32 +112,32 @@ var gChecking = {
 
             addonItem.findUpdates(self, AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
           }
         });
       });
     });
   },
 
-  onUpdateAvailable: function(aAddon, aInstall) {
+  onUpdateAvailable: function gChecking_onUpdateAvailable(aAddon, aInstall) {
     // If the add-on can be upgraded then remember the new version
     if (aAddon.permissions & AddonManager.PERM_CAN_UPGRADE)
       gAddons[aAddon.id].install = aInstall;
   },
 
-  onUpdateFinished: function(aAddon, aError) {
+  onUpdateFinished: function gChecking_onUpdateFinished(aAddon, aError) {
     this._completeCount++;
     this._progress.value = this._completeCount;
 
     if (this._completeCount < this._addonCount)
       return;
 
     var addons = [gAddons[id] for (id in gAddons)];
 
-    addons.sort(function(a, b) {
+    addons.sort(function sortAddons(a, b) {
       let orderA = orderForScope(a.addon.scope);
       let orderB = orderForScope(b.addon.scope);
 
       if (orderA != orderB)
         return orderA - orderB;
 
       return String.localeCompare(a.addon.name, b.addon.name);
     });
@@ -166,48 +166,48 @@ var gChecking = {
 
     showView(gSelect);
   }
 };
 
 var gSelect = {
   nodeID: "select",
 
-  show: function() {
+  show: function gSelect_show() {
     this.updateButtons();
   },
 
-  updateButtons: function() {
+  updateButtons: function gSelect_updateButtons() {
     for (let row = document.getElementById("select-rows").firstChild;
          row; row = row.nextSibling) {
       if (row.localName == "separator")
         continue;
 
       if (row.action) {
         showButtons(false, false, true, false);
         return;
       }
     }
 
     showButtons(false, false, false, true);
   },
 
-  next: function() {
+  next: function gSelect_next() {
     showView(gConfirm);
   },
 
-  done: function() {
+  done: function gSelect_done() {
     window.close();
   }
 };
 
 var gConfirm = {
   nodeID: "confirm",
 
-  show: function() {
+  show: function gConfirm_show() {
     showButtons(false, true, false, true);
 
     let box = document.getElementById("confirm-scrollbox").firstChild;
     while (box) {
       box.hidden = true;
       while (box.lastChild != box.firstChild)
         box.removeChild(box.lastChild);
       box = box.nextSibling;
@@ -234,25 +234,25 @@ var gConfirm = {
         item.setAttribute("active", "true");
       list.appendChild(item);
 
       if (action == "update")
         showButtons(false, true, true, false);
     }
   },
 
-  back: function() {
+  back: function gConfirm_back() {
     showView(gSelect);
   },
 
-  next: function() {
+  next: function gConfirm_next() {
     showView(gUpdate);
   },
 
-  done: function() {
+  done: function gConfirm_done() {
     for (let row = document.getElementById("select-rows").firstChild;
          row; row = row.nextSibling) {
       if (row.localName != "separator")
         row.apply();
     }
 
     window.close();
   }
@@ -261,83 +261,84 @@ var gConfirm = {
 var gUpdate = {
   nodeID: "update",
 
   _progress: null,
   _waitingCount: 0,
   _completeCount: 0,
   _errorCount: 0,
 
-  show: function() {
+  show: function gUpdate_show() {
     showButtons(true, false, false, false);
 
     this._progress = document.getElementById("update-progress");
 
     for (let row = document.getElementById("select-rows").firstChild;
          row; row = row.nextSibling) {
       if (row.localName != "separator")
         row.apply();
     }
 
     this._progress.mode = "determined";
     this._progress.max = this._waitingCount;
     this._progress.value = this._completeCount;
   },
 
-  checkComplete: function() {
+  checkComplete: function gUpdate_checkComplete() {
     this._progress.value = this._completeCount;
     if (this._completeCount < this._waitingCount)
       return;
 
     if (this._errorCount > 0) {
       showView(gErrors);
       return;
     }
 
     window.close();
   },
 
-  onDownloadStarted: function(aInstall) {
+  onDownloadStarted: function gUpdate_onDownloadStarted(aInstall) {
     this._waitingCount++;
   },
 
-  onDownloadFailed: function(aInstall) {
+  onDownloadFailed: function gUpdate_onDownloadFailed(aInstall) {
     this._errorCount++;
     this._completeCount++;
     this.checkComplete();
   },
 
-  onInstallFailed: function(aInstall) {
+  onInstallFailed: function gUpdate_onInstallFailed(aInstall) {
     this._errorCount++;
     this._completeCount++;
     this.checkComplete();
   },
 
-  onInstallEnded: function(aInstall) {
+  onInstallEnded: function gUpdate_onInstallEnded(aInstall) {
     this._completeCount++;
     this.checkComplete();
   }
 };
 
 var gErrors = {
   nodeID: "errors",
 
-  show: function() {
+  show: function gErrors_show() {
     showButtons(false, false, false, true);
   },
 
-  done: function() {
+  done: function gErrors_done() {
     window.close();
   }
 };
 
-window.addEventListener("load", function() { showView(gChecking); }, false);
+window.addEventListener("load", function loadEventListener() {
+                                         showView(gChecking); }, false);
 
 // When closing the window cancel any pending or in-progress installs
-window.addEventListener("unload", function() {
+window.addEventListener("unload", function unloadEventListener() {
   for (let id in gAddons) {
     let entry = gAddons[id];
     if (!entry.install)
       return;
 
     aEntry.install.removeListener(gUpdate);
 
     if (entry.install.state != AddonManager.STATE_INSTALLED &&
--- a/toolkit/mozapps/extensions/content/update.js
+++ b/toolkit/mozapps/extensions/content/update.js
@@ -31,17 +31,17 @@ var gUpdateWizard = {
   inactiveAddonIDs: [],
   // The add-ons that we found updates available for
   addonsToUpdate: [],
   shouldSuggestAutoChecking: false,
   shouldAutoCheck: false,
   xpinstallEnabled: true,
   xpinstallLocked: false,
 
-  init: function ()
+  init: function gUpdateWizard_init()
   {
     this.inactiveAddonIDs = window.arguments[0];
 
     try {
       this.shouldSuggestAutoChecking =
         !Services.prefs.getBoolPref(PREF_UPDATE_EXTENSIONS_ENABLED);
     }
     catch (e) {
@@ -55,62 +55,62 @@ var gUpdateWizard = {
     }
 
     if (Services.io.offline)
       document.documentElement.currentPage = document.getElementById("offline");
     else
       document.documentElement.currentPage = document.getElementById("versioninfo");
   },
 
-  onWizardFinish: function ()
+  onWizardFinish: function gUpdateWizard_onWizardFinish ()
   {
     if (this.shouldSuggestAutoChecking)
       Services.prefs.setBoolPref(PREF_UPDATE_EXTENSIONS_ENABLED, this.shouldAutoCheck);
   },
 
-  _setUpButton: function (aButtonID, aButtonKey, aDisabled)
+  _setUpButton: function gUpdateWizard_setUpButton(aButtonID, aButtonKey, aDisabled)
   {
     var strings = document.getElementById("updateStrings");
     var button = document.documentElement.getButton(aButtonID);
     if (aButtonKey) {
       button.label = strings.getString(aButtonKey);
       try {
         button.setAttribute("accesskey", strings.getString(aButtonKey + "Accesskey"));
       }
       catch (e) {
       }
     }
     button.disabled = aDisabled;
   },
 
-  setButtonLabels: function (aBackButton, aBackButtonIsDisabled,
+  setButtonLabels: function gUpdateWizard_setButtonLabels(aBackButton, aBackButtonIsDisabled,
                              aNextButton, aNextButtonIsDisabled,
                              aCancelButton, aCancelButtonIsDisabled)
   {
     this._setUpButton("back", aBackButton, aBackButtonIsDisabled);
     this._setUpButton("next", aNextButton, aNextButtonIsDisabled);
     this._setUpButton("cancel", aCancelButton, aCancelButtonIsDisabled);
   },
 
   /////////////////////////////////////////////////////////////////////////////
   // Update Errors
   errorItems: [],
 
-  checkForErrors: function (aElementIDToShow)
+  checkForErrors: function gUpdateWizard_checkForErrors(aElementIDToShow)
   {
     if (this.errorItems.length > 0)
       document.getElementById(aElementIDToShow).hidden = false;
   },
 
-  onWizardClose: function (aEvent)
+  onWizardClose: function gUpdateWizard_onWizardClose(aEvent)
   {
     return this.onWizardCancel();
   },
 
-  onWizardCancel: function ()
+  onWizardCancel: function gUpdateWizard_onWizardCancel()
   {
     if (!gInteruptable) {
       gPendingClose = true;
       this._setUpButton("back", null, true);
       this._setUpButton("next", null, true);
       this._setUpButton("cancel", null, true);
       return false;
     }
@@ -119,75 +119,75 @@ var gUpdateWizard = {
       gInstallingPage.cancelInstalls();
       return false;
     }
     return true;
   }
 };
 
 var gOfflinePage = {
-  onPageAdvanced: function ()
+  onPageAdvanced: function gOfflinePage_onPageAdvanced()
   {
     Services.io.offline = false;
     return true;
   },
 
-  toggleOffline: function ()
+  toggleOffline: function gOfflinePage_toggleOffline()
   {
     var nextbtn = document.documentElement.getButton("next");
     nextbtn.disabled = !nextbtn.disabled;
   }
 }
 
 var gVersionInfoPage = {
   _completeCount: 0,
   _totalCount: 0,
-  onPageShow: function ()
+  onPageShow: function gVersionInfoPage_onPageShow()
   {
     gUpdateWizard.setButtonLabels(null, true,
                                   "nextButtonText", true,
                                   "cancelButtonText", false);
 
     try {
       var hotfixID = Services.prefs.getCharPref(PREF_EM_HOTFIX_ID);
     }
     catch (e) { }
 
     // Retrieve all add-ons in order to sync their app compatibility information
-    AddonManager.getAllAddons(function(aAddons) {
-      gUpdateWizard.addons = aAddons.filter(function(a) {
+    AddonManager.getAllAddons(function gVersionInfoPage_getAllAddons(aAddons) {
+      gUpdateWizard.addons = aAddons.filter(function gVersionInfoPage_filterAddons(a) {
         return a.type != "plugin" && a.id != hotfixID;
       });
 
       gVersionInfoPage._totalCount = gUpdateWizard.addons.length;
 
       // Ensure compatibility overrides are up to date before checking for
       // individual addon updates.
       let ids = [addon.id for each (addon in gUpdateWizard.addons)];
 
       gInteruptable = false;
-      AddonRepository.repopulateCache(ids, function() {
-        AddonManagerPrivate.updateAddonRepositoryData(function() {
+      AddonRepository.repopulateCache(ids, function gVersionInfoPage_repolulateCache() {
+        AddonManagerPrivate.updateAddonRepositoryData(function gVersionInfoPage_updateAddonRepoData() {
           gInteruptable = true;
           if (gPendingClose) {
             window.close();
             return;
           }
 
           for (let addon of gUpdateWizard.addons)
             addon.findUpdates(gVersionInfoPage, AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
         });
       });
     });
   },
 
-  onAllUpdatesFinished: function() {
+  onAllUpdatesFinished: function gVersionInfoPage_onAllUpdatesFinished() {
     // Filter out any add-ons that were disabled before the application was
     // upgraded or are already compatible
-    gUpdateWizard.addons = gUpdateWizard.addons.filter(function(a) {
+    gUpdateWizard.addons = gUpdateWizard.addons.filter(function onAllUpdatesFinished_filterAddons(a) {
       return a.appDisabled && gUpdateWizard.inactiveAddonIDs.indexOf(a.id) < 0;
     });
 
     if (gUpdateWizard.addons.length > 0) {
       // There are still incompatible addons, inform the user.
       document.documentElement.currentPage = document.getElementById("mismatch");
     }
     else {
@@ -196,17 +196,17 @@ var gVersionInfoPage = {
       //XXX Bug 314754 - We need to use setTimeout to close the window due to
       // the EM using xmlHttpRequest when checking for updates.
       setTimeout(close, 0);
     }
   },
 
   /////////////////////////////////////////////////////////////////////////////
   // UpdateListener
-  onUpdateFinished: function(aAddon, status) {
+  onUpdateFinished: function gVersionInfoPage_onUpdateFinished(aAddon, status) {
     // If the add-on is now active then it won't have been disabled by startup
     if (aAddon.active)
       AddonManagerPrivate.removeStartupChange("disabled", aAddon.id);
 
     if (status != AddonManager.UPDATE_STATUS_NO_ERROR)
       gUpdateWizard.errorItems.push(aAddon);
 
     ++this._completeCount;
@@ -223,17 +223,17 @@ var gVersionInfoPage = {
     progress.value = Math.ceil((this._completeCount / this._totalCount) * 100);
 
     if (this._completeCount == this._totalCount)
       this.onAllUpdatesFinished();
   },
 };
 
 var gMismatchPage = {
-  onPageShow: function ()
+  onPageShow: function gMismatchPage_onPageShow()
   {
     gUpdateWizard.setButtonLabels(null, true,
                                   "mismatchCheckNow", false,
                                   "mismatchDontCheck", false);
     document.documentElement.getButton("next").focus();
 
     var incompatible = document.getElementById("mismatch.incompatible");
     for (let addon of gUpdateWizard.addons) {
@@ -242,17 +242,17 @@ var gMismatchPage = {
       incompatible.appendChild(listitem);
     }
   }
 };
 
 var gUpdatePage = {
   _totalCount: 0,
   _completeCount: 0,
-  onPageShow: function ()
+  onPageShow: function gUpdatePage_onPageShow()
   {
     if (!gUpdateWizard.xpinstallEnabled && gUpdateWizard.xpinstallLocked) {
       document.documentElement.currentPage = document.getElementById("adminDisabled");
       return;
     }
 
     gUpdateWizard.setButtonLabels(null, true,
                                   "nextButtonText", true,
@@ -261,30 +261,30 @@ var gUpdatePage = {
 
     gUpdateWizard.errorItems = [];
 
     this._totalCount = gUpdateWizard.addons.length;
     for (let addon of gUpdateWizard.addons)
       addon.findUpdates(this, AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
   },
 
-  onAllUpdatesFinished: function() {
+  onAllUpdatesFinished: function gUpdatePage_onAllUpdatesFinished() {
     var nextPage = document.getElementById("noupdates");
     if (gUpdateWizard.addonsToUpdate.length > 0)
       nextPage = document.getElementById("found");
     document.documentElement.currentPage = nextPage;
   },
 
   /////////////////////////////////////////////////////////////////////////////
   // UpdateListener
-  onUpdateAvailable: function(aAddon, aInstall) {
+  onUpdateAvailable: function gUpdatePage_onUpdateAvailable(aAddon, aInstall) {
     gUpdateWizard.addonsToUpdate.push(aInstall);
   },
 
-  onUpdateFinished: function(aAddon, status) {
+  onUpdateFinished: function gUpdatePage_onUpdateFinished(aAddon, status) {
     if (status != AddonManager.UPDATE_STATUS_NO_ERROR)
       gUpdateWizard.errorItems.push(aAddon);
 
     ++this._completeCount;
 
     // Update the status text and progress bar
     var updateStrings = document.getElementById("updateStrings");
     var status = document.getElementById("checking.status");
@@ -295,17 +295,17 @@ var gUpdatePage = {
     progress.value = Math.ceil((this._completeCount / this._totalCount) * 100);
 
     if (this._completeCount == this._totalCount)
       this.onAllUpdatesFinished()
   },
 };
 
 var gFoundPage = {
-  onPageShow: function ()
+  onPageShow: function gFoundPage_onPageShow()
   {
     gUpdateWizard.setButtonLabels(null, true,
                                   "installButtonText", false,
                                   null, false);
 
     var foundUpdates = document.getElementById("found.updates");
     var itemCount = gUpdateWizard.addonsToUpdate.length;
     for (let install of gUpdateWizard.addonsToUpdate) {
@@ -321,27 +321,27 @@ var gFoundPage = {
       document.documentElement.getButton("next").disabled = true;
     }
     else {
       document.documentElement.getButton("next").focus();
       document.documentElement.getButton("next").disabled = false;
     }
   },
 
-  toggleXPInstallEnable: function(aEvent)
+  toggleXPInstallEnable: function gFoundPage_toggleXPInstallEnable(aEvent)
   {
     var enabled = aEvent.target.checked;
     gUpdateWizard.xpinstallEnabled = enabled;
     var pref = Components.classes["@mozilla.org/preferences-service;1"]
                          .getService(Components.interfaces.nsIPrefBranch);
     pref.setBoolPref(PREF_XPINSTALL_ENABLED, enabled);
     this.updateNextButton();
   },
 
-  updateNextButton: function ()
+  updateNextButton: function gFoundPage_updateNextButton()
   {
     if (!gUpdateWizard.xpinstallEnabled) {
       document.documentElement.getButton("next").disabled = true;
       return;
     }
 
     var oneChecked = false;
     var foundUpdates = document.getElementById("found.updates");
@@ -363,17 +363,17 @@ var gFoundPage = {
 
 var gInstallingPage = {
   _installs         : [],
   _errors           : [],
   _strings          : null,
   _currentInstall   : -1,
   _installing       : false,
 
-  onPageShow: function ()
+  onPageShow: function gInstallingPage_onPageShow()
   {
     gUpdateWizard.setButtonLabels(null, true,
                                   "nextButtonText", true,
                                   null, true);
     this._errors = [];
 
     var foundUpdates = document.getElementById("found.updates");
     var updates = foundUpdates.getElementsByTagName("listitem");
@@ -383,17 +383,17 @@ var gInstallingPage = {
       this._installs.push(update.install);
     }
 
     this._strings = document.getElementById("updateStrings");
     this._installing = true;
     this.startNextInstall();
   },
 
-  startNextInstall: function() {
+  startNextInstall: function gInstallingPage_startNextInstall() {
     if (this._currentInstall >= 0) {
       this._installs[this._currentInstall].removeListener(this);
     }
 
     this._currentInstall++;
 
     if (this._installs.length == this._currentInstall) {
       this._installing = false;
@@ -402,89 +402,89 @@ var gInstallingPage = {
       document.documentElement.advance();
       return;
     }
 
     this._installs[this._currentInstall].addListener(this);
     this._installs[this._currentInstall].install();
   },
 
-  cancelInstalls: function() {
+  cancelInstalls: function gInstallingPage_cancelInstalls() {
     this._installs[this._currentInstall].removeListener(this);
     this._installs[this._currentInstall].cancel();
   },
 
   /////////////////////////////////////////////////////////////////////////////
   // InstallListener
-  onDownloadStarted: function(aInstall) {
+  onDownloadStarted: function gInstallingPage_onDownloadStarted(aInstall) {
     var strings = document.getElementById("updateStrings");
     var label = strings.getFormattedString("downloadingPrefix", [aInstall.name]);
     var actionItem = document.getElementById("actionItem");
     actionItem.value = label;
   },
 
-  onDownloadProgress: function(aInstall) {
+  onDownloadProgress: function gInstallingPage_onDownloadProgress(aInstall) {
     var downloadProgress = document.getElementById("downloadProgress");
     downloadProgress.value = Math.ceil(100 * aInstall.progress / aInstall.maxProgress);
   },
 
-  onDownloadEnded: function(aInstall) {
+  onDownloadEnded: function gInstallingPage_onDownloadEnded(aInstall) {
   },
 
-  onDownloadFailed: function(aInstall) {
+  onDownloadFailed: function gInstallingPage_onDownloadFailed(aInstall) {
     this._errors.push(aInstall);
 
     this.startNextInstall();
   },
 
-  onInstallStarted: function(aInstall) {
+  onInstallStarted: function gInstallingPage_onInstallStarted(aInstall) {
     var strings = document.getElementById("updateStrings");
     var label = strings.getFormattedString("installingPrefix", [aInstall.name]);
     var actionItem = document.getElementById("actionItem");
     actionItem.value = label;
   },
 
-  onInstallEnded: function(aInstall, aAddon) {
+  onInstallEnded: function gInstallingPage_onInstallEnded(aInstall, aAddon) {
     // Remember that this add-on was updated during startup
     AddonManagerPrivate.addStartupChange(AddonManager.STARTUP_CHANGE_CHANGED,
                                          aAddon.id);
 
     this.startNextInstall();
   },
 
-  onInstallFailed: function(aInstall) {
+  onInstallFailed: function gInstallingPage_onInstallFailed(aInstall) {
     this._errors.push(aInstall);
 
     this.startNextInstall();
   }
 };
 
 var gInstallErrorsPage = {
-  onPageShow: function ()
+  onPageShow: function gInstallErrorsPage_onPageShow()
   {
     gUpdateWizard.setButtonLabels(null, true, null, true, null, true);
     document.documentElement.getButton("finish").focus();
   },
 };
 
 // Displayed when there are incompatible add-ons and the xpinstall.enabled
 // pref is false and locked.
 var gAdminDisabledPage = {
-  onPageShow: function ()
+  onPageShow: function gAdminDisabledPage_onPageShow()
   {
     gUpdateWizard.setButtonLabels(null, true, null, true,
                                   "cancelButtonText", true);
     document.documentElement.getButton("finish").focus();
   }
 };
 
 // Displayed when selected add-on updates have been installed without error.
 // There can still be add-ons that are not compatible and don't have an update.
 var gFinishedPage = {
-  onPageShow: function ()
+  onPageShow: function gFinishedPage_onPageShow()
   {
     gUpdateWizard.setButtonLabels(null, true, null, true, null, true);
     document.documentElement.getButton("finish").focus();
 
     if (gUpdateWizard.shouldSuggestAutoChecking) {
       document.getElementById("finishedCheckDisabled").hidden = false;
       gUpdateWizard.shouldAutoCheck = true;
     }
@@ -493,17 +493,17 @@ var gFinishedPage = {
 
     document.documentElement.getButton("finish").focus();
   }
 };
 
 // Displayed when there are incompatible add-ons and there are no available
 // updates.
 var gNoUpdatesPage = {
-  onPageShow: function (aEvent)
+  onPageShow: function gNoUpdatesPage_onPageLoad(aEvent)
   {
     gUpdateWizard.setButtonLabels(null, true, null, true, null, true);
     if (gUpdateWizard.shouldSuggestAutoChecking) {
       document.getElementById("noupdatesCheckDisabled").hidden = false;
       gUpdateWizard.shouldAutoCheck = true;
     }
     else
       document.getElementById("noupdatesCheckEnabled").hidden = false;
--- a/toolkit/mozapps/extensions/content/xpinstallConfirm.js
+++ b/toolkit/mozapps/extensions/content/xpinstallConfirm.js
@@ -3,17 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var args
 
 var XPInstallConfirm = {};
 
-XPInstallConfirm.init = function ()
+XPInstallConfirm.init = function XPInstallConfirm_init()
 {
   var _installCountdown;
   var _installCountdownInterval;
   var _focused;
   var _timeout;
 
   var bundle = document.getElementById("xpinstallConfirmStrings");
 
@@ -131,25 +131,25 @@ XPInstallConfirm.init = function ()
 
     okButton.disabled = true;
     setWidgetsAfterFocus();
   }
   else
     okButton.label = bundle.getString("installButtonLabel");
 }
 
-XPInstallConfirm.onOK = function ()
+XPInstallConfirm.onOK = function XPInstallConfirm_onOk()
 {
   Components.classes["@mozilla.org/base/telemetry;1"].
     getService(Components.interfaces.nsITelemetry).
     getHistogramById("SECURITY_UI").
     add(Components.interfaces.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL_CLICK_THROUGH);
   for (let install of args.installs)
     install.install();
   return true;
 }
 
-XPInstallConfirm.onCancel = function ()
+XPInstallConfirm.onCancel = function XPInstallConfirm_onCancel()
 {
   for (let install of args.installs)
     install.cancel();
   return true;
 }
--- a/toolkit/mozapps/extensions/nsBlocklistService.js
+++ b/toolkit/mozapps/extensions/nsBlocklistService.js
@@ -270,17 +270,17 @@ Blocklist.prototype = {
    *                   "minVersion"  The minimum version in a version range
    *                                 (default = 0)
    *                   "maxVersion"  The maximum version in a version range
    *                                 (default = *)
    */
   _addonEntries: null,
   _pluginEntries: null,
 
-  observe: function(aSubject, aTopic, aData) {
+  observe: function Blocklist_observe(aSubject, aTopic, aData) {
     switch (aTopic) {
     case "xpcom-shutdown":
       let os = getObserverService();
       os.removeObserver(this, "xpcom-shutdown");
       gPref.removeObserver("extensions.blocklist.", this);
       break;
     case "nsPref:changed":
       switch (aData) {
@@ -295,23 +295,23 @@ Blocklist.prototype = {
           this._blocklistUpdated(null, null);
           break;
       }
       break;
     }
   },
 
   /* See nsIBlocklistService */
-  isAddonBlocklisted: function(id, version, appVersion, toolkitVersion) {
+  isAddonBlocklisted: function Blocklist_isAddonBlocklisted(id, version, appVersion, toolkitVersion) {
     return this.getAddonBlocklistState(id, version, appVersion, toolkitVersion) ==
                    Ci.nsIBlocklistService.STATE_BLOCKED;
   },
 
   /* See nsIBlocklistService */
-  getAddonBlocklistState: function(id, version, appVersion, toolkitVersion) {
+  getAddonBlocklistState: function Blocklist_getAddonBlocklistState(id, version, appVersion, toolkitVersion) {
     if (!this._addonEntries)
       this._loadBlocklist();
     return this._getAddonBlocklistState(id, version, this._addonEntries,
                                         appVersion, toolkitVersion);
   },
 
   /**
    * Private version of getAddonBlocklistState that allows the caller to pass in
@@ -327,17 +327,18 @@ Blocklist.prototype = {
    *          The application version to compare to, will use the current
    *          version if null.
    * @param   toolkitVersion
    *          The toolkit version to compare to, will use the current version if
    *          null.
    * @returns The blocklist state for the item, one of the STATE constants as
    *          defined in nsIBlocklistService.
    */
-  _getAddonBlocklistState: function(id, version, addonEntries, appVersion, toolkitVersion) {
+  _getAddonBlocklistState: function Blocklist_getAddonBlocklistStateCall(id,
+                           version, addonEntries, appVersion, toolkitVersion) {
     if (!gBlocklistEnabled)
       return Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
 
     if (!appVersion)
       appVersion = gApp.version;
     if (!toolkitVersion)
       toolkitVersion = gApp.platformVersion;
 
@@ -349,38 +350,38 @@ Blocklist.prototype = {
       if (currentblItem.includesItem(version, appVersion, toolkitVersion))
         return currentblItem.severity >= gBlocklistLevel ? Ci.nsIBlocklistService.STATE_BLOCKED :
                                                        Ci.nsIBlocklistService.STATE_SOFTBLOCKED;
     }
     return Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
   },
 
   /* See nsIBlocklistService */
-  getAddonBlocklistURL: function(id, version, appVersion, toolkitVersion) {
+  getAddonBlocklistURL: function Blocklist_getAddonBlocklistURL(id, version, appVersion, toolkitVersion) {
     if (!gBlocklistEnabled)
       return "";
 
     if (!this._addonEntries)
       this._loadBlocklist();
 
     let blItem = this._addonEntries[id];
     if (!blItem || !blItem.blockID)
       return null;
 
     return this._createBlocklistURL(blItem.blockID);
   },
 
-  _createBlocklistURL: function(id) {
+  _createBlocklistURL: function Blocklist_createBlocklistURL(id) {
     let url = Services.urlFormatter.formatURLPref(PREF_BLOCKLIST_ITEM_URL);
     url = url.replace(/%blockID%/g, id);
 
     return url;
   },
 
-  notify: function(aTimer) {
+  notify: function Blocklist_notify(aTimer) {
     if (!gBlocklistEnabled)
       return;
 
     try {
       var dsURI = gPref.getCharPref(PREF_BLOCKLIST_URL);
     }
     catch (e) {
       LOG("Blocklist::notify: The " + PREF_BLOCKLIST_URL + " preference" +
@@ -474,27 +475,29 @@ Blocklist.prototype = {
                   createInstance(Ci.nsIXMLHttpRequest);
     request.open("GET", uri.spec, true);
     request.channel.notificationCallbacks = new gCertUtils.BadCertHandler();
     request.overrideMimeType("text/xml");
     request.setRequestHeader("Cache-Control", "no-cache");
     request.QueryInterface(Components.interfaces.nsIJSXMLHttpRequest);
 
     var self = this;
-    request.addEventListener("error", function(event) { self.onXMLError(event); }, false);
-    request.addEventListener("load", function(event) { self.onXMLLoad(event);  }, false);
+    request.addEventListener("error", function errorEventListener(event) {
+                                      self.onXMLError(event); }, false);
+    request.addEventListener("load", function loadEventListener(event) {
+                                     self.onXMLLoad(event);  }, false);
     request.send(null);
 
     // When the blocklist loads we need to compare it to the current copy so
     // make sure we have loaded it.
     if (!this._addonEntries)
       this._loadBlocklist();
   },
 
-  onXMLLoad: function(aEvent) {
+  onXMLLoad: function Blocklist_onXMLLoad(aEvent) {
     var request = aEvent.target;
     try {
       gCertUtils.checkCert(request.channel);
     }
     catch (e) {
       LOG("Blocklist::onXMLLoad: " + e);
       return;
     }
@@ -516,17 +519,17 @@ Blocklist.prototype = {
     this._addonEntries = { };
     this._pluginEntries = { };
     this._loadBlocklistFromFile(FileUtils.getFile(KEY_PROFILEDIR,
                                                   [FILE_BLOCKLIST]));
 
     this._blocklistUpdated(oldAddonEntries, oldPluginEntries);
   },
 
-  onXMLError: function(aEvent) {
+  onXMLError: function Blocklist_onXMLError(aEvent) {
     try {
       var request = aEvent.target;
       // the following may throw (e.g. a local file or timeout)
       var status = request.status;
     }
     catch (e) {
       request = aEvent.target.channel.QueryInterface(Ci.nsIRequest);
       status = request.status;
@@ -542,17 +545,17 @@ Blocklist.prototype = {
     LOG("Blocklist:onError: There was an error loading the blocklist file\r\n" +
         statusText);
   },
 
   /**
    * Finds the newest blocklist file from the application and the profile and
    * load it or does nothing if neither exist.
    */
-  _loadBlocklist: function() {
+  _loadBlocklist: function Blocklist_loadBlocklist() {
     this._addonEntries = { };
     this._pluginEntries = { };
     var profFile = FileUtils.getFile(KEY_PROFILEDIR, [FILE_BLOCKLIST]);
     if (profFile.exists()) {
       this._loadBlocklistFromFile(profFile);
       return;
     }
     var appFile = FileUtils.getFile(KEY_APPDIR, [FILE_BLOCKLIST]);
@@ -610,17 +613,17 @@ Blocklist.prototype = {
 #          <!-- All match tags must match a plugin to blocklist a plugin -->
 #          <match name="name" exp="some plugin"/>
 #          <match name="description" exp="1[.]2[.]3"/>
 #        </pluginItem>
 #      </pluginItems>
 #    </blocklist>
    */
 
-  _loadBlocklistFromFile: function(file) {
+  _loadBlocklistFromFile: function Blocklist_loadBlocklistFromFile(file) {
     if (!gBlocklistEnabled) {
       LOG("Blocklist::_loadBlocklistFromFile: blocklist is disabled");
       return;
     }
 
     if (!file.exists()) {
       LOG("Blocklist::_loadBlocklistFromFile: XML File does not exist");
       return;
@@ -662,31 +665,31 @@ Blocklist.prototype = {
     }
     catch (e) {
       LOG("Blocklist::_loadBlocklistFromFile: Error constructing blocklist " + e);
       return;
     }
     fileStream.close();
   },
 
-  _processItemNodes: function(itemNodes, prefix, handler) {
+  _processItemNodes: function Blocklist_processItemNodes(itemNodes, prefix, handler) {
     var result = [];
     var itemName = prefix + "Item";
     for (var i = 0; i < itemNodes.length; ++i) {
       var blocklistElement = itemNodes.item(i);
       if (!(blocklistElement instanceof Ci.nsIDOMElement) ||
           blocklistElement.localName != itemName)
         continue;
 
       handler(blocklistElement, result);
     }
     return result;
   },
 
-  _handleEmItemNode: function(blocklistElement, result) {
+  _handleEmItemNode: function Blocklist_handleEmItemNode(blocklistElement, result) {
     if (!matchesOSABI(blocklistElement))
       return;
 
     var versionNodes = blocklistElement.childNodes;
     var id = blocklistElement.getAttribute("id");
     result[id] = [];
     for (var x = 0; x < versionNodes.length; ++x) {
       var versionRangeElement = versionNodes.item(x);
@@ -699,17 +702,17 @@ Blocklist.prototype = {
     // if only the extension ID is specified block all versions of the
     // extension for the current application.
     if (result[id].length == 0)
       result[id].push(new BlocklistItemData(null));
 
     result[id].blockID = blocklistElement.getAttribute("blockID");
   },
 
-  _handlePluginItemNode: function(blocklistElement, result) {
+  _handlePluginItemNode: function Blocklist_handlePluginItemNode(blocklistElement, result) {
     if (!matchesOSABI(blocklistElement))
       return;
 
     var matchNodes = blocklistElement.childNodes;
     var blockEntry = {
       matches: {},
       versions: [],
       blockID: null,
@@ -740,17 +743,18 @@ Blocklist.prototype = {
       blockEntry.versions.push(new BlocklistItemData(null));
 
     blockEntry.blockID = blocklistElement.getAttribute("blockID");
 
     result.push(blockEntry);
   },
 
   /* See nsIBlocklistService */
-  getPluginBlocklistState: function(plugin, appVersion, toolkitVersion) {
+  getPluginBlocklistState: function Blocklist_getPluginBlocklistState(plugin,
+                           appVersion, toolkitVersion) {
     if (!this._pluginEntries)
       this._loadBlocklist();
     return this._getPluginBlocklistState(plugin, this._pluginEntries,
                                          appVersion, toolkitVersion);
   },
 
   /**
    * Private version of getPluginBlocklistState that allows the caller to pass in
@@ -764,17 +768,18 @@ Blocklist.prototype = {
    *          The application version to compare to, will use the current
    *          version if null.
    * @param   toolkitVersion
    *          The toolkit version to compare to, will use the current version if
    *          null.
    * @returns The blocklist state for the item, one of the STATE constants as
    *          defined in nsIBlocklistService.
    */
-  _getPluginBlocklistState: function(plugin, pluginEntries, appVersion, toolkitVersion) {
+  _getPluginBlocklistState: function Blocklist_getPluginBlocklistState(plugin,
+                            pluginEntries, appVersion, toolkitVersion) {
     if (!gBlocklistEnabled)
       return Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
 
     if (!appVersion)
       appVersion = gApp.version;
     if (!toolkitVersion)
       toolkitVersion = gApp.platformVersion;
 
@@ -809,17 +814,17 @@ Blocklist.prototype = {
         }
       }
     }
 
     return Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
   },
 
   /* See nsIBlocklistService */
-  getPluginBlocklistURL: function(plugin) {
+  getPluginBlocklistURL: function Blocklist_getPluginBlocklistURL(plugin) {
     if (!gBlocklistEnabled)
       return "";
 
     if (!this._pluginEntries)
       this._loadBlocklist();
 
     for each (let blockEntry in this._pluginEntries) {
       let matchFailed = false;
@@ -836,21 +841,22 @@ Blocklist.prototype = {
         if(!blockEntry.blockID)
           return null;
         else
           return this._createBlocklistURL(blockEntry.blockID);
       }
     }
   },
 
-  _blocklistUpdated: function(oldAddonEntries, oldPluginEntries) {
+  _blocklistUpdated: function Blocklist_blocklistUpdated(oldAddonEntries, oldPluginEntries) {
     var addonList = [];
 
     var self = this;
-    AddonManager.getAddonsByTypes(["extension", "theme", "locale", "dictionary"], function(addons) {
+    const types = ["extension", "theme", "locale", "dictionary"]
+    AddonManager.getAddonsByTypes(types, function blocklistUpdated_getAddonsByTypes(addons) {
 
       for (let addon of addons) {
         let oldState = Ci.nsIBlocklistService.STATE_NOTBLOCKED;
         if (oldAddonEntries)
           oldState = self._getAddonBlocklistState(addon.id, addon.version,
                                                   oldAddonEntries);
         let state = self.getAddonBlocklistState(addon.id, addon.version);
 
@@ -964,17 +970,17 @@ Blocklist.prototype = {
       };
       // This lets the dialog get the raw js object
       args.wrappedJSObject = args;
 
       /*
         Some tests run without UI, so the async code listens to a message
         that can be sent programatically
       */
-      let applyBlocklistChanges = function() {
+      let applyBlocklistChanges = function blocklistUpdated_applyBlocklistChanges() {
         for (let addon of addonList) {
           if (!addon.disable)
             continue;
 
           if (addon.item instanceof Ci.nsIPluginTag)
             addon.item.disabled = true;
           else
             addon.item.softDisabled = true;
@@ -1054,17 +1060,17 @@ BlocklistItemData.prototype = {
    *          The version of the item being tested.
    * @param   appVersion
    *          The application version to test with.
    * @param   toolkitVersion
    *          The toolkit version to test with.
    * @returns True if the version range covers the item version and application
    *          or toolkit version.
    */
-  includesItem: function(version, appVersion, toolkitVersion) {
+  includesItem: function BlocklistItemData_includesItem(version, appVersion, toolkitVersion) {
     // Some platforms have no version for plugins, these don't match if there
     // was a min/maxVersion provided
     if (!version && (this.minVersion || this.maxVersion))
       return false;
 
     // Check if the item version matches
     if (!this.matchesRange(version, this.minVersion, this.maxVersion))
       return false;
@@ -1084,34 +1090,34 @@ BlocklistItemData.prototype = {
    *          The version to test.
    * @param   minVersion
    *          The minimum version. If null it is assumed that version is always
    *          larger.
    * @param   maxVersion
    *          The maximum version. If null it is assumed that version is always
    *          smaller.
    */
-  matchesRange: function(version, minVersion, maxVersion) {
+  matchesRange: function BlocklistItemData_matchesRange(version, minVersion, maxVersion) {
     if (minVersion && gVersionChecker.compare(version, minVersion) < 0)
       return false;
     if (maxVersion && gVersionChecker.compare(version, maxVersion) > 0)
       return false;
     return true;
   },
 
   /**
    * Tests if there is a matching range for the given target application id and
    * version.
    * @param   appID
    *          The application ID to test for, may be for an application or toolkit
    * @param   appVersion
    *          The version of the application to test for.
    * @returns True if this version range covers the application version given.
    */
-  matchesTargetRange: function(appID, appVersion) {
+  matchesTargetRange: function BlocklistItemData_matchesTargetRange(appID, appVersion) {
     var blTargetApp = this.targetApps[appID];
     if (!blTargetApp)
       return false;
 
     for (let app of blTargetApp) {
       if (this.matchesRange(appVersion, app.minVersion, app.maxVersion))
         return true;
     }
@@ -1123,17 +1129,17 @@ BlocklistItemData.prototype = {
    * Retrieves a version range (e.g. minVersion and maxVersion) for a
    * blocklist item's targetApplication element.
    * @param   targetAppElement
    *          A targetApplication blocklist element.
    * @returns An array of JS objects with the following properties:
    *          "minVersion"  The minimum version in a version range (default = null).
    *          "maxVersion"  The maximum version in a version range (default = null).
    */
-  getBlocklistAppVersions: function(targetAppElement) {
+  getBlocklistAppVersions: function BlocklistItemData_getBlocklistAppVersions(targetAppElement) {
     var appVersions = [ ];
 
     if (targetAppElement) {
       for (var i = 0; i < targetAppElement.childNodes.length; ++i) {
         var versionRangeElement = targetAppElement.childNodes.item(i);
         if (!(versionRangeElement instanceof Ci.nsIDOMElement) ||
             versionRangeElement.localName != "versionRange")
           continue;
@@ -1151,17 +1157,17 @@ BlocklistItemData.prototype = {
    * Retrieves a version range (e.g. minVersion and maxVersion) for a blocklist
    * versionRange element.
    * @param   versionRangeElement
    *          The versionRange blocklist element.
    * @returns A JS object with the following properties:
    *          "minVersion"  The minimum version in a version range (default = null).
    *          "maxVersion"  The maximum version in a version range (default = null).
    */
-  getBlocklistVersionRange: function(versionRangeElement) {
+  getBlocklistVersionRange: function BlocklistItemData_getBlocklistVersionRange(versionRangeElement) {
     var minVersion = null;
     var maxVersion = null;
     if (!versionRangeElement)
       return { minVersion: minVersion, maxVersion: maxVersion };
 
     if (versionRangeElement.hasAttribute("minVersion"))
       minVersion = versionRangeElement.getAttribute("minVersion");
     if (versionRangeElement.hasAttribute("maxVersion"))
--- a/toolkit/mozapps/extensions/test/browser/browser_updatessl.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_updatessl.js
@@ -83,17 +83,17 @@ function run_update_tests(callback) {
                     mainURL + " to " + redirectURL;
     }
     else {
       url = mainURL + updaterdf;
       message = "Should have seen the right result for an update check from " +
                 mainURL;
     }
 
-    AddonUpdateChecker.checkForUpdates("addon1@tests.mozilla.org", "extension",
+    AddonUpdateChecker.checkForUpdates("addon1@tests.mozilla.org",
                                        null, url, {
       onUpdateCheckComplete: function(updates) {
         is(updates.length, 1, "Should be the right number of results");
         is(SUCCESS, expectedStatus, message);
         info("Update test ran in " + (Date.now() - gLast) + "ms");
         run_next_update_test();
       },
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_updatecheck.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_updatecheck.js
@@ -22,17 +22,17 @@ function run_test() {
 }
 
 function end_test() {
   testserver.stop(do_test_finished);
 }
 
 // Test that a basic update check returns the expected available updates
 function run_test_1() {
-  AddonUpdateChecker.checkForUpdates("updatecheck1@tests.mozilla.org", "extension", null,
+  AddonUpdateChecker.checkForUpdates("updatecheck1@tests.mozilla.org", null,
                                      "http://localhost:4444/data/test_updatecheck.rdf", {
     onUpdateCheckComplete: function(updates) {
       check_test_1(updates);
     },
 
     onUpdateCheckError: function(status) {
       do_throw("Update check failed with status " + status);
     }
@@ -70,175 +70,175 @@ function check_test_1(updates) {
 
 let updateKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDK426erD/H3XtsjvaB5+PJqbhj" +
                 "Zc9EDI5OCJS8R3FIObJ9ZHJK1TXeaE7JWqt9WUmBWTEFvwS+FI9vWu8058N9CHhD" +
                 "NyeP6i4LuUYjTURnn7Yw/IgzyIJ2oKsYa32RuxAyteqAWqPT/J63wBixIeCxmysf" +
                 "awB/zH4KaPiY3vnrzQIDAQAB";
 
 function run_test_2() {
   AddonUpdateChecker.checkForUpdates("test_bug378216_5@tests.mozilla.org",
-                                     "extension", updateKey,
+                                     updateKey,
                                      "http://localhost:4444/data/test_updatecheck.rdf", {
     onUpdateCheckComplete: function(updates) {
       do_throw("Expected the update check to fail");
     },
 
     onUpdateCheckError: function(status) {
       run_test_3();
     }
   });
 }
 
 function run_test_3() {
   AddonUpdateChecker.checkForUpdates("test_bug378216_7@tests.mozilla.org",
-                                     "extension", updateKey,
+                                     updateKey,
                                      "http://localhost:4444/data/test_updatecheck.rdf", {
     onUpdateCheckComplete: function(updates) {
       do_throw("Expected the update check to fail");
     },
 
     onUpdateCheckError: function(status) {
       run_test_4();
     }
   });
 }
 
 function run_test_4() {
   AddonUpdateChecker.checkForUpdates("test_bug378216_8@tests.mozilla.org",
-                                     "extension", updateKey,
+                                     updateKey,
                                      "http://localhost:4444/data/test_updatecheck.rdf", {
     onUpdateCheckComplete: function(updates) {
       do_check_eq(updates.length, 1);
       do_check_false("updateURL" in updates[0]);
       run_test_5();
     },
 
     onUpdateCheckError: function(status) {
       do_throw("Update check failed with status " + status);
     }
   });
 }
 
 function run_test_5() {
   AddonUpdateChecker.checkForUpdates("test_bug378216_9@tests.mozilla.org",
-                                     "extension", updateKey,
+                                     updateKey,
                                      "http://localhost:4444/data/test_updatecheck.rdf", {
     onUpdateCheckComplete: function(updates) {
       do_check_eq(updates.length, 1);
       do_check_eq(updates[0].version, "2.0");
       do_check_true("updateURL" in updates[0]);
       run_test_6();
     },
 
     onUpdateCheckError: function(status) {
       do_throw("Update check failed with status " + status);
     }
   });
 }
 
 function run_test_6() {
   AddonUpdateChecker.checkForUpdates("test_bug378216_10@tests.mozilla.org",
-                                     "extension", updateKey,
+                                     updateKey,
                                      "http://localhost:4444/data/test_updatecheck.rdf", {
     onUpdateCheckComplete: function(updates) {
       do_check_eq(updates.length, 1);
       do_check_eq(updates[0].version, "2.0");
       do_check_true("updateURL" in updates[0]);
       run_test_7();
     },
 
     onUpdateCheckError: function(status) {
       do_throw("Update check failed with status " + status);
     }
   });
 }
 
 function run_test_7() {
   AddonUpdateChecker.checkForUpdates("test_bug378216_11@tests.mozilla.org",
-                                     "extension", updateKey,
+                                     updateKey,
                                      "http://localhost:4444/data/test_updatecheck.rdf", {
     onUpdateCheckComplete: function(updates) {
       do_check_eq(updates.length, 1);
       do_check_eq(updates[0].version, "2.0");
       do_check_true("updateURL" in updates[0]);
       run_test_8();
     },
 
     onUpdateCheckError: function(status) {
       do_throw("Update check failed with status " + status);
     }
   });
 }
 
 function run_test_8() {
   AddonUpdateChecker.checkForUpdates("test_bug378216_12@tests.mozilla.org",
-                                     "extension", updateKey,
+                                     updateKey,
                                      "http://localhost:4444/data/test_updatecheck.rdf", {
     onUpdateCheckComplete: function(updates) {
       do_check_eq(updates.length, 1);
       do_check_false("updateURL" in updates[0]);
       run_test_9();
     },
 
     onUpdateCheckError: function(status) {
       do_throw("Update check failed with status " + status);
     }
   });
 }
 
 function run_test_9() {
   AddonUpdateChecker.checkForUpdates("test_bug378216_13@tests.mozilla.org",
-                                     "extension", updateKey,
+                                     updateKey,
                                      "http://localhost:4444/data/test_updatecheck.rdf", {
     onUpdateCheckComplete: function(updates) {
       do_check_eq(updates.length, 1);
       do_check_eq(updates[0].version, "2.0");
       do_check_true("updateURL" in updates[0]);
       run_test_10();
     },
 
     onUpdateCheckError: function(status) {
       do_throw("Update check failed with status " + status);
     }
   });
 }
 
 function run_test_10() {
   AddonUpdateChecker.checkForUpdates("test_bug378216_14@tests.mozilla.org",
-                                     "extension", null,
+                                     null,
                                      "http://localhost:4444/data/test_updatecheck.rdf", {
     onUpdateCheckComplete: function(updates) {
       do_check_eq(updates.length, 0);
       run_test_11();
     },
 
     onUpdateCheckError: function(status) {
       do_throw("Update check failed with status " + status);
     }
   });
 }
 
 function run_test_11() {
   AddonUpdateChecker.checkForUpdates("test_bug378216_15@tests.mozilla.org",
-                                     "extension", null,
+                                     null,
                                      "http://localhost:4444/data/test_updatecheck.rdf", {
     onUpdateCheckComplete: function(updates) {
       do_throw("Update check should have failed");
     },
 
     onUpdateCheckError: function(status) {
       do_check_eq(status, AddonUpdateChecker.ERROR_PARSE_ERROR);
       run_test_12();
     }
   });
 }
 
 function run_test_12() {
   AddonUpdateChecker.checkForUpdates("ignore-compat@tests.mozilla.org",
-                                     "extension", null,
+                                     null,
                                      "http://localhost:4444/data/test_updatecheck.rdf", {
     onUpdateCheckComplete: function(updates) {
       do_check_eq(updates.length, 3);
       let update = AddonUpdateChecker.getNewestCompatibleUpdate(updates,
                                                                 null,
                                                                 null,
                                                                 true);
       do_check_neq(update, null);
@@ -249,17 +249,17 @@ function run_test_12() {
     onUpdateCheckError: function(status) {
       do_throw("Update check failed with status " + status);
     }
   });
 }
 
 function run_test_13() {
   AddonUpdateChecker.checkForUpdates("compat-override@tests.mozilla.org",
-                                     "extension", null,
+                                     null,
                                      "http://localhost:4444/data/test_updatecheck.rdf", {
     onUpdateCheckComplete: function(updates) {
       do_check_eq(updates.length, 3);
       let overrides = [{
         type: "incompatible",
         minVersion: 1,
         maxVersion: 2,
         appID: "xpcshell@tests.mozilla.org",
@@ -287,17 +287,17 @@ function run_test_13() {
     onUpdateCheckError: function(status) {
       do_throw("Update check failed with status " + status);
     }
   });
 }
 
 function run_test_14() {
   AddonUpdateChecker.checkForUpdates("compat-strict-optin@tests.mozilla.org",
-                                     "extension", null,
+                                     null,
                                      "http://localhost:4444/data/test_updatecheck.rdf", {
     onUpdateCheckComplete: function(updates) {
       do_check_eq(updates.length, 1);
       let update = AddonUpdateChecker.getNewestCompatibleUpdate(updates,
                                                                 null,
                                                                 null,
                                                                 true,
                                                                 false);