diff --git a/modules/libpref/components.conf b/modules/libpref/components.conf index 25f3aecbb78f8..20f4e61d2f331 100644 --- a/modules/libpref/components.conf +++ b/modules/libpref/components.conf @@ -21,7 +21,7 @@ Classes = [ 'type': 'mozilla::Preferences', 'headers': ['mozilla/Preferences.h'], 'constructor': 'mozilla::Preferences::GetInstanceForService', - 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS, + 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS, }, { 'cid': '{064d9cee-1dd2-11b2-83e3-d25ab0193c26}', diff --git a/toolkit/components/telemetry/core/components.conf b/toolkit/components/telemetry/core/components.conf index 82a624f4ece53..d003b414a1bee 100644 --- a/toolkit/components/telemetry/core/components.conf +++ b/toolkit/components/telemetry/core/components.conf @@ -16,6 +16,6 @@ Classes = [ 'interfaces': ['nsITelemetry'], 'singleton': True, 'type': 'nsITelemetry', - 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS, + 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS, }, ] diff --git a/widget/android/components.conf b/widget/android/components.conf index 3b926771f371d..c678ca8b32ee0 100644 --- a/widget/android/components.conf +++ b/widget/android/components.conf @@ -17,7 +17,7 @@ Classes = [ 'contract_ids': ['@mozilla.org/widget/appshell/android;1'], 'legacy_constructor': 'nsAppShellConstructor', 'headers': ['/widget/android/nsWidgetFactory.h'], - 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS, + 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS, }, { 'cid': '{d594094c-28b6-466b-97d7-66c039c3dea9}', diff --git a/widget/cocoa/components.conf b/widget/cocoa/components.conf index 199e5cf255086..2f9cb911367f7 100644 --- a/widget/cocoa/components.conf +++ b/widget/cocoa/components.conf @@ -41,7 +41,7 @@ Classes = [ '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, + 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS, }, { 'cid': '{15cc80a9-5329-4fcb-9a0b-c6cf1440ae51}', diff --git a/widget/gtk/components.conf b/widget/gtk/components.conf index a2759a3c45cc0..851de59d0c66d 100644 --- a/widget/gtk/components.conf +++ b/widget/gtk/components.conf @@ -17,7 +17,7 @@ Classes = [ 'contract_ids': ['@mozilla.org/widget/appshell/gtk;1'], 'legacy_constructor': 'nsAppShellConstructor', 'headers': ['/widget/gtk/nsWidgetFactory.h'], - 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS, + 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS, }, { 'cid': '{e9537f8f-c07e-4435-8ab3-83f1ad6e3bbf}', diff --git a/widget/windows/components.conf b/widget/windows/components.conf index 0ccaae359826c..11b1df3ebd016 100644 --- a/widget/windows/components.conf +++ b/widget/windows/components.conf @@ -26,7 +26,7 @@ Classes = [ 'contract_ids': ['@mozilla.org/widget/appshell/win;1'], 'headers': ['/widget/windows/nsWidgetFactory.h'], 'legacy_constructor': 'nsAppShellConstructor', - 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS, + 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS, }, { 'cid': '{6987230e-0098-4e78-bc5f-1493ee7519fa}', diff --git a/xpcom/build/components.conf b/xpcom/build/components.conf index 6bf301c26f088..cc734f3d5321f 100644 --- a/xpcom/build/components.conf +++ b/xpcom/build/components.conf @@ -78,7 +78,7 @@ Classes = [ 'type': 'nsMemoryReporterManager', 'headers': ['/xpcom/base/nsMemoryReporterManager.h'], 'init_method': 'Init', - 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS, + 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS, }, { 'cid': '{7b4eeb20-d781-11d4-8a83-0010a4e0c9ca}', diff --git a/xpcom/components/Module.h b/xpcom/components/Module.h index f9b8f16f4e325..b8fae64356933 100644 --- a/xpcom/components/Module.h +++ b/xpcom/components/Module.h @@ -24,9 +24,9 @@ enum ProcessSelector { CONTENT_PROCESS_ONLY = 1 << 1, /** - * By default, modules are not loaded in the GPU, VR, Socket, RDD, Utility - * and IPDLUnitTest processes, even if ANY_PROCESS is specified. This flag - * enables a module in the relevant process. + * By default, modules are not loaded in the GPU, VR, Socket, RDD, Utility, + * GMPlugin and IPDLUnitTest processes, even if ANY_PROCESS is specified. + * This flag enables a module in the relevant process. * * NOTE: IPDLUnitTest does not have its own flag, and will only load a * module if it is enabled in all processes. @@ -36,6 +36,7 @@ enum ProcessSelector { ALLOW_IN_SOCKET_PROCESS = 1 << 4, ALLOW_IN_RDD_PROCESS = 1 << 5, ALLOW_IN_UTILITY_PROCESS = 1 << 6, + ALLOW_IN_GMPLUGIN_PROCESS = 1 << 7, ALLOW_IN_GPU_AND_MAIN_PROCESS = ALLOW_IN_GPU_PROCESS | MAIN_PROCESS_ONLY, ALLOW_IN_GPU_AND_VR_PROCESS = ALLOW_IN_GPU_PROCESS | ALLOW_IN_VR_PROCESS, ALLOW_IN_GPU_AND_SOCKET_PROCESS = @@ -53,11 +54,15 @@ enum ProcessSelector { ALLOW_IN_SOCKET_PROCESS, ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS = ALLOW_IN_GPU_PROCESS | ALLOW_IN_RDD_PROCESS | ALLOW_IN_VR_PROCESS | - ALLOW_IN_SOCKET_PROCESS | ALLOW_IN_UTILITY_PROCESS + ALLOW_IN_SOCKET_PROCESS | ALLOW_IN_UTILITY_PROCESS, + ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS = + ALLOW_IN_GPU_PROCESS | ALLOW_IN_RDD_PROCESS | ALLOW_IN_VR_PROCESS | + ALLOW_IN_SOCKET_PROCESS | ALLOW_IN_UTILITY_PROCESS | + ALLOW_IN_GMPLUGIN_PROCESS }; -static constexpr size_t kMaxProcessSelector = - size_t(ProcessSelector::ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS); +static constexpr size_t kMaxProcessSelector = size_t( + ProcessSelector::ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS); /** * This allows category entries to be marked so that they are or are diff --git a/xpcom/components/components.conf b/xpcom/components/components.conf index 73cc177e8d942..9938fb104f81a 100644 --- a/xpcom/components/components.conf +++ b/xpcom/components/components.conf @@ -18,6 +18,6 @@ Classes = [ 'cid': '{91775d60-d5dc-11d2-92fb-00e09805570f}', 'legacy_constructor': 'nsComponentManagerImpl::Create', 'headers': ['/xpcom/components/nsComponentManager.h'], - 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS, + 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS, }, ] diff --git a/xpcom/components/gen_static_components.py b/xpcom/components/gen_static_components.py index 8e5d3e9685fb9..f759dc3132455 100644 --- a/xpcom/components/gen_static_components.py +++ b/xpcom/components/gen_static_components.py @@ -64,6 +64,7 @@ class ProcessSelector: ALLOW_IN_SOCKET_PROCESS = 1 << 4 ALLOW_IN_RDD_PROCESS = 1 << 5 ALLOW_IN_UTILITY_PROCESS = 1 << 6 + ALLOW_IN_GMPLUGIN_PROCESS = 1 << 7 ALLOW_IN_GPU_AND_MAIN_PROCESS = ALLOW_IN_GPU_PROCESS | MAIN_PROCESS_ONLY ALLOW_IN_GPU_AND_SOCKET_PROCESS = ALLOW_IN_GPU_PROCESS | ALLOW_IN_SOCKET_PROCESS ALLOW_IN_GPU_AND_VR_PROCESS = ALLOW_IN_GPU_PROCESS | ALLOW_IN_VR_PROCESS @@ -93,6 +94,14 @@ class ProcessSelector: | ALLOW_IN_SOCKET_PROCESS | ALLOW_IN_UTILITY_PROCESS ) + ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS = ( + ALLOW_IN_GPU_PROCESS + | ALLOW_IN_RDD_PROCESS + | ALLOW_IN_VR_PROCESS + | ALLOW_IN_SOCKET_PROCESS + | ALLOW_IN_UTILITY_PROCESS + | ALLOW_IN_GMPLUGIN_PROCESS + ) # Maps ProcessSelector constants to the name of the corresponding @@ -114,6 +123,7 @@ class ProcessSelector: ProcessSelector.ALLOW_IN_GPU_RDD_SOCKET_AND_UTILITY_PROCESS: "ALLOW_IN_GPU_RDD_SOCKET_AND_UTILITY_PROCESS", # NOQA: E501 ProcessSelector.ALLOW_IN_GPU_RDD_VR_AND_SOCKET_PROCESS: "ALLOW_IN_GPU_RDD_VR_AND_SOCKET_PROCESS", # NOQA: E501 ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS: "ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS", # NOQA: E501 + ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS: "ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS", # NOQA: E501 } diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp index 35954b1702054..a55d926b4f0a2 100644 --- a/xpcom/components/nsComponentManager.cpp +++ b/xpcom/components/nsComponentManager.cpp @@ -115,6 +115,10 @@ bool ProcessSelectorMatches(ProcessSelector aSelector) { return !!(aSelector & Module::ALLOW_IN_UTILITY_PROCESS); } + if (type == GeckoProcessType_GMPlugin) { + return !!(aSelector & Module::ALLOW_IN_GMPLUGIN_PROCESS); + } + // Only allow XPCOM modules which can be loaded in all processes to be loaded // in the IPDLUnitTest process. if (type == GeckoProcessType_IPDLUnitTest) { @@ -294,6 +298,8 @@ nsresult nsComponentManagerImpl::Init() { ProcessSelectorMatches(ProcessSelector::ALLOW_IN_SOCKET_PROCESS); gProcessMatchTable[size_t(ProcessSelector::ALLOW_IN_RDD_PROCESS)] = ProcessSelectorMatches(ProcessSelector::ALLOW_IN_RDD_PROCESS); + gProcessMatchTable[size_t(ProcessSelector::ALLOW_IN_GMPLUGIN_PROCESS)] = + ProcessSelectorMatches(ProcessSelector::ALLOW_IN_GMPLUGIN_PROCESS); gProcessMatchTable[size_t(ProcessSelector::ALLOW_IN_GPU_AND_MAIN_PROCESS)] = ProcessSelectorMatches(ProcessSelector::ALLOW_IN_GPU_AND_MAIN_PROCESS); gProcessMatchTable[size_t(ProcessSelector::ALLOW_IN_GPU_AND_VR_PROCESS)] = @@ -326,6 +332,12 @@ nsresult nsComponentManagerImpl::Init() { ProcessSelector::ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS)] = ProcessSelectorMatches( ProcessSelector::ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS); + gProcessMatchTable[size_t( + ProcessSelector:: + ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS)] = + ProcessSelectorMatches( + ProcessSelector:: + ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS); } MOZ_ASSERT(NOT_INITIALIZED == mStatus); @@ -360,7 +372,6 @@ nsresult nsComponentManagerImpl::Init() { // processes really need chrome manifests...? case GeckoProcessType_Default: case GeckoProcessType_Content: - case GeckoProcessType_GMPlugin: loadChromeManifests = true; break; } diff --git a/xpcom/ds/components.conf b/xpcom/ds/components.conf index 1b600352b3e4b..c2cf35e787e7b 100644 --- a/xpcom/ds/components.conf +++ b/xpcom/ds/components.conf @@ -19,6 +19,6 @@ Classes = [ 'interfaces': ['nsIObserverService'], 'legacy_constructor': 'nsObserverService::Create', 'headers': ['/xpcom/ds/nsObserverService.h'], - 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS, + 'processes': ProcessSelector.ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS, }, ]