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

Side by Side Diff: ipc/mojo/ipc_message_pipe_reader.cc

Issue 453643003: IPC::ChannelMojo: Don't supress MOJO_RESULT_FAILED_PRECONDITION (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ipc/mojo/ipc_channel_mojo_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ipc/mojo/ipc_message_pipe_reader.h" 5 #include "ipc/mojo/ipc_message_pipe_reader.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 if (!pipe_wait_id_) 60 if (!pipe_wait_id_)
61 return; 61 return;
62 mojo::Environment::GetDefaultAsyncWaiter()->CancelWait(pipe_wait_id_); 62 mojo::Environment::GetDefaultAsyncWaiter()->CancelWait(pipe_wait_id_);
63 pipe_wait_id_ = 0; 63 pipe_wait_id_ = 0;
64 } 64 }
65 65
66 void MessagePipeReader::PipeIsReady(MojoResult wait_result) { 66 void MessagePipeReader::PipeIsReady(MojoResult wait_result) {
67 pipe_wait_id_ = 0; 67 pipe_wait_id_ = 0;
68 68
69 if (wait_result != MOJO_RESULT_OK) { 69 if (wait_result != MOJO_RESULT_OK) {
70 // FAILED_PRECONDITION happens when the pipe is 70 if (wait_result != MOJO_RESULT_ABORTED) {
viettrungluu 2014/08/08 00:36:12 This is fine, but do you ever expect to see MOJO_R
71 // closed before the waiter is scheduled in a backend thread. 71 // FAILED_PRECONDITION happens every time the peer is dead so
72 if (wait_result != MOJO_RESULT_ABORTED && 72 // it isn't worth polluting the log message.
73 wait_result != MOJO_RESULT_FAILED_PRECONDITION) { 73 DLOG_IF(WARNING, wait_result != MOJO_RESULT_FAILED_PRECONDITION)
74 DLOG(WARNING) << "Pipe got error from the waiter. Closing: " 74 << "Pipe got error from the waiter. Closing: "
75 << wait_result; 75 << wait_result;
76 OnPipeError(wait_result); 76 OnPipeError(wait_result);
77 } 77 }
78 78
79 Close(); 79 Close();
80 return; 80 return;
81 } 81 }
82 82
83 while (pipe_.is_valid()) { 83 while (pipe_.is_valid()) {
84 MojoResult read_result = ReadMessageBytes(); 84 MojoResult read_result = ReadMessageBytes();
85 if (read_result == MOJO_RESULT_SHOULD_WAIT) 85 if (read_result == MOJO_RESULT_SHOULD_WAIT)
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 void MessagePipeReader::DelayedDeleter::operator()( 136 void MessagePipeReader::DelayedDeleter::operator()(
137 MessagePipeReader* ptr) const { 137 MessagePipeReader* ptr) const {
138 ptr->Close(); 138 ptr->Close();
139 base::MessageLoopProxy::current()->PostTask( 139 base::MessageLoopProxy::current()->PostTask(
140 FROM_HERE, base::Bind(&DeleteNow, ptr)); 140 FROM_HERE, base::Bind(&DeleteNow, ptr));
141 } 141 }
142 142
143 } // namespace internal 143 } // namespace internal
144 } // namespace IPC 144 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/mojo/ipc_channel_mojo_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698