diff options
author | morrita <morrita@chromium.org> | 2015-03-24 16:52:26 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-24 23:53:29 +0000 |
commit | 29d88220e88d21deaf6856b7ded300fa06ab94d3 (patch) | |
tree | 7079dc17fc8d29949d0c97dd441600b3a5345eff /ipc | |
parent | 1d5a4c807e011a38ec9a2aa84ce66c1cbfe52be1 (diff) | |
download | chromium_src-29d88220e88d21deaf6856b7ded300fa06ab94d3.zip chromium_src-29d88220e88d21deaf6856b7ded300fa06ab94d3.tar.gz chromium_src-29d88220e88d21deaf6856b7ded300fa06ab94d3.tar.bz2 |
ChannelMojo: Let MessagePipeReader wait "peer closed" signal as well.
This CL adds MOJO_SIGNAL_PEER_CLOSED for the MessagePipeReader's
waiting bits. Without this, PRECONDITION_FAILED error can be notified
at the end of the channel lifetime, and the browser process misinterprets
it as a renderer crash, which results sadface screen.
This rarely happens and is reproduced only with some underpowered CPU
with excessive pressure. So we cannot have any reliable test.
BUG=466814
R=viettrungluu@chromium.org
Review URL: https://codereview.chromium.org/1023043002
Cr-Commit-Position: refs/heads/master@{#322094}
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/mojo/ipc_message_pipe_reader.cc | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/ipc/mojo/ipc_message_pipe_reader.cc b/ipc/mojo/ipc_message_pipe_reader.cc index 61b36f6..d40d6e2 100644 --- a/ipc/mojo/ipc_message_pipe_reader.cc +++ b/ipc/mojo/ipc_message_pipe_reader.cc @@ -161,8 +161,9 @@ void MessagePipeReader::ReadMessagesThenWait() { // If can fail with |MOJO_RESULT_ALREADY_EXISTS| otherwise. // Also, we don't use MOJO_HANDLE_SIGNAL_WRITABLE here, expecting buffer in // MessagePipe. - MojoResult result = - async_waiter_->Wait(pipe_.get().value(), MOJO_HANDLE_SIGNAL_READABLE); + MojoResult result = async_waiter_->Wait( + pipe_.get().value(), + MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED); // If the result is |MOJO_RESULT_ALREADY_EXISTS|, there could be messages // that have been arrived after the last |ReadAvailableMessages()|. // We have to consume then and retry in that case. @@ -180,13 +181,9 @@ void MessagePipeReader::ReadMessagesThenWait() { void MessagePipeReader::PipeIsReady(MojoResult wait_result) { if (wait_result != MOJO_RESULT_OK) { - if (wait_result != MOJO_RESULT_ABORTED) { - // FAILED_PRECONDITION happens every time the peer is dead so - // it isn't worth polluting the log message. - LOG_IF(WARNING, wait_result != MOJO_RESULT_FAILED_PRECONDITION) - << "Pipe got error from the waiter. Closing: " << wait_result; - OnPipeError(wait_result); - } + CHECK_NE(wait_result, MOJO_RESULT_ABORTED); + LOG(ERROR) << "Pipe got error from the waiter. Closing: " << wait_result; + OnPipeError(wait_result); Close(); return; |