зеркало из https://github.com/mozilla/gecko-dev.git
Bug 890840 - calling KillHard() multiple times may crash parent process. r=jlebar
This commit is contained in:
Родитель
4c971fbac6
Коммит
d6d156b7b1
|
@ -1184,6 +1184,7 @@ ContentParent::ContentParent(mozIApplication* aApp,
|
|||
, mIsForBrowser(aIsForBrowser)
|
||||
, mCalledClose(false)
|
||||
, mCalledCloseWithError(false)
|
||||
, mCalledKillHard(false)
|
||||
{
|
||||
// No more than one of !!aApp, aIsForBrowser, and aIsForPreallocated should
|
||||
// be true.
|
||||
|
@ -1921,6 +1922,13 @@ ContentParent::GetOrCreateActorForBlob(nsIDOMBlob* aBlob)
|
|||
void
|
||||
ContentParent::KillHard()
|
||||
{
|
||||
// On Windows, calling KillHard multiple times causes problems - the
|
||||
// process handle becomes invalid on the first call, causing a second call
|
||||
// to crash our process - more details in bug 890840.
|
||||
if (mCalledKillHard) {
|
||||
return;
|
||||
}
|
||||
mCalledKillHard = true;
|
||||
mForceKillTask = nullptr;
|
||||
// This ensures the process is eventually killed, but doesn't
|
||||
// immediately KILLITWITHFIRE because we want to get a minidump if
|
||||
|
|
|
@ -475,10 +475,11 @@ private:
|
|||
bool mSendPermissionUpdates;
|
||||
bool mIsForBrowser;
|
||||
|
||||
// These variables track whether we've called Close() and CloseWithError()
|
||||
// on our channel.
|
||||
// These variables track whether we've called Close(), CloseWithError()
|
||||
// and KillHard() on our channel.
|
||||
bool mCalledClose;
|
||||
bool mCalledCloseWithError;
|
||||
bool mCalledKillHard;
|
||||
|
||||
friend class CrashReporterParent;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче