Bug 1524688: Part 7 - Convert process singletons to static registration r=mconley

--HG--
rename : toolkit/components/processsingleton/ContentProcessSingleton.js => toolkit/components/processsingleton/ContentProcessSingleton.jsm
rename : toolkit/components/processsingleton/MainProcessSingleton.js => toolkit/components/processsingleton/MainProcessSingleton.jsm
extra : rebase_source : 6842e09777db559a25e94118fd64b18079616c6f
This commit is contained in:
Kris Maglione 2019-01-29 18:32:37 -08:00
Родитель 5990d491bd
Коммит 742b6ab14b
9 изменённых файлов: 33 добавлений и 19 удалений

Просмотреть файл

@ -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",
]),

Просмотреть файл

@ -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",

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -39,4 +39,4 @@ ContentProcessSingleton.prototype = {
},
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentProcessSingleton]);
var EXPORTED_SYMBOLS = ["ContentProcessSingleton"];

Просмотреть файл

@ -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"];

Просмотреть файл

@ -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

Просмотреть файл

@ -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,
},
]

Просмотреть файл

@ -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',
]