diff options
author | rockot <rockot@chromium.org> | 2014-11-21 17:51:49 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-22 01:52:09 +0000 |
commit | 46da0c1f3810737c10c40c64a244991509a15c0e (patch) | |
tree | 0924244effcc1e79054e65d6550706116124d4c8 /mojo/edk/system/message_pipe.h | |
parent | fa8ed5bdb9f2f5f917a2e2d7adbf3ec9599f675e (diff) | |
download | chromium_src-46da0c1f3810737c10c40c64a244991509a15c0e.zip chromium_src-46da0c1f3810737c10c40c64a244991509a15c0e.tar.gz chromium_src-46da0c1f3810737c10c40c64a244991509a15c0e.tar.bz2 |
Update mojo sdk to rev 5aa6dbdccf1950daf0cd3014bf763f35899bccf9
BUG=433814
Review URL: https://codereview.chromium.org/748113004
Cr-Commit-Position: refs/heads/master@{#305339}
Diffstat (limited to 'mojo/edk/system/message_pipe.h')
-rw-r--r-- | mojo/edk/system/message_pipe.h | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/mojo/edk/system/message_pipe.h b/mojo/edk/system/message_pipe.h index b39e517..1c1af1e 100644 --- a/mojo/edk/system/message_pipe.h +++ b/mojo/edk/system/message_pipe.h @@ -15,6 +15,7 @@ #include "base/memory/scoped_ptr.h" #include "base/synchronization/lock.h" #include "mojo/edk/embedder/platform_handle_vector.h" +#include "mojo/edk/system/channel_endpoint_client.h" #include "mojo/edk/system/dispatcher.h" #include "mojo/edk/system/handle_signals_state.h" #include "mojo/edk/system/memory.h" @@ -34,8 +35,7 @@ class Waiter; // |MessagePipe| is the secondary object implementing a message pipe (see the // explanatory comment in core.cc). It is typically owned by the dispatcher(s) // corresponding to the local endpoints. This class is thread-safe. -class MOJO_SYSTEM_IMPL_EXPORT MessagePipe - : public base::RefCountedThreadSafe<MessagePipe> { +class MOJO_SYSTEM_IMPL_EXPORT MessagePipe : public ChannelEndpointClient { public: // Creates a |MessagePipe| with two new |LocalMessagePipeEndpoint|s. static MessagePipe* CreateLocalLocal(); @@ -106,38 +106,30 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipe size_t* actual_size, embedder::PlatformHandleVector* platform_handles); - // Used by |EndSerialize()|. TODO(vtl): Remove this (merge it into - // |EndSerialize()|). - scoped_refptr<ChannelEndpoint> ConvertLocalToProxy(unsigned port); - - // This is used by |Channel| to enqueue messages (typically to a - // |LocalMessagePipeEndpoint|). Unlike |WriteMessage()|, |port| is the - // *destination* port. - MojoResult EnqueueMessage(unsigned port, - scoped_ptr<MessageInTransit> message); + // |ChannelEndpointClient| methods: + bool OnReadMessage(unsigned port, + scoped_ptr<MessageInTransit> message) override; + void OnDetachFromChannel(unsigned port) override; private: MessagePipe(); + virtual ~MessagePipe(); - friend class base::RefCountedThreadSafe<MessagePipe>; - ~MessagePipe(); - - // This is used internally by |WriteMessage()| and by |EnqueueMessage()|. + // This is used internally by |WriteMessage()| and by |OnReadMessage()|. // |transports| may be non-null only if it's nonempty and |message| has no // dispatchers attached. - MojoResult EnqueueMessageInternal( - unsigned port, - scoped_ptr<MessageInTransit> message, - std::vector<DispatcherTransport>* transports); + MojoResult EnqueueMessage(unsigned port, + scoped_ptr<MessageInTransit> message, + std::vector<DispatcherTransport>* transports); - // Helper for |EnqueueMessageInternal()|. Must be called with |lock_| held. + // Helper for |EnqueueMessage()|. Must be called with |lock_| held. MojoResult AttachTransportsNoLock( unsigned port, MessageInTransit* message, std::vector<DispatcherTransport>* transports); - // Used by |EnqueueMessageInternal()| to handle control messages that are - // actually meant for us. + // Used by |EnqueueMessage()| to handle control messages that are actually + // meant for us. MojoResult HandleControlMessage(unsigned port, scoped_ptr<MessageInTransit> message); |