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

Unified Diff: mojo/system/local_message_pipe_endpoint.cc

Issue 68993005: Mojo: More plumbing to support sending 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.h ('k') | mojo/system/message_pipe.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/local_message_pipe_endpoint.cc
diff --git a/mojo/system/local_message_pipe_endpoint.cc b/mojo/system/local_message_pipe_endpoint.cc
index 8f1cdf39123f3ab12ab1e3957f92fa560f85968b..2886a1d66537c6d189f6a54917e2ba346c6613bd 100644
--- a/mojo/system/local_message_pipe_endpoint.cc
+++ b/mojo/system/local_message_pipe_endpoint.cc
@@ -51,10 +51,18 @@ bool LocalMessagePipeEndpoint::OnPeerClose() {
return true;
}
-MojoResult LocalMessagePipeEndpoint::EnqueueMessage(MessageInTransit* message) {
+MojoResult LocalMessagePipeEndpoint::EnqueueMessage(
+ MessageInTransit* message,
+ const std::vector<Dispatcher*>* dispatchers) {
DCHECK(is_open_);
DCHECK(is_peer_open_);
+ // TODO(vtl)
+ if (dispatchers) {
+ message->Destroy();
+ return MOJO_RESULT_UNIMPLEMENTED;
+ }
+
bool was_empty = message_queue_.empty();
message_queue_.push_back(message);
if (was_empty) {
@@ -70,9 +78,11 @@ void LocalMessagePipeEndpoint::CancelAllWaiters() {
waiter_list_.CancelAllWaiters();
}
+// TODO(vtl): Support receiving handles.
MojoResult LocalMessagePipeEndpoint::ReadMessage(
void* bytes, uint32_t* num_bytes,
- MojoHandle* handles, uint32_t* num_handles,
+ uint32_t max_num_dispatchers,
+ std::vector<scoped_refptr<Dispatcher> >* dispatchers,
MojoReadMessageFlags flags) {
DCHECK(is_open_);
@@ -96,10 +106,6 @@ MojoResult LocalMessagePipeEndpoint::ReadMessage(
else
not_enough_space = true;
- // TODO(vtl): Support receiving handles.
- if (num_handles)
- *num_handles = 0;
-
if (!not_enough_space || (flags & MOJO_READ_MESSAGE_FLAG_MAY_DISCARD)) {
message_queue_.pop_front();
message->Destroy();
« no previous file with comments | « mojo/system/local_message_pipe_endpoint.h ('k') | mojo/system/message_pipe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698