Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / mojo / system / proxy_message_pipe_endpoint.h
index 6f9068e..137f192 100644 (file)
@@ -21,6 +21,7 @@ namespace mojo {
 namespace system {
 
 class Channel;
+class MessagePipe;
 
 // A |ProxyMessagePipeEndpoint| connects an end of a |MessagePipe| to a
 // |Channel|, over which it transmits and receives data (to/from another
@@ -46,12 +47,9 @@ class MOJO_SYSTEM_IMPL_EXPORT ProxyMessagePipeEndpoint
   // |MessagePipeEndpoint| implementation:
   virtual void Close() OVERRIDE;
   virtual void OnPeerClose() OVERRIDE;
-  virtual MojoResult CanEnqueueMessage(
-      const MessageInTransit* message,
-      const std::vector<Dispatcher*>* dispatchers) OVERRIDE;
-  virtual void EnqueueMessage(
+  virtual MojoResult EnqueueMessage(
       MessageInTransit* message,
-      std::vector<scoped_refptr<Dispatcher> >* dispatchers) OVERRIDE;
+      std::vector<DispatcherTransport>* transports) OVERRIDE;
   virtual void Attach(scoped_refptr<Channel> channel,
                       MessageInTransit::EndpointId local_id) OVERRIDE;
   virtual void Run(MessageInTransit::EndpointId remote_id) OVERRIDE;
@@ -65,6 +63,12 @@ class MOJO_SYSTEM_IMPL_EXPORT ProxyMessagePipeEndpoint
     return remote_id_ != MessageInTransit::kInvalidEndpointId;
   }
 
+  // "Attaches" |transports| (which must be non-null and nonempty) to |message|
+  // by "serializing" them in an appropriate way, and closes each dispatcher.
+  void AttachAndCloseDispatchers(MessageInTransit* message,
+                                 std::vector<DispatcherTransport>* transports);
+  void EnqueueMessageInternal(MessageInTransit* message);
+
 #ifdef NDEBUG
   void AssertConsistentState() const {}
 #else