Bug 1671773: Add ContentParent to ContentProcessManager before we call InitInternal. r=nika

Otherwise, if we return early, it will never get added, and we will crash when
trying to remove it when it's destroyed.

Differential Revision: https://phabricator.services.mozilla.com/D94487
This commit is contained in:
Kris Maglione 2020-10-22 21:34:43 +00:00
Родитель cffbc80aca
Коммит 7f1732b64e
1 изменённых файлов: 3 добавлений и 2 удалений

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

@ -2414,6 +2414,9 @@ bool ContentParent::LaunchSubprocessResolve(bool aIsSync,
base::ProcessId procId =
base::GetProcId(mSubprocess->GetChildProcessHandle());
Open(mSubprocess->TakeChannel(), procId);
ContentProcessManager::GetSingleton()->AddContentProcess(this);
#ifdef MOZ_CODE_COVERAGE
Unused << SendShareCodeCoverageMutex(
CodeCoverageHandler::Get()->GetMutexHandle(procId));
@ -2428,8 +2431,6 @@ bool ContentParent::LaunchSubprocessResolve(bool aIsSync,
return false;
}
ContentProcessManager::GetSingleton()->AddContentProcess(this);
mHangMonitorActor = ProcessHangMonitor::AddProcess(this);
// Set a reply timeout for CPOWs.