diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-19 17:08:12 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-19 17:08:12 +0000 |
commit | 2ce26c438a2cd219348eefa324a64c15d1bf8cf2 (patch) | |
tree | 8b17944db4ef181365a7a29d4c86bb96f9a29754 /ipc/ipc_channel_posix.h | |
parent | 334b47007cdd108b8e0b0566bd29f952f5ad71f8 (diff) | |
download | chromium_src-2ce26c438a2cd219348eefa324a64c15d1bf8cf2.zip chromium_src-2ce26c438a2cd219348eefa324a64c15d1bf8cf2.tar.gz chromium_src-2ce26c438a2cd219348eefa324a64c15d1bf8cf2.tar.bz2 |
Wait properly for renderer crashes
This replaces a Sleep in automation with a wait for renderer crash. It turns out that our IPC on POSIX had one loophole that caused it not to notice very early crashes, so I also fixed that.
The problem was that when the child process died before connecting to the parent's IPC channel, the parent wouldn't notice the crash because the child end of the IPC pipe was kept open for too long. This change makes the code close the child end of the pipe right after forking the child.
This might also help with automation not noticing the browser crash during initial launch, or at least should be a good step toward fixing that problem.
BUG=38497,90489
Review URL: http://codereview.chromium.org/7870008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101760 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_channel_posix.h')
-rw-r--r-- | ipc/ipc_channel_posix.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ipc/ipc_channel_posix.h b/ipc/ipc_channel_posix.h index 06c545c..e141998 100644 --- a/ipc/ipc_channel_posix.h +++ b/ipc/ipc_channel_posix.h @@ -57,7 +57,9 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher { void Close(); void set_listener(Listener* listener) { listener_ = listener; } bool Send(Message* message); - int GetClientFileDescriptor() const; + int GetClientFileDescriptor(); + int TakeClientFileDescriptor(); + void CloseClientFileDescriptor(); bool AcceptsConnections() const; bool HasAcceptedConnection() const; bool GetClientEuid(uid_t* client_euid) const; @@ -109,6 +111,7 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher { // For a server, the client end of our socketpair() -- the other end of our // pipe_ that is passed to the client. int client_pipe_; + base::Lock client_pipe_lock_; // Lock that protects |client_pipe_|. #if defined(IPC_USES_READWRITE) // Linux/BSD use a dedicated socketpair() for passing file descriptors. |