Bug 1524688: Part 32 - Convert mozProtocolHandler to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 10:31:13 -0800
changeset 459004 5746311ef859
parent 459003 df02f7d25212
child 459005 56f5c8f0d708
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 32 - Convert mozProtocolHandler to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18442
browser/installer/package-manifest.in
mobile/android/installer/package-manifest.in
toolkit/components/mozprotocol/MozProtocolHandler.jsm
toolkit/components/mozprotocol/components.conf
toolkit/components/mozprotocol/moz.build
toolkit/components/mozprotocol/mozProtocolHandler.js
toolkit/components/mozprotocol/mozProtocolHandler.manifest
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -204,18 +204,16 @@
 @RESPATH@/components/WebVTTParserWrapper.js
 @RESPATH@/components/nsHelperAppDlg.manifest
 @RESPATH@/components/nsHelperAppDlg.js
 @RESPATH@/components/extensions.manifest
 #ifdef MOZ_UPDATER
 @RESPATH@/components/nsUpdateService.manifest
 #endif
 @RESPATH@/components/ProcessSingleton.manifest
-@RESPATH@/components/mozProtocolHandler.js
-@RESPATH@/components/mozProtocolHandler.manifest
 @RESPATH@/components/ContentPrefService2.manifest
 @RESPATH@/components/ContentPrefService2.js
 @RESPATH@/components/nsContentDispatchChooser.manifest
 @RESPATH@/components/nsContentDispatchChooser.js
 @RESPATH@/components/contentAreaDropListener.manifest
 @RESPATH@/components/contentAreaDropListener.js
 @RESPATH@/components/HandlerService.manifest
 @RESPATH@/components/HandlerService.js
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -109,18 +109,16 @@
 @BINPATH@/components/Push.manifest
 #endif
 @BINPATH@/components/BrowserElementParent.manifest
 @BINPATH@/components/BrowserElementParent.js
 @BINPATH@/components/UAOverridesBootstrapper.js
 @BINPATH@/components/UAOverridesBootstrapper.manifest
 @BINPATH@/components/WellKnownOpportunisticUtils.js
 @BINPATH@/components/WellKnownOpportunisticUtils.manifest
-@BINPATH@/components/mozProtocolHandler.js
-@BINPATH@/components/mozProtocolHandler.manifest
 #ifndef MOZ_GECKOVIEW_JAR
 @BINPATH@/components/nsDNSServiceDiscovery.manifest
 @BINPATH@/components/nsDNSServiceDiscovery.js
 #endif
 @BINPATH@/components/toolkitsearch.manifest
 
 @BINPATH@/components/extensions.manifest
 
rename from toolkit/components/mozprotocol/mozProtocolHandler.js
rename to toolkit/components/mozprotocol/MozProtocolHandler.jsm
--- a/toolkit/components/mozprotocol/mozProtocolHandler.js
+++ b/toolkit/components/mozprotocol/MozProtocolHandler.jsm
@@ -2,22 +2,22 @@
  * 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/. */
 "use strict";
 
 const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 
-function mozProtocolHandler() {
+function MozProtocolHandler() {
   XPCOMUtils.defineLazyPreferenceGetter(this, "urlToLoad", "toolkit.mozprotocol.url",
                                         "https://www.mozilla.org/protocol");
 }
 
-mozProtocolHandler.prototype = {
+MozProtocolHandler.prototype = {
   scheme: "moz",
   defaultPort: -1,
   protocolFlags: Ci.nsIProtocolHandler.URI_DANGEROUS_TO_LOAD,
 
   newURI(spec, charset, base) {
     let mutator = Cc["@mozilla.org/network/simple-uri-mutator;1"]
                     .createInstance(Ci.nsIURIMutator);
     if (base) {
@@ -35,14 +35,12 @@ mozProtocolHandler.prototype = {
     loadInfo.resultPrincipalURI = realURL;
     return channel;
   },
 
   newChannel(uri) {
     return this.newChannel2(uri, null);
   },
 
-  classID: Components.ID("{47a45e5f-691e-4799-8686-14f8d3fc0f8c}"),
-
   QueryInterface: ChromeUtils.generateQI([Ci.nsIProtocolHandler]),
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([mozProtocolHandler]);
+var EXPORTED_SYMBOLS = ["MozProtocolHandler"];
new file mode 100644
--- /dev/null
+++ b/toolkit/components/mozprotocol/components.conf
@@ -0,0 +1,14 @@
+# -*- 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': '{47a45e5f-691e-4799-8686-14f8d3fc0f8c}',
+        'contract_ids': ['@mozilla.org/network/protocol;1?name=moz'],
+        'jsm': 'resource://gre/modules/MozProtocolHandler.jsm',
+        'constructor': 'MozProtocolHandler',
+    },
+]
--- a/toolkit/components/mozprotocol/moz.build
+++ b/toolkit/components/mozprotocol/moz.build
@@ -2,16 +2,19 @@
 # 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/.
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'General')
 
-EXTRA_COMPONENTS += [
-    'mozProtocolHandler.js',
-    'mozProtocolHandler.manifest',
+EXTRA_JS_MODULES += [
+    'MozProtocolHandler.jsm',
+]
+
+XPCOM_MANIFESTS += [
+    'components.conf',
 ]
 
 BROWSER_CHROME_MANIFESTS += [
     'tests/browser.ini'
 ]
deleted file mode 100644
--- a/toolkit/components/mozprotocol/mozProtocolHandler.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {47a45e5f-691e-4799-8686-14f8d3fc0f8c} mozProtocolHandler.js
-contract @mozilla.org/network/protocol;1?name=moz {47a45e5f-691e-4799-8686-14f8d3fc0f8c}