Bug 1066812 - Set AbortOnError in the ContentProcess on initialization. r=billm.

This will cause the content process to take itself down in the event that it
loses communication with the parent process. This case is particularly
important for the case where the parent process crashes while the content
process is blocked or busy on the main thread, as the content process will
no longer continue to exist as a zombie process, but will shut down after
a short delay.
This commit is contained in:
Mike Conley 2015-02-13 14:10:56 -05:00
parent ce02722142
commit eb4205771e
2 changed files with 7 additions and 1 deletions

View File

@ -615,6 +615,10 @@ ContentChild::Init(MessageLoop* aIOLoop,
// urgent messages.
GetIPCChannel()->BlockScripts();
// If communications with the parent have broken down, take the process
// down so it's not hanging around.
GetIPCChannel()->SetAbortOnError(true);
#ifdef MOZ_X11
// Send the parent our X socket to act as a proxy reference for our X
// resources.
@ -2571,6 +2575,8 @@ ContentChild::RecvShutdown()
os->NotifyObservers(this, "content-child-shutdown", nullptr);
}
GetIPCChannel()->SetAbortOnError(false);
// Ignore errors here. If this fails, the parent will kill us after a
// timeout.
unused << SendFinishShutdown();

View File

@ -88,7 +88,7 @@ class MessageChannel : HasResultCodes
void SetAbortOnError(bool abort)
{
mAbortOnError = true;
mAbortOnError = abort;
}
// Misc. behavioral traits consumers can request for this channel