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:
Greg Stoll 2022-10-07 19:22:45 +00:00
parent ce2995a71a
commit 7950aa0894
2 changed files with 6 additions and 10 deletions

View File

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

View File

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