Bug 1524688: Part 14 - Convert SimpleServices to static registration. r=aswan
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Tue, 29 Jan 2019 20:23:24 -0800
changeset 458987 35a5f031dd1e
parent 458986 b586d55d76d5
child 458988 38e1e42a0fb0
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)
reviewersaswan
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 14 - Convert SimpleServices to static registration. r=aswan
browser/installer/package-manifest.in
mobile/android/installer/package-manifest.in
toolkit/components/utils/SimpleServices.jsm
toolkit/components/utils/components.conf
toolkit/components/utils/moz.build
toolkit/components/utils/simpleServices.js
toolkit/components/utils/utils.manifest
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -210,18 +210,16 @@
 @RESPATH@/components/NetworkGeolocationProvider.manifest
 @RESPATH@/components/NetworkGeolocationProvider.js
 @RESPATH@/components/extensions.manifest
 #ifdef MOZ_UPDATER
 @RESPATH@/components/nsUpdateService.manifest
 #endif
 @RESPATH@/components/nsUpdateTimerManager.manifest
 @RESPATH@/components/nsUpdateTimerManager.js
-@RESPATH@/components/utils.manifest
-@RESPATH@/components/simpleServices.js
 @RESPATH@/components/ProcessSingleton.manifest
 @RESPATH@/components/nsURLFormatter.manifest
 @RESPATH@/components/nsURLFormatter.js
 @RESPATH@/components/PageThumbsStorageService.js
 @RESPATH@/components/mozProtocolHandler.js
 @RESPATH@/components/mozProtocolHandler.manifest
 @RESPATH@/components/nsDefaultCLH.manifest
 @RESPATH@/components/nsDefaultCLH.js
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -126,18 +126,16 @@
 @BINPATH@/components/TooltipTextProvider.js
 @BINPATH@/components/TooltipTextProvider.manifest
 @BINPATH@/components/NetworkGeolocationProvider.manifest
 @BINPATH@/components/NetworkGeolocationProvider.js
 
 @BINPATH@/components/extensions.manifest
 
 #ifndef MOZ_GECKOVIEW_JAR
-@BINPATH@/components/utils.manifest
-@BINPATH@/components/simpleServices.js
 @BINPATH@/components/amContentHandler.js
 @BINPATH@/components/amWebAPI.js
 @BINPATH@/components/amInstallTrigger.js
 #ifndef RELEASE_OR_BETA
 @BINPATH@/components/TabSource.js
 #endif
 #endif
 
rename from toolkit/components/utils/simpleServices.js
rename to toolkit/components/utils/SimpleServices.jsm
--- a/toolkit/components/utils/simpleServices.js
+++ b/toolkit/components/utils/SimpleServices.jsm
@@ -33,17 +33,16 @@ const ArrayBufferInputStream = Component
  *
  * See SubstituteChannel in netwerk/protocol/res/ExtensionProtocolHandler.cpp
  * for usage.
  */
 function AddonLocalizationConverter() {
 }
 
 AddonLocalizationConverter.prototype = {
-  classID: Components.ID("{ded150e3-c92e-4077-a396-0dba9953e39f}"),
   QueryInterface: ChromeUtils.generateQI([Ci.nsIStreamConverter]),
 
   FROM_TYPE: "application/vnd.mozilla.webext.unlocalized",
   TO_TYPE: "text/css",
 
   checkTypes(aFromType, aToType) {
     if (aFromType != this.FROM_TYPE) {
       throw Components.Exception("Invalid aFromType value", Cr.NS_ERROR_INVALID_ARG,
@@ -116,17 +115,16 @@ AddonLocalizationConverter.prototype = {
     this.listener.onStopRequest(aRequest, null, aStatusCode);
   },
 };
 
 function HttpIndexViewer() {
 }
 
 HttpIndexViewer.prototype = {
-  classID: Components.ID("{742ad274-34c5-43d1-a8b7-293eaf8962d6}"),
   QueryInterface: ChromeUtils.generateQI([Ci.nsIDocumentLoaderFactory]),
 
   createInstance(aCommand, aChannel, aLoadGroup, aContentType, aContainer,
                  aExtraInfo, aDocListenerResult) {
     aChannel.contentType = "text/html";
 
     let contract = Services.catMan.getCategoryEntry("Gecko-Content-Viewers", "text/html");
     let factory = Cc[contract].getService(Ci.nsIDocumentLoaderFactory);
@@ -139,10 +137,9 @@ HttpIndexViewer.prototype = {
     aDocListenerResult.value =
       streamConv.asyncConvertData("application/http-index-format",
                                   "text/html", listener.value, null);
 
     return res;
   },
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AddonLocalizationConverter,
-                                                     HttpIndexViewer]);
+var EXPORTED_SYMBOLS = ["AddonLocalizationConverter", "HttpIndexViewer"];
new file mode 100644
--- /dev/null
+++ b/toolkit/components/utils/components.conf
@@ -0,0 +1,21 @@
+# -*- 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': '{ded150e3-c92e-4077-a396-0dba9953e39f}',
+        'contract_ids': ['@mozilla.org/streamconv;1?from=application/vnd.mozilla.webext.unlocalized&to=text/css'],
+        'jsm': 'resource://gre/modules/SimpleServices.jsm',
+        'constructor': 'AddonLocalizationConverter',
+    },
+    {
+        'cid': '{742ad274-34c5-43d1-a8b7-293eaf8962d6}',
+        'contract_ids': ['@mozilla.org/content-viewers/http-index-format'],
+        'jsm': 'resource://gre/modules/SimpleServices.jsm',
+        'constructor': 'HttpIndexViewer',
+        'categories': {'Gecko-Content-Viewers': 'application/http-index-format'},
+    },
+]
--- a/toolkit/components/utils/moz.build
+++ b/toolkit/components/utils/moz.build
@@ -2,24 +2,27 @@
 # 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 += [
-    'simpleServices.js',
-    'utils.manifest',
+EXTRA_JS_MODULES += [
+    'SimpleServices.jsm',
 ]
 
 EXTRA_JS_MODULES['components-utils'] = [
     'ClientEnvironment.jsm',
     'FilterExpressions.jsm',
     'JsonSchemaValidator.jsm',
     'mozjexl.js',
     'PreferenceFilters.jsm',
     'Sampling.jsm',
 ]
 
+XPCOM_MANIFESTS += [
+    'components.conf',
+]
+
 BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
 XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
deleted file mode 100644
--- a/toolkit/components/utils/utils.manifest
+++ /dev/null
@@ -1,6 +0,0 @@
-component {ded150e3-c92e-4077-a396-0dba9953e39f} simpleServices.js
-contract @mozilla.org/streamconv;1?from=application/vnd.mozilla.webext.unlocalized&to=text/css {ded150e3-c92e-4077-a396-0dba9953e39f}
-
-component {742ad274-34c5-43d1-a8b7-293eaf8962d6} simpleServices.js
-contract @mozilla.org/content-viewsers/http-index-format {742ad274-34c5-43d1-a8b7-293eaf8962d6}
-category Gecko-Content-Viewers application/http-index-format @mozilla.org/content-viewsers/http-index-format