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

Unified Diff: mojo/system/message_pipe_endpoint.h

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/message_pipe.cc ('k') | mojo/system/proxy_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_endpoint.h
diff --git a/mojo/system/message_pipe_endpoint.h b/mojo/system/message_pipe_endpoint.h
index 00c67e3c039fb37c4f15aaa02efc410652cc893c..878467ed402422ed5e062d2ce99e50feae2b5963 100644
--- a/mojo/system/message_pipe_endpoint.h
+++ b/mojo/system/message_pipe_endpoint.h
@@ -38,10 +38,20 @@ class MOJO_SYSTEM_EXPORT MessagePipeEndpoint {
virtual void Close() = 0;
// Returns false if the endpoint should be closed and destroyed, else true.
virtual bool OnPeerClose() = 0;
- // Takes ownership of |message|.
- virtual MojoResult EnqueueMessage(
- MessageInTransit* message,
+ // Checks if |EnqueueMessage()| will be able to enqueue the given message
+ // (with the given set of dispatchers). |dispatchers| should be non-null only
+ // if it's nonempty. Returns |MOJO_RESULT_OK| if it will and an appropriate
+ // error code if it won't.
+ virtual MojoResult CanEnqueueMessage(
+ const MessageInTransit* message,
const std::vector<Dispatcher*>* dispatchers) = 0;
+ // Takes ownership of |message| and the contents of |dispatchers| (leaving
+ // it empty). This should only be called after |CanEnqueueMessage()| has
+ // indicated success. (Unlike |CanEnqueueMessage()|, |dispatchers| may be
+ // non-null but empty.)
+ virtual void EnqueueMessage(
+ MessageInTransit* message,
+ std::vector<scoped_refptr<Dispatcher> >* dispatchers) = 0;
// Implementations must override these if they represent a local endpoint,
// i.e., one for which there's a |MessagePipeDispatcher| (and thus a handle).
« no previous file with comments | « mojo/system/message_pipe.cc ('k') | mojo/system/proxy_message_pipe_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698