From 470dbf03b6247fcae45a931f65f706ec06602004 Mon Sep 17 00:00:00 2001 From: "arthur.iakab" Date: Thu, 21 Feb 2019 02:04:02 +0200 Subject: [PATCH] Backed out 5 changesets (bug 1524687) for causing build bustages on platform.h CLOSED TREE Backed out changeset 0f06a6b51bfe (bug 1524687) Backed out changeset 7a1ef487a9e7 (bug 1524687) Backed out changeset accad7b4cbc7 (bug 1524687) Backed out changeset eb33f7e6467c (bug 1524687) Backed out changeset 86cf09db340b (bug 1524687) --- devtools/platform/components.conf | 14 -- devtools/platform/moz.build | 4 - devtools/platform/nsJSInspector.cpp | 18 ++ dom/file/uri/BlobURLProtocolHandler.cpp | 28 +++ dom/file/uri/FontTableURIProtocolHandler.cpp | 32 ++- dom/file/uri/components.conf | 20 -- dom/file/uri/moz.build | 4 - dom/media/webspeech/synth/moz.build | 5 +- .../synth/speechd/SpeechDispatcherModule.cpp | 54 ++++ .../webspeech/synth/speechd/components.conf | 17 -- dom/media/webspeech/synth/speechd/moz.build | 6 +- .../webspeech/synth/test/FakeSynthModule.cpp | 45 ++++ .../webspeech/synth/test/components.conf | 17 -- .../synth/test/nsFakeSynthServices.cpp | 10 +- .../synth/test/nsFakeSynthServices.h | 2 + dom/plugins/base/components.conf | 16 -- dom/plugins/base/moz.build | 5 +- dom/plugins/base/nsPluginModule.cpp | 22 ++ .../PresentationDeviceProviderModule.cpp | 49 ++++ dom/presentation/provider/components.conf | 12 - dom/presentation/provider/moz.build | 5 +- extensions/cookie/components.conf | 22 -- extensions/cookie/moz.build | 4 - extensions/cookie/nsCookieModule.cpp | 31 ++- extensions/cookie/nsCookieModule.h | 19 -- extensions/permissions/components.conf | 16 -- extensions/permissions/moz.build | 5 +- extensions/permissions/nsModuleFactory.cpp | 31 +++ .../pref/autoconfig/src/components.conf | 16 -- extensions/pref/autoconfig/src/moz.build | 5 +- .../pref/autoconfig/src/nsConfigFactory.cpp | 37 +++ .../spellcheck/hunspell/glue/mozHunspell.cpp | 9 - extensions/spellcheck/src/components.conf | 20 -- extensions/spellcheck/src/moz.build | 5 +- .../spellcheck/src/mozSpellCheckerFactory.cpp | 31 +++ gfx/src/components.conf | 14 -- gfx/src/moz.build | 5 +- gfx/src/nsThebesGfxFactory.cpp | 40 +++ js/ductwork/debugger/JSDebugger.cpp | 18 ++ js/ductwork/debugger/components.conf | 14 -- js/ductwork/debugger/moz.build | 4 - modules/libpref/Preferences.cpp | 41 ++- modules/libpref/Preferences.h | 2 - modules/libpref/components.conf | 27 -- modules/libpref/moz.build | 4 - netwerk/dns/mdns/libmdns/components.conf | 9 +- netwerk/dns/mdns/libmdns/moz.build | 5 +- .../dns/mdns/libmdns/nsMulticastDNSModule.cpp | 63 +++++ netwerk/protocol/gio/components.conf | 13 - netwerk/protocol/gio/moz.build | 4 - netwerk/protocol/gio/nsGIOProtocolHandler.cpp | 39 ++- parser/htmlparser/components.conf | 20 -- parser/htmlparser/moz.build | 4 - security/manager/pki/components.conf | 27 -- security/manager/pki/moz.build | 5 +- security/manager/pki/nsPKIModule.cpp | 34 +++ security/sandbox/common/SandboxSettings.cpp | 25 +- security/sandbox/common/components.conf | 13 - security/sandbox/common/moz.build | 4 - .../reporter/SandboxReporterWrappers.cpp | 25 +- .../sandbox/linux/reporter/components.conf | 13 - security/sandbox/linux/reporter/moz.build | 4 - .../component/IdentityCryptoService.cpp | 33 ++- services/crypto/component/components.conf | 13 - services/crypto/component/moz.build | 4 - storage/build/components.conf | 25 -- storage/build/moz.build | 8 +- storage/build/mozStorageModule.cpp | 48 ++++ testing/xpcshell/head.js | 11 +- toolkit/components/mozintl/components.conf | 1 - toolkit/components/mozintl/moz.build | 4 - toolkit/components/places/moz.build | 4 - toolkit/components/satchel/moz.build | 4 - tools/profiler/gecko/components.conf | 15 -- tools/profiler/gecko/nsProfilerFactory.cpp | 25 ++ tools/profiler/moz.build | 5 +- widget/moz.build | 1 - widget/windows/components.conf | 199 --------------- widget/windows/moz.build | 4 - widget/windows/nsWidgetFactory.cpp | 233 +++++++++++++++++- widget/windows/nsWidgetFactory.h | 22 -- xpcom/build/XPCOMInit.cpp | 20 -- xpfe/appshell/components.conf | 21 -- xpfe/appshell/moz.build | 5 +- xpfe/appshell/nsAppShellFactory.cpp | 38 +++ 85 files changed, 1014 insertions(+), 841 deletions(-) delete mode 100644 devtools/platform/components.conf delete mode 100644 dom/file/uri/components.conf create mode 100644 dom/media/webspeech/synth/speechd/SpeechDispatcherModule.cpp delete mode 100644 dom/media/webspeech/synth/speechd/components.conf create mode 100644 dom/media/webspeech/synth/test/FakeSynthModule.cpp delete mode 100644 dom/media/webspeech/synth/test/components.conf delete mode 100644 dom/plugins/base/components.conf create mode 100644 dom/plugins/base/nsPluginModule.cpp create mode 100644 dom/presentation/provider/PresentationDeviceProviderModule.cpp delete mode 100644 extensions/cookie/components.conf delete mode 100644 extensions/cookie/nsCookieModule.h delete mode 100644 extensions/permissions/components.conf create mode 100644 extensions/permissions/nsModuleFactory.cpp delete mode 100644 extensions/pref/autoconfig/src/components.conf create mode 100644 extensions/pref/autoconfig/src/nsConfigFactory.cpp delete mode 100644 extensions/spellcheck/src/components.conf create mode 100644 extensions/spellcheck/src/mozSpellCheckerFactory.cpp delete mode 100644 gfx/src/components.conf create mode 100644 gfx/src/nsThebesGfxFactory.cpp delete mode 100644 js/ductwork/debugger/components.conf delete mode 100644 modules/libpref/components.conf create mode 100644 netwerk/dns/mdns/libmdns/nsMulticastDNSModule.cpp delete mode 100644 netwerk/protocol/gio/components.conf delete mode 100644 parser/htmlparser/components.conf delete mode 100644 security/manager/pki/components.conf create mode 100644 security/manager/pki/nsPKIModule.cpp delete mode 100644 security/sandbox/common/components.conf delete mode 100644 security/sandbox/linux/reporter/components.conf delete mode 100644 services/crypto/component/components.conf delete mode 100644 storage/build/components.conf create mode 100644 storage/build/mozStorageModule.cpp delete mode 100644 tools/profiler/gecko/components.conf create mode 100644 tools/profiler/gecko/nsProfilerFactory.cpp delete mode 100644 widget/windows/components.conf delete mode 100644 widget/windows/nsWidgetFactory.h delete mode 100644 xpfe/appshell/components.conf create mode 100644 xpfe/appshell/nsAppShellFactory.cpp diff --git a/devtools/platform/components.conf b/devtools/platform/components.conf deleted file mode 100644 index 7e7d451b832c..000000000000 --- a/devtools/platform/components.conf +++ /dev/null @@ -1,14 +0,0 @@ -# -*- 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': '{ec5aa99c-7abb-4142-ac5f-aab2419e38e2}', - 'contract_ids': ['@mozilla.org/jsinspector;1'], - 'type': 'mozilla::jsinspector::nsJSInspector', - 'headers': ['/devtools/platform/nsJSInspector.h'], - }, -] diff --git a/devtools/platform/moz.build b/devtools/platform/moz.build index 349f5554029c..5aad20065ea7 100644 --- a/devtools/platform/moz.build +++ b/devtools/platform/moz.build @@ -16,8 +16,4 @@ SOURCES += [ 'nsJSInspector.cpp', ] -XPCOM_MANIFESTS += [ - 'components.conf', -] - FINAL_LIBRARY = 'xul' diff --git a/devtools/platform/nsJSInspector.cpp b/devtools/platform/nsJSInspector.cpp index e4a1e92130f3..298f61121e46 100644 --- a/devtools/platform/nsJSInspector.cpp +++ b/devtools/platform/nsJSInspector.cpp @@ -8,6 +8,7 @@ #include "nsThreadUtils.h" #include "jsfriendapi.h" #include "mozilla/HoldDropJSObjects.h" +#include "mozilla/ModuleUtils.h" #include "mozilla/dom/ScriptSettings.h" #include "nsServiceManagerUtils.h" #include "nsMemory.h" @@ -26,6 +27,8 @@ namespace mozilla { namespace jsinspector { +NS_GENERIC_FACTORY_CONSTRUCTOR(nsJSInspector) + NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsJSInspector) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_ENTRY(nsIJSInspector) @@ -118,3 +121,18 @@ nsJSInspector::GetLastNestRequestor(JS::MutableHandle out) { } // namespace jsinspector } // namespace mozilla + +NS_DEFINE_NAMED_CID(JSINSPECTOR_CID); + +static const mozilla::Module::CIDEntry kJSInspectorCIDs[] = { + {&kJSINSPECTOR_CID, false, nullptr, + mozilla::jsinspector::nsJSInspectorConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry kJSInspectorContracts[] = { + {JSINSPECTOR_CONTRACTID, &kJSINSPECTOR_CID}, {nullptr}}; + +static const mozilla::Module kJSInspectorModule = { + mozilla::Module::kVersion, kJSInspectorCIDs, kJSInspectorContracts}; + +NSMODULE_DEFN(jsinspector) = &kJSInspectorModule; diff --git a/dom/file/uri/BlobURLProtocolHandler.cpp b/dom/file/uri/BlobURLProtocolHandler.cpp index e915224891a3..1e64fcfb6441 100644 --- a/dom/file/uri/BlobURLProtocolHandler.cpp +++ b/dom/file/uri/BlobURLProtocolHandler.cpp @@ -17,6 +17,7 @@ #include "mozilla/dom/MediaSource.h" #include "mozilla/ipc/IPCStreamUtils.h" #include "mozilla/LoadInfo.h" +#include "mozilla/ModuleUtils.h" #include "mozilla/NullPrincipal.h" #include "mozilla/Preferences.h" #include "mozilla/SystemGroup.h" @@ -902,6 +903,33 @@ nsresult NS_GetSourceForMediaSourceURI(nsIURI* aURI, MediaSource** aSource) { namespace mozilla { namespace dom { +#define NS_BLOBPROTOCOLHANDLER_CID \ + { \ + 0xb43964aa, 0xa078, 0x44b2, { \ + 0xb0, 0x6b, 0xfd, 0x4d, 0x1b, 0x17, 0x2e, 0x66 \ + } \ + } + +NS_GENERIC_FACTORY_CONSTRUCTOR(BlobURLProtocolHandler) + +NS_DEFINE_NAMED_CID(NS_BLOBPROTOCOLHANDLER_CID); + +static const Module::CIDEntry kBlobURLProtocolHandlerCIDs[] = { + {&kNS_BLOBPROTOCOLHANDLER_CID, false, nullptr, + BlobURLProtocolHandlerConstructor}, + {nullptr}}; + +static const Module::ContractIDEntry kBlobURLProtocolHandlerContracts[] = { + {NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX BLOBURI_SCHEME, + &kNS_BLOBPROTOCOLHANDLER_CID}, + {nullptr}}; + +static const Module kBlobURLProtocolHandlerModule = { + Module::kVersion, kBlobURLProtocolHandlerCIDs, + kBlobURLProtocolHandlerContracts}; + +NSMODULE_DEFN(BlobURLProtocolHandler) = &kBlobURLProtocolHandlerModule; + bool IsType(nsIURI* aUri, DataInfo::ObjectType aType) { DataInfo* info = GetDataInfoFromURI(aUri); if (!info) { diff --git a/dom/file/uri/FontTableURIProtocolHandler.cpp b/dom/file/uri/FontTableURIProtocolHandler.cpp index 2e2fde110193..b401fceb8a0e 100644 --- a/dom/file/uri/FontTableURIProtocolHandler.cpp +++ b/dom/file/uri/FontTableURIProtocolHandler.cpp @@ -5,10 +5,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "FontTableURIProtocolHandler.h" -#include "nsIURIMutator.h" -#include "nsIUUIDGenerator.h" +#include "mozilla/ModuleUtils.h" #include "nsNetUtil.h" -#include "nsSimpleURI.h" using namespace mozilla; using namespace mozilla::dom; @@ -109,3 +107,31 @@ FontTableURIProtocolHandler::NewURI(const nsACString &aSpec, uri.forget(aResult); return NS_OK; } + +#define NS_FONTTABLEPROTOCOLHANDLER_CID \ + { \ + 0x3fc8f04e, 0xd719, 0x43ca, { \ + 0x9a, 0xd0, 0x18, 0xee, 0x32, 0x02, 0x11, 0xf2 \ + } \ + } + +NS_GENERIC_FACTORY_CONSTRUCTOR(FontTableURIProtocolHandler) + +NS_DEFINE_NAMED_CID(NS_FONTTABLEPROTOCOLHANDLER_CID); + +static const mozilla::Module::CIDEntry FontTableURIProtocolHandlerCIDs[] = { + {&kNS_FONTTABLEPROTOCOLHANDLER_CID, false, nullptr, + FontTableURIProtocolHandlerConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry + FontTableURIProtocolHandlerContracts[] = { + {NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX FONTTABLEURI_SCHEME, + &kNS_FONTTABLEPROTOCOLHANDLER_CID}, + {nullptr}}; + +static const mozilla::Module FontTableURIProtocolHandlerModule = { + mozilla::Module::kVersion, FontTableURIProtocolHandlerCIDs, + FontTableURIProtocolHandlerContracts}; + +NSMODULE_DEFN(FontTableURIProtocolHandler) = &FontTableURIProtocolHandlerModule; diff --git a/dom/file/uri/components.conf b/dom/file/uri/components.conf deleted file mode 100644 index 67b7f799bb66..000000000000 --- a/dom/file/uri/components.conf +++ /dev/null @@ -1,20 +0,0 @@ -# -*- 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': '{3fc8f04e-d719-43ca-9ad0-18ee320211f2}', - 'contract_ids': ['@mozilla.org/network/protocol;1?name=moz-fonttable'], - 'type': 'mozilla::dom::FontTableURIProtocolHandler', - 'headers': ['mozilla/dom/FontTableURIProtocolHandler.h'], - }, - { - 'cid': '{b43964aa-a078-44b2-b06b-fd4d1b172e66}', - 'contract_ids': ['@mozilla.org/network/protocol;1?name=blob'], - 'type': 'mozilla::dom::BlobURLProtocolHandler', - 'headers': ['mozilla/dom/BlobURLProtocolHandler.h'], - }, -] diff --git a/dom/file/uri/moz.build b/dom/file/uri/moz.build index bfd9c4e6024c..1bf3b9ccc673 100644 --- a/dom/file/uri/moz.build +++ b/dom/file/uri/moz.build @@ -20,10 +20,6 @@ UNIFIED_SOURCES += [ 'FontTableURIProtocolHandler.cpp', ] -XPCOM_MANIFESTS += [ - 'components.conf', -] - LOCAL_INCLUDES += [ '/dom/file', '/netwerk/base', diff --git a/dom/media/webspeech/synth/moz.build b/dom/media/webspeech/synth/moz.build index ab1136dbec29..696881c83822 100644 --- a/dom/media/webspeech/synth/moz.build +++ b/dom/media/webspeech/synth/moz.build @@ -38,13 +38,10 @@ if CONFIG['MOZ_WEBSPEECH']: if CONFIG['MOZ_WEBSPEECH_TEST_BACKEND']: UNIFIED_SOURCES += [ + 'test/FakeSynthModule.cpp', 'test/nsFakeSynthServices.cpp' ] - XPCOM_MANIFESTS += [ - 'test/components.conf', - ] - if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': DIRS += ['windows'] diff --git a/dom/media/webspeech/synth/speechd/SpeechDispatcherModule.cpp b/dom/media/webspeech/synth/speechd/SpeechDispatcherModule.cpp new file mode 100644 index 000000000000..4bf356bc846d --- /dev/null +++ b/dom/media/webspeech/synth/speechd/SpeechDispatcherModule.cpp @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* 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/. */ + +#include "mozilla/ModuleUtils.h" +#include "nsIClassInfoImpl.h" +#include "SpeechDispatcherService.h" + +using namespace mozilla::dom; + +#define SPEECHDISPATCHERSERVICE_CID \ + { \ + 0x8817b1cf, 0x5ada, 0x43bf, { \ + 0xbd, 0x73, 0x60, 0x76, 0x57, 0x70, 0x3d, 0x0d \ + } \ + } + +#define SPEECHDISPATCHERSERVICE_CONTRACTID \ + "@mozilla.org/synthspeechdispatcher;1" + +// Defines SpeechDispatcherServiceConstructor +NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR( + SpeechDispatcherService, SpeechDispatcherService::GetInstanceForService) + +// Defines kSPEECHDISPATCHERSERVICE_CID +NS_DEFINE_NAMED_CID(SPEECHDISPATCHERSERVICE_CID); + +static const mozilla::Module::CIDEntry kCIDs[] = { + {&kSPEECHDISPATCHERSERVICE_CID, true, nullptr, + SpeechDispatcherServiceConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry kContracts[] = { + {SPEECHDISPATCHERSERVICE_CONTRACTID, &kSPEECHDISPATCHERSERVICE_CID}, + {nullptr}}; + +static const mozilla::Module::CategoryEntry kCategories[] = { + {"speech-synth-started", "SpeechDispatcher Speech Synth", + SPEECHDISPATCHERSERVICE_CONTRACTID}, + {nullptr}}; + +static const mozilla::Module kModule = { + mozilla::Module::kVersion, + kCIDs, + kContracts, + kCategories, + nullptr, + nullptr, + nullptr, +}; + +NSMODULE_DEFN(synthspeechdispatcher) = &kModule; diff --git a/dom/media/webspeech/synth/speechd/components.conf b/dom/media/webspeech/synth/speechd/components.conf deleted file mode 100644 index 56b01ba5cbc5..000000000000 --- a/dom/media/webspeech/synth/speechd/components.conf +++ /dev/null @@ -1,17 +0,0 @@ -# -*- 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': '{8817b1cf-5ada-43bf-bd73-607657703d0d}', - 'contract_ids': ['@mozilla.org/synthspeechdispatcher;1'], - 'singleton': True, - 'type': 'mozilla::dom::SpeechDispatcherService', - 'headers': ['/dom/media/webspeech/synth/speechd/SpeechDispatcherService.h'], - 'constructor': 'mozilla::dom::SpeechDispatcherService::GetInstanceForService', - 'categories': {"speech-synth-started": 'SpeechDispatcher Speech Synth'}, - }, -] diff --git a/dom/media/webspeech/synth/speechd/moz.build b/dom/media/webspeech/synth/speechd/moz.build index 5dc831883d6c..51d675c10a48 100644 --- a/dom/media/webspeech/synth/speechd/moz.build +++ b/dom/media/webspeech/synth/speechd/moz.build @@ -5,13 +5,9 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. UNIFIED_SOURCES += [ + 'SpeechDispatcherModule.cpp', 'SpeechDispatcherService.cpp' ] - -XPCOM_MANIFESTS += [ - 'components.conf', -] - include('/ipc/chromium/chromium-config.mozbuild') FINAL_LIBRARY = 'xul' diff --git a/dom/media/webspeech/synth/test/FakeSynthModule.cpp b/dom/media/webspeech/synth/test/FakeSynthModule.cpp new file mode 100644 index 000000000000..c195748f3922 --- /dev/null +++ b/dom/media/webspeech/synth/test/FakeSynthModule.cpp @@ -0,0 +1,45 @@ +/* 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/. */ + +#include "mozilla/ModuleUtils.h" +#include "nsIClassInfoImpl.h" + +#include "nsFakeSynthServices.h" + +using namespace mozilla::dom; + +#define FAKESYNTHSERVICE_CID \ + { \ + 0xe7d52d9e, 0xc148, 0x47d8, { \ + 0xab, 0x2a, 0x95, 0xd7, 0xf4, 0x0e, 0xa5, 0x3d \ + } \ + } + +#define FAKESYNTHSERVICE_CONTRACTID "@mozilla.org/fakesynth;1" + +// Defines nsFakeSynthServicesConstructor +NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR( + nsFakeSynthServices, nsFakeSynthServices::GetInstanceForService) + +// Defines kFAKESYNTHSERVICE_CID +NS_DEFINE_NAMED_CID(FAKESYNTHSERVICE_CID); + +static const mozilla::Module::CIDEntry kCIDs[] = { + {&kFAKESYNTHSERVICE_CID, true, nullptr, nsFakeSynthServicesConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry kContracts[] = { + {FAKESYNTHSERVICE_CONTRACTID, &kFAKESYNTHSERVICE_CID}, {nullptr}}; + +static const mozilla::Module::CategoryEntry kCategories[] = { + {"speech-synth-started", "Fake Speech Synth", FAKESYNTHSERVICE_CONTRACTID}, + {nullptr}}; + +static void UnloadFakeSynthmodule() { nsFakeSynthServices::Shutdown(); } + +static const mozilla::Module kModule = { + mozilla::Module::kVersion, kCIDs, kContracts, kCategories, nullptr, nullptr, + UnloadFakeSynthmodule}; + +NSMODULE_DEFN(fakesynth) = &kModule; diff --git a/dom/media/webspeech/synth/test/components.conf b/dom/media/webspeech/synth/test/components.conf deleted file mode 100644 index f37e4eafae77..000000000000 --- a/dom/media/webspeech/synth/test/components.conf +++ /dev/null @@ -1,17 +0,0 @@ -# -*- 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': '{e7d52d9e-c148-47d8-ab2a-95d7f40ea53d}', - 'contract_ids': ['@mozilla.org/fakesynth;1'], - 'singleton': True, - 'type': 'mozilla::dom::nsFakeSynthServices', - 'headers': ['/dom/media/webspeech/synth/test/nsFakeSynthServices.h'], - 'constructor': 'mozilla::dom::nsFakeSynthServices::GetInstanceForService', - 'categories': {'speech-synth-started': 'Fake Speech Synth'}, - }, -] diff --git a/dom/media/webspeech/synth/test/nsFakeSynthServices.cpp b/dom/media/webspeech/synth/test/nsFakeSynthServices.cpp index e1d6a2bb4028..2c7db5ec4ee0 100644 --- a/dom/media/webspeech/synth/test/nsFakeSynthServices.cpp +++ b/dom/media/webspeech/synth/test/nsFakeSynthServices.cpp @@ -10,7 +10,6 @@ #include "SharedBuffer.h" #include "nsISimpleEnumerator.h" -#include "mozilla/ClearOnShutdown.h" #include "mozilla/dom/nsSynthVoiceRegistry.h" #include "mozilla/dom/nsSpeechTask.h" @@ -274,7 +273,6 @@ nsFakeSynthServices* nsFakeSynthServices::GetInstance() { if (!sSingleton) { sSingleton = new nsFakeSynthServices(); - ClearOnShutdown(&sSingleton); } return sSingleton; @@ -286,5 +284,13 @@ nsFakeSynthServices::GetInstanceForService() { return picoService.forget(); } +void nsFakeSynthServices::Shutdown() { + if (!sSingleton) { + return; + } + + sSingleton = nullptr; +} + } // namespace dom } // namespace mozilla diff --git a/dom/media/webspeech/synth/test/nsFakeSynthServices.h b/dom/media/webspeech/synth/test/nsFakeSynthServices.h index 872ad0bb9fdb..9d059bc899f7 100644 --- a/dom/media/webspeech/synth/test/nsFakeSynthServices.h +++ b/dom/media/webspeech/synth/test/nsFakeSynthServices.h @@ -29,6 +29,8 @@ class nsFakeSynthServices : public nsIObserver { static already_AddRefed GetInstanceForService(); + static void Shutdown(); + private: virtual ~nsFakeSynthServices() = default; diff --git a/dom/plugins/base/components.conf b/dom/plugins/base/components.conf deleted file mode 100644 index 4b90c78f4416..000000000000 --- a/dom/plugins/base/components.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -*- 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': '{23e8fd98-a625-4b08-be1a-f7cc18a5b106}', - 'contract_ids': ['@mozilla.org/plugin/host;1'], - 'singleton': True, - 'type': 'nsPluginHost', - 'headers': ['nsPluginHost.h'], - 'constructor': 'nsPluginHost::GetInst', - }, -] diff --git a/dom/plugins/base/moz.build b/dom/plugins/base/moz.build index ea67636794f7..7f6161d80a51 100644 --- a/dom/plugins/base/moz.build +++ b/dom/plugins/base/moz.build @@ -38,6 +38,7 @@ UNIFIED_SOURCES += [ 'nsNPAPIPluginInstance.cpp', 'nsNPAPIPluginStreamListener.cpp', 'nsPluginInstanceOwner.cpp', + 'nsPluginModule.cpp', 'nsPluginStreamListenerPeer.cpp', 'nsPluginTags.cpp', ] @@ -66,10 +67,6 @@ else: 'nsPluginsDirUnix.cpp', ] -XPCOM_MANIFESTS += [ - 'components.conf', -] - LOCAL_INCLUDES += [ '/dom/base', '/dom/plugins/ipc', diff --git a/dom/plugins/base/nsPluginModule.cpp b/dom/plugins/base/nsPluginModule.cpp new file mode 100644 index 000000000000..4648a7567aae --- /dev/null +++ b/dom/plugins/base/nsPluginModule.cpp @@ -0,0 +1,22 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#include "mozilla/ModuleUtils.h" +#include "nsPluginHost.h" +#include "nsPluginsCID.h" + +NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsPluginHost, nsPluginHost::GetInst) +NS_DEFINE_NAMED_CID(NS_PLUGIN_HOST_CID); + +static const mozilla::Module::CIDEntry kPluginCIDs[] = { + {&kNS_PLUGIN_HOST_CID, false, nullptr, nsPluginHostConstructor}, {nullptr}}; + +static const mozilla::Module::ContractIDEntry kPluginContracts[] = { + {MOZ_PLUGIN_HOST_CONTRACTID, &kNS_PLUGIN_HOST_CID}, {nullptr}}; + +static const mozilla::Module kPluginModule = {mozilla::Module::kVersion, + kPluginCIDs, kPluginContracts}; + +NSMODULE_DEFN(nsPluginModule) = &kPluginModule; diff --git a/dom/presentation/provider/PresentationDeviceProviderModule.cpp b/dom/presentation/provider/PresentationDeviceProviderModule.cpp new file mode 100644 index 000000000000..4afa3c08d3ec --- /dev/null +++ b/dom/presentation/provider/PresentationDeviceProviderModule.cpp @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* 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/. */ + +#include "MulticastDNSDeviceProvider.h" +#include "mozilla/ModuleUtils.h" + +#define MULTICAST_DNS_PROVIDER_CID \ + { \ + 0x814f947a, 0x52f7, 0x41c9, { \ + 0x94, 0xa1, 0x36, 0x84, 0x79, 0x72, 0x84, 0xac \ + } \ + } + +#define MULTICAST_DNS_PROVIDER_CONTRACT_ID \ + "@mozilla.org/presentation-device/multicastdns-provider;1" + +using mozilla::dom::presentation::MulticastDNSDeviceProvider; + +NS_GENERIC_FACTORY_CONSTRUCTOR(MulticastDNSDeviceProvider) +NS_DEFINE_NAMED_CID(MULTICAST_DNS_PROVIDER_CID); + +static const mozilla::Module::CIDEntry kPresentationDeviceProviderCIDs[] = { + {&kMULTICAST_DNS_PROVIDER_CID, false, nullptr, + MulticastDNSDeviceProviderConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry + kPresentationDeviceProviderContracts[] = { + {MULTICAST_DNS_PROVIDER_CONTRACT_ID, &kMULTICAST_DNS_PROVIDER_CID}, + {nullptr}}; + +static const mozilla::Module::CategoryEntry + kPresentationDeviceProviderCategories[] = { +#if defined(MOZ_WIDGET_COCOA) || defined(MOZ_WIDGET_ANDROID) + {PRESENTATION_DEVICE_PROVIDER_CATEGORY, "MulticastDNSDeviceProvider", + MULTICAST_DNS_PROVIDER_CONTRACT_ID}, +#endif + {nullptr}}; + +static const mozilla::Module kPresentationDeviceProviderModule = { + mozilla::Module::kVersion, kPresentationDeviceProviderCIDs, + kPresentationDeviceProviderContracts, + kPresentationDeviceProviderCategories}; + +NSMODULE_DEFN(PresentationDeviceProviderModule) = + &kPresentationDeviceProviderModule; diff --git a/dom/presentation/provider/components.conf b/dom/presentation/provider/components.conf index 70e86eb6b84f..5faef5f26dda 100644 --- a/dom/presentation/provider/components.conf +++ b/dom/presentation/provider/components.conf @@ -4,11 +4,6 @@ # 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/. -categories = {} - -if buildconfig.substs['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'android'): - categories["presentation-device-provider"] = "MulticastDNSDeviceProvider" - Classes = [ { 'cid': '{f4079b8b-ede5-4b90-a112-5b415a931deb}', @@ -16,13 +11,6 @@ Classes = [ 'jsm': 'resource://gre/modules/PresentationControlService.jsm', 'constructor': 'PresentationControlService', }, - { - 'cid': '{814f947a-52f7-41c9-94a1-3684797284ac}', - 'contract_ids': ['@mozilla.org/presentation-device/multicastdns-provider;1'], - 'type': 'mozilla::dom::presentation::MulticastDNSDeviceProvider', - 'headers': ['/dom/presentation/provider/MulticastDNSDeviceProvider.h'], - 'categories': categories, - }, ] if buildconfig.substs['MOZ_WIDGET_TOOLKIT'] == 'android': diff --git a/dom/presentation/provider/moz.build b/dom/presentation/provider/moz.build index 139f30589330..cc4427dd6d03 100644 --- a/dom/presentation/provider/moz.build +++ b/dom/presentation/provider/moz.build @@ -11,10 +11,7 @@ EXTRA_JS_MODULES += [ UNIFIED_SOURCES += [ 'DeviceProviderHelpers.cpp', 'MulticastDNSDeviceProvider.cpp', -] - -XPCOM_MANIFESTS += [ - 'components.conf', + 'PresentationDeviceProviderModule.cpp', ] XPCOM_MANIFESTS += [ diff --git a/extensions/cookie/components.conf b/extensions/cookie/components.conf deleted file mode 100644 index 1e0075b1e52e..000000000000 --- a/extensions/cookie/components.conf +++ /dev/null @@ -1,22 +0,0 @@ -# -*- 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/. - -Headers = [ - '/extensions/cookie/nsCookieModule.h', -] - -UnloadFunc = 'mozilla::CookieModuleDtor' - -Classes = [ - { - 'cid': '{4f6b5e00-0c36-11d5-a535-0010a401eb10}', - 'contract_ids': ['@mozilla.org/permissionmanager;1'], - 'singleton': True, - 'type': 'nsIPermissionManager', - 'constructor': 'nsPermissionManager::GetXPCOMSingleton', - 'headers': ['/extensions/cookie/nsPermissionManager.h'], - }, -] diff --git a/extensions/cookie/moz.build b/extensions/cookie/moz.build index 079150c156fd..51f906e00777 100644 --- a/extensions/cookie/moz.build +++ b/extensions/cookie/moz.build @@ -17,10 +17,6 @@ UNIFIED_SOURCES += [ 'nsPermissionManager.cpp', ] -XPCOM_MANIFESTS += [ - 'components.conf', -] - LOCAL_INCLUDES += [ '/caps', ] diff --git a/extensions/cookie/nsCookieModule.cpp b/extensions/cookie/nsCookieModule.cpp index 63c2db62bdeb..310b2e5b8eff 100644 --- a/extensions/cookie/nsCookieModule.cpp +++ b/extensions/cookie/nsCookieModule.cpp @@ -3,10 +3,35 @@ * 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/. */ +#include "mozilla/ModuleUtils.h" +#include "nsIServiceManager.h" +#include "nsPermissionManager.h" +#include "nsICategoryManager.h" #include "nsCookiePermission.h" +#include "nsString.h" -namespace mozilla { +// Define the constructor function for the objects +NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIPermissionManager, + nsPermissionManager::GetXPCOMSingleton) -void CookieModuleDtor() { nsCookiePermission::Shutdown(); } +NS_DEFINE_NAMED_CID(NS_PERMISSIONMANAGER_CID); -} // namespace mozilla +static const mozilla::Module::CIDEntry kCookieCIDs[] = { + {&kNS_PERMISSIONMANAGER_CID, false, nullptr, + nsIPermissionManagerConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry kCookieContracts[] = { + {NS_PERMISSIONMANAGER_CONTRACTID, &kNS_PERMISSIONMANAGER_CID}, {nullptr}}; + +static void CookieModuleDtor() { nsCookiePermission::Shutdown(); } + +static const mozilla::Module kCookieModule = {mozilla::Module::kVersion, + kCookieCIDs, + kCookieContracts, + nullptr, + nullptr, + nullptr, + CookieModuleDtor}; + +NSMODULE_DEFN(nsCookieModule) = &kCookieModule; diff --git a/extensions/cookie/nsCookieModule.h b/extensions/cookie/nsCookieModule.h deleted file mode 100644 index a654a1c85707..000000000000 --- a/extensions/cookie/nsCookieModule.h +++ /dev/null @@ -1,19 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* 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/. */ - -#ifndef nsCookieModule_h -#define nsCookieModule_h - -#include "nscore.h" - -namespace mozilla { - -void CookieModuleDtor(); - -} // namespace mozilla - -#endif - diff --git a/extensions/permissions/components.conf b/extensions/permissions/components.conf deleted file mode 100644 index ed04a893b32b..000000000000 --- a/extensions/permissions/components.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -*- 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': '{4ca6b67b-5cc7-4e71-a98a-97af1c134862}', - 'contract_ids': ['@mozilla.org/permissions/contentblocker;1'], - 'type': 'nsContentBlocker', - 'headers': ['/extensions/permissions/nsContentBlocker.h'], - 'init_method': 'Init', - 'categories': {'content-policy': '@mozilla.org/permissions/contentblocker;1'}, - }, -] diff --git a/extensions/permissions/moz.build b/extensions/permissions/moz.build index 6860583da840..14bc17b5c748 100644 --- a/extensions/permissions/moz.build +++ b/extensions/permissions/moz.build @@ -6,10 +6,7 @@ UNIFIED_SOURCES += [ 'nsContentBlocker.cpp', -] - -XPCOM_MANIFESTS += [ - 'components.conf', + 'nsModuleFactory.cpp', ] FINAL_LIBRARY = 'xul' diff --git a/extensions/permissions/nsModuleFactory.cpp b/extensions/permissions/nsModuleFactory.cpp new file mode 100644 index 000000000000..3ed08e918a4d --- /dev/null +++ b/extensions/permissions/nsModuleFactory.cpp @@ -0,0 +1,31 @@ +/* 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/. */ + +#include "mozilla/ModuleUtils.h" +#include "nsIServiceManager.h" +#include "nsContentBlocker.h" +#include "nsString.h" + +// Define the constructor function for the objects +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsContentBlocker, Init) + +NS_DEFINE_NAMED_CID(NS_CONTENTBLOCKER_CID); + +static const mozilla::Module::CIDEntry kPermissionsCIDs[] = { + {&kNS_CONTENTBLOCKER_CID, false, nullptr, nsContentBlockerConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry kPermissionsContracts[] = { + {NS_CONTENTBLOCKER_CONTRACTID, &kNS_CONTENTBLOCKER_CID}, {nullptr}}; + +static const mozilla::Module::CategoryEntry kPermissionsCategories[] = { + {"content-policy", NS_CONTENTBLOCKER_CONTRACTID, + NS_CONTENTBLOCKER_CONTRACTID}, + {nullptr}}; + +static const mozilla::Module kPermissionsModule = { + mozilla::Module::kVersion, kPermissionsCIDs, kPermissionsContracts, + kPermissionsCategories}; + +NSMODULE_DEFN(nsPermissionsModule) = &kPermissionsModule; diff --git a/extensions/pref/autoconfig/src/components.conf b/extensions/pref/autoconfig/src/components.conf deleted file mode 100644 index 789a44b2e39b..000000000000 --- a/extensions/pref/autoconfig/src/components.conf +++ /dev/null @@ -1,16 +0,0 @@ -# -*- 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': '{ba5bc4c6-1dd1-11b2-bb89-b844c6ec0339}', - 'contract_ids': ['@mozilla.org/readconfig;1'], - 'type': 'nsReadConfig', - 'headers': ['/extensions/pref/autoconfig/src/nsReadConfig.h'], - 'init_method': 'Init', - 'categories': {'pref-config-startup': 'ReadConfig Module'}, - }, -] diff --git a/extensions/pref/autoconfig/src/moz.build b/extensions/pref/autoconfig/src/moz.build index cb697f0c6615..3417269f0793 100644 --- a/extensions/pref/autoconfig/src/moz.build +++ b/extensions/pref/autoconfig/src/moz.build @@ -6,14 +6,11 @@ UNIFIED_SOURCES += [ 'nsAutoConfig.cpp', + 'nsConfigFactory.cpp', 'nsJSConfigTriggers.cpp', 'nsReadConfig.cpp', ] -XPCOM_MANIFESTS += [ - 'components.conf', -] - FINAL_LIBRARY = 'xul' FINAL_TARGET_FILES.defaults.autoconfig += [ diff --git a/extensions/pref/autoconfig/src/nsConfigFactory.cpp b/extensions/pref/autoconfig/src/nsConfigFactory.cpp new file mode 100644 index 000000000000..3ad82ecbc7ac --- /dev/null +++ b/extensions/pref/autoconfig/src/nsConfigFactory.cpp @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#include "mozilla/ModuleUtils.h" +#include "nsReadConfig.h" +#include "nsIAppStartupNotifier.h" + +#define NS_READCONFIG_CID \ + { \ + 0xba5bc4c6, 0x1dd1, 0x11b2, { \ + 0xbb, 0x89, 0xb8, 0x44, 0xc6, 0xec, 0x03, 0x39 \ + } \ + } + +#define NS_READCONFIG_CONTRACTID "@mozilla.org/readconfig;1" + +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsReadConfig, Init) + +NS_DEFINE_NAMED_CID(NS_READCONFIG_CID); + +static const mozilla::Module::CIDEntry kAutoConfigCIDs[] = { + {&kNS_READCONFIG_CID, false, nullptr, nsReadConfigConstructor}, {nullptr}}; + +static const mozilla::Module::ContractIDEntry kAutoConfigContracts[] = { + {NS_READCONFIG_CONTRACTID, &kNS_READCONFIG_CID}, {nullptr}}; + +static const mozilla::Module::CategoryEntry kAutoConfigCategories[] = { + {"pref-config-startup", "ReadConfig Module", NS_READCONFIG_CONTRACTID}, + {nullptr}}; + +static const mozilla::Module kAutoConfigModule = { + mozilla::Module::kVersion, kAutoConfigCIDs, kAutoConfigContracts, + kAutoConfigCategories}; + +NSMODULE_DEFN(nsAutoConfigModule) = &kAutoConfigModule; diff --git a/extensions/spellcheck/hunspell/glue/mozHunspell.cpp b/extensions/spellcheck/hunspell/glue/mozHunspell.cpp index 9f60f2269d78..e2d985c247ab 100644 --- a/extensions/spellcheck/hunspell/glue/mozHunspell.cpp +++ b/extensions/spellcheck/hunspell/glue/mozHunspell.cpp @@ -72,7 +72,6 @@ #include "nsIPrefBranch.h" #include "nsNetUtil.h" #include "mozilla/dom/ContentParent.h" -#include "mozilla/Components.h" using mozilla::dom::ContentParent; using namespace mozilla; @@ -91,14 +90,6 @@ NS_INTERFACE_MAP_END NS_IMPL_CYCLE_COLLECTION(mozHunspell, mPersonalDictionary) -NS_IMPL_COMPONENT_FACTORY(mozHunspell) { - auto hunspell = MakeRefPtr(); - if (NS_SUCCEEDED(hunspell->Init())) { - return hunspell.forget().downcast(); - } - return nullptr; -} - template <> mozilla::CountingAllocatorBase::AmountType mozilla::CountingAllocatorBase::sAmount(0); diff --git a/extensions/spellcheck/src/components.conf b/extensions/spellcheck/src/components.conf deleted file mode 100644 index 7fc73c1a1714..000000000000 --- a/extensions/spellcheck/src/components.conf +++ /dev/null @@ -1,20 +0,0 @@ -# -*- 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': '{56c778e4-1bee-45f3-a689-886692a97fe7}', - 'contract_ids': ['@mozilla.org/spellchecker/engine;1'], - 'type': 'mozHunspell', - }, - { - 'cid': '{7ef52eaf-b7e1-462b-87e2-5d1dbaca9048}', - 'contract_ids': ['@mozilla.org/spellchecker/personaldictionary;1'], - 'type': 'mozPersonalDictionary', - 'headers': ['/extensions/spellcheck/src/mozPersonalDictionary.h'], - 'init_method': 'Init', - }, -] diff --git a/extensions/spellcheck/src/moz.build b/extensions/spellcheck/src/moz.build index 1fa03d1c566b..3eabf96c4a5f 100644 --- a/extensions/spellcheck/src/moz.build +++ b/extensions/spellcheck/src/moz.build @@ -11,10 +11,7 @@ UNIFIED_SOURCES += [ 'mozInlineSpellWordUtil.cpp', 'mozPersonalDictionary.cpp', 'mozSpellChecker.cpp', -] - -XPCOM_MANIFESTS += [ - 'components.conf', + 'mozSpellCheckerFactory.cpp', ] FINAL_LIBRARY = 'xul' diff --git a/extensions/spellcheck/src/mozSpellCheckerFactory.cpp b/extensions/spellcheck/src/mozSpellCheckerFactory.cpp new file mode 100644 index 000000000000..4b7dff4266c6 --- /dev/null +++ b/extensions/spellcheck/src/mozSpellCheckerFactory.cpp @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#include "mozilla/ModuleUtils.h" +#include "mozHunspell.h" +#include "mozPersonalDictionary.h" +#include "nsIFile.h" + +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(mozHunspell, Init) +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(mozPersonalDictionary, Init) + +NS_DEFINE_NAMED_CID(MOZ_HUNSPELL_CID); +NS_DEFINE_NAMED_CID(MOZ_PERSONALDICTIONARY_CID); + +static const mozilla::Module::CIDEntry kSpellcheckCIDs[] = { + {&kMOZ_HUNSPELL_CID, false, nullptr, mozHunspellConstructor}, + {&kMOZ_PERSONALDICTIONARY_CID, false, nullptr, + mozPersonalDictionaryConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry kSpellcheckContracts[] = { + {MOZ_HUNSPELL_CONTRACTID, &kMOZ_HUNSPELL_CID}, + {MOZ_PERSONALDICTIONARY_CONTRACTID, &kMOZ_PERSONALDICTIONARY_CID}, + {nullptr}}; + +const mozilla::Module kSpellcheckModule = { + mozilla::Module::kVersion, kSpellcheckCIDs, kSpellcheckContracts, nullptr}; + +NSMODULE_DEFN(mozSpellCheckerModule) = &kSpellcheckModule; diff --git a/gfx/src/components.conf b/gfx/src/components.conf deleted file mode 100644 index d1c5d69351b1..000000000000 --- a/gfx/src/components.conf +++ /dev/null @@ -1,14 +0,0 @@ -# -*- 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': '{a6cf9115-15b3-11d2-932e-00805f8add32}', - 'contract_ids': ['@mozilla.org/gfx/fontenumerator;1'], - 'type': 'nsThebesFontEnumerator', - 'headers': ['/gfx/src/nsThebesFontEnumerator.h'], - }, -] diff --git a/gfx/src/moz.build b/gfx/src/moz.build index 75aea035e3c3..8c0e6b9a089a 100644 --- a/gfx/src/moz.build +++ b/gfx/src/moz.build @@ -68,6 +68,7 @@ UNIFIED_SOURCES += [ 'nsRect.cpp', 'nsRegion.cpp', 'nsThebesFontEnumerator.cpp', + 'nsThebesGfxFactory.cpp', 'nsTransform2D.cpp', 'TiledRegion.cpp', ] @@ -77,10 +78,6 @@ SOURCES += [ 'nsDeviceContext.cpp', ] -XPCOM_MANIFESTS += [ - 'components.conf', -] - include('/ipc/chromium/chromium-config.mozbuild') LOCAL_INCLUDES += [ diff --git a/gfx/src/nsThebesGfxFactory.cpp b/gfx/src/nsThebesGfxFactory.cpp new file mode 100644 index 000000000000..301876541d7d --- /dev/null +++ b/gfx/src/nsThebesGfxFactory.cpp @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* 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/. */ + +#include "gfxPlatform.h" // for gfxPlatform +#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2 +#include "mozilla/Attributes.h" // for final +#include "mozilla/Module.h" // for Module, Module::CIDEntry, etc +#include "mozilla/ModuleUtils.h" +#include "mozilla/mozalloc.h" // for operator new +#include "nsCOMPtr.h" // for nsCOMPtr +#include "nsError.h" // for NS_ERROR_NO_AGGREGATION, etc +#include "nsGfxCIID.h" // for NS_FONT_ENUMERATOR_CID, etc +#include "nsID.h" // for NS_DEFINE_NAMED_CID, etc +#include "nsISupports.h" // for NS_DECL_ISUPPORTS, etc +#include "nsThebesFontEnumerator.h" // for nsThebesFontEnumerator + +NS_GENERIC_FACTORY_CONSTRUCTOR(nsThebesFontEnumerator) + +NS_DEFINE_NAMED_CID(NS_FONT_ENUMERATOR_CID); + +static const mozilla::Module::CIDEntry kThebesCIDs[] = { + {&kNS_FONT_ENUMERATOR_CID, false, nullptr, + nsThebesFontEnumeratorConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry kThebesContracts[] = { + {"@mozilla.org/gfx/fontenumerator;1", &kNS_FONT_ENUMERATOR_CID}, {nullptr}}; + +static const mozilla::Module kThebesModule = {mozilla::Module::kVersion, + kThebesCIDs, + kThebesContracts, + nullptr, + nullptr, + nullptr, + nullptr}; + +NSMODULE_DEFN(nsGfxModule) = &kThebesModule; diff --git a/js/ductwork/debugger/JSDebugger.cpp b/js/ductwork/debugger/JSDebugger.cpp index 4fcb1a681897..9e6af1b54af2 100644 --- a/js/ductwork/debugger/JSDebugger.cpp +++ b/js/ductwork/debugger/JSDebugger.cpp @@ -10,6 +10,7 @@ #include "jsapi.h" #include "jsfriendapi.h" #include "js/Wrapper.h" +#include "mozilla/ModuleUtils.h" #include "nsServiceManagerUtils.h" #include "nsMemory.h" @@ -25,6 +26,8 @@ namespace mozilla { namespace jsdebugger { +NS_GENERIC_FACTORY_CONSTRUCTOR(JSDebugger) + NS_IMPL_ISUPPORTS(JSDebugger, IJSDebugger) JSDebugger::JSDebugger() {} @@ -72,3 +75,18 @@ JSDebugger::AddClass(JS::Handle global, JSContext* cx) { } // namespace jsdebugger } // namespace mozilla + +NS_DEFINE_NAMED_CID(JSDEBUGGER_CID); + +static const mozilla::Module::CIDEntry kJSDebuggerCIDs[] = { + {&kJSDEBUGGER_CID, false, nullptr, + mozilla::jsdebugger::JSDebuggerConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry kJSDebuggerContracts[] = { + {JSDEBUGGER_CONTRACTID, &kJSDEBUGGER_CID}, {nullptr}}; + +static const mozilla::Module kJSDebuggerModule = { + mozilla::Module::kVersion, kJSDebuggerCIDs, kJSDebuggerContracts}; + +NSMODULE_DEFN(jsdebugger) = &kJSDebuggerModule; diff --git a/js/ductwork/debugger/components.conf b/js/ductwork/debugger/components.conf deleted file mode 100644 index 16d3c450dc40..000000000000 --- a/js/ductwork/debugger/components.conf +++ /dev/null @@ -1,14 +0,0 @@ -# -*- 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': '{0365cbd5-d46e-4e94-a39f-83b63cd1a963}', - 'contract_ids': ['@mozilla.org/jsdebugger;1'], - 'type': 'mozilla::jsdebugger::JSDebugger', - 'headers': ['/js/ductwork/debugger/JSDebugger.h'], - }, -] diff --git a/js/ductwork/debugger/moz.build b/js/ductwork/debugger/moz.build index 6309c202c231..0fb85f8b86ef 100644 --- a/js/ductwork/debugger/moz.build +++ b/js/ductwork/debugger/moz.build @@ -19,10 +19,6 @@ SOURCES += [ 'JSDebugger.cpp', ] -XPCOM_MANIFESTS += [ - 'components.conf', -] - EXTRA_JS_MODULES += [ 'jsdebugger.jsm', ] diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp index aad344bd3149..8b87f36dc519 100644 --- a/modules/libpref/Preferences.cpp +++ b/modules/libpref/Preferences.cpp @@ -17,13 +17,13 @@ #include "mozilla/ArenaAllocator.h" #include "mozilla/ArrayUtils.h" #include "mozilla/Attributes.h" -#include "mozilla/Components.h" #include "mozilla/dom/PContent.h" #include "mozilla/HashFunctions.h" #include "mozilla/HashTable.h" #include "mozilla/Logging.h" #include "mozilla/Maybe.h" #include "mozilla/MemoryReporting.h" +#include "mozilla/ModuleUtils.h" #include "mozilla/Omnijar.h" #include "mozilla/Preferences.h" #include "mozilla/ResultExtensions.h" @@ -5409,16 +5409,35 @@ static void InitVarCachePref(const nsACString& aName, float* aCache, // Module and factory stuff //=========================================================================== -NS_IMPL_COMPONENT_FACTORY(nsPrefLocalizedString) { - auto str = MakeRefPtr(); - if (NS_SUCCEEDED(str->Init())) { - return str.forget().downcast(); - } - return nullptr; -} +NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(Preferences, + Preferences::GetInstanceForService) +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrefLocalizedString, Init) -namespace mozilla { +static NS_DEFINE_CID(kPrefServiceCID, NS_PREFSERVICE_CID); +static NS_DEFINE_CID(kPrefLocalizedStringCID, NS_PREFLOCALIZEDSTRING_CID); -void UnloadPrefsModule() { Preferences::Shutdown(); } +static mozilla::Module::CIDEntry kPrefCIDs[] = { + {&kPrefServiceCID, true, nullptr, PreferencesConstructor, + Module::ALLOW_IN_SOCKET_PROCESS}, + {&kPrefLocalizedStringCID, false, nullptr, + nsPrefLocalizedStringConstructor}, + {nullptr}}; -} +static mozilla::Module::ContractIDEntry kPrefContracts[] = { + {NS_PREFSERVICE_CONTRACTID, &kPrefServiceCID, + Module::ALLOW_IN_SOCKET_PROCESS}, + {NS_PREFLOCALIZEDSTRING_CONTRACTID, &kPrefLocalizedStringCID}, + {nullptr}}; + +static void UnloadPrefsModule() { Preferences::Shutdown(); } + +static const mozilla::Module kPrefModule = {mozilla::Module::kVersion, + kPrefCIDs, + kPrefContracts, + nullptr, + nullptr, + nullptr, + UnloadPrefsModule, + Module::ALLOW_IN_SOCKET_PROCESS}; + +NSMODULE_DEFN(nsPrefModule) = &kPrefModule; diff --git a/modules/libpref/Preferences.h b/modules/libpref/Preferences.h index 14e0b95b314d..68a58022edb6 100644 --- a/modules/libpref/Preferences.h +++ b/modules/libpref/Preferences.h @@ -33,8 +33,6 @@ class nsPrefBranch; namespace mozilla { -void UnloadPrefsModule(); - // A typesafe version of PrefChangeFunc, with its data argument type deduced // from the type of the argument passed to RegisterCallback. // diff --git a/modules/libpref/components.conf b/modules/libpref/components.conf deleted file mode 100644 index 4b8dff423af0..000000000000 --- a/modules/libpref/components.conf +++ /dev/null @@ -1,27 +0,0 @@ -# -*- 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/. - -Headers = [ - 'mozilla/Preferences.h', -] - -UnloadFunc = 'mozilla::UnloadPrefsModule' - -Classes = [ - { - 'cid': '{91ca2441-050f-4f7c-9df8-75b40ea40156}', - 'contract_ids': ['@mozilla.org/preferences-service;1'], - 'singleton': True, - 'type': 'mozilla::Preferences', - 'headers': ['mozilla/Preferences.h'], - 'constructor': 'mozilla::Preferences::GetInstanceForService', - }, - { - 'cid': '{064d9cee-1dd2-11b2-83e3-d25ab0193c26}', - 'contract_ids': ['@mozilla.org/pref-localizedstring;1'], - 'type': 'nsPrefLocalizedString', - }, -] diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build index 24f98e186415..655a6c1e4d1f 100644 --- a/modules/libpref/moz.build +++ b/modules/libpref/moz.build @@ -36,10 +36,6 @@ UNIFIED_SOURCES += [ 'SharedPrefMap.cpp', ] -XPCOM_MANIFESTS += [ - 'components.conf', -] - include('/ipc/chromium/chromium-config.mozbuild') FINAL_LIBRARY = 'xul' diff --git a/netwerk/dns/mdns/libmdns/components.conf b/netwerk/dns/mdns/libmdns/components.conf index 6e64140c820e..00eb7e139600 100644 --- a/netwerk/dns/mdns/libmdns/components.conf +++ b/netwerk/dns/mdns/libmdns/components.conf @@ -4,14 +4,7 @@ # 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': '{14a50f2b-7ff6-48a5-88e3-615fd111f5d3}', - 'contract_ids': ['@mozilla.org/toolkit/components/mdnsresponder/dns-info;1'], - 'type': 'mozilla::net::nsDNSServiceInfo', - 'headers': ['/netwerk/dns/mdns/libmdns/nsDNSServiceInfo.h'], - }, -] +Classes = [] if buildconfig.substs['MOZ_WIDGET_TOOLKIT'] != 'cocoa': Classes += [ diff --git a/netwerk/dns/mdns/libmdns/moz.build b/netwerk/dns/mdns/libmdns/moz.build index 05dc75eb9eda..6f8b179f5362 100644 --- a/netwerk/dns/mdns/libmdns/moz.build +++ b/netwerk/dns/mdns/libmdns/moz.build @@ -34,10 +34,7 @@ else: UNIFIED_SOURCES += [ 'nsDNSServiceInfo.cpp', -] - -XPCOM_MANIFESTS += [ - 'components.conf', + 'nsMulticastDNSModule.cpp', ] XPCOM_MANIFESTS += [ diff --git a/netwerk/dns/mdns/libmdns/nsMulticastDNSModule.cpp b/netwerk/dns/mdns/libmdns/nsMulticastDNSModule.cpp new file mode 100644 index 000000000000..3a108abcbc66 --- /dev/null +++ b/netwerk/dns/mdns/libmdns/nsMulticastDNSModule.cpp @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#if defined(MOZ_WIDGET_COCOA) +# define ENABLE_DNS_SERVICE_DISCOVERY +#endif + +#include "mozilla/ModuleUtils.h" + +#ifdef ENABLE_DNS_SERVICE_DISCOVERY +# include "nsDNSServiceDiscovery.h" +#endif + +#include "nsDNSServiceInfo.h" + +#ifdef ENABLE_DNS_SERVICE_DISCOVERY +using mozilla::net::nsDNSServiceDiscovery; +# define DNSSERVICEDISCOVERY_CID \ + { \ + 0x8df43d23, 0xd3f9, 0x4dd5, { \ + 0xb9, 0x65, 0xde, 0x2c, 0xa3, 0xf6, 0xa4, 0x2c \ + } \ + } +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsDNSServiceDiscovery, Init) +NS_DEFINE_NAMED_CID(DNSSERVICEDISCOVERY_CID); +#endif // ENABLE_DNS_SERVICE_DISCOVERY + +using mozilla::net::nsDNSServiceInfo; +#define DNSSERVICEINFO_CID \ + { \ + 0x14a50f2b, 0x7ff6, 0x48a5, { \ + 0x88, 0xe3, 0x61, 0x5f, 0xd1, 0x11, 0xf5, 0xd3 \ + } \ + } +NS_GENERIC_FACTORY_CONSTRUCTOR(nsDNSServiceInfo) +NS_DEFINE_NAMED_CID(DNSSERVICEINFO_CID); + +static const mozilla::Module::CIDEntry knsDNSServiceDiscoveryCIDs[] = { +#ifdef ENABLE_DNS_SERVICE_DISCOVERY + {&kDNSSERVICEDISCOVERY_CID, false, nullptr, + nsDNSServiceDiscoveryConstructor}, +#endif + {&kDNSSERVICEINFO_CID, false, nullptr, nsDNSServiceInfoConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry + knsDNSServiceDiscoveryContracts[] = { +#ifdef ENABLE_DNS_SERVICE_DISCOVERY + {DNSSERVICEDISCOVERY_CONTRACT_ID, &kDNSSERVICEDISCOVERY_CID}, +#endif + {DNSSERVICEINFO_CONTRACT_ID, &kDNSSERVICEINFO_CID}, + {nullptr}}; + +static const mozilla::Module::CategoryEntry knsDNSServiceDiscoveryCategories[] = + {{nullptr}}; + +static const mozilla::Module knsDNSServiceDiscoveryModule = { + mozilla::Module::kVersion, knsDNSServiceDiscoveryCIDs, + knsDNSServiceDiscoveryContracts, knsDNSServiceDiscoveryCategories}; + +NSMODULE_DEFN(nsDNSServiceDiscoveryModule) = &knsDNSServiceDiscoveryModule; diff --git a/netwerk/protocol/gio/components.conf b/netwerk/protocol/gio/components.conf deleted file mode 100644 index a8b9a50fb17e..000000000000 --- a/netwerk/protocol/gio/components.conf +++ /dev/null @@ -1,13 +0,0 @@ -# -*- 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': '{ee706783-3af8-4d19-9e84-e2ebfe213480}', - 'contract_ids': ['@mozilla.org/network/protocol;1?name=moz-gio'], - 'type': 'nsGIOProtocolHandler', - }, -] diff --git a/netwerk/protocol/gio/moz.build b/netwerk/protocol/gio/moz.build index 268d125dd3fc..7a45898537ca 100644 --- a/netwerk/protocol/gio/moz.build +++ b/netwerk/protocol/gio/moz.build @@ -8,10 +8,6 @@ SOURCES += [ 'nsGIOProtocolHandler.cpp', ] -XPCOM_MANIFESTS += [ - 'components.conf', -] - FINAL_LIBRARY = 'xul' CXXFLAGS += CONFIG['TK_CFLAGS'] diff --git a/netwerk/protocol/gio/nsGIOProtocolHandler.cpp b/netwerk/protocol/gio/nsGIOProtocolHandler.cpp index a04387e64b95..2640d644bfec 100644 --- a/netwerk/protocol/gio/nsGIOProtocolHandler.cpp +++ b/netwerk/protocol/gio/nsGIOProtocolHandler.cpp @@ -7,7 +7,7 @@ * This code is based on original Mozilla gnome-vfs extension. It implements * input stream provided by GVFS/GIO. */ -#include "mozilla/Components.h" +#include "mozilla/ModuleUtils.h" #include "mozilla/NullPrincipal.h" #include "nsIPrefService.h" #include "nsIPrefBranch.h" @@ -32,8 +32,6 @@ #include #include -using namespace mozilla; - #define MOZ_GIO_SCHEME "moz-gio" #define MOZ_GIO_SUPPORTED_PROTOCOLS "network.gio.supported-protocols" @@ -847,14 +845,6 @@ class nsGIOProtocolHandler final : public nsIProtocolHandler, NS_IMPL_ISUPPORTS(nsGIOProtocolHandler, nsIProtocolHandler, nsIObserver) -NS_IMPL_COMPONENT_FACTORY(nsGIOProtocolHandler) { - auto inst = MakeRefPtr(); - if (NS_SUCCEEDED(inst->Init())) { - return inst.forget().downcast(); - } - return nullptr; -} - nsresult nsGIOProtocolHandler::Init() { nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); if (prefs) { @@ -1018,3 +1008,30 @@ nsGIOProtocolHandler::Observe(nsISupports *aSubject, const char *aTopic, } return NS_OK; } + +//----------------------------------------------------------------------------- + +#define NS_GIOPROTOCOLHANDLER_CID \ + { /* ee706783-3af8-4d19-9e84-e2ebfe213480 */ \ + 0xee706783, 0x3af8, 0x4d19, { \ + 0x9e, 0x84, 0xe2, 0xeb, 0xfe, 0x21, 0x34, 0x80 \ + } \ + } + +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGIOProtocolHandler, Init) +NS_DEFINE_NAMED_CID(NS_GIOPROTOCOLHANDLER_CID); + +static const mozilla::Module::CIDEntry kVFSCIDs[] = { + {&kNS_GIOPROTOCOLHANDLER_CID, false, nullptr, + nsGIOProtocolHandlerConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry kVFSContracts[] = { + {NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX MOZ_GIO_SCHEME, + &kNS_GIOPROTOCOLHANDLER_CID}, + {nullptr}}; + +static const mozilla::Module kVFSModule = {mozilla::Module::kVersion, kVFSCIDs, + kVFSContracts}; + +NSMODULE_DEFN(nsGIOModule) = &kVFSModule; diff --git a/parser/htmlparser/components.conf b/parser/htmlparser/components.conf deleted file mode 100644 index bf00428c4055..000000000000 --- a/parser/htmlparser/components.conf +++ /dev/null @@ -1,20 +0,0 @@ -# -*- 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/. - -Headers = [ - 'nsHTMLTags.h', -] - -UnloadFunc = 'nsHTMLTags::ReleaseTable' - -Classes = [ - { - 'cid': '{2ce606b0-bee6-11d1-aad9-00805f8a3e14}', - 'contract_ids': [], - 'type': 'nsParser', - 'headers': ['/parser/htmlparser/nsParser.h'], - }, -] diff --git a/parser/htmlparser/moz.build b/parser/htmlparser/moz.build index a582f967de8f..46d61831431d 100644 --- a/parser/htmlparser/moz.build +++ b/parser/htmlparser/moz.build @@ -46,10 +46,6 @@ UNIFIED_SOURCES += [ 'nsScannerString.cpp', ] -XPCOM_MANIFESTS += [ - 'components.conf', -] - FINAL_LIBRARY = 'xul' if CONFIG['CC_TYPE'] in ('clang', 'gcc'): diff --git a/security/manager/pki/components.conf b/security/manager/pki/components.conf deleted file mode 100644 index 4850e1f17d8d..000000000000 --- a/security/manager/pki/components.conf +++ /dev/null @@ -1,27 +0,0 @@ -# -*- 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': '{4bfaa9f0-1dd2-11b2-afae-a82cbaa0b606}', - 'contract_ids': ['@mozilla.org/security/nsASN1Tree;1'], - 'type': 'nsNSSASN1Tree', - 'headers': ['/security/manager/pki/nsASN1Tree.h'], - }, - { - 'cid': '{518e071f-1dd2-11b2-937e-c45f14def778}', - 'contract_ids': [ - '@mozilla.org/nsCertificateDialogs;1', - '@mozilla.org/nsClientAuthDialogs;1', - '@mozilla.org/nsGeneratingKeypairInfoDialogs;1', - '@mozilla.org/nsTokenDialogs;1', - '@mozilla.org/nsTokenPasswordDialogs;1', - ], - 'type': 'nsNSSDialogs', - 'headers': ['/security/manager/pki/nsNSSDialogs.h'], - 'init_method': 'Init', - }, -] diff --git a/security/manager/pki/moz.build b/security/manager/pki/moz.build index 93e5205f3a40..7c3081d4ca61 100644 --- a/security/manager/pki/moz.build +++ b/security/manager/pki/moz.build @@ -16,10 +16,7 @@ UNIFIED_SOURCES += [ 'nsASN1Tree.cpp', 'nsNSSDialogHelper.cpp', 'nsNSSDialogs.cpp', -] - -XPCOM_MANIFESTS += [ - 'components.conf', + 'nsPKIModule.cpp', ] LOCAL_INCLUDES += [ diff --git a/security/manager/pki/nsPKIModule.cpp b/security/manager/pki/nsPKIModule.cpp new file mode 100644 index 000000000000..ca081ad09dad --- /dev/null +++ b/security/manager/pki/nsPKIModule.cpp @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * 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/. */ + +#include "mozilla/ModuleUtils.h" +#include "nsASN1Tree.h" +#include "nsNSSDialogs.h" + +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNSSDialogs, Init) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsNSSASN1Tree) + +NS_DEFINE_NAMED_CID(NS_NSSDIALOGS_CID); +NS_DEFINE_NAMED_CID(NS_NSSASN1OUTINER_CID); + +static const mozilla::Module::CIDEntry kPKICIDs[] = { + {&kNS_NSSDIALOGS_CID, false, nullptr, nsNSSDialogsConstructor}, + {&kNS_NSSASN1OUTINER_CID, false, nullptr, nsNSSASN1TreeConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry kPKIContracts[] = { + {NS_TOKENPASSWORDSDIALOG_CONTRACTID, &kNS_NSSDIALOGS_CID}, + {NS_CERTIFICATEDIALOGS_CONTRACTID, &kNS_NSSDIALOGS_CID}, + {NS_CLIENTAUTHDIALOGS_CONTRACTID, &kNS_NSSDIALOGS_CID}, + {NS_TOKENDIALOGS_CONTRACTID, &kNS_NSSDIALOGS_CID}, + {NS_GENERATINGKEYPAIRINFODIALOGS_CONTRACTID, &kNS_NSSDIALOGS_CID}, + {NS_ASN1TREE_CONTRACTID, &kNS_NSSASN1OUTINER_CID}, + {nullptr}}; + +static const mozilla::Module kPKIModule = {mozilla::Module::kVersion, kPKICIDs, + kPKIContracts}; + +NSMODULE_DEFN(PKI) = &kPKIModule; diff --git a/security/sandbox/common/SandboxSettings.cpp b/security/sandbox/common/SandboxSettings.cpp index 7e437953e264..11c55d3cdb20 100644 --- a/security/sandbox/common/SandboxSettings.cpp +++ b/security/sandbox/common/SandboxSettings.cpp @@ -6,13 +6,11 @@ #include "mozISandboxSettings.h" -#include "mozilla/Components.h" +#include "mozilla/ModuleUtils.h" #include "mozilla/Preferences.h" #include "prenv.h" -using namespace mozilla; - namespace mozilla { int GetEffectiveContentSandboxLevel() { @@ -74,9 +72,20 @@ NS_IMETHODIMP SandboxSettings::GetEffectiveContentSandboxLevel( return NS_OK; } +NS_GENERIC_FACTORY_CONSTRUCTOR(SandboxSettings) + +NS_DEFINE_NAMED_CID(MOZ_SANDBOX_SETTINGS_CID); + +static const mozilla::Module::CIDEntry kSandboxSettingsCIDs[] = { + {&kMOZ_SANDBOX_SETTINGS_CID, false, nullptr, SandboxSettingsConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry kSandboxSettingsContracts[] = { + {MOZ_SANDBOX_SETTINGS_CONTRACTID, &kMOZ_SANDBOX_SETTINGS_CID}, {nullptr}}; + +static const mozilla::Module kSandboxSettingsModule = { + mozilla::Module::kVersion, kSandboxSettingsCIDs, kSandboxSettingsContracts}; + +NSMODULE_DEFN(SandboxSettingsModule) = &kSandboxSettingsModule; + } // namespace mozilla - - -NS_IMPL_COMPONENT_FACTORY(mozISandboxSettings) { - return MakeAndAddRef().downcast(); -} diff --git a/security/sandbox/common/components.conf b/security/sandbox/common/components.conf deleted file mode 100644 index fe8b07ca9699..000000000000 --- a/security/sandbox/common/components.conf +++ /dev/null @@ -1,13 +0,0 @@ -# -*- 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': '{5516303d-9007-45a0-94b9-940ef134a6e2}', - 'contract_ids': ['@mozilla.org/sandbox/sandbox-settings;1'], - 'type': 'mozISandboxSettings', - }, -] diff --git a/security/sandbox/common/moz.build b/security/sandbox/common/moz.build index 10c1cf63f8f7..a2fcba4cad22 100644 --- a/security/sandbox/common/moz.build +++ b/security/sandbox/common/moz.build @@ -9,10 +9,6 @@ with Files('**'): UNIFIED_SOURCES += ['SandboxSettings.cpp'] -XPCOM_MANIFESTS += [ - 'components.conf', -] - XPIDL_SOURCES += [ 'mozISandboxSettings.idl', ] diff --git a/security/sandbox/linux/reporter/SandboxReporterWrappers.cpp b/security/sandbox/linux/reporter/SandboxReporterWrappers.cpp index d2d64037f452..4db5b3a31915 100644 --- a/security/sandbox/linux/reporter/SandboxReporterWrappers.cpp +++ b/security/sandbox/linux/reporter/SandboxReporterWrappers.cpp @@ -10,14 +10,12 @@ #include #include "mozilla/Assertions.h" -#include "mozilla/Components.h" +#include "mozilla/ModuleUtils.h" #include "nsCOMPtr.h" #include "nsPrintfCString.h" #include "nsTArray.h" #include "nsXULAppAPI.h" -using namespace mozilla; - namespace mozilla { class SandboxReportWrapper final : public mozISandboxReport { @@ -183,8 +181,21 @@ NS_IMETHODIMP SandboxReporterWrapper::Snapshot( return NS_OK; } -} // namespace mozilla +NS_GENERIC_FACTORY_CONSTRUCTOR(SandboxReporterWrapper) -NS_IMPL_COMPONENT_FACTORY(mozISandboxReporter) { - return MakeAndAddRef().downcast(); -} +NS_DEFINE_NAMED_CID(MOZ_SANDBOX_REPORTER_CID); + +static const mozilla::Module::CIDEntry kSandboxReporterCIDs[] = { + {&kMOZ_SANDBOX_REPORTER_CID, false, nullptr, + SandboxReporterWrapperConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry kSandboxReporterContracts[] = { + {MOZ_SANDBOX_REPORTER_CONTRACTID, &kMOZ_SANDBOX_REPORTER_CID}, {nullptr}}; + +static const mozilla::Module kSandboxReporterModule = { + mozilla::Module::kVersion, kSandboxReporterCIDs, kSandboxReporterContracts}; + +NSMODULE_DEFN(SandboxReporterModule) = &kSandboxReporterModule; + +} // namespace mozilla diff --git a/security/sandbox/linux/reporter/components.conf b/security/sandbox/linux/reporter/components.conf deleted file mode 100644 index 7bd278f3498e..000000000000 --- a/security/sandbox/linux/reporter/components.conf +++ /dev/null @@ -1,13 +0,0 @@ -# -*- 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': '{5118a6f9-2493-4f97-9552-620663e03cb3}', - 'contract_ids': ['@mozilla.org/sandbox/syscall-reporter;1'], - 'type': 'mozISandboxReporter', - }, -] diff --git a/security/sandbox/linux/reporter/moz.build b/security/sandbox/linux/reporter/moz.build index 0a9c5cf3de50..5244b494d8fc 100644 --- a/security/sandbox/linux/reporter/moz.build +++ b/security/sandbox/linux/reporter/moz.build @@ -14,10 +14,6 @@ SOURCES += [ 'SandboxReporterWrappers.cpp', ] -XPCOM_MANIFESTS += [ - 'components.conf', -] - LOCAL_INCLUDES += [ '/security/sandbox/linux', # SandboxLogging.h ] diff --git a/services/crypto/component/IdentityCryptoService.cpp b/services/crypto/component/IdentityCryptoService.cpp index de1f7032753d..11668c579ec4 100644 --- a/services/crypto/component/IdentityCryptoService.cpp +++ b/services/crypto/component/IdentityCryptoService.cpp @@ -5,6 +5,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsIIdentityCryptoService.h" +#include "mozilla/ModuleUtils.h" #include "nsServiceManagerUtils.h" #include "nsIThread.h" #include "nsThreadUtils.h" @@ -13,7 +14,6 @@ #include "nsString.h" #include "mozilla/ArrayUtils.h" // ArrayLength #include "mozilla/Base64.h" -#include "mozilla/Components.h" #include "ScopedNSSTypes.h" #include "NSSErrorsService.h" @@ -449,14 +449,31 @@ SignRunnable::Run() { return NS_OK; } -} // unnamed namespace // XPCOM module registration -NS_IMPL_COMPONENT_FACTORY(nsIIdentityCryptoService) { - auto inst = MakeRefPtr(); - if (NS_SUCCEEDED(inst->Init())) { - return inst.forget().downcast(); +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(IdentityCryptoService, Init) + +#define NS_IDENTITYCRYPTOSERVICE_CID \ + { \ + 0xbea13a3a, 0x44e8, 0x4d7f, { \ + 0xa0, 0xa2, 0x2c, 0x67, 0xf8, 0x4e, 0x3a, 0x97 \ + } \ } - return nullptr; -} + +NS_DEFINE_NAMED_CID(NS_IDENTITYCRYPTOSERVICE_CID); + +const mozilla::Module::CIDEntry kCIDs[] = { + {&kNS_IDENTITYCRYPTOSERVICE_CID, false, nullptr, + IdentityCryptoServiceConstructor}, + {nullptr}}; + +const mozilla::Module::ContractIDEntry kContracts[] = { + {"@mozilla.org/identity/crypto-service;1", &kNS_IDENTITYCRYPTOSERVICE_CID}, + {nullptr}}; + +const mozilla::Module kModule = {mozilla::Module::kVersion, kCIDs, kContracts}; + +} // unnamed namespace + +NSMODULE_DEFN(identity) = &kModule; diff --git a/services/crypto/component/components.conf b/services/crypto/component/components.conf deleted file mode 100644 index 49a4b74d7a54..000000000000 --- a/services/crypto/component/components.conf +++ /dev/null @@ -1,13 +0,0 @@ -# -*- 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': '{bea13a3a-44e8-4d7f-a0a2-2c67f84e3a97}', - 'contract_ids': ['@mozilla.org/identity/crypto-service;1'], - 'type': 'nsIIdentityCryptoService', - }, -] diff --git a/services/crypto/component/moz.build b/services/crypto/component/moz.build index b6db8c8fea8c..e91868118810 100644 --- a/services/crypto/component/moz.build +++ b/services/crypto/component/moz.build @@ -14,8 +14,4 @@ SOURCES += [ 'IdentityCryptoService.cpp', ] -XPCOM_MANIFESTS += [ - 'components.conf', -] - FINAL_LIBRARY = 'xul' diff --git a/storage/build/components.conf b/storage/build/components.conf deleted file mode 100644 index 13eb8b4bd9de..000000000000 --- a/storage/build/components.conf +++ /dev/null @@ -1,25 +0,0 @@ -# -*- 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': '{bbbb1d61-438f-4436-92ed-8308e5830fb0}', - 'contract_ids': ['@mozilla.org/storage/service;1'], - 'singleton': True, - 'type': 'mozilla::storage::Service', - 'headers': ['/storage/mozStorageService.h'], - 'constructor': 'mozilla::storage::Service::getSingleton', - }, - { - 'cid': '{3b667ee0-d2da-4ccc-9c3d-95f2ca6a8b4c}', - 'contract_ids': ['@mozilla.org/storage/vacuum;1'], - 'singleton': True, - 'type': 'mozilla::storage::VacuumManager', - 'headers': ['/storage/VacuumManager.h'], - 'constructor': 'mozilla::storage::VacuumManager::getSingleton', - 'categories': {'idle-daily': 'MozStorage Vacuum Manager'}, - }, -] diff --git a/storage/build/moz.build b/storage/build/moz.build index 27c61326d3d3..284cd7e3f574 100644 --- a/storage/build/moz.build +++ b/storage/build/moz.build @@ -8,10 +8,14 @@ EXPORTS += [ 'mozStorageCID.h', ] -XPCOM_MANIFESTS += [ - 'components.conf', +SOURCES += [ + 'mozStorageModule.cpp', ] FINAL_LIBRARY = 'xul' +LOCAL_INCLUDES += [ + '..', +] + CXXFLAGS += CONFIG['SQLITE_CFLAGS'] diff --git a/storage/build/mozStorageModule.cpp b/storage/build/mozStorageModule.cpp new file mode 100644 index 000000000000..e57c7e4a80a4 --- /dev/null +++ b/storage/build/mozStorageModule.cpp @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#include "nsCOMPtr.h" +#include "mozilla/ModuleUtils.h" + +#include "mozStorageService.h" +#include "mozStorageConnection.h" +#include "VacuumManager.h" + +#include "mozStorageCID.h" + +namespace mozilla { +namespace storage { + +NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(Service, Service::getSingleton) +NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(VacuumManager, + VacuumManager::getSingleton) + +} // namespace storage +} // namespace mozilla + +NS_DEFINE_NAMED_CID(MOZ_STORAGE_SERVICE_CID); +NS_DEFINE_NAMED_CID(VACUUMMANAGER_CID); + +static const mozilla::Module::CIDEntry kStorageCIDs[] = { + {&kMOZ_STORAGE_SERVICE_CID, false, nullptr, + mozilla::storage::ServiceConstructor}, + {&kVACUUMMANAGER_CID, false, nullptr, + mozilla::storage::VacuumManagerConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry kStorageContracts[] = { + {MOZ_STORAGE_SERVICE_CONTRACTID, &kMOZ_STORAGE_SERVICE_CID}, + {VACUUMMANAGER_CONTRACTID, &kVACUUMMANAGER_CID}, + {nullptr}}; + +static const mozilla::Module::CategoryEntry kStorageCategories[] = { + {"idle-daily", "MozStorage Vacuum Manager", VACUUMMANAGER_CONTRACTID}, + {nullptr}}; + +static const mozilla::Module kStorageModule = {mozilla::Module::kVersion, + kStorageCIDs, kStorageContracts, + kStorageCategories}; + +NSMODULE_DEFN(mozStorageModule) = &kStorageModule; diff --git a/testing/xpcshell/head.js b/testing/xpcshell/head.js index 8a1fa0485494..0eeb0d289bed 100644 --- a/testing/xpcshell/head.js +++ b/testing/xpcshell/head.js @@ -231,11 +231,6 @@ function _do_quit() { _quit = true; } -// This is useless, except to the extent that it has the side-effect of -// initializing the widget module, which some tests unfortunately -// accidentally rely on. -void Cc["@mozilla.org/widget/transferable;1"].createInstance(); - /** * Overrides idleService with a mock. Idle is commonly used for maintenance * tasks, thus if a test uses a service that requires the idle service, it will @@ -257,6 +252,12 @@ var _fakeIdleService = { activate: function FIS_activate() { if (!this.originalCID) { + // This is useless, except to the extent that it has the + // side-effect of initializing the widget module, which some + // callers unfortunately accidentally rely on. + void Components.manager.getClassObject(Cc[this.contractID], + Ci.nsIFactory); + this.originalCID = this.registrar.contractIDToCID(this.contractID); // Replace with the mock. this.registrar.registerFactory(this.CID, "Fake Idle Service", diff --git a/toolkit/components/mozintl/components.conf b/toolkit/components/mozintl/components.conf index 521ff211b97a..7f9aebf54558 100644 --- a/toolkit/components/mozintl/components.conf +++ b/toolkit/components/mozintl/components.conf @@ -11,7 +11,6 @@ Classes = [ 'type': 'mozilla::MozIntlHelper', 'headers': ['/toolkit/components/mozintl/MozIntlHelper.h'], }, - { 'cid': '{35ec195a-e8d0-4300-83af-c8a2cc84b4a3}', 'contract_ids': ['@mozilla.org/mozintl;1'], diff --git a/toolkit/components/mozintl/moz.build b/toolkit/components/mozintl/moz.build index db6a1fd744ef..92b1fc54b28f 100644 --- a/toolkit/components/mozintl/moz.build +++ b/toolkit/components/mozintl/moz.build @@ -28,8 +28,4 @@ XPCOM_MANIFESTS += [ 'components.conf', ] -XPCOM_MANIFESTS += [ - 'components.conf', -] - FINAL_LIBRARY = 'xul' diff --git a/toolkit/components/places/moz.build b/toolkit/components/places/moz.build index 6c45b5860523..05db20f0f564 100644 --- a/toolkit/components/places/moz.build +++ b/toolkit/components/places/moz.build @@ -83,10 +83,6 @@ if CONFIG['MOZ_PLACES']: 'components.conf', ] - XPCOM_MANIFESTS += [ - 'components.conf', - ] - FINAL_LIBRARY = 'xul' include('/ipc/chromium/chromium-config.mozbuild') diff --git a/toolkit/components/satchel/moz.build b/toolkit/components/satchel/moz.build index 25573c454fd7..ecdf1be5922a 100644 --- a/toolkit/components/satchel/moz.build +++ b/toolkit/components/satchel/moz.build @@ -40,10 +40,6 @@ XPCOM_MANIFESTS += [ 'components.conf', ] -XPCOM_MANIFESTS += [ - 'components.conf', -] - FINAL_LIBRARY = 'xul' JAR_MANIFESTS += ['jar.mn'] diff --git a/tools/profiler/gecko/components.conf b/tools/profiler/gecko/components.conf deleted file mode 100644 index 1584afc25465..000000000000 --- a/tools/profiler/gecko/components.conf +++ /dev/null @@ -1,15 +0,0 @@ -# -*- 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': '{25db9b8e-8123-4de1-b66d-8bbbedf2cdf4}', - 'contract_ids': ['@mozilla.org/tools/profiler;1'], - 'type': 'nsProfiler', - 'headers': ['/tools/profiler/gecko/nsProfiler.h'], - 'init_method': 'Init', - }, -] diff --git a/tools/profiler/gecko/nsProfilerFactory.cpp b/tools/profiler/gecko/nsProfilerFactory.cpp new file mode 100644 index 000000000000..2835555490a4 --- /dev/null +++ b/tools/profiler/gecko/nsProfilerFactory.cpp @@ -0,0 +1,25 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#include "nsProfiler.h" +#include "nsProfilerCIID.h" + +#include "mozilla/ModuleUtils.h" +#include "nsCOMPtr.h" + +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsProfiler, Init) + +NS_DEFINE_NAMED_CID(NS_PROFILER_CID); + +static const mozilla::Module::CIDEntry kProfilerCIDs[] = { + {&kNS_PROFILER_CID, false, nullptr, nsProfilerConstructor}, {nullptr}}; + +static const mozilla::Module::ContractIDEntry kProfilerContracts[] = { + {"@mozilla.org/tools/profiler;1", &kNS_PROFILER_CID}, {nullptr}}; + +static const mozilla::Module kProfilerModule = { + mozilla::Module::kVersion, kProfilerCIDs, kProfilerContracts}; + +NSMODULE_DEFN(nsProfilerModule) = &kProfilerModule; diff --git a/tools/profiler/moz.build b/tools/profiler/moz.build index 018bc2201b0a..c12ad1211dc2 100644 --- a/tools/profiler/moz.build +++ b/tools/profiler/moz.build @@ -30,6 +30,7 @@ if CONFIG['MOZ_GECKO_PROFILER']: 'core/ProfilerMarkerPayload.cpp', 'core/RegisteredThread.cpp', 'gecko/ChildProfilerController.cpp', + 'gecko/nsProfilerFactory.cpp', 'gecko/nsProfilerStartParams.cpp', 'gecko/ProfilerChild.cpp', 'gecko/ProfilerIOInterposeObserver.cpp', @@ -41,10 +42,6 @@ if CONFIG['MOZ_GECKO_PROFILER']: 'core/memory_hooks.cpp', # conflicts with platform.h class Thread ] - XPCOM_MANIFESTS += [ - 'gecko/components.conf', - ] - if CONFIG['OS_TARGET'] == 'Darwin': # This file cannot be built in unified mode because it includes # "nsLocalFile.h", which pulls in a system header which uses a type diff --git a/widget/moz.build b/widget/moz.build index f3cbc6c9f15b..544974e5ce92 100644 --- a/widget/moz.build +++ b/widget/moz.build @@ -127,7 +127,6 @@ EXPORTS += [ 'GfxInfoBase.h', 'GfxInfoCollector.h', 'InputData.h', - 'nsBaseAppShell.h', 'nsBaseDragService.h', 'nsBaseFilePicker.h', 'nsBaseScreen.h', diff --git a/widget/windows/components.conf b/widget/windows/components.conf deleted file mode 100644 index 8db66ea3a64a..000000000000 --- a/widget/windows/components.conf +++ /dev/null @@ -1,199 +0,0 @@ -# -*- 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/. - -Headers = [ - '/widget/windows/nsWidgetFactory.h', -] - -InitFunc = 'nsWidgetWindowsModuleCtor' -UnloadFunc = 'nsWidgetWindowsModuleDtor' - -Classes = [ - { - 'cid': '{c401eb80-f9ea-11d3-bb6f-e732b73ebe7c}', - 'contract_ids': ['@mozilla.org/gfx/screenmanager;1'], - 'singleton': True, - 'type': 'mozilla::widget::ScreenManager', - 'constructor': 'mozilla::widget::ScreenManager::GetAddRefedSingleton', - 'headers': ['/widget/ScreenManager.h'], - 'processes': ProcessSelector.MAIN_PROCESS_ONLY, - }, - { - 'cid': '{2d96b3df-c051-11d1-a827-0040959a28c9}', - 'contract_ids': ['@mozilla.org/widget/appshell/win;1'], - 'headers': ['/widget/windows/nsWidgetFactory.h'], - 'legacy_constructor': 'nsAppShellConstructor', - 'processes': ProcessSelector.ALLOW_IN_GPU_VR_AND_SOCKET_PROCESS, - }, - { - 'cid': '{6987230e-0098-4e78-bc5f-1493ee7519fa}', - 'contract_ids': ['@mozilla.org/widget/idleservice;1'], - 'singleton': True, - 'type': 'nsIdleServiceWin', - 'constructor': 'nsIdleServiceWin::GetInstance', - 'headers': ['/widget/windows/nsIdleServiceWin.h', 'nsIdleService.h'], - }, - { - 'cid': '{b148eed2-236d-11d3-b35c-00a0cc3c1cde}', - 'contract_ids': ['@mozilla.org/sound;1'], - 'singleton': True, - 'type': 'nsISound', - 'constructor': 'nsSound::GetInstance', - 'headers': ['/widget/windows/nsSound.h'], - 'processes': ProcessSelector.MAIN_PROCESS_ONLY, - }, - { - 'cid': '{77221d5a-1dd2-11b2-8c69-c710f15d2ed5}', - 'contract_ids': ['@mozilla.org/widget/clipboardhelper;1'], - 'type': 'nsClipboardHelper', - 'headers': ['/widget/nsClipboardHelper.h'], - }, - { - 'cid': '{b8e5bc54-a22f-4eb2-b061-24cb6d19c15f}', - 'contract_ids': ['@mozilla.org/windows-taskbar;1'], - 'type': 'mozilla::widget::WinTaskbar', - 'headers': ['/widget/windows/WinTaskbar.h'], - }, - { - 'cid': '{73a5946f-608d-454f-9d33-0b8f8c7294b6}', - 'contract_ids': ['@mozilla.org/windows-jumplistbuilder;1'], - 'type': 'mozilla::widget::JumpListBuilder', - 'headers': ['/widget/windows/JumpListBuilder.h'], - }, - { - 'cid': '{2b9a1f2c-27ce-45b6-8d4e-755d0e34f8db}', - 'contract_ids': ['@mozilla.org/windows-jumplistitem;1'], - 'type': 'mozilla::widget::JumpListItem', - 'headers': ['/widget/windows/JumpListItem.h'], - }, - { - 'cid': '{21f1f13b-f75a-42ad-867a-d91ad694447e}', - 'contract_ids': ['@mozilla.org/windows-jumplistseparator;1'], - 'type': 'mozilla::widget::JumpListSeparator', - 'headers': ['/widget/windows/JumpListItem.h'], - }, - { - 'cid': '{f72c5dc4-5a12-47be-be28-ab105f33b08f}', - 'contract_ids': ['@mozilla.org/windows-jumplistlink;1'], - 'type': 'mozilla::widget::JumpListLink', - 'headers': ['/widget/windows/JumpListItem.h'], - }, - { - 'cid': '{b16656b2-5187-498f-abf4-56346126bfdb}', - 'contract_ids': ['@mozilla.org/windows-jumplistshortcut;1'], - 'type': 'mozilla::widget::JumpListShortcut', - 'headers': ['/widget/windows/JumpListItem.h'], - }, - { - 'cid': '{e04a55e8-fee3-4ea2-a98b-41d2621adc3c}', - 'contract_ids': ['@mozilla.org/windows-ui-utils;1'], - 'type': 'WindowsUIUtils', - 'headers': ['/widget/windows/WindowsUIUtils.h'], - }, - { - 'cid': '{8b5314bc-db01-11d2-96ce-0060b0fb9956}', - 'contract_ids': ['@mozilla.org/widget/transferable;1'], - 'type': 'nsTransferable', - 'headers': ['/widget/nsTransferable.h'], - }, - { - 'cid': '{948a0023-e3a7-11d2-96cf-0060b0fb9956}', - 'contract_ids': ['@mozilla.org/widget/htmlformatconverter;1'], - 'type': 'nsHTMLFormatConverter', - 'headers': ['/widget/nsHTMLFormatConverter.h'], - }, - { - 'cid': '{8b5314bb-db01-11d2-96ce-0060b0fb9956}', - 'contract_ids': ['@mozilla.org/widget/dragservice;1'], - 'type': 'nsDragService', - 'headers': ['/widget/windows/nsDragService.h'], - 'processes': ProcessSelector.MAIN_PROCESS_ONLY, - }, - { - 'cid': '{9a0cb62b-d638-4faf-9588-ae96f5e29093}', - 'contract_ids': ['@mozilla.org/widget/taskbar-preview-callback;1'], - 'type': 'mozilla::widget::TaskbarPreviewCallback', - 'headers': ['/widget/windows/TaskbarPreview.h'], - }, - { - 'cid': '{d755a760-9f27-11df-0800-200c9a664242}', - 'contract_ids': ['@mozilla.org/gfx/info;1'], - 'type': 'mozilla::widget::GfxInfo', - 'headers': ['/widget/windows/GfxInfo.h'], - 'init_method': 'Init', - 'processes': ProcessSelector.ALLOW_IN_GPU_AND_SOCKET_PROCESS, - }, - { - 'cid': '{bd57cee8-1dd1-11b2-9fe7-95cf4709aea3}', - 'contract_ids': ['@mozilla.org/filepicker;1'], - 'type': 'nsFilePicker', - 'headers': ['/widget/windows/nsFilePicker.h'], - 'processes': ProcessSelector.MAIN_PROCESS_ONLY, - }, - { - 'cid': '{0f872c8c-3ee6-46bd-92a2-69652c6b474e}', - 'contract_ids': ['@mozilla.org/colorpicker;1'], - 'type': 'nsColorPicker', - 'headers': ['/widget/windows/nsColorPicker.h'], - 'processes': ProcessSelector.MAIN_PROCESS_ONLY, - }, - { - 'cid': '{8b5314ba-db01-11d2-96ce-0060b0fb9956}', - 'contract_ids': ['@mozilla.org/widget/clipboard;1'], - 'type': 'nsIClipboard', - 'processes': ProcessSelector.MAIN_PROCESS_ONLY, - }, -] - -if buildconfig.substs['CC_TYPE'] in ('msvc', 'clang-cl'): - Classes += [ - { - 'cid': '{84e11f80-ca55-11dd-ad8b-0800200c9a66}', - 'contract_ids': ['@mozilla.org/system-alerts-service;1'], - 'type': 'mozilla::widget::ToastNotification', - 'headers': ['/widget/windows/ToastNotification.h'], - 'init_method': 'Init', - 'processes': ProcessSelector.MAIN_PROCESS_ONLY, - }, - ] - -if defined('NS_PRINTING'): - Classes += [ - { - 'cid': '{d3f69889-e13a-4321-980c-a39332e21f34}', - 'contract_ids': ['@mozilla.org/gfx/devicecontextspec;1'], - 'type': 'nsDeviceContextSpecWin', - 'headers': ['/widget/windows/nsDeviceContextSpecWin.h'], - }, - { - 'cid': '{06beec76-a183-4d9f-85dd-085f26da565a}', - 'contract_ids': ['@mozilla.org/widget/printdialog-service;1'], - 'type': 'nsPrintDialogServiceWin', - 'headers': ['/widget/windows/nsPrintDialogWin.h'], - 'init_method': 'Init', - 'processes': ProcessSelector.MAIN_PROCESS_ONLY, - }, - { - 'cid': '{841387c8-72e6-484b-9296-bf6eea80d58a}', - 'contract_ids': ['@mozilla.org/gfx/printsettings-service;1'], - 'type': 'nsPrintSettingsServiceWin', - 'headers': ['/widget/windows/nsPrintSettingsServiceWin.h'], - 'init_method': 'Init', - }, - { - 'cid': '{a6cf9129-15b3-11d2-932e-00805f8add32}', - 'contract_ids': ['@mozilla.org/gfx/printerenumerator;1'], - 'type': 'nsPrinterEnumeratorWin', - 'headers': ['/widget/windows/nsDeviceContextSpecWin.h'], - }, - { - 'cid': '{2f977d53-5485-11d4-87e2-0010a4e75ef2}', - 'contract_ids': ['@mozilla.org/gfx/printsession;1'], - 'type': 'nsPrintSession', - 'headers': ['/widget/nsPrintSession.h'], - 'init_method': 'Init', - }, - ] diff --git a/widget/windows/moz.build b/widget/windows/moz.build index 420f2c714c4a..fc592ce5974a 100644 --- a/widget/windows/moz.build +++ b/widget/windows/moz.build @@ -116,10 +116,6 @@ if CONFIG['NS_ENABLE_TSF']: 'TSFTextStore.cpp', ] -XPCOM_MANIFESTS += [ - 'components.conf', -] - include('/ipc/chromium/chromium-config.mozbuild') FINAL_LIBRARY = 'xul' diff --git a/widget/windows/nsWidgetFactory.cpp b/widget/windows/nsWidgetFactory.cpp index c89b4dca9aec..db0f27675cc6 100644 --- a/widget/windows/nsWidgetFactory.cpp +++ b/widget/windows/nsWidgetFactory.cpp @@ -3,21 +3,22 @@ * 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/. */ -#include "nsWidgetFactory.h" - -#include "mozilla/Components.h" #include "nsIFactory.h" #include "nsISupports.h" #include "nsdefs.h" #include "nsWidgetsCID.h" #include "nsAppShell.h" #include "nsAppShellSingleton.h" +#include "mozilla/ModuleUtils.h" #include "mozilla/WidgetUtils.h" #include "mozilla/widget/ScreenManager.h" #include "nsIServiceManager.h" +#include "nsIdleServiceWin.h" #include "nsLookAndFeel.h" +#include "nsSound.h" #include "WinMouseScrollHandler.h" #include "KeyboardLayout.h" +#include "GfxInfo.h" #include "nsToolkit.h" // Modules that switch out based on the environment @@ -28,31 +29,231 @@ // Content processes #include "nsFilePickerProxy.h" -// Clipboard +// Drag & Drop, Clipboard #include "nsClipboardHelper.h" #include "nsClipboard.h" #include "HeadlessClipboard.h" +#include "nsDragService.h" +#include "nsTransferable.h" +#include "nsHTMLFormatConverter.h" + +#include "WinTaskbar.h" +#include "JumpListBuilder.h" +#include "JumpListItem.h" +#include "TaskbarPreview.h" +// Toast notification support +#ifndef __MINGW32__ +# include "ToastNotification.h" +# include "nsToolkitCompsCID.h" +#endif #include "WindowsUIUtils.h" +#ifdef NS_PRINTING +# include "nsDeviceContextSpecWin.h" +# include "nsPrintDialogWin.h" +# include "nsPrintSettingsServiceWin.h" +# include "nsPrintSession.h" +#endif + using namespace mozilla; using namespace mozilla::widget; -NS_IMPL_COMPONENT_FACTORY(nsIClipboard) { +static nsresult FilePickerConstructor(nsISupports *aOuter, REFNSIID aIID, + void **aResult) { + *aResult = nullptr; + if (aOuter != nullptr) { + return NS_ERROR_NO_AGGREGATION; + } + nsCOMPtr picker = new nsFilePicker; + return picker->QueryInterface(aIID, aResult); +} + +static nsresult ColorPickerConstructor(nsISupports *aOuter, REFNSIID aIID, + void **aResult) { + *aResult = nullptr; + if (aOuter != nullptr) { + return NS_ERROR_NO_AGGREGATION; + } + nsCOMPtr picker = new nsColorPicker; + return picker->QueryInterface(aIID, aResult); +} + +static nsresult nsClipboardConstructor(nsISupports *aOuter, REFNSIID aIID, + void **aResult) { + *aResult = nullptr; + if (aOuter != nullptr) { + return NS_ERROR_NO_AGGREGATION; + } nsCOMPtr inst; if (gfxPlatform::IsHeadless()) { inst = new HeadlessClipboard(); } else { inst = new nsClipboard(); } - return inst.forget().downcast(); + return inst->QueryInterface(aIID, aResult); } -nsresult nsWidgetWindowsModuleCtor() { - return nsAppShellInit(); -} +NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ScreenManager, + ScreenManager::GetAddRefedSingleton) +NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIdleServiceWin, + nsIdleServiceWin::GetInstance) +NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsISound, nsSound::GetInstance) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper) +NS_GENERIC_FACTORY_CONSTRUCTOR(WinTaskbar) +NS_GENERIC_FACTORY_CONSTRUCTOR(JumpListBuilder) +NS_GENERIC_FACTORY_CONSTRUCTOR(JumpListItem) +NS_GENERIC_FACTORY_CONSTRUCTOR(JumpListSeparator) +NS_GENERIC_FACTORY_CONSTRUCTOR(JumpListLink) +NS_GENERIC_FACTORY_CONSTRUCTOR(JumpListShortcut) +NS_GENERIC_FACTORY_CONSTRUCTOR(WindowsUIUtils) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService) +#ifndef __MINGW32__ +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ToastNotification, Init) +#endif +NS_GENERIC_FACTORY_CONSTRUCTOR(TaskbarPreviewCallback) +#ifdef NS_PRINTING +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintDialogServiceWin, Init) +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSettingsServiceWin, Init) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsPrinterEnumeratorWin) +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSession, Init) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecWin) +#endif -void nsWidgetWindowsModuleDtor() { +namespace mozilla { +namespace widget { +// This constructor should really be shared with all platforms. +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(GfxInfo, Init) +} // namespace widget +} // namespace mozilla + +NS_DEFINE_NAMED_CID(NS_FILEPICKER_CID); +NS_DEFINE_NAMED_CID(NS_COLORPICKER_CID); +NS_DEFINE_NAMED_CID(NS_APPSHELL_CID); +NS_DEFINE_NAMED_CID(NS_SCREENMANAGER_CID); +NS_DEFINE_NAMED_CID(NS_GFXINFO_CID); +NS_DEFINE_NAMED_CID(NS_IDLE_SERVICE_CID); +NS_DEFINE_NAMED_CID(NS_CLIPBOARD_CID); +NS_DEFINE_NAMED_CID(NS_CLIPBOARDHELPER_CID); +NS_DEFINE_NAMED_CID(NS_SOUND_CID); +NS_DEFINE_NAMED_CID(NS_TRANSFERABLE_CID); +NS_DEFINE_NAMED_CID(NS_HTMLFORMATCONVERTER_CID); +NS_DEFINE_NAMED_CID(NS_WIN_TASKBAR_CID); +NS_DEFINE_NAMED_CID(NS_WIN_JUMPLISTBUILDER_CID); +NS_DEFINE_NAMED_CID(NS_WIN_JUMPLISTITEM_CID); +NS_DEFINE_NAMED_CID(NS_WIN_JUMPLISTSEPARATOR_CID); +NS_DEFINE_NAMED_CID(NS_WIN_JUMPLISTLINK_CID); +NS_DEFINE_NAMED_CID(NS_WIN_JUMPLISTSHORTCUT_CID); +NS_DEFINE_NAMED_CID(NS_WINDOWS_UIUTILS_CID); +NS_DEFINE_NAMED_CID(NS_DRAGSERVICE_CID); +#ifndef __MINGW32__ +NS_DEFINE_NAMED_CID(NS_SYSTEMALERTSSERVICE_CID); +#endif +NS_DEFINE_NAMED_CID(NS_TASKBARPREVIEWCALLBACK_CID); +#ifdef NS_PRINTING +NS_DEFINE_NAMED_CID(NS_PRINTDIALOGSERVICE_CID); +NS_DEFINE_NAMED_CID(NS_PRINTSETTINGSSERVICE_CID); +NS_DEFINE_NAMED_CID(NS_PRINTER_ENUMERATOR_CID); +NS_DEFINE_NAMED_CID(NS_PRINTSESSION_CID); +NS_DEFINE_NAMED_CID(NS_DEVICE_CONTEXT_SPEC_CID); +#endif + +static const mozilla::Module::CIDEntry kWidgetCIDs[] = { + {&kNS_FILEPICKER_CID, false, nullptr, FilePickerConstructor, + Module::MAIN_PROCESS_ONLY}, + {&kNS_COLORPICKER_CID, false, nullptr, ColorPickerConstructor, + Module::MAIN_PROCESS_ONLY}, + {&kNS_APPSHELL_CID, false, nullptr, nsAppShellConstructor, + Module::ALLOW_IN_GPU_VR_AND_SOCKET_PROCESS}, + {&kNS_SCREENMANAGER_CID, false, nullptr, ScreenManagerConstructor, + Module::MAIN_PROCESS_ONLY}, + {&kNS_GFXINFO_CID, false, nullptr, GfxInfoConstructor, + Module::ALLOW_IN_GPU_AND_SOCKET_PROCESS}, + {&kNS_IDLE_SERVICE_CID, false, nullptr, nsIdleServiceWinConstructor}, + {&kNS_CLIPBOARD_CID, false, nullptr, nsClipboardConstructor, + Module::MAIN_PROCESS_ONLY}, + {&kNS_CLIPBOARDHELPER_CID, false, nullptr, nsClipboardHelperConstructor}, + {&kNS_SOUND_CID, false, nullptr, nsISoundConstructor, + Module::MAIN_PROCESS_ONLY}, + {&kNS_TRANSFERABLE_CID, false, nullptr, nsTransferableConstructor}, + {&kNS_HTMLFORMATCONVERTER_CID, false, nullptr, + nsHTMLFormatConverterConstructor}, + {&kNS_WIN_TASKBAR_CID, false, nullptr, WinTaskbarConstructor}, + {&kNS_WIN_JUMPLISTBUILDER_CID, false, nullptr, JumpListBuilderConstructor}, + {&kNS_WIN_JUMPLISTITEM_CID, false, nullptr, JumpListItemConstructor}, + {&kNS_WIN_JUMPLISTSEPARATOR_CID, false, nullptr, + JumpListSeparatorConstructor}, + {&kNS_WIN_JUMPLISTLINK_CID, false, nullptr, JumpListLinkConstructor}, + {&kNS_WIN_JUMPLISTSHORTCUT_CID, false, nullptr, + JumpListShortcutConstructor}, + {&kNS_WINDOWS_UIUTILS_CID, false, nullptr, WindowsUIUtilsConstructor}, + {&kNS_DRAGSERVICE_CID, false, nullptr, nsDragServiceConstructor, + Module::MAIN_PROCESS_ONLY}, +#ifndef __MINGW32__ + {&kNS_SYSTEMALERTSSERVICE_CID, false, nullptr, ToastNotificationConstructor, + Module::MAIN_PROCESS_ONLY}, +#endif + {&kNS_TASKBARPREVIEWCALLBACK_CID, false, nullptr, + TaskbarPreviewCallbackConstructor}, +#ifdef NS_PRINTING + {&kNS_PRINTDIALOGSERVICE_CID, false, nullptr, + nsPrintDialogServiceWinConstructor, Module::MAIN_PROCESS_ONLY}, + {&kNS_PRINTSETTINGSSERVICE_CID, false, nullptr, + nsPrintSettingsServiceWinConstructor}, + {&kNS_PRINTER_ENUMERATOR_CID, false, nullptr, + nsPrinterEnumeratorWinConstructor}, + {&kNS_PRINTSESSION_CID, false, nullptr, nsPrintSessionConstructor}, + {&kNS_DEVICE_CONTEXT_SPEC_CID, false, nullptr, + nsDeviceContextSpecWinConstructor}, +#endif + {nullptr}}; + +static const mozilla::Module::ContractIDEntry kWidgetContracts[] = { + {"@mozilla.org/filepicker;1", &kNS_FILEPICKER_CID, + Module::MAIN_PROCESS_ONLY}, + {"@mozilla.org/colorpicker;1", &kNS_COLORPICKER_CID, + Module::MAIN_PROCESS_ONLY}, + {"@mozilla.org/widget/appshell/win;1", &kNS_APPSHELL_CID, + Module::ALLOW_IN_GPU_VR_AND_SOCKET_PROCESS}, + {"@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID, + Module::MAIN_PROCESS_ONLY}, + {"@mozilla.org/gfx/info;1", &kNS_GFXINFO_CID, + Module::ALLOW_IN_GPU_AND_SOCKET_PROCESS}, + {"@mozilla.org/widget/idleservice;1", &kNS_IDLE_SERVICE_CID}, + {"@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID, + Module::MAIN_PROCESS_ONLY}, + {"@mozilla.org/widget/clipboardhelper;1", &kNS_CLIPBOARDHELPER_CID}, + {"@mozilla.org/sound;1", &kNS_SOUND_CID, Module::MAIN_PROCESS_ONLY}, + {"@mozilla.org/widget/transferable;1", &kNS_TRANSFERABLE_CID}, + {"@mozilla.org/widget/htmlformatconverter;1", &kNS_HTMLFORMATCONVERTER_CID}, + {"@mozilla.org/windows-taskbar;1", &kNS_WIN_TASKBAR_CID}, + {"@mozilla.org/windows-jumplistbuilder;1", &kNS_WIN_JUMPLISTBUILDER_CID}, + {"@mozilla.org/windows-jumplistitem;1", &kNS_WIN_JUMPLISTITEM_CID}, + {"@mozilla.org/windows-jumplistseparator;1", + &kNS_WIN_JUMPLISTSEPARATOR_CID}, + {"@mozilla.org/windows-jumplistlink;1", &kNS_WIN_JUMPLISTLINK_CID}, + {"@mozilla.org/windows-jumplistshortcut;1", &kNS_WIN_JUMPLISTSHORTCUT_CID}, + {"@mozilla.org/windows-ui-utils;1", &kNS_WINDOWS_UIUTILS_CID}, + {"@mozilla.org/widget/dragservice;1", &kNS_DRAGSERVICE_CID, + Module::MAIN_PROCESS_ONLY}, +#ifndef __MINGW32__ + {NS_SYSTEMALERTSERVICE_CONTRACTID, &kNS_SYSTEMALERTSSERVICE_CID, + Module::MAIN_PROCESS_ONLY}, +#endif + {"@mozilla.org/widget/taskbar-preview-callback;1", + &kNS_TASKBARPREVIEWCALLBACK_CID}, +#ifdef NS_PRINTING + {NS_PRINTDIALOGSERVICE_CONTRACTID, &kNS_PRINTDIALOGSERVICE_CID}, + {"@mozilla.org/gfx/printsettings-service;1", &kNS_PRINTSETTINGSSERVICE_CID}, + {"@mozilla.org/gfx/printerenumerator;1", &kNS_PRINTER_ENUMERATOR_CID}, + {"@mozilla.org/gfx/printsession;1", &kNS_PRINTSESSION_CID}, + {"@mozilla.org/gfx/devicecontextspec;1", &kNS_DEVICE_CONTEXT_SPEC_CID}, +#endif + {nullptr}}; + +static void nsWidgetWindowsModuleDtor() { // Shutdown all XP level widget classes. WidgetUtils::Shutdown(); @@ -62,3 +263,15 @@ void nsWidgetWindowsModuleDtor() { nsToolkit::Shutdown(); nsAppShellShutdown(); } + +static const mozilla::Module kWidgetModule = { + mozilla::Module::kVersion, + kWidgetCIDs, + kWidgetContracts, + nullptr, + nullptr, + nsAppShellInit, + nsWidgetWindowsModuleDtor, + Module::ALLOW_IN_GPU_VR_AND_SOCKET_PROCESS}; + +NSMODULE_DEFN(nsWidgetModule) = &kWidgetModule; diff --git a/widget/windows/nsWidgetFactory.h b/widget/windows/nsWidgetFactory.h deleted file mode 100644 index cc9b30a77676..000000000000 --- a/widget/windows/nsWidgetFactory.h +++ /dev/null @@ -1,22 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:expandtab:shiftwidth=4:tabstop=4: - */ -/* 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/. */ - -#ifndef widget_windows_nsWidgetFactory_h -#define widget_windows_nsWidgetFactory_h - -#include "nscore.h" -#include "nsID.h" - -class nsISupports; - -nsresult nsAppShellConstructor(nsISupports *outer, const nsIID &iid, - void **result); - -nsresult nsWidgetWindowsModuleCtor(); -void nsWidgetWindowsModuleDtor(); - -#endif // defined widget_windows_nsWidgetFactory_h diff --git a/xpcom/build/XPCOMInit.cpp b/xpcom/build/XPCOMInit.cpp index d480898e714b..766cdb469ad8 100644 --- a/xpcom/build/XPCOMInit.cpp +++ b/xpcom/build/XPCOMInit.cpp @@ -175,26 +175,6 @@ const mozilla::Module kXPCOMModule = { nullptr, Module::ALLOW_IN_GPU_VR_AND_SOCKET_PROCESS}; -// FIXME: Dummy modules to avoid Windows PGO bustage when we have too few -// modules registered. -static const mozilla::Module kDummy1 = {mozilla::Module::kVersion}; -static const mozilla::Module kDummy2 = {mozilla::Module::kVersion}; -static const mozilla::Module kDummy3 = {mozilla::Module::kVersion}; -static const mozilla::Module kDummy4 = {mozilla::Module::kVersion}; -static const mozilla::Module kDummy5 = {mozilla::Module::kVersion}; -static const mozilla::Module kDummy6 = {mozilla::Module::kVersion}; -static const mozilla::Module kDummy7 = {mozilla::Module::kVersion}; -static const mozilla::Module kDummy8 = {mozilla::Module::kVersion}; - -NSMODULE_DEFN(Dummy1) = &kDummy1; -NSMODULE_DEFN(Dummy2) = &kDummy2; -NSMODULE_DEFN(Dummy3) = &kDummy3; -NSMODULE_DEFN(Dummy4) = &kDummy4; -NSMODULE_DEFN(Dummy5) = &kDummy5; -NSMODULE_DEFN(Dummy6) = &kDummy6; -NSMODULE_DEFN(Dummy7) = &kDummy7; -NSMODULE_DEFN(Dummy8) = &kDummy8; - // gDebug will be freed during shutdown. static nsIDebug2* gDebug = nullptr; diff --git a/xpfe/appshell/components.conf b/xpfe/appshell/components.conf deleted file mode 100644 index 547f5e502874..000000000000 --- a/xpfe/appshell/components.conf +++ /dev/null @@ -1,21 +0,0 @@ -# -*- 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': '{0099907d-123c-4853-a46a-43098b5fb68c}', - 'contract_ids': ['@mozilla.org/appshell/appShellService;1'], - 'type': 'nsAppShellService', - 'headers': ['/xpfe/appshell/nsAppShellService.h'], - }, - { - 'cid': '{79a2b7cc-f05b-4605-bfa0-fac54f27eec8}', - 'contract_ids': ['@mozilla.org/appshell/window-mediator;1'], - 'type': 'nsWindowMediator', - 'headers': ['/xpfe/appshell/nsWindowMediator.h'], - 'init_method': 'Init', - }, -] diff --git a/xpfe/appshell/moz.build b/xpfe/appshell/moz.build index ca09649e4fd9..a46feae97122 100644 --- a/xpfe/appshell/moz.build +++ b/xpfe/appshell/moz.build @@ -26,6 +26,7 @@ EXPORTS += [ ] UNIFIED_SOURCES += [ + 'nsAppShellFactory.cpp', 'nsAppShellService.cpp', 'nsAppShellWindowEnumerator.cpp', 'nsChromeTreeOwner.cpp', @@ -35,10 +36,6 @@ UNIFIED_SOURCES += [ 'nsXULWindow.cpp', ] -XPCOM_MANIFESTS += [ - 'components.conf', -] - LOCAL_INCLUDES += [ '/dom/base', '/dom/xul', diff --git a/xpfe/appshell/nsAppShellFactory.cpp b/xpfe/appshell/nsAppShellFactory.cpp new file mode 100644 index 000000000000..0684a2c558d7 --- /dev/null +++ b/xpfe/appshell/nsAppShellFactory.cpp @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. */ + +#include "mozilla/ModuleUtils.h" +#include "nscore.h" +#include "nsIWindowMediator.h" + +#include "nsIAppShellService.h" +#include "nsAppShellService.h" +#include "nsWindowMediator.h" +#include "nsChromeTreeOwner.h" +#include "nsAppShellCID.h" + +NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppShellService) +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowMediator, Init) + +NS_DEFINE_NAMED_CID(NS_APPSHELLSERVICE_CID); +NS_DEFINE_NAMED_CID(NS_WINDOWMEDIATOR_CID); + +static const mozilla::Module::CIDEntry kAppShellCIDs[] = { + {&kNS_APPSHELLSERVICE_CID, false, nullptr, nsAppShellServiceConstructor}, + {&kNS_WINDOWMEDIATOR_CID, false, nullptr, nsWindowMediatorConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry kAppShellContracts[] = { + {NS_APPSHELLSERVICE_CONTRACTID, &kNS_APPSHELLSERVICE_CID}, + {NS_WINDOWMEDIATOR_CONTRACTID, &kNS_WINDOWMEDIATOR_CID}, + {nullptr}}; + +static const mozilla::Module kAppShellModule = { + mozilla::Module::kVersion, + kAppShellCIDs, + kAppShellContracts, +}; + +NSMODULE_DEFN(appshell) = &kAppShellModule;