Bug 1743489 - Content process makes early return from `LauncherMain` before any registry access. r=mhowell

Differential Revision: https://phabricator.services.mozilla.com/D132407
This commit is contained in:
Toshihito Kikuchi 2021-11-29 22:04:19 +00:00
Родитель caaffc3a03
Коммит f5551c4395
1 изменённых файлов: 10 добавлений и 9 удалений

Просмотреть файл

@ -199,15 +199,6 @@ static mozilla::Maybe<bool> RunAsLauncherProcess(
#else
static mozilla::Maybe<bool> RunAsLauncherProcess(int& argc, wchar_t** argv) {
#endif // defined(MOZ_LAUNCHER_PROCESS)
// return fast when we're a child process.
// (The remainder of this function has some side effects that are
// undesirable for content processes)
if (mozilla::CheckArg(argc, argv, L"contentproc",
static_cast<const wchar_t**>(nullptr),
mozilla::CheckArgFlag::None) == mozilla::ARG_FOUND) {
return mozilla::Some(false);
}
bool runAsLauncher = DoLauncherProcessChecks(argc, argv);
#if defined(MOZ_LAUNCHER_PROCESS)
@ -262,6 +253,16 @@ Maybe<int> LauncherMain(int& argc, wchar_t* argv[],
SetLauncherErrorForceEventLog();
}
// return fast when we're a child process.
// (The remainder of this function has some side effects that are
// undesirable for content processes)
if (mozilla::CheckArg(argc, argv, L"contentproc",
static_cast<const wchar_t**>(nullptr),
mozilla::CheckArgFlag::None) == mozilla::ARG_FOUND) {
// A child process should not instantiate LauncherRegistryInfo.
return Nothing();
}
#if defined(MOZ_LAUNCHER_PROCESS)
LauncherRegistryInfo regInfo;
Maybe<bool> runAsLauncher = RunAsLauncherProcess(regInfo, argc, argv);