Bug 1524688: Part 59 - Convert DevToolsStartup to static registration. r=ochameau
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 11:53:03 -0800
changeset 459030 de0b9993bd5d
parent 459029 92877cf4fe33
child 459031 9e9ec7de4160
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)
reviewersochameau
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 59 - Convert DevToolsStartup to static registration. r=ochameau Differential Revision: https://phabricator.services.mozilla.com/D18469
browser/installer/package-manifest.in
devtools/startup/AboutDebuggingNewRegistration.jsm
devtools/startup/AboutDebuggingRegistration.jsm
devtools/startup/AboutDevToolsToolboxRegistration.jsm
devtools/startup/DevToolsStartup.jsm
devtools/startup/aboutdebugging-new-registration.js
devtools/startup/aboutdebugging-new.manifest
devtools/startup/aboutdebugging-registration.js
devtools/startup/aboutdebugging.manifest
devtools/startup/aboutdevtools/AboutDevToolsRegistration.jsm
devtools/startup/aboutdevtools/aboutdevtools-registration.js
devtools/startup/aboutdevtools/aboutdevtools.manifest
devtools/startup/aboutdevtools/components.conf
devtools/startup/aboutdevtools/moz.build
devtools/startup/aboutdevtoolstoolbox-registration.js
devtools/startup/aboutdevtoolstoolbox.manifest
devtools/startup/components.conf
devtools/startup/devtools-startup.js
devtools/startup/devtools-startup.manifest
devtools/startup/moz.build
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -156,28 +156,16 @@
 @BINPATH@/AccessibleHandler.dll
 @BINPATH@/AccessibleMarshal.dll
 @BINPATH@/IA2Marshal.dll
 #endif
 #endif
 
 ; JavaScript components
 @RESPATH@/browser/components/BrowserComponents.manifest
-@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
-@RESPATH@/browser/components/aboutdevtools-registration.js
-@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@/components/toolkitsearch.manifest
 #ifdef NIGHTLY_BUILD
 @RESPATH@/browser/components/payments.manifest
rename from devtools/startup/aboutdebugging-new-registration.js
rename to devtools/startup/AboutDebuggingNewRegistration.jsm
--- a/devtools/startup/aboutdebugging-new-registration.js
+++ b/devtools/startup/AboutDebuggingNewRegistration.jsm
@@ -3,17 +3,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 // This component is only registered and packaged for local and nightly builds in order to
 // open the new about:debugging when going to about:debugging-new, without having to flip
 // the preference. This allows running both versions of about:debugging side by side to
 // compare them.
-const { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const { nsIAboutModule } = Ci;
 
 function AboutDebuggingNew() {}
 
 AboutDebuggingNew.prototype = {
   classDescription: "about:debugging-new",
@@ -33,11 +32,9 @@ AboutDebuggingNew.prototype = {
     return chan;
   },
 
   getURIFlags: function(uri) {
     return nsIAboutModule.ALLOW_SCRIPT;
   },
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([
-  AboutDebuggingNew,
-]);
+var EXPORTED_SYMBOLS = ["AboutDebuggingNew"];
rename from devtools/startup/aboutdebugging-registration.js
rename to devtools/startup/AboutDebuggingRegistration.jsm
--- a/devtools/startup/aboutdebugging-registration.js
+++ b/devtools/startup/AboutDebuggingRegistration.jsm
@@ -3,17 +3,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 // Register the about:debugging URL, that allows to debug various targets such as addons,
 // workers and tabs by launching a dedicated DevTools toolbox for the selected target.
 // If DevTools are not installed, this about page will display a shim landing page
 // encouraging the user to download and install DevTools.
-const { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const { nsIAboutModule } = Ci;
 
 function AboutDebugging() {}
 
 AboutDebugging.prototype = {
   classDescription: "about:debugging",
@@ -35,11 +34,9 @@ AboutDebugging.prototype = {
     return chan;
   },
 
   getURIFlags: function(uri) {
     return nsIAboutModule.ALLOW_SCRIPT;
   },
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([
-  AboutDebugging,
-]);
+var EXPORTED_SYMBOLS = ["AboutDebugging"];
rename from devtools/startup/aboutdevtoolstoolbox-registration.js
rename to devtools/startup/AboutDevToolsToolboxRegistration.jsm
--- a/devtools/startup/aboutdevtoolstoolbox-registration.js
+++ b/devtools/startup/AboutDevToolsToolboxRegistration.jsm
@@ -2,17 +2,16 @@
  * 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";
 
 // Register about:devtools-toolbox which allows to open a devtools toolbox
 // in a Firefox tab or a custom html iframe in browser.html
 
-const { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const { nsIAboutModule } = Ci;
 
 function AboutDevtoolsToolbox() {}
 
 AboutDevtoolsToolbox.prototype = {
   uri: Services.io.newURI("chrome://devtools/content/framework/toolbox.xul"),
@@ -30,11 +29,9 @@ AboutDevtoolsToolbox.prototype = {
 
   getURIFlags: function(uri) {
     return nsIAboutModule.ALLOW_SCRIPT |
            nsIAboutModule.ENABLE_INDEXED_DB |
            nsIAboutModule.HIDE_FROM_ABOUTABOUT;
   },
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([
-  AboutDevtoolsToolbox,
-]);
+var EXPORTED_SYMBOLS = ["AboutDevtoolsToolbox"];
rename from devtools/startup/devtools-startup.js
rename to devtools/startup/DevToolsStartup.jsm
--- a/devtools/startup/devtools-startup.js
+++ b/devtools/startup/DevToolsStartup.jsm
@@ -1002,10 +1002,9 @@ const JsonView = {
         onError(status) {
           throw new Error("JSON Viewer's onSave failed in startPersistence");
         },
       });
     }
   },
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(
-  [DevToolsStartup]);
+var EXPORTED_SYMBOLS = ["DevToolsStartup"];
deleted file mode 100644
--- a/devtools/startup/aboutdebugging-new.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {610e4e26-26bd-4a7d-aebc-69211d5a3be0} aboutdebugging-new-registration.js
-contract @mozilla.org/network/protocol/about;1?what=debugging-new {610e4e26-26bd-4a7d-aebc-69211d5a3be0}
deleted file mode 100644
--- a/devtools/startup/aboutdebugging.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {1060afaf-dc9e-43da-8646-23a2faf48493} aboutdebugging-registration.js
-contract @mozilla.org/network/protocol/about;1?what=debugging {1060afaf-dc9e-43da-8646-23a2faf48493}
\ No newline at end of file
rename from devtools/startup/aboutdevtools/aboutdevtools-registration.js
rename to devtools/startup/aboutdevtools/AboutDevToolsRegistration.jsm
--- a/devtools/startup/aboutdevtools/aboutdevtools-registration.js
+++ b/devtools/startup/aboutdevtools/AboutDevToolsRegistration.jsm
@@ -1,17 +1,16 @@
 /* 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/. */
 
 "use strict";
 
 // Register the about:devtools URL, that is opened whenever a user attempts to open
 // DevTools for the first time.
-const { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const { nsIAboutModule } = Ci;
 
 function AboutDevtools() {}
 
 AboutDevtools.prototype = {
   uri: Services.io.newURI("chrome://devtools-startup/content/aboutdevtools/aboutdevtools.xhtml"),
@@ -30,11 +29,9 @@ AboutDevtools.prototype = {
     return chan;
   },
 
   getURIFlags: function(uri) {
     return nsIAboutModule.ALLOW_SCRIPT;
   },
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([
-  AboutDevtools,
-]);
+var EXPORTED_SYMBOLS = ["AboutDevtools"];
deleted file mode 100644
--- a/devtools/startup/aboutdevtools/aboutdevtools.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {3a16d383-92bd-4c24-ac10-0e2bd66883ab} aboutdevtools-registration.js
-contract @mozilla.org/network/protocol/about;1?what=devtools {3a16d383-92bd-4c24-ac10-0e2bd66883ab}
new file mode 100644
--- /dev/null
+++ b/devtools/startup/aboutdevtools/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': '{3a16d383-92bd-4c24-ac10-0e2bd66883ab}',
+        'contract_ids': ['@mozilla.org/network/protocol/about;1?what=devtools'],
+        'jsm': 'resource:///modules/AboutDevToolsRegistration.jsm',
+        'constructor': 'AboutDevtools',
+    },
+]
--- a/devtools/startup/aboutdevtools/moz.build
+++ b/devtools/startup/aboutdevtools/moz.build
@@ -1,12 +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/.
 
-EXTRA_COMPONENTS += [
-  'aboutdevtools-registration.js',
-  'aboutdevtools.manifest',
+EXTRA_JS_MODULES += [
+  'AboutDevToolsRegistration.jsm',
+]
+
+XPCOM_MANIFESTS += [
+    'components.conf',
 ]
 
 BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
deleted file mode 100644
--- a/devtools/startup/aboutdevtoolstoolbox.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {11342911-3135-45a8-8d71-737a2b0ad469} aboutdevtoolstoolbox-registration.js
-contract @mozilla.org/network/protocol/about;1?what=devtools-toolbox {11342911-3135-45a8-8d71-737a2b0ad469}
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/devtools/startup/components.conf
@@ -0,0 +1,40 @@
+# -*- 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 = []
+
+if buildconfig.substs['MOZ_DEVTOOLS'] == 'all':
+    Classes += [
+        {
+            'cid': '{9e9a9283-0ce9-4e4a-8f1c-ba129a032c32}',
+            'contract_ids': ['@mozilla.org/devtools/startup-clh;1'],
+            'jsm': 'resource:///modules/DevToolsStartup.jsm',
+            'constructor': 'DevToolsStartup',
+            'categories': {'command-line-handler': 'm-devtools'},
+        },
+        {
+            'cid': '{1060afaf-dc9e-43da-8646-23a2faf48493}',
+            'contract_ids': ['@mozilla.org/network/protocol/about;1?what=debugging'],
+            'jsm': 'resource:///modules/AboutDebuggingRegistration.jsm',
+            'constructor': 'AboutDebugging',
+        },
+        {
+            'cid': '{11342911-3135-45a8-8d71-737a2b0ad469}',
+            'contract_ids': ['@mozilla.org/network/protocol/about;1?what=devtools-toolbox'],
+            'jsm': 'resource:///modules/AboutDevToolsToolboxRegistration.jsm',
+            'constructor': 'AboutDevtoolsToolbox',
+        },
+    ]
+
+if defined('NIGHTLY_BUILD'):
+    Classes += [
+        {
+            'cid': '{610e4e26-26bd-4a7d-aebc-69211d5a3be0}',
+            'contract_ids': ['@mozilla.org/network/protocol/about;1?what=debugging-new'],
+            'jsm': 'resource:///modules/AboutDebuggingNewRegistration.jsm',
+            'constructor': 'AboutDebuggingNew',
+        },
+    ]
deleted file mode 100644
--- a/devtools/startup/devtools-startup.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-component {9e9a9283-0ce9-4e4a-8f1c-ba129a032c32} devtools-startup.js
-contract @mozilla.org/devtools/startup-clh;1 {9e9a9283-0ce9-4e4a-8f1c-ba129a032c32}
-category command-line-handler m-devtools @mozilla.org/devtools/startup-clh;1
--- a/devtools/startup/moz.build
+++ b/devtools/startup/moz.build
@@ -7,32 +7,32 @@
 JAR_MANIFESTS += ['jar.mn']
 
 DIRS += [
     'preferences',
 ]
 
 # Register the startup components only for 'all' builds.
 if CONFIG['MOZ_DEVTOOLS'] == 'all':
-    EXTRA_COMPONENTS += [
-        'aboutdebugging-registration.js',
-        'aboutdebugging.manifest',
-        'aboutdevtoolstoolbox-registration.js',
-        'aboutdevtoolstoolbox.manifest',
-        'devtools-startup.js',
-        'devtools-startup.manifest',
+    EXTRA_JS_MODULES += [
+        'AboutDebuggingRegistration.jsm',
+        'AboutDevToolsToolboxRegistration.jsm',
+        'DevToolsStartup.jsm',
     ]
 
     DIRS += [
       'aboutdevtools',
       'locales',
     ]
 
 if CONFIG['NIGHTLY_BUILD']:
     EXTRA_COMPONENTS += [
-        'aboutdebugging-new-registration.js',
-        'aboutdebugging-new.manifest',
+        'AboutDebuggingNewRegistration.jsm',
     ]
 
+XPCOM_MANIFESTS += [
+    'components.conf',
+]
+
 XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
 
 if CONFIG['MOZ_BUILD_APP'] != 'mobile/android':
     BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']