Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: ipc/mojo/ipc_message_pipe_reader.cc

Issue 1035633002: Revert of ChannelMojo: Let MessagePipeReader wait "peer closed" signal as well. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/mojo/ipc_message_pipe_reader.cc
diff --git a/ipc/mojo/ipc_message_pipe_reader.cc b/ipc/mojo/ipc_message_pipe_reader.cc
index d40d6e2b228e631d9634167037f871578d71454a..61b36f6f384531dd68e0d7358f59889e5dca00d0 100644
--- a/ipc/mojo/ipc_message_pipe_reader.cc
+++ b/ipc/mojo/ipc_message_pipe_reader.cc
@@ -161,9 +161,8 @@
// 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 | MOJO_HANDLE_SIGNAL_PEER_CLOSED);
+ MojoResult result =
+ async_waiter_->Wait(pipe_.get().value(), MOJO_HANDLE_SIGNAL_READABLE);
// 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.
@@ -181,9 +180,13 @@
void MessagePipeReader::PipeIsReady(MojoResult wait_result) {
if (wait_result != MOJO_RESULT_OK) {
- CHECK_NE(wait_result, MOJO_RESULT_ABORTED);
- LOG(ERROR) << "Pipe got error from the waiter. Closing: " << wait_result;
- OnPipeError(wait_result);
+ 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);
+ }
Close();
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698