mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 840277 - Explicitly check that the preallocated process hasn't been killed before we use it. r=cjones
We have to do this check /after/ we set the process's priority, since before then, it has BACKGROUND priority and is a candidate for killing.
This commit is contained in:
parent
f4358d3449
commit
2479e627f8
@ -564,7 +564,22 @@ ContentParent::TransformPreallocatedIntoApp(const nsAString& aAppManifestURL,
|
||||
PROCESS_PRIORITY_FOREGROUND);
|
||||
}
|
||||
|
||||
// If this fails, the child process died.
|
||||
// Now that we've increased the process's priority from BACKGROUND (where
|
||||
// the preallocated app sits) to something higher, check whether the process
|
||||
// is still alive. Hopefully the process won't unexpectedly crash after
|
||||
// this point!
|
||||
//
|
||||
// It's not legal to call DidProcessCrash on Windows if the process has not
|
||||
// terminated yet, so we have to skip this check there.
|
||||
|
||||
#ifndef XP_WIN
|
||||
bool exited = false;
|
||||
base::DidProcessCrash(&exited, mSubprocess->GetChildProcessHandle());
|
||||
if (exited) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
return SendSetProcessPrivileges(aPrivs);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user