Bug 1431079 - Ensure we don't attempt to launch content processes during shutdown. r=smaug

This commit is contained in:
Andrew Osmond 2018-01-22 06:11:46 -06:00
parent 24eb731836
commit 83aecd3510
2 changed files with 13 additions and 0 deletions

View File

@ -601,6 +601,14 @@ public:
nullptr);
}
// But starting a process can failure for any number of reasons. Reject the
// promise if we could not.
if (!targetProcess) {
mPromise->Reject(NS_ERROR_ABORT, __func__);
mPromise = nullptr;
return NS_OK;
}
ClientOpenWindowOpParent* actor =
new ClientOpenWindowOpParent(mArgs, mPromise);

View File

@ -1989,6 +1989,11 @@ ContentParent::LaunchSubprocess(ProcessPriority aInitialPriority /* = PROCESS_PR
{
AUTO_PROFILER_LABEL("ContentParent::LaunchSubprocess", OTHER);
if (!ContentProcessManager::GetSingleton()) {
// Shutdown has begun, we shouldn't spawn any more child processes.
return false;
}
std::vector<std::string> extraArgs;
extraArgs.push_back("-childID");
char idStr[21];