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

Unified Diff: ipc/mojo/ipc_channel_mojo_readers.cc

Issue 554363004: ChannelMojo: Handle errors in pending message processing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
Index: ipc/mojo/ipc_channel_mojo_readers.cc
diff --git a/ipc/mojo/ipc_channel_mojo_readers.cc b/ipc/mojo/ipc_channel_mojo_readers.cc
index 7af96f8d7cfc8d6fc731aab91f2511fa1bfbd26a..d57c69574512c2c17ebf8fa7a6737f2fefbebf14 100644
--- a/ipc/mojo/ipc_channel_mojo_readers.cc
+++ b/ipc/mojo/ipc_channel_mojo_readers.cc
@@ -146,12 +146,11 @@ bool MessageReader::Send(scoped_ptr<Message> message) {
}
#endif
MojoResult write_result =
- MojoWriteMessage(handle(),
- message->data(),
- static_cast<uint32>(message->size()),
- handles.empty() ? NULL : &handles[0],
- static_cast<uint32>(handles.size()),
- MOJO_WRITE_MESSAGE_FLAG_NONE);
+ WriteMessageToPipe(message->data(),
+ static_cast<uint32>(message->size()),
+ handles.empty() ? NULL : &handles[0],
+ static_cast<uint32>(handles.size()),
+ MOJO_WRITE_MESSAGE_FLAG_NONE);
if (MOJO_RESULT_OK != write_result) {
std::for_each(handles.begin(), handles.end(), &MojoClose);
CloseWithError(write_result);
@@ -161,6 +160,18 @@ bool MessageReader::Send(scoped_ptr<Message> message) {
return true;
}
+MojoResult MessageReader::WriteMessageToPipe(
+ const void* bytes,
+ uint32_t num_bytes,
+ const MojoHandle* handles,
+ uint32_t num_handles,
+ MojoWriteMessageFlags flags) {
+ return MojoWriteMessage(handle(),
+ bytes, num_bytes,
+ handles, num_handles,
+ flags);
+}
+
//------------------------------------------------------------------------------
ControlReader::ControlReader(mojo::ScopedMessagePipeHandle pipe,

Powered by Google App Engine
This is Rietveld 408576698