diff --git a/browser/base/content/test/performance/browser_startup.js b/browser/base/content/test/performance/browser_startup.js index e212738997a0..29637b615dc2 100644 --- a/browser/base/content/test/performance/browser_startup.js +++ b/browser/base/content/test/performance/browser_startup.js @@ -27,8 +27,6 @@ const startupPhases = { // eg. from BrowserGlue.jsm' _onFirstWindowLoaded method). "before profile selection": {whitelist: { components: new Set([ - "MainProcessSingleton.js", - // Bugs to fix: The following components shouldn't be initialized that early. "PushComponents.js", // bug 1369436 ]), @@ -38,6 +36,7 @@ const startupPhases = { "resource://gre/modules/ActorManagerParent.jsm", "resource://gre/modules/CustomElementsListener.jsm", "resource://gre/modules/ExtensionUtils.jsm", + "resource://gre/modules/MainProcessSingleton.jsm", "resource://gre/modules/XPCOMUtils.jsm", "resource://gre/modules/Services.jsm", ]), diff --git a/browser/base/content/test/performance/browser_startup_content.js b/browser/base/content/test/performance/browser_startup_content.js index bbce161fb925..dbf8d92c5287 100644 --- a/browser/base/content/test/performance/browser_startup_content.js +++ b/browser/base/content/test/performance/browser_startup_content.js @@ -18,14 +18,13 @@ const kDumpAllStacks = false; const whitelist = { - components: new Set([ - "ContentProcessSingleton.js", - ]), modules: new Set([ "chrome://mochikit/content/ShutdownLeaksCollector.jsm", "resource://specialpowers/specialpowers.js", "resource://specialpowers/specialpowersAPI.js", + "resource://gre/modules/ContentProcessSingleton.jsm", + // General utilities "resource://gre/modules/AppConstants.jsm", "resource://gre/modules/AsyncShutdown.jsm", diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index 34ef22262469..49391c824022 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -231,8 +231,6 @@ @RESPATH@/components/utils.manifest @RESPATH@/components/simpleServices.js @RESPATH@/components/ProcessSingleton.manifest -@RESPATH@/components/MainProcessSingleton.js -@RESPATH@/components/ContentProcessSingleton.js @RESPATH@/components/nsURLFormatter.manifest @RESPATH@/components/nsURLFormatter.js @RESPATH@/components/PageThumbsStorageService.js diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in index 133505106e7a..5a44f872241c 100644 --- a/mobile/android/installer/package-manifest.in +++ b/mobile/android/installer/package-manifest.in @@ -166,8 +166,6 @@ @BINPATH@/components/nsUpdateTimerManager.js @BINPATH@/components/ProcessSingleton.manifest -@BINPATH@/components/MainProcessSingleton.js -@BINPATH@/components/ContentProcessSingleton.js @BINPATH@/components/nsURLFormatter.manifest @BINPATH@/components/nsURLFormatter.js @BINPATH@/components/ContentPrefService2.manifest diff --git a/toolkit/components/processsingleton/ContentProcessSingleton.js b/toolkit/components/processsingleton/ContentProcessSingleton.jsm similarity index 94% rename from toolkit/components/processsingleton/ContentProcessSingleton.js rename to toolkit/components/processsingleton/ContentProcessSingleton.jsm index 9d56b1d621b5..e27b58a11c71 100644 --- a/toolkit/components/processsingleton/ContentProcessSingleton.js +++ b/toolkit/components/processsingleton/ContentProcessSingleton.jsm @@ -39,4 +39,4 @@ ContentProcessSingleton.prototype = { }, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentProcessSingleton]); +var EXPORTED_SYMBOLS = ["ContentProcessSingleton"]; diff --git a/toolkit/components/processsingleton/MainProcessSingleton.js b/toolkit/components/processsingleton/MainProcessSingleton.jsm similarity index 95% rename from toolkit/components/processsingleton/MainProcessSingleton.js rename to toolkit/components/processsingleton/MainProcessSingleton.jsm index 142491b9f46d..e9eaa5d8c935 100644 --- a/toolkit/components/processsingleton/MainProcessSingleton.js +++ b/toolkit/components/processsingleton/MainProcessSingleton.jsm @@ -5,7 +5,6 @@ "use strict"; const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); -const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); ChromeUtils.defineModuleGetter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm"); @@ -75,4 +74,4 @@ MainProcessSingleton.prototype = { }, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MainProcessSingleton]); +var EXPORTED_SYMBOLS = ["MainProcessSingleton"]; diff --git a/toolkit/components/processsingleton/ProcessSingleton.manifest b/toolkit/components/processsingleton/ProcessSingleton.manifest index 7a882ed7b6fb..bf33cfd5c2cd 100644 --- a/toolkit/components/processsingleton/ProcessSingleton.manifest +++ b/toolkit/components/processsingleton/ProcessSingleton.manifest @@ -1,7 +1,2 @@ -component {0636a680-45cb-11e4-916c-0800200c9a66} MainProcessSingleton.js process=main -contract @mozilla.org/main-process-singleton;1 {0636a680-45cb-11e4-916c-0800200c9a66} process=main category app-startup MainProcessSingleton service,@mozilla.org/main-process-singleton;1 process=main - -component {ca2a8470-45c7-11e4-916c-0800200c9a66} ContentProcessSingleton.js process=content -contract @mozilla.org/content-process-singleton;1 {ca2a8470-45c7-11e4-916c-0800200c9a66} process=content category app-startup ContentProcessSingleton service,@mozilla.org/content-process-singleton;1 process=content diff --git a/toolkit/components/processsingleton/components.conf b/toolkit/components/processsingleton/components.conf new file mode 100644 index 000000000000..2a3c02a8395e --- /dev/null +++ b/toolkit/components/processsingleton/components.conf @@ -0,0 +1,22 @@ +# -*- 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': '{0636a680-45cb-11e4-916c-0800200c9a66}', + 'contract_ids': ['@mozilla.org/main-process-singleton;1'], + 'jsm': 'resource://gre/modules/MainProcessSingleton.jsm', + 'constructor': 'MainProcessSingleton', + 'processes': ProcessSelector.MAIN_PROCESS_ONLY, + }, + { + 'cid': '{ca2a8470-45c7-11e4-916c-0800200c9a66}', + 'contract_ids': ['@mozilla.org/content-process-singleton;1'], + 'jsm': 'resource://gre/modules/ContentProcessSingleton.jsm', + 'constructor': 'ContentProcessSingleton', + 'processes': ProcessSelector.CONTENT_PROCESS_ONLY, + }, +] diff --git a/toolkit/components/processsingleton/moz.build b/toolkit/components/processsingleton/moz.build index fbb32d3f96fe..ee72302e6b6a 100644 --- a/toolkit/components/processsingleton/moz.build +++ b/toolkit/components/processsingleton/moz.build @@ -8,11 +8,15 @@ with Files('**'): BUG_COMPONENT = ('Toolkit', 'General') EXTRA_COMPONENTS += [ - 'ContentProcessSingleton.js', - 'MainProcessSingleton.js', 'ProcessSingleton.manifest', ] EXTRA_JS_MODULES += [ + 'ContentProcessSingleton.jsm', 'CustomElementsListener.jsm', + 'MainProcessSingleton.jsm', +] + +XPCOM_MANIFESTS += [ + 'components.conf', ]