mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1783304 - Simplify DLL blocklist init r=handyman
Now that SetGeckoProcessType() is called earlier, we can use that to determine if we are a utility process instead of parsing command-line arguments Differential Revision: https://phabricator.services.mozilla.com/D158811
This commit is contained in:
parent
ce2995a71a
commit
7950aa0894
@ -311,13 +311,11 @@ int main(int argc, char* argv[], char* envp[]) {
|
||||
# ifdef HAS_DLL_BLOCKLIST
|
||||
uint32_t initFlags =
|
||||
gBlocklistInitFlags | eDllBlocklistInitFlagIsChildProcess;
|
||||
# if defined(MOZ_SANDBOX)
|
||||
Maybe<uint64_t> sandboxingKind =
|
||||
geckoargs::sSandboxingKind.Get(argc, argv, CheckArgFlag::None);
|
||||
if (sandboxingKind.isSome()) {
|
||||
// This is too early in launch to call XRE_IsUtilityProcess(), so roll
|
||||
// our own.
|
||||
if (GetGeckoProcessType() == GeckoProcessType_Utility) {
|
||||
initFlags |= eDllBlocklistInitFlagIsUtilityProcess;
|
||||
}
|
||||
# endif // defined(MOZ_SANDBOX)
|
||||
DllBlocklist_Initialize(initFlags);
|
||||
# endif // HAS_DLL_BLOCKLIST
|
||||
# if defined(XP_WIN) && defined(MOZ_SANDBOX)
|
||||
|
@ -83,13 +83,11 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
#ifdef HAS_DLL_BLOCKLIST
|
||||
uint32_t initFlags = eDllBlocklistInitFlagIsChildProcess;
|
||||
# if defined(MOZ_SANDBOX)
|
||||
Maybe<uint64_t> sandboxingKind =
|
||||
geckoargs::sSandboxingKind.Get(argc, argv, CheckArgFlag::None);
|
||||
if (sandboxingKind.isSome()) {
|
||||
// This is too early in launch to call XRE_IsUtilityProcess(), so roll
|
||||
// our own.
|
||||
if (GetGeckoProcessType() == GeckoProcessType_Utility) {
|
||||
initFlags |= eDllBlocklistInitFlagIsUtilityProcess;
|
||||
}
|
||||
# endif // defined(MOZ_SANDBOX)
|
||||
DllBlocklist_Initialize(initFlags);
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user