Bug 1524688: Part 2 - Convert BrowserGlue and friends to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Tue, 29 Jan 2019 17:44:35 -0800
changeset 458975 9201a7ea3c54
parent 458974 d5dca413e2da
child 458976 ee28258a5724
push id111909
push usermaglione.k@gmail.com
push dateThu, 14 Feb 2019 02:30:40 +0000
treeherdermozilla-inbound@81dc12cc9257 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1524688
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1524688: Part 2 - Convert BrowserGlue and friends to static registration. r=mconley
browser/base/content/browser.js
browser/base/content/test/performance/browser_startup.js
browser/components/BrowserComponents.manifest
browser/components/BrowserContentHandler.jsm
browser/components/BrowserGlue.jsm
browser/components/components.conf
browser/components/moz.build
browser/components/nsBrowserContentHandler.js
browser/components/nsBrowserGlue.js
browser/components/protocolhandler/WebProtocolHandlerRegistrar.js
browser/components/protocolhandler/WebProtocolHandlerRegistrar.jsm
browser/components/protocolhandler/components.conf
browser/components/protocolhandler/moz.build
browser/components/tests/browser/browser_bug538331.js
browser/components/tests/startupRecorder.js
browser/extensions/pdfjs/content/PdfJs.jsm
browser/installer/package-manifest.in
browser/modules/ContentClick.jsm
browser/modules/ContentSearch.jsm
browser/modules/FormValidationHandler.jsm
browser/modules/ReaderParent.jsm
browser/modules/RemotePrompt.jsm
browser/modules/webrtcUI.jsm
browser/themes/shared/compacttheme.inc.css
mobile/android/components/BrowserCLH.js
python/mozbuild/mozbuild/test/codecoverage/test_lcov_rewrite.py
toolkit/components/contentprefs/ContentPrefServiceParent.jsm
toolkit/components/passwordmgr/LoginManagerParent.jsm
toolkit/components/telemetry/hybrid-content/HybridContentTelemetry.jsm
toolkit/components/telemetry/hybrid-content/content-HybridContentTelemetry.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1718,17 +1718,17 @@ var gBrowserInit = {
   /**
    * Use this function as an entry point to schedule tasks that
    * need to run once per window after startup, and can be scheduled
    * by using an idle callback.
    *
    * The functions scheduled here will fire from idle callbacks
    * once every window has finished being restored by session
    * restore, and after the equivalent only-once tasks
-   * have run (from _scheduleStartupIdleTasks in nsBrowserGlue.js).
+   * have run (from _scheduleStartupIdleTasks in BrowserGlue.jsm).
    */
   _schedulePerWindowIdleTasks() {
     // Bail out if the window has been closed in the meantime.
     if (window.closed) {
       return;
     }
 
     function scheduleIdleTask(func, options) {
--- a/browser/base/content/test/performance/browser_startup.js
+++ b/browser/base/content/test/performance/browser_startup.js
@@ -19,26 +19,26 @@
 /* Set this to true only for debugging purpose; it makes the output noisy. */
 const kDumpAllStacks = false;
 
 const startupPhases = {
   // For app-startup, we have a whitelist of acceptable JS files.
   // Anything loaded during app-startup must have a compelling reason
   // to run before we have even selected the user profile.
   // Consider loading your code after first paint instead,
-  // eg. from nsBrowserGlue.js' _onFirstWindowLoaded method).
+  // eg. from BrowserGlue.jsm' _onFirstWindowLoaded method).
   "before profile selection": {whitelist: {
     components: new Set([
-      "nsBrowserGlue.js",
       "MainProcessSingleton.js",
 
       // Bugs to fix: The following components shouldn't be initialized that early.
       "PushComponents.js", // bug 1369436
     ]),
     modules: new Set([
+      "resource:///modules/BrowserGlue.jsm",
       "resource://gre/modules/AppConstants.jsm",
       "resource://gre/modules/ActorManagerParent.jsm",
       "resource://gre/modules/CustomElementsListener.jsm",
       "resource://gre/modules/ExtensionUtils.jsm",
       "resource://gre/modules/XPCOMUtils.jsm",
       "resource://gre/modules/Services.jsm",
     ]),
   }},
--- a/browser/components/BrowserComponents.manifest
+++ b/browser/components/BrowserComponents.manifest
@@ -1,43 +1,10 @@
-# nsBrowserContentHandler.js
-component {5d0ce354-df01-421a-83fb-7ead0990c24e} nsBrowserContentHandler.js application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/browser/clh;1 {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-component {47cd0651-b1be-4a0f-b5c4-10e5a573ef71} nsBrowserContentHandler.js application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/browser/final-clh;1 {47cd0651-b1be-4a0f-b5c4-10e5a573ef71} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/uriloader/content-handler;1?type=text/html {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/uriloader/content-handler;1?type=application/vnd.mozilla.xul+xml {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/uriloader/content-handler;1?type=image/svg+xml {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/uriloader/content-handler;1?type=text/rdf {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/uriloader/content-handler;1?type=text/xml {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/uriloader/content-handler;1?type=application/xhtml+xml {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/uriloader/content-handler;1?type=text/css {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/uriloader/content-handler;1?type=text/plain {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/uriloader/content-handler;1?type=image/gif {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/uriloader/content-handler;1?type=image/jpeg {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/uriloader/content-handler;1?type=image/jpg {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/uriloader/content-handler;1?type=image/png {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/uriloader/content-handler;1?type=image/bmp {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/uriloader/content-handler;1?type=image/x-icon {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/uriloader/content-handler;1?type=image/vnd.microsoft.icon {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-contract @mozilla.org/uriloader/content-handler;1?type=application/http-index-format {5d0ce354-df01-421a-83fb-7ead0990c24e} application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-category command-line-handler m-browser @mozilla.org/browser/clh;1 application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-category command-line-handler x-default @mozilla.org/browser/final-clh;1 application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-category command-line-validator b-browser @mozilla.org/browser/clh;1 application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-
 # nsBrowserGlue.js
 
 # This component must restrict its registration for the app-startup category
 # to the specific list of apps that use it so it doesn't get loaded in xpcshell.
 # Thus we restrict it to these apps:
 #
 #   browser:        {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
 #   mobile/android: {aa3c5121-dab2-40e2-81ca-7ea25febc110}
 
-component {eab9012e-5f74-4cbc-b2b5-a590235513cc} nsBrowserGlue.js
-contract @mozilla.org/browser/browserglue;1 {eab9012e-5f74-4cbc-b2b5-a590235513cc}
 category app-startup nsBrowserGlue service,@mozilla.org/browser/browserglue;1 application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} application={aa3c5121-dab2-40e2-81ca-7ea25febc110}
-component {d8903bf6-68d5-4e97-bcd1-e4d3012f721a} nsBrowserGlue.js
-contract @mozilla.org/content-permission/prompt;1 {d8903bf6-68d5-4e97-bcd1-e4d3012f721a}
-
-# RegisterProtocolHandler support
-component {efbd7b87-9b15-4684-abf0-dc2679daadb1} WebProtocolHandlerRegistrar.js process=main
-contract @mozilla.org/embeddor.implemented/web-protocol-handler-registrar;1 {efbd7b87-9b15-4684-abf0-dc2679daadb1} process=main
rename from browser/components/nsBrowserContentHandler.js
rename to browser/components/BrowserContentHandler.jsm
--- a/browser/components/nsBrowserContentHandler.js
+++ b/browser/components/BrowserContentHandler.jsm
@@ -1,12 +1,14 @@
 /* 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 EXPORTED_SYMBOLS = ["nsBrowserContentHandler", "nsDefaultCommandLineHandler"];
+
 const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
   HeadlessShell: "resource:///modules/HeadlessShell.jsm",
   HomePage: "resource:///modules/HomePage.jsm",
@@ -173,17 +175,17 @@ function getPostUpdateOverridePage(defau
     return defaultOverridePage;
   }
 
   return update.getProperty("openURL") || defaultOverridePage;
 }
 
 /**
  * Open a browser window. If this is the initial launch, this function will
- * attempt to use the navigator:blank window opened by nsBrowserGlue.js during
+ * attempt to use the navigator:blank window opened by BrowserGlue.jsm during
  * early startup.
  *
  * @param cmdLine
  *        The nsICommandLine object given to nsICommandLineHandler's handle
  *        method.
  *        Used to check if we are processing the command line for the initial launch.
  * @param triggeringPrincipal
  *        The nsIPrincipal to use as triggering principal for the page load(s).
@@ -320,28 +322,22 @@ function doSearch(searchTerm, cmdLine) {
   var submission = engine.getSubmission(searchTerm, null, "system");
 
   // XXXbsmedberg: use handURIToExistingBrowser to obey tabbed-browsing
   // preferences, but need nsIBrowserDOMWindow extensions
   openBrowserWindow(cmdLine, gSystemPrincipal, submission.uri.spec, submission.postData);
 }
 
 function nsBrowserContentHandler() {
+  if (!gBrowserContentHandler) {
+    gBrowserContentHandler = this;
+  }
+  return gBrowserContentHandler;
 }
 nsBrowserContentHandler.prototype = {
-  classID: Components.ID("{5d0ce354-df01-421a-83fb-7ead0990c24e}"),
-
-  _xpcom_factory: {
-    createInstance: function bch_factory_ci(outer, iid) {
-      if (outer)
-        throw Cr.NS_ERROR_NO_AGGREGATION;
-      return gBrowserContentHandler.QueryInterface(iid);
-    },
-  },
-
   /* nsISupports */
   QueryInterface: ChromeUtils.generateQI([Ci.nsICommandLineHandler,
                                           Ci.nsIBrowserHandler,
                                           Ci.nsIContentHandler,
                                           Ci.nsICommandLineValidator]),
 
   /* nsICommandLineHandler */
   handle: function bch_handle(cmdLine) {
@@ -728,18 +724,16 @@ function handURIToExistingBrowser(uri, l
   bwin.openURI(uri, null, location,
                Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL, triggeringPrincipal);
 }
 
 function nsDefaultCommandLineHandler() {
 }
 
 nsDefaultCommandLineHandler.prototype = {
-  classID: Components.ID("{47cd0651-b1be-4a0f-b5c4-10e5a573ef71}"),
-
   /* nsISupports */
   QueryInterface: ChromeUtils.generateQI(["nsICommandLineHandler"]),
 
   _haveProfile: false,
 
   /* nsICommandLineHandler */
   handle: function dch_handle(cmdLine) {
     var urilist = [];
@@ -831,11 +825,8 @@ nsDefaultCommandLineHandler.prototype = 
       let win = Services.wm.getMostRecentWindow("navigator:blank");
       if (win)
         win.close();
     }
   },
 
   helpInfo: "",
 };
-
-var components = [nsBrowserContentHandler, nsDefaultCommandLineHandler];
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
rename from browser/components/nsBrowserGlue.js
rename to browser/components/BrowserGlue.jsm
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/BrowserGlue.jsm
@@ -1,12 +1,14 @@
 /* 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 EXPORTED_SYMBOLS = ["BrowserGlue", "ContentPermissionPrompt"];
+
 const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
 const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 ChromeUtils.defineModuleGetter(this, "ActorManagerParent",
                                "resource://gre/modules/ActorManagerParent.jsm");
@@ -360,90 +362,89 @@ let ACTORS = {
   // The window becomes visible after OnStopRequest, so make this happen now.
   win.stop();
 
   let { TelemetryTimestamps } =
     ChromeUtils.import("resource://gre/modules/TelemetryTimestamps.jsm");
   TelemetryTimestamps.add("blankWindowShown");
 })();
 
-XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]);
-
 XPCOMUtils.defineLazyServiceGetters(this, {
-  WindowsUIUtils: ["@mozilla.org/windows-ui-utils;1", "nsIWindowsUIUtils"],
   aboutNewTabService: ["@mozilla.org/browser/aboutnewtab-service;1", "nsIAboutNewTabService"],
 });
 XPCOMUtils.defineLazyGetter(this, "WeaveService", () =>
   Cc["@mozilla.org/weave/service;1"].getService().wrappedJSObject
 );
 
 // lazy module getters
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   AboutPrivateBrowsingHandler: "resource:///modules/aboutpages/AboutPrivateBrowsingHandler.jsm",
   AddonManager: "resource://gre/modules/AddonManager.jsm",
   AppMenuNotifications: "resource://gre/modules/AppMenuNotifications.jsm",
-  AsyncPrefs: "resource://gre/modules/AsyncPrefs.jsm",
   AsyncShutdown: "resource://gre/modules/AsyncShutdown.jsm",
   AutoCompletePopup: "resource://gre/modules/AutoCompletePopup.jsm",
   Blocklist: "resource://gre/modules/Blocklist.jsm",
   BookmarkHTMLUtils: "resource://gre/modules/BookmarkHTMLUtils.jsm",
   BookmarkJSONUtils: "resource://gre/modules/BookmarkJSONUtils.jsm",
   BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm",
   BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
-  ContentClick: "resource:///modules/ContentClick.jsm",
   ContextualIdentityService: "resource://gre/modules/ContextualIdentityService.jsm",
-  CustomizableUI: "resource:///modules/CustomizableUI.jsm",
   DateTimePickerParent: "resource://gre/modules/DateTimePickerParent.jsm",
   Discovery: "resource:///modules/Discovery.jsm",
   ExtensionsUI: "resource:///modules/ExtensionsUI.jsm",
   FileSource: "resource://gre/modules/L10nRegistry.jsm",
-  FormValidationHandler: "resource:///modules/FormValidationHandler.jsm",
   FxAccounts: "resource://gre/modules/FxAccounts.jsm",
   HomePage: "resource:///modules/HomePage.jsm",
   HybridContentTelemetry: "resource://gre/modules/HybridContentTelemetry.jsm",
   Integration: "resource://gre/modules/Integration.jsm",
   L10nRegistry: "resource://gre/modules/L10nRegistry.jsm",
   LanguagePrompt: "resource://gre/modules/LanguagePrompt.jsm",
   LightweightThemeManager: "resource://gre/modules/LightweightThemeManager.jsm",
   LiveBookmarkMigrator: "resource:///modules/LiveBookmarkMigrator.jsm",
-  LoginHelper: "resource://gre/modules/LoginHelper.jsm",
-  LoginManagerParent: "resource://gre/modules/LoginManagerParent.jsm",
   NewTabUtils: "resource://gre/modules/NewTabUtils.jsm",
   Normandy: "resource://normandy/Normandy.jsm",
   ObjectUtils: "resource://gre/modules/ObjectUtils.jsm",
   OS: "resource://gre/modules/osfile.jsm",
   PageActions: "resource:///modules/PageActions.jsm",
   PageThumbs: "resource://gre/modules/PageThumbs.jsm",
   PdfJs: "resource://pdf.js/PdfJs.jsm",
   PermissionUI: "resource:///modules/PermissionUI.jsm",
-  PictureInPicture: "resource://gre/modules/PictureInPicture.jsm",
   PingCentre: "resource:///modules/PingCentre.jsm",
   PlacesBackups: "resource://gre/modules/PlacesBackups.jsm",
   PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
   PluralForm: "resource://gre/modules/PluralForm.jsm",
   PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
   ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.jsm",
-  ReaderParent: "resource:///modules/ReaderParent.jsm",
-  RemotePrompt: "resource:///modules/RemotePrompt.jsm",
   RemoteSettings: "resource://services-settings/remote-settings.js",
   SafeBrowsing: "resource://gre/modules/SafeBrowsing.jsm",
   Sanitizer: "resource:///modules/Sanitizer.jsm",
   SaveToPocket: "chrome://pocket/content/SaveToPocket.jsm",
   SearchTelemetry: "resource:///modules/SearchTelemetry.jsm",
   SessionStartup: "resource:///modules/sessionstore/SessionStartup.jsm",
   SessionStore: "resource:///modules/sessionstore/SessionStore.jsm",
   ShellService: "resource:///modules/ShellService.jsm",
   TabCrashHandler: "resource:///modules/ContentCrashHandlers.jsm",
   UIState: "resource://services-sync/UIState.jsm",
   UITour: "resource:///modules/UITour.jsm",
   WebChannel: "resource://gre/modules/WebChannel.jsm",
   WindowsRegistry: "resource://gre/modules/WindowsRegistry.jsm",
 });
 
+// eslint-disable-next-line no-unused-vars
+XPCOMUtils.defineLazyModuleGetters(this, {
+  AsyncPrefs: "resource://gre/modules/AsyncPrefs.jsm",
+  ContentClick: "resource:///modules/ContentClick.jsm",
+  FormValidationHandler: "resource:///modules/FormValidationHandler.jsm",
+  LoginManagerParent: "resource://gre/modules/LoginManagerParent.jsm",
+  PictureInPicture: "resource://gre/modules/PictureInPicture.jsm",
+  ReaderParent: "resource:///modules/ReaderParent.jsm",
+  RemotePrompt: "resource:///modules/RemotePrompt.jsm",
+});
+
 /* global ContentPrefServiceParent:false, ContentSearch:false,
           UpdateListener:false, webrtcUI:false */
 
 /**
  * IF YOU ADD OR REMOVE FROM THIS LIST, PLEASE UPDATE THE LIST ABOVE AS WELL.
  * XXX Bug 1325373 is for making eslint detect these automatically.
  */
 
@@ -461,17 +462,16 @@ let initializedModules = {};
     return initializedModules[name];
   });
 });
 
 if (AppConstants.MOZ_CRASHREPORTER) {
   XPCOMUtils.defineLazyModuleGetters(this, {
     PluginCrashReporter: "resource:///modules/ContentCrashHandlers.jsm",
     UnsubmittedCrashHandler: "resource:///modules/ContentCrashHandlers.jsm",
-    CrashSubmit: "resource://gre/modules/CrashSubmit.jsm",
   });
 }
 
 XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() {
   return Services.strings.createBundle("chrome://branding/locale/brand.properties");
 });
 
 XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() {
@@ -2980,23 +2980,18 @@ BrowserGlue.prototype = {
     if (state.status == UIState.STATUS_LOGIN_FAILED ||
         state.status == UIState.STATUS_NOT_VERIFIED) {
       AppMenuNotifications.showBadgeOnlyNotification("fxa-needs-authentication");
     } else {
       AppMenuNotifications.removeNotification("fxa-needs-authentication");
     }
   },
 
-  // for XPCOM
-  classID:          Components.ID("{eab9012e-5f74-4cbc-b2b5-a590235513cc}"),
-
   QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
                                           Ci.nsISupportsWeakReference]),
-
-  _xpcom_factory: XPCOMUtils.generateSingletonFactory(BrowserGlue),
 };
 
 var ContentBlockingCategoriesPrefs = {
   PREF_CB_CATEGORY: "browser.contentblocking.category",
   // The prefs inside CATEGORY_PREFS set expected value for each CB category.
   // A null value means that pref is default.
   CATEGORY_PREFS: {
     strict: [
@@ -3484,19 +3479,16 @@ var JawsScreenReaderVersionCheck = {
 
     notification =
       win.PopupNotifications.show(browser, "e10s_enabled_with_incompat_jaws",
                                   promptMessage, null, mainAction,
                                   null, options);
   },
 };
 
-var components = [BrowserGlue, ContentPermissionPrompt];
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
-
 // Listen for UITour messages.
 // Do it here instead of the UITour module itself so that the UITour module is lazy loaded
 // when the first message is received.
 Services.mm.addMessageListener("UITour:onPageEvent", function(aMessage) {
   UITour.onPageEvent(aMessage, aMessage.data);
 });
 
 // Listen for HybridContentTelemetry messages.
new file mode 100644
--- /dev/null
+++ b/browser/components/components.conf
@@ -0,0 +1,55 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+Classes = [
+    {
+        'cid': '{5d0ce354-df01-421a-83fb-7ead0990c24e}',
+        'contract_ids': [
+            '@mozilla.org/browser/clh;1',
+            '@mozilla.org/uriloader/content-handler;1?type=application/http-index-format',
+            '@mozilla.org/uriloader/content-handler;1?type=application/vnd.mozilla.xul+xml',
+            '@mozilla.org/uriloader/content-handler;1?type=application/xhtml+xml',
+            '@mozilla.org/uriloader/content-handler;1?type=image/bmp',
+            '@mozilla.org/uriloader/content-handler;1?type=image/gif',
+            '@mozilla.org/uriloader/content-handler;1?type=image/jpeg',
+            '@mozilla.org/uriloader/content-handler;1?type=image/jpg',
+            '@mozilla.org/uriloader/content-handler;1?type=image/png',
+            '@mozilla.org/uriloader/content-handler;1?type=image/svg+xml',
+            '@mozilla.org/uriloader/content-handler;1?type=image/vnd.microsoft.icon',
+            '@mozilla.org/uriloader/content-handler;1?type=image/x-icon',
+            '@mozilla.org/uriloader/content-handler;1?type=text/css',
+            '@mozilla.org/uriloader/content-handler;1?type=text/html',
+            '@mozilla.org/uriloader/content-handler;1?type=text/plain',
+            '@mozilla.org/uriloader/content-handler;1?type=text/rdf',
+            '@mozilla.org/uriloader/content-handler;1?type=text/xml',
+        ],
+        'jsm': 'resource:///modules/BrowserContentHandler.jsm',
+        'constructor': 'nsBrowserContentHandler',
+        'categories': {
+            'command-line-handler': 'm-browser',
+            'command-line-validator': 'b-browser',
+        },
+    },
+    {
+        'cid': '{47cd0651-b1be-4a0f-b5c4-10e5a573ef71}',
+        'contract_ids': ['@mozilla.org/browser/final-clh;1'],
+        'jsm': 'resource:///modules/BrowserContentHandler.jsm',
+        'constructor': 'nsDefaultCommandLineHandler',
+        'categories': {'command-line-handler': 'x-default'},
+    },
+    {
+        'cid': '{eab9012e-5f74-4cbc-b2b5-a590235513cc}',
+        'contract_ids': ['@mozilla.org/browser/browserglue;1'],
+        'jsm': 'resource:///modules/BrowserGlue.jsm',
+        'constructor': 'BrowserGlue',
+    },
+    {
+        'cid': '{d8903bf6-68d5-4e97-bcd1-e4d3012f721a}',
+        'contract_ids': ['@mozilla.org/content-permission/prompt;1'],
+        'jsm': 'resource:///modules/BrowserGlue.jsm',
+        'constructor': 'ContentPermissionPrompt',
+    },
+]
--- a/browser/components/moz.build
+++ b/browser/components/moz.build
@@ -69,25 +69,29 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
     DIRS += ['touchbar']
 
 XPIDL_SOURCES += [
     'nsIBrowserHandler.idl',
 ]
 
 XPIDL_MODULE = 'browsercompsbase'
 
+XPCOM_MANIFESTS += [
+    'components.conf',
+]
+
 EXTRA_COMPONENTS += [
     'BrowserComponents.manifest',
-    'nsBrowserContentHandler.js',
-    'nsBrowserGlue.js',
     'tests/startupRecorder.js',
     'tests/testComponents.manifest',
 ]
 
 EXTRA_JS_MODULES += [
+    'BrowserContentHandler.jsm',
+    'BrowserGlue.jsm',
     'distribution.js',
 ]
 
 BROWSER_CHROME_MANIFESTS += [
     'safebrowsing/content/test/browser.ini',
     'tests/browser/browser.ini'
 ]
 
rename from browser/components/protocolhandler/WebProtocolHandlerRegistrar.js
rename to browser/components/protocolhandler/WebProtocolHandlerRegistrar.jsm
--- a/browser/components/protocolhandler/WebProtocolHandlerRegistrar.js
+++ b/browser/components/protocolhandler/WebProtocolHandlerRegistrar.jsm
@@ -1,15 +1,16 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* 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 EXPORTED_SYMBOLS = ["WebProtocolHandlerRegistrar"];
+
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 const STRING_BUNDLE_URI = "chrome://browser/locale/feeds/subscribe.properties";
 
 function WebProtocolHandlerRegistrar() {
 }
 
 WebProtocolHandlerRegistrar.prototype = {
   get stringBundle() {
@@ -141,18 +142,13 @@ WebProtocolHandlerRegistrar.prototype = 
     let notificationBox = browser.getTabBrowser().getNotificationBox(browser);
     notificationBox.appendNotification(message,
                                        notificationValue,
                                        notificationIcon,
                                        notificationBox.PRIORITY_INFO_LOW,
                                        [addButton]);
   },
 
-  classID: Components.ID("{efbd7b87-9b15-4684-abf0-dc2679daadb1}"),
-
   /**
    * See nsISupports
    */
   QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProtocolHandlerRegistrar]),
 };
-
-this.NSGetFactory =
-  XPCOMUtils.generateNSGetFactory([WebProtocolHandlerRegistrar]);
new file mode 100644
--- /dev/null
+++ b/browser/components/protocolhandler/components.conf
@@ -0,0 +1,15 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+Classes = [
+    {
+        'cid': '{efbd7b87-9b15-4684-abf0-dc2679daadb1}',
+        'contract_ids': ['@mozilla.org/embeddor.implemented/web-protocol-handler-registrar;1'],
+        'jsm': 'resource:///modules/WebProtocolHandlerRegistrar.jsm',
+        'constructor': 'WebProtocolHandlerRegistrar',
+        'processes': ProcessSelector.MAIN_PROCESS_ONLY,
+    },
+]
--- a/browser/components/protocolhandler/moz.build
+++ b/browser/components/protocolhandler/moz.build
@@ -2,14 +2,18 @@
 # vim: set filetype=python:
 # 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/.
 
 MOCHITEST_MANIFESTS += ['test/mochitest.ini']
 BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
 
-EXTRA_COMPONENTS += [
-    'WebProtocolHandlerRegistrar.js',
+EXTRA_JS_MODULES += [
+    'WebProtocolHandlerRegistrar.jsm',
+]
+
+XPCOM_MANIFESTS += [
+    'components.conf',
 ]
 
 with Files('**'):
     BUG_COMPONENT = ('Firefox', 'General')
--- a/browser/components/tests/browser/browser_bug538331.js
+++ b/browser/components/tests/browser/browser_bug538331.js
@@ -260,17 +260,17 @@ function testDefaultArgs() {
     if (Services.prefs.prefHasUserValue(PREF_POSTUPDATE)) {
       Services.prefs.clearUserPref(PREF_POSTUPDATE);
     }
   }
 
   testShowNotification();
 }
 
-// nsBrowserGlue.js _showUpdateNotification notification tests
+// BrowserGlue.jsm _showUpdateNotification notification tests
 const BG_NOTIFY_TESTS = [
   {
     description: "'silent showNotification' actions should not display a notification",
     actions: "silent showNotification",
   }, {
     description: "'showNotification' for actions should display a notification",
     actions: "showNotification",
   }, {
@@ -287,17 +287,17 @@ const BG_NOTIFY_TESTS = [
     notificationText: "notification text",
     notificationURL: DEFAULT_UPDATE_URL,
     notificationButtonLabel: "button label",
     notificationButtonAccessKey: "b",
   },
 ];
 
 // Test showing a notification after an update
-// _showUpdateNotification in nsBrowserGlue.js
+// _showUpdateNotification in BrowserGlue.jsm
 function testShowNotification() {
   // Catches any windows opened by these tests (e.g. alert windows) and closes
   // them
   gWindowCatcher.start();
 
   for (let i = 0; i < BG_NOTIFY_TESTS.length; i++) {
     let testCase = BG_NOTIFY_TESTS[i];
     ok(true, "Test showNotification " + (i + 1) + ": " + testCase.description);
--- a/browser/components/tests/startupRecorder.js
+++ b/browser/components/tests/startupRecorder.js
@@ -74,17 +74,17 @@ startupRecorder.prototype = {
       }),
     };
   },
 
   observe(subject, topic, data) {
     if (topic == "app-startup") {
       // We can't ensure our observer will be called first or last, so the list of
       // topics we observe here should avoid the topics used to trigger things
-      // during startup (eg. the topics observed by nsBrowserGlue.js).
+      // during startup (eg. the topics observed by BrowserGlue.jsm).
       let topics = [
         "profile-do-change", // This catches stuff loaded during app-startup
         "toplevel-window-ready", // Catches stuff from final-ui-startup
         "image-loading",
         "image-drawing",
         firstPaintNotification,
         "sessionstore-windows-restored",
       ];
--- a/browser/extensions/pdfjs/content/PdfJs.jsm
+++ b/browser/extensions/pdfjs/content/PdfJs.jsm
@@ -104,17 +104,17 @@ var PdfJs = {
     PdfjsChromeUtils.init();
     this.initPrefs();
 
     Services.ppmm.sharedData.set("pdfjs.enabled", this.checkEnabled());
   },
 
   earlyInit() {
     // Note: Please keep this in sync with the duplicated logic in
-    // nsBrowserGlue.js.
+    // BrowserGlue.jsm.
     Services.ppmm.sharedData.set("pdfjs.enabled", this.checkEnabled());
   },
 
   initPrefs: function initPrefs() {
     if (this._initialized) {
       return;
     }
     this._initialized = true;
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -169,18 +169,16 @@
 @RESPATH@/components/WellKnownOpportunisticUtils.js
 @RESPATH@/components/WellKnownOpportunisticUtils.manifest
 #ifndef XP_MACOSX
 ; OSX uses native platform impl.  Windows, Linux, and Android uses fallback JS impl.
 @BINPATH@/components/nsDNSServiceDiscovery.manifest
 @BINPATH@/components/nsDNSServiceDiscovery.js
 #endif
 @RESPATH@/browser/components/BrowserComponents.manifest
-@RESPATH@/browser/components/nsBrowserContentHandler.js
-@RESPATH@/browser/components/nsBrowserGlue.js
 @RESPATH@/browser/components/devtools-startup.manifest
 @RESPATH@/browser/components/devtools-startup.js
 @RESPATH@/browser/components/aboutdebugging-registration.js
 @RESPATH@/browser/components/aboutdebugging.manifest
 #ifdef NIGHTLY_BUILD
 @RESPATH@/browser/components/aboutdebugging-new-registration.js
 @RESPATH@/browser/components/aboutdebugging-new.manifest
 #endif
@@ -188,17 +186,16 @@
 @RESPATH@/browser/components/aboutdevtools.manifest
 @RESPATH@/browser/components/aboutdevtoolstoolbox-registration.js
 @RESPATH@/browser/components/aboutdevtoolstoolbox.manifest
 @RESPATH@/browser/components/aboutNewTabService.js
 @RESPATH@/browser/components/NewTabComponents.manifest
 @RESPATH@/browser/components/EnterprisePolicies.js
 @RESPATH@/browser/components/EnterprisePoliciesContent.js
 @RESPATH@/browser/components/EnterprisePolicies.manifest
-@RESPATH@/browser/components/WebProtocolHandlerRegistrar.js
 @RESPATH@/components/Downloads.manifest
 @RESPATH@/components/DownloadLegacy.js
 @RESPATH@/components/PageThumbsComponents.manifest
 @RESPATH@/components/crashmonitor.manifest
 @RESPATH@/components/nsCrashMonitor.js
 @RESPATH@/components/toolkitsearch.manifest
 @RESPATH@/components/nsSearchService.js
 @RESPATH@/components/nsSearchSuggestions.js
--- a/browser/modules/ContentClick.jsm
+++ b/browser/modules/ContentClick.jsm
@@ -10,17 +10,17 @@ var EXPORTED_SYMBOLS = [ "ContentClick" 
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 ChromeUtils.defineModuleGetter(this, "PlacesUIUtils",
                                "resource:///modules/PlacesUIUtils.jsm");
 ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",
                                "resource://gre/modules/PrivateBrowsingUtils.jsm");
 
 var ContentClick = {
-  // Listeners are added in nsBrowserGlue.js
+  // Listeners are added in BrowserGlue.jsm
   receiveMessage(message) {
     switch (message.name) {
       case "Content:Click":
         this.contentAreaClick(message.json, message.target);
         break;
     }
   },
 
--- a/browser/modules/ContentSearch.jsm
+++ b/browser/modules/ContentSearch.jsm
@@ -148,17 +148,17 @@ var ContentSearch = {
    *         The MessageManager object of the selected browser.
    */
   focusInput(messageManager) {
     messageManager.sendAsyncMessage(OUTBOUND_MESSAGE, {
       type: "FocusInput",
     });
   },
 
-  // Listeners and observers are added in nsBrowserGlue.js
+  // Listeners and observers are added in BrowserGlue.jsm
   receiveMessage(msg) {
     // Add a temporary event handler that exists only while the message is in
     // the event queue.  If the message's source docshell changes browsers in
     // the meantime, then we need to update msg.target.  event.detail will be
     // the docshell's new parent <xul:browser> element.
     msg.handleEvent = event => {
       let browserData = this._suggestionMap.get(msg.target);
       if (browserData) {
--- a/browser/modules/FormValidationHandler.jsm
+++ b/browser/modules/FormValidationHandler.jsm
@@ -27,17 +27,17 @@ var FormValidationHandler =
   hidePopup() {
     this._hidePopup();
   },
 
   /*
    * Events
    */
 
-  // Listeners are added in nsBrowserGlue.js
+  // Listeners are added in BrowserGlue.jsm
   receiveMessage(aMessage) {
     let window = aMessage.target.ownerGlobal;
     let json = aMessage.json;
     let tabBrowser = window.gBrowser;
     switch (aMessage.name) {
       case "FormValidation:ShowPopup":
         // target is the <browser>, make sure we're receiving a message
         // from the foreground tab.
--- a/browser/modules/ReaderParent.jsm
+++ b/browser/modules/ReaderParent.jsm
@@ -10,17 +10,17 @@ var EXPORTED_SYMBOLS = [ "ReaderParent" 
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 ChromeUtils.defineModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
 ChromeUtils.defineModuleGetter(this, "ReaderMode", "resource://gre/modules/ReaderMode.jsm");
 
 const gStringBundle = Services.strings.createBundle("chrome://global/locale/aboutReader.properties");
 
 var ReaderParent = {
-  // Listeners are added in nsBrowserGlue.js
+  // Listeners are added in BrowserGlue.jsm
   receiveMessage(message) {
     switch (message.name) {
       case "Reader:FaviconRequest": {
         if (message.target.messageManager) {
           try {
             let preferredWidth = message.data.preferredWidth || 0;
             let uri = Services.io.newURI(message.data.url);
             PlacesUtils.favicons.getFaviconURLForPage(uri, iconUri => {
--- a/browser/modules/RemotePrompt.jsm
+++ b/browser/modules/RemotePrompt.jsm
@@ -8,17 +8,17 @@
 var EXPORTED_SYMBOLS = [ "RemotePrompt" ];
 
 ChromeUtils.defineModuleGetter(this, "PromptUtils",
                                "resource://gre/modules/SharedPromptUtils.jsm");
 ChromeUtils.defineModuleGetter(this, "Services",
                                "resource://gre/modules/Services.jsm");
 
 var RemotePrompt = {
-  // Listeners are added in nsBrowserGlue.js
+  // Listeners are added in BrowserGlue.jsm
   receiveMessage(message) {
     switch (message.name) {
       case "Prompt:Open":
         if (message.data.uri) {
           this.openModalWindow(message.data, message.target);
         } else {
           this.openTabPrompt(message.data, message.target);
         }
--- a/browser/modules/webrtcUI.jsm
+++ b/browser/modules/webrtcUI.jsm
@@ -196,17 +196,17 @@ var webrtcUI = {
   on(...args) {
     return this.emitter.on(...args);
   },
 
   off(...args) {
     return this.emitter.off(...args);
   },
 
-  // Listeners and observers are registered in nsBrowserGlue.js
+  // Listeners and observers are registered in BrowserGlue.jsm
   receiveMessage(aMessage) {
     switch (aMessage.name) {
       case "rtcpeer:Request": {
         let params = Object.freeze(Object.assign({
           origin: aMessage.target.contentPrincipal.origin,
         }, aMessage.data));
 
         let blockers = Array.from(this.peerConnectionBlockers);
--- a/browser/themes/shared/compacttheme.inc.css
+++ b/browser/themes/shared/compacttheme.inc.css
@@ -9,13 +9,13 @@
 :root:-moz-lwtheme {
   --toolbar-non-lwt-bgcolor: var(--toolbar-bgcolor);
   --toolbar-non-lwt-textcolor: var(--lwt-text-color);
   --toolbar-non-lwt-bgimage: none;
 }
 
 :root:-moz-lwtheme-brighttext {
   /* !important to override LightweightThemeManager.addBuiltInTheme in
-     nsBrowserGlue.js */
+     BrowserGlue.jsm */
   --autocomplete-popup-background: #2A2A2E !important;
   --autocomplete-popup-highlight-background: #0060DF;
 }
 
--- a/mobile/android/components/BrowserCLH.js
+++ b/mobile/android/components/BrowserCLH.js
@@ -81,24 +81,26 @@ BrowserCLH.prototype = {
           notifyInvalidSubmit: (form, element) => {
             this.FormAssistant.notifyInvalidSubmit(form, element);
           },
         }, "invalidformsubmit");
 
         GeckoViewUtils.addLazyGetter(this, "LoginManagerParent", {
           module: "resource://gre/modules/LoginManagerParent.jsm",
           mm: [
-            // PLEASE KEEP THIS LIST IN SYNC WITH THE DESKTOP LIST IN nsBrowserGlue.js
+            // PLEASE KEEP THIS LIST IN SYNC WITH THE DESKTOP LIST IN
+            // BrowserGlue.jsm
             "RemoteLogins:findLogins",
             "RemoteLogins:findRecipes",
             "RemoteLogins:onFormSubmit",
             "RemoteLogins:autoCompleteLogins",
             "RemoteLogins:removeLogin",
             "RemoteLogins:insecureLoginFormPresent",
-            // PLEASE KEEP THIS LIST IN SYNC WITH THE DESKTOP LIST IN nsBrowserGlue.js
+            // PLEASE KEEP THIS LIST IN SYNC WITH THE DESKTOP LIST IN
+            // BrowserGlue.jsm
           ],
         });
         GeckoViewUtils.addLazyGetter(this, "LoginManagerContent", {
           module: "resource://gre/modules/LoginManagerContent.jsm",
         });
 
         GeckoViewUtils.addLazyGetter(this, "ActionBarHandler", {
           module: "resource://gre/modules/ActionBarHandler.jsm",
--- a/python/mozbuild/mozbuild/test/codecoverage/test_lcov_rewrite.py
+++ b/python/mozbuild/mozbuild/test/codecoverage/test_lcov_rewrite.py
@@ -284,20 +284,16 @@ class TestUrlFinder(unittest.TestCase):
             {
                 'chrome://global/content/netError.xhtml': 'chrome://browser/content/aboutNetError.xhtml',
             },
             {
                 'dist/bin/components/MainProcessSingleton.js': [
                     'path1',
                     None
                 ],
-                'dist/bin/browser/components/nsBrowserGlue.js': [
-                    'path2',
-                    None
-                ],
                 'dist/bin/browser/features/firefox@getpocket.com/bootstrap.js': [
                     'path4',
                     None
                 ],
                 'dist/bin/modules/osfile/osfile_async_worker.js': [
                     'toolkit/components/osfile/modules/osfile_async_worker.js',
                     None
                 ],
@@ -329,17 +325,16 @@ class TestUrlFinder(unittest.TestCase):
             shutil.move(self._old_chrome_info_file, self._chrome_map_file)
 
     def test_jar_paths(self):
         app_name = buildconfig.substs.get('MOZ_APP_NAME')
         omnijar_name = buildconfig.substs.get('OMNIJAR_NAME')
 
         paths = [
             ('jar:file:///home/worker/workspace/build/application/' + app_name + '/' + omnijar_name + '!/components/MainProcessSingleton.js', 'path1'),
-            ('jar:file:///home/worker/workspace/build/application/' + app_name + '/browser/' + omnijar_name + '!/components/nsBrowserGlue.js', 'path2'),
             ('jar:file:///home/worker/workspace/build/application/' + app_name + '/browser/features/firefox@getpocket.com.xpi!/bootstrap.js', 'path4'),
         ]
 
         url_finder = lcov_rewriter.UrlFinder(self._chrome_map_file, '', '', [])
         for path, expected in paths:
             self.assertEqual(url_finder.rewrite_url(path)[0], expected)
 
     def test_wrong_scheme_paths(self):
--- a/toolkit/components/contentprefs/ContentPrefServiceParent.jsm
+++ b/toolkit/components/contentprefs/ContentPrefServiceParent.jsm
@@ -24,17 +24,17 @@ function contextArg(context) {
 var ContentPrefServiceParent = {
   // Called on all platforms.
   alwaysInit() {
     let globalMM = Cc["@mozilla.org/parentprocessmessagemanager;1"].getService();
 
     globalMM.addMessageListener("child-process-shutdown", this);
   },
 
-  // Only called on Android. Listeners are added in nsBrowserGlue.js on other
+  // Only called on Android. Listeners are added in BrowserGlue.jsm on other
   // platforms.
   init() {
     let globalMM = Cc["@mozilla.org/parentprocessmessagemanager;1"].getService();
 
     // PLEASE KEEP THIS LIST IN SYNC WITH THE LISTENERS ADDED IN nsBrowserGlue
     globalMM.addMessageListener("ContentPrefs:FunctionCall", this);
     globalMM.addMessageListener("ContentPrefs:AddObserverForName", this);
     globalMM.addMessageListener("ContentPrefs:RemoveObserverForName", this);
@@ -101,17 +101,17 @@ var ContentPrefServiceParent = {
       observer._names.delete(prefName);
       if (observer._names.size === 0) {
         // This was the last use for this observer.
         this._observers.delete(msg.target);
       }
     }
   },
 
-  // Listeners are added in nsBrowserGlue.js
+  // Listeners are added in BrowserGlue.jsm
   receiveMessage(msg) {
     if (msg.name != "ContentPrefs:FunctionCall") {
       this.handleObserverChange(msg);
       return;
     }
 
     let data = msg.data;
     let signature;
--- a/toolkit/components/passwordmgr/LoginManagerParent.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerParent.jsm
@@ -62,17 +62,17 @@ var LoginManagerParent = {
     // Dedupe so the length checks below still make sense with scheme upgrades.
     let resolveBy = [
       "scheme",
       "timePasswordChanged",
     ];
     return LoginHelper.dedupeLogins(logins, ["username"], resolveBy, formOrigin);
   },
 
-  // Listeners are added in nsBrowserGlue.js on desktop
+  // Listeners are added in BrowserGlue.jsm on desktop
   // and in BrowserCLH.js on mobile.
   receiveMessage(msg) {
     let data = msg.data;
     switch (msg.name) {
       case "RemoteLogins:findLogins": {
         // TODO Verify msg.target's principals against the formOrigin?
         this.sendLoginDataToChild(data.options.showMasterPassword,
                                   data.formOrigin,
--- a/toolkit/components/telemetry/hybrid-content/HybridContentTelemetry.jsm
+++ b/toolkit/components/telemetry/hybrid-content/HybridContentTelemetry.jsm
@@ -40,17 +40,18 @@ let HybridContentTelemetry = {
                                           TelemetryUtils.Preferences.FhrUploadEnabled,
                                           false, /* aDefaultValue */
                                           () => this._broadcastPolicyUpdate());
     this._observerInstalled = true;
   },
 
   /**
    * This is the handler for the async "HybridContentTelemetry:onTelemetryMessage"
-   * message. This function is getting called by the listener in nsBrowserGlue.js.
+   * message. This function is getting called by the listener in
+   * BrowserGlue.jsm.
    */
   onTelemetryMessage(aMessage, aData) {
     if (!this._hybridContentEnabled) {
       this._log.trace("onTelemetryMessage - hybrid content telemetry is disabled.");
       return;
     }
 
     this._log.trace("onTelemetryMessage - Message received, dispatching API call.");
--- a/toolkit/components/telemetry/hybrid-content/content-HybridContentTelemetry.js
+++ b/toolkit/components/telemetry/hybrid-content/content-HybridContentTelemetry.js
@@ -119,17 +119,17 @@ var HybridContentTelemetryListener = {
     // Note that the name of the message must match the name of the one
     // in HybridContentTelemetry.jsm.
     if (!this._hasListener) {
       addMessageListener(HCT_POLICY_CHANGE_MSG, this);
       this._hasListener = true;
     }
 
     // Note that the name of the async message must match the name of
-    // the message in the related listener in nsBrowserGlue.js.
+    // the message in the related listener in BrowserGlue.jsm.
     sendAsyncMessage("HybridContentTelemetry:onTelemetryMessage", {
       name: event.detail.name,
       data: event.detail.data,
     });
   },
 
   /**
    * Handles the HCT_POLICY_CHANGE_MSG message coming from chrome and