Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / mojo / system / message_pipe_endpoint.h
index 835b966..a07cc0b 100644 (file)
@@ -12,6 +12,7 @@
 #include "base/basictypes.h"
 #include "base/memory/ref_counted.h"
 #include "mojo/public/system/core.h"
+#include "mojo/system/dispatcher.h"
 #include "mojo/system/message_in_transit.h"
 #include "mojo/system/system_impl_export.h"
 
@@ -19,7 +20,6 @@ namespace mojo {
 namespace system {
 
 class Channel;
-class Dispatcher;
 class Waiter;
 
 // This is an interface to one of the ends of a message pipe, and is used by
@@ -37,20 +37,11 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipeEndpoint {
   // All implementations must implement these.
   virtual void Close() = 0;
   virtual void OnPeerClose() = 0;
-  // 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(
+  // Implements |MessagePipe::EnqueueMessage()| (see its description for
+  // details).
+  virtual MojoResult EnqueueMessage(
       MessageInTransit* message,
-      std::vector<scoped_refptr<Dispatcher> >* dispatchers) = 0;
+      std::vector<DispatcherTransport>* transports) = 0;
 
   // Implementations must override these if they represent a local endpoint,
   // i.e., one for which there's a |MessagePipeDispatcher| (and thus a handle).