Bug 1773770: Part 8 - Migrate Cocoa widget module to static component registration. r=mstange

Differential Revision: https://phabricator.services.mozilla.com/D149435
This commit is contained in:
Kris Maglione 2022-06-24 07:10:17 +00:00
parent fc1c2b1b04
commit ec68cbb32e
4 changed files with 231 additions and 125 deletions

View File

@ -4,6 +4,11 @@
# 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/cocoa/nsWidgetFactory.h',
InitFunc = 'nsWidgetCocoaModuleCtor'
UnloadFunc = 'nsWidgetCocoaModuleDtor'
Classes = [
{
'js_name': 'clipboard',
@ -22,4 +27,144 @@ Classes = [
'headers': ['/widget/cocoa/GfxInfo.h'],
'init_method': 'Init',
},
{
'cid': '{bd57cee8-1dd1-11b2-9fe7-95cf4709aea3}',
'contract_ids': ['@mozilla.org/filepicker;1'],
'type': 'nsFilePicker',
'processes': ProcessSelector.MAIN_PROCESS_ONLY,
},
{
'cid': '{0f872c8c-3ee6-46bd-92a2-69652c6b474e}',
'contract_ids': ['@mozilla.org/colorpicker;1'],
'type': 'nsColorPicker',
'processes': ProcessSelector.MAIN_PROCESS_ONLY,
},
{
'cid': '{2d96b3df-c051-11d1-a827-0040959a28c9}',
'contract_ids': ['@mozilla.org/widget/appshell/mac;1'],
'legacy_constructor': 'nsAppShellConstructor',
'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS,
},
{
'cid': '{b148eed2-236d-11d3-b35c-00a0cc3c1cde}',
'contract_ids': ['@mozilla.org/sound;1'],
'type': 'nsSound',
'processes': ProcessSelector.MAIN_PROCESS_ONLY,
},
{
'cid': '{8b5314bc-db01-11d2-96ce-0060b0fb9956}',
'contract_ids': ['@mozilla.org/widget/transferable;1'],
'type': 'nsTransferable',
'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS,
},
{
'cid': '{948a0023-e3a7-11d2-96cf-0060b0fb9956}',
'contract_ids': ['@mozilla.org/widget/htmlformatconverter;1'],
'type': 'nsHTMLFormatConverter',
'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS,
},
{
'cid': '{77221d5a-1dd2-11b2-8c69-c710f15d2ed5}',
'contract_ids': ['@mozilla.org/widget/clipboardhelper;1'],
'type': 'nsClipboardHelper',
'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS,
},
{
'cid': '{8b5314bb-db01-11d2-96ce-0060b0fb9956}',
'contract_ids': ['@mozilla.org/widget/dragservice;1'],
'type': 'nsDragService',
'processes': ProcessSelector.MAIN_PROCESS_ONLY,
},
{
'cid': '{c401eb80-f9ea-11d3-bb6f-e732b73ebe7c}',
'contract_ids': ['@mozilla.org/gfx/screenmanager;1'],
'type': 'mozilla::widget::ScreenManager',
'processes': ProcessSelector.MAIN_PROCESS_ONLY,
'singleton': True,
},
{
'cid': '{d3f69889-e13a-4321-980c-a39332e21f34}',
'contract_ids': ['@mozilla.org/gfx/devicecontextspec;1'],
'type': 'nsDeviceContextSpecX',
'processes': ProcessSelector.MAIN_PROCESS_ONLY,
},
{
'cid': '{a6cf9129-15b3-11d2-932e-00805f8add32}',
'contract_ids': ['@mozilla.org/gfx/printerlist;1'],
'type': 'nsPrinterListCUPS',
'processes': ProcessSelector.MAIN_PROCESS_ONLY,
},
{
'cid': '{841387c8-72e6-484b-9296-bf6eea80d58a}',
'contract_ids': ['@mozilla.org/gfx/printsettings-service;1'],
'type': 'nsPrintSettingsServiceX',
'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS,
},
{
'cid': '{06beec76-a183-4d9f-85dd-085f26da565a}',
'contract_ids': ['@mozilla.org/widget/printdialog-service;1'],
'type': 'nsPrintDialogServiceX',
'processes': ProcessSelector.MAIN_PROCESS_ONLY,
},
{
'cid': '{6987230e-0089-4e78-bc5f-1493ee7519fa}',
'contract_ids': ['@mozilla.org/widget/useridleservice;1'],
'type': 'nsUserIdleServiceX',
'singleton': True,
'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS,
},
{
'cid': '{84e11f80-ca55-11dd-ad8b-0800200c9a66}',
'contract_ids': ['@mozilla.org/system-alerts-service;1'],
'type': 'mozilla::OSXNotificationCenter',
'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS,
},
{
'cid': '{2451baed-8dc3-46d9-9e30-96e1baa03666}',
'contract_ids': ['@mozilla.org/widget/macdocksupport;1'],
'type': 'nsMacDockSupport',
'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS,
},
{
'cid': '{74ea4101-a5bb-49bc-9984-66da8b225a37}',
'contract_ids': ['@mozilla.org/widget/macfinderprogress;1'],
'type': 'nsMacFinderProgress',
'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS,
},
{
'cid': '{de59fe1a-46c8-490f-b04d-34545acb06c9}',
'contract_ids': ['@mozilla.org/widget/macsharingservice;1'],
'type': 'nsMacSharingService',
'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS,
},
{
'cid': '{29046c8f-cba6-4ffa-9141-1685e96c4ea0}',
'contract_ids': ['@mozilla.org/widget/macuseractivityupdater;1'],
'type': 'nsMacUserActivityUpdater',
'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS,
},
{
'cid': '{e9096367-ddd9-45e4-b762-49c0c18b7119}',
'contract_ids': ['@mozilla.org/widget/mac-web-app-utils;1'],
'type': 'nsMacWebAppUtils',
'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS,
},
{
'cid': '{1f39ae50-b6a0-4b37-90f4-60af614193d8}',
'contract_ids': ['@mozilla.org/widget/standalonenativemenu;1'],
'type': 'nsStandaloneNativeMenu',
'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS,
},
{
'cid': '{b6e1a890-b2b8-4883-a65f-9476f6185313}',
'contract_ids': ['@mozilla.org/widget/systemstatusbar;1'],
'type': 'nsSystemStatusBarCocoa',
'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS,
},
{
'cid': '{38f396e2-93c9-4a77-aaf7-2d50b9962186}',
'contract_ids': ['@mozilla.org/widget/touchbarupdater;1'],
'type': 'nsTouchBarUpdater',
'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS,
},
]

View File

@ -0,0 +1,44 @@
/* -*- 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/. */
// This file contains forward declarations for classes defined in static
// components. The appropriate headers for those types cannot be included in
// the generated static component code directly.
#include "nsID.h"
namespace mozilla {
class OSXNotificationCenter;
} // namespace mozilla
namespace mozilla::widget {
class ScreenManager;
}
class nsClipboardHelper;
class nsColorPicker;
class nsDeviceContextSpecX;
class nsDragService;
class nsFilePicker;
class nsHTMLFormatConverter;
class nsMacDockSupport;
class nsMacFinderProgress;
class nsMacSharingService;
class nsMacUserActivityUpdater;
class nsMacWebAppUtils;
class nsPrintDialogServiceX;
class nsPrintSettingsServiceX;
class nsPrinterListCUPS;
class nsSound;
class nsStandaloneNativeMenu;
class nsSystemStatusBarCocoa;
class nsTouchBarUpdater;
class nsTransferable;
class nsUserIdleServiceX;
nsresult nsAppShellConstructor(const nsIID&, void**);
void nsWidgetCocoaModuleCtor();
void nsWidgetCocoaModuleDtor();

View File

@ -54,133 +54,66 @@ NS_IMPL_COMPONENT_FACTORY(nsIClipboard) {
return inst.forget();
}
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePicker)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsColorPicker)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecX)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsPrinterListCUPS)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSettingsServiceX, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintDialogServiceX, Init)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsUserIdleServiceX, nsUserIdleServiceX::GetInstance)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ScreenManager, ScreenManager::GetAddRefedSingleton)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(OSXNotificationCenter, Init)
#define MAKE_GENERIC_CTOR(class_, iface_) \
NS_IMPL_COMPONENT_FACTORY(class_) { \
RefPtr inst = new class_(); \
return inst.forget().downcast<iface_>(); \
}
#define MAKE_GENERIC_CTOR_INIT(class_, iface_, init_) \
NS_IMPL_COMPONENT_FACTORY(class_) { \
RefPtr inst = new class_(); \
if (NS_SUCCEEDED(inst->init_())) { \
return inst.forget().downcast<iface_>(); \
} \
return nullptr; \
}
#define MAKE_GENERIC_SINGLETON_CTOR(iface_, func_) \
NS_IMPL_COMPONENT_FACTORY(iface_) { return func_(); }
MAKE_GENERIC_CTOR(nsFilePicker, nsIFilePicker)
MAKE_GENERIC_CTOR(nsColorPicker, nsIColorPicker)
MAKE_GENERIC_CTOR(nsSound, nsISound)
MAKE_GENERIC_CTOR(nsTransferable, nsITransferable)
MAKE_GENERIC_CTOR(nsHTMLFormatConverter, nsIFormatConverter)
MAKE_GENERIC_CTOR(nsClipboardHelper, nsIClipboardHelper)
MAKE_GENERIC_CTOR(nsDragService, nsIDragService)
MAKE_GENERIC_CTOR(nsDeviceContextSpecX, nsIDeviceContextSpec)
MAKE_GENERIC_CTOR(nsPrinterListCUPS, nsIPrinterList)
MAKE_GENERIC_CTOR_INIT(nsPrintSettingsServiceX, nsIPrintSettingsService, Init)
MAKE_GENERIC_CTOR_INIT(nsPrintDialogServiceX, nsIPrintDialogService, Init)
MAKE_GENERIC_SINGLETON_CTOR(nsUserIdleServiceX, nsUserIdleServiceX::GetInstance)
MAKE_GENERIC_SINGLETON_CTOR(ScreenManager, ScreenManager::GetAddRefedSingleton)
MAKE_GENERIC_CTOR_INIT(OSXNotificationCenter, nsIAlertsService, Init)
#include "nsMacDockSupport.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacDockSupport)
MAKE_GENERIC_CTOR(nsMacDockSupport, nsIMacDockSupport)
#include "nsMacFinderProgress.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacFinderProgress)
MAKE_GENERIC_CTOR(nsMacFinderProgress, nsIMacFinderProgress)
#include "nsMacSharingService.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacSharingService)
MAKE_GENERIC_CTOR(nsMacSharingService, nsIMacSharingService)
#include "nsMacUserActivityUpdater.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacUserActivityUpdater)
MAKE_GENERIC_CTOR(nsMacUserActivityUpdater, nsIMacUserActivityUpdater)
#include "nsMacWebAppUtils.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacWebAppUtils)
MAKE_GENERIC_CTOR(nsMacWebAppUtils, nsIMacWebAppUtils)
#include "nsStandaloneNativeMenu.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsStandaloneNativeMenu)
MAKE_GENERIC_CTOR(nsStandaloneNativeMenu, nsIStandaloneNativeMenu)
#include "nsSystemStatusBarCocoa.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSystemStatusBarCocoa)
MAKE_GENERIC_CTOR(nsSystemStatusBarCocoa, nsISystemStatusBar)
#include "nsTouchBarUpdater.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTouchBarUpdater)
MAKE_GENERIC_CTOR(nsTouchBarUpdater, nsITouchBarUpdater)
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_SOUND_CID);
NS_DEFINE_NAMED_CID(NS_TRANSFERABLE_CID);
NS_DEFINE_NAMED_CID(NS_HTMLFORMATCONVERTER_CID);
NS_DEFINE_NAMED_CID(NS_CLIPBOARDHELPER_CID);
NS_DEFINE_NAMED_CID(NS_DRAGSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_SCREENMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_DEVICE_CONTEXT_SPEC_CID);
NS_DEFINE_NAMED_CID(NS_PRINTER_LIST_CID);
NS_DEFINE_NAMED_CID(NS_PRINTSETTINGSSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_PRINTDIALOGSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_IDLE_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_SYSTEMALERTSSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_MACDOCKSUPPORT_CID);
NS_DEFINE_NAMED_CID(NS_MACFINDERPROGRESS_CID);
NS_DEFINE_NAMED_CID(NS_MACSHARINGSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_MACUSERACTIVITYUPDATER_CID);
NS_DEFINE_NAMED_CID(NS_MACWEBAPPUTILS_CID);
NS_DEFINE_NAMED_CID(NS_STANDALONENATIVEMENU_CID);
NS_DEFINE_NAMED_CID(NS_SYSTEMSTATUSBAR_CID);
NS_DEFINE_NAMED_CID(NS_TOUCHBARUPDATER_CID);
void nsWidgetCocoaModuleCtor() { nsAppShellInit(); }
static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
{&kNS_FILEPICKER_CID, false, NULL, nsFilePickerConstructor, mozilla::Module::MAIN_PROCESS_ONLY},
{&kNS_COLORPICKER_CID, false, NULL, nsColorPickerConstructor,
mozilla::Module::MAIN_PROCESS_ONLY},
{&kNS_APPSHELL_CID, false, NULL, nsAppShellConstructor,
mozilla::Module::ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS},
{&kNS_SOUND_CID, false, NULL, nsSoundConstructor, mozilla::Module::MAIN_PROCESS_ONLY},
{&kNS_TRANSFERABLE_CID, false, NULL, nsTransferableConstructor},
{&kNS_HTMLFORMATCONVERTER_CID, false, NULL, nsHTMLFormatConverterConstructor},
{&kNS_CLIPBOARDHELPER_CID, false, NULL, nsClipboardHelperConstructor},
{&kNS_DRAGSERVICE_CID, false, NULL, nsDragServiceConstructor,
mozilla::Module::MAIN_PROCESS_ONLY},
{&kNS_SCREENMANAGER_CID, false, NULL, ScreenManagerConstructor,
mozilla::Module::MAIN_PROCESS_ONLY},
{&kNS_DEVICE_CONTEXT_SPEC_CID, false, NULL, nsDeviceContextSpecXConstructor,
mozilla::Module::MAIN_PROCESS_ONLY},
{&kNS_PRINTER_LIST_CID, false, NULL, nsPrinterListCUPSConstructor,
mozilla::Module::MAIN_PROCESS_ONLY},
{&kNS_PRINTSETTINGSSERVICE_CID, false, NULL, nsPrintSettingsServiceXConstructor},
{&kNS_PRINTDIALOGSERVICE_CID, false, NULL, nsPrintDialogServiceXConstructor,
mozilla::Module::MAIN_PROCESS_ONLY},
{&kNS_IDLE_SERVICE_CID, false, NULL, nsUserIdleServiceXConstructor},
{&kNS_SYSTEMALERTSSERVICE_CID, false, NULL, OSXNotificationCenterConstructor},
{&kNS_MACDOCKSUPPORT_CID, false, NULL, nsMacDockSupportConstructor},
{&kNS_MACFINDERPROGRESS_CID, false, NULL, nsMacFinderProgressConstructor},
{&kNS_MACSHARINGSERVICE_CID, false, NULL, nsMacSharingServiceConstructor},
{&kNS_MACUSERACTIVITYUPDATER_CID, false, NULL, nsMacUserActivityUpdaterConstructor},
{&kNS_MACWEBAPPUTILS_CID, false, NULL, nsMacWebAppUtilsConstructor},
{&kNS_STANDALONENATIVEMENU_CID, false, NULL, nsStandaloneNativeMenuConstructor},
{&kNS_SYSTEMSTATUSBAR_CID, false, NULL, nsSystemStatusBarCocoaConstructor},
{&kNS_TOUCHBARUPDATER_CID, false, NULL, nsTouchBarUpdaterConstructor},
{NULL}};
static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
{"@mozilla.org/filepicker;1", &kNS_FILEPICKER_CID, mozilla::Module::MAIN_PROCESS_ONLY},
{"@mozilla.org/colorpicker;1", &kNS_COLORPICKER_CID, mozilla::Module::MAIN_PROCESS_ONLY},
{"@mozilla.org/widget/appshell/mac;1", &kNS_APPSHELL_CID,
mozilla::Module::ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS},
{"@mozilla.org/sound;1", &kNS_SOUND_CID, mozilla::Module::MAIN_PROCESS_ONLY},
{"@mozilla.org/widget/transferable;1", &kNS_TRANSFERABLE_CID},
{"@mozilla.org/widget/htmlformatconverter;1", &kNS_HTMLFORMATCONVERTER_CID},
{"@mozilla.org/widget/clipboardhelper;1", &kNS_CLIPBOARDHELPER_CID},
{"@mozilla.org/widget/dragservice;1", &kNS_DRAGSERVICE_CID, mozilla::Module::MAIN_PROCESS_ONLY},
{"@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID,
mozilla::Module::MAIN_PROCESS_ONLY},
{"@mozilla.org/gfx/devicecontextspec;1", &kNS_DEVICE_CONTEXT_SPEC_CID,
mozilla::Module::MAIN_PROCESS_ONLY},
{"@mozilla.org/gfx/printerlist;1", &kNS_PRINTER_LIST_CID, mozilla::Module::MAIN_PROCESS_ONLY},
{"@mozilla.org/gfx/printsettings-service;1", &kNS_PRINTSETTINGSSERVICE_CID},
{NS_PRINTDIALOGSERVICE_CONTRACTID, &kNS_PRINTDIALOGSERVICE_CID,
mozilla::Module::MAIN_PROCESS_ONLY},
{"@mozilla.org/widget/useridleservice;1", &kNS_IDLE_SERVICE_CID},
{"@mozilla.org/system-alerts-service;1", &kNS_SYSTEMALERTSSERVICE_CID},
{"@mozilla.org/widget/macdocksupport;1", &kNS_MACDOCKSUPPORT_CID},
{"@mozilla.org/widget/macfinderprogress;1", &kNS_MACFINDERPROGRESS_CID},
{"@mozilla.org/widget/macsharingservice;1", &kNS_MACSHARINGSERVICE_CID},
{"@mozilla.org/widget/macuseractivityupdater;1", &kNS_MACUSERACTIVITYUPDATER_CID},
{"@mozilla.org/widget/mac-web-app-utils;1", &kNS_MACWEBAPPUTILS_CID},
{"@mozilla.org/widget/standalonenativemenu;1", &kNS_STANDALONENATIVEMENU_CID},
{"@mozilla.org/widget/systemstatusbar;1", &kNS_SYSTEMSTATUSBAR_CID},
{"@mozilla.org/widget/touchbarupdater;1", &kNS_TOUCHBARUPDATER_CID},
{NULL}};
static void nsWidgetCocoaModuleDtor() {
void nsWidgetCocoaModuleDtor() {
// Shutdown all XP level widget classes.
WidgetUtils::Shutdown();
@ -189,13 +122,3 @@ static void nsWidgetCocoaModuleDtor() {
nsToolkit::Shutdown();
nsAppShellShutdown();
}
extern const mozilla::Module kWidgetModule = {
mozilla::Module::kVersion,
kWidgetCIDs,
kWidgetContracts,
NULL,
NULL,
nsAppShellInit,
nsWidgetCocoaModuleDtor,
mozilla::Module::ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS};

View File

@ -272,9 +272,6 @@ nsComponentManagerImpl::nsComponentManagerImpl()
mStatus(NOT_INITIALIZED) {}
extern const mozilla::Module kContentProcessWidgetModule;
#if defined(MOZ_WIDGET_COCOA) || defined(MOZ_WIDGET_UIKIT)
extern const mozilla::Module kWidgetModule;
#endif
static nsTArray<const mozilla::Module*>* sExtraStaticModules;
@ -360,9 +357,6 @@ nsresult nsComponentManagerImpl::Init() {
nsCategoryManager::GetSingleton()->SuppressNotifications(true);
RegisterModule(&kContentProcessWidgetModule);
#if defined(MOZ_WIDGET_COCOA) || defined(MOZ_WIDGET_UIKIT)
RegisterModule(&kWidgetModule);
#endif
for (uint32_t i = 0; i < sExtraStaticModules->Length(); ++i) {
RegisterModule((*sExtraStaticModules)[i]);