From 8d2d3540c68af8f70f78b514e47607ae3d418b4e Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 29 Jan 2019 20:23:24 -0800 Subject: [PATCH] Bug 1524688: Part 14 - Convert SimpleServices to static registration. r=aswan --HG-- rename : toolkit/components/utils/simpleServices.js => toolkit/components/utils/SimpleServices.jsm extra : rebase_source : 4648187a04804b04c28a135e839e838b0b2ca1cb --- browser/installer/package-manifest.in | 2 -- mobile/android/installer/package-manifest.in | 2 -- .../{simpleServices.js => SimpleServices.jsm} | 5 +---- toolkit/components/utils/components.conf | 21 +++++++++++++++++++ toolkit/components/utils/moz.build | 9 +++++--- toolkit/components/utils/utils.manifest | 6 ------ 6 files changed, 28 insertions(+), 17 deletions(-) rename toolkit/components/utils/{simpleServices.js => SimpleServices.jsm} (94%) create mode 100644 toolkit/components/utils/components.conf delete mode 100644 toolkit/components/utils/utils.manifest diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index 8f5792ec2514..6c1b5021063d 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -215,8 +215,6 @@ #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 diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in index a6844537da7a..9e6935374d04 100644 --- a/mobile/android/installer/package-manifest.in +++ b/mobile/android/installer/package-manifest.in @@ -131,8 +131,6 @@ @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 diff --git a/toolkit/components/utils/simpleServices.js b/toolkit/components/utils/SimpleServices.jsm similarity index 94% rename from toolkit/components/utils/simpleServices.js rename to toolkit/components/utils/SimpleServices.jsm index d14ae59bf577..2665308df525 100644 --- a/toolkit/components/utils/simpleServices.js +++ b/toolkit/components/utils/SimpleServices.jsm @@ -38,7 +38,6 @@ function AddonLocalizationConverter() { } AddonLocalizationConverter.prototype = { - classID: Components.ID("{ded150e3-c92e-4077-a396-0dba9953e39f}"), QueryInterface: ChromeUtils.generateQI([Ci.nsIStreamConverter]), FROM_TYPE: "application/vnd.mozilla.webext.unlocalized", @@ -121,7 +120,6 @@ function HttpIndexViewer() { } HttpIndexViewer.prototype = { - classID: Components.ID("{742ad274-34c5-43d1-a8b7-293eaf8962d6}"), QueryInterface: ChromeUtils.generateQI([Ci.nsIDocumentLoaderFactory]), createInstance(aCommand, aChannel, aLoadGroup, aContentType, aContainer, @@ -144,5 +142,4 @@ HttpIndexViewer.prototype = { }, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AddonLocalizationConverter, - HttpIndexViewer]); +var EXPORTED_SYMBOLS = ["AddonLocalizationConverter", "HttpIndexViewer"]; diff --git a/toolkit/components/utils/components.conf b/toolkit/components/utils/components.conf new file mode 100644 index 000000000000..595381b8e09f --- /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'}, + }, +] diff --git a/toolkit/components/utils/moz.build b/toolkit/components/utils/moz.build index 35ed1bc62193..02dee89be450 100644 --- a/toolkit/components/utils/moz.build +++ b/toolkit/components/utils/moz.build @@ -7,9 +7,8 @@ with Files('**'): BUG_COMPONENT = ('Toolkit', 'General') -EXTRA_COMPONENTS += [ - 'simpleServices.js', - 'utils.manifest', +EXTRA_JS_MODULES += [ + 'SimpleServices.jsm', ] EXTRA_JS_MODULES['components-utils'] = [ @@ -21,5 +20,9 @@ EXTRA_JS_MODULES['components-utils'] = [ 'Sampling.jsm', ] +XPCOM_MANIFESTS += [ + 'components.conf', +] + BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini'] XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini'] diff --git a/toolkit/components/utils/utils.manifest b/toolkit/components/utils/utils.manifest deleted file mode 100644 index cb9dfb1514bd..000000000000 --- 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