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

Unified Diff: mojo/system/message_pipe.cc

Issue 68303007: Mojo: More plumbing required to transfer handles over MessagePipes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | « mojo/system/local_message_pipe_endpoint.cc ('k') | mojo/system/message_pipe_endpoint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/message_pipe.cc
diff --git a/mojo/system/message_pipe.cc b/mojo/system/message_pipe.cc
index b9643524f77f49bf3f8a36d7561ec54fcac7f3b0..01b05eedd12715d25dc87dc6225fe4caab3dde0a 100644
--- a/mojo/system/message_pipe.cc
+++ b/mojo/system/message_pipe.cc
@@ -136,7 +136,19 @@ MojoResult MessagePipe::EnqueueMessage(
return MOJO_RESULT_FAILED_PRECONDITION;
}
- return endpoints_[port]->EnqueueMessage(message, dispatchers);
+ MojoResult result = endpoints_[port]->CanEnqueueMessage(message, dispatchers);
+ if (result != MOJO_RESULT_OK) {
+ message->Destroy();
+ return result;
+ }
+
+ // TODO(vtl): No endpoints currently support transferring dispatchers, so we
+ // can get away with this. What we really need to do is create equivalent
+ // dispatchers here (and close the original dispatchers).
+ DCHECK(!dispatchers);
+
+ endpoints_[port]->EnqueueMessage(message, NULL);
+ return MOJO_RESULT_OK;
}
void MessagePipe::Attach(unsigned port,
« no previous file with comments | « mojo/system/local_message_pipe_endpoint.cc ('k') | mojo/system/message_pipe_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698