diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-25 21:22:25 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-25 21:22:25 +0000 |
commit | 37f3a08e3bf57db1fcaf8bf1cd91875c4614b350 (patch) | |
tree | 00ac9e78ebf25116824b6f48125b2718433fde4c | |
parent | ce05fd0d65d7308400f2eec1fb3e4966cef51c3f (diff) | |
download | chromium_src-37f3a08e3bf57db1fcaf8bf1cd91875c4614b350.zip chromium_src-37f3a08e3bf57db1fcaf8bf1cd91875c4614b350.tar.gz chromium_src-37f3a08e3bf57db1fcaf8bf1cd91875c4614b350.tar.bz2 |
Mojo: Remove MessagePipeEndpoint::EnqueueMessage()'s return value.
The new semantics are that it must succeed. (Next, pending another CL that moves
the Dispatchers into the MessageInTransit itself: move the attaching of
dispatchers "up" the stack into message_pipe.cc.)
R=davemoore@chromium.org
Review URL: https://codereview.chromium.org/180133004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253252 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | mojo/system/local_message_pipe_endpoint.cc | 4 | ||||
-rw-r--r-- | mojo/system/local_message_pipe_endpoint.h | 2 | ||||
-rw-r--r-- | mojo/system/message_pipe.cc | 4 | ||||
-rw-r--r-- | mojo/system/message_pipe_endpoint.h | 9 | ||||
-rw-r--r-- | mojo/system/proxy_message_pipe_endpoint.cc | 3 | ||||
-rw-r--r-- | mojo/system/proxy_message_pipe_endpoint.h | 2 |
6 files changed, 12 insertions, 12 deletions
diff --git a/mojo/system/local_message_pipe_endpoint.cc b/mojo/system/local_message_pipe_endpoint.cc index 723f05b..3ed73d7 100644 --- a/mojo/system/local_message_pipe_endpoint.cc +++ b/mojo/system/local_message_pipe_endpoint.cc @@ -48,7 +48,7 @@ void LocalMessagePipeEndpoint::OnPeerClose() { } } -MojoResult LocalMessagePipeEndpoint::EnqueueMessage( +void LocalMessagePipeEndpoint::EnqueueMessage( scoped_ptr<MessageInTransit> message, std::vector<DispatcherTransport>* transports) { DCHECK(is_open_); @@ -78,8 +78,6 @@ MojoResult LocalMessagePipeEndpoint::EnqueueMessage( waiter_list_.AwakeWaitersForStateChange(SatisfiedFlags(), SatisfiableFlags()); } - - return MOJO_RESULT_OK; } void LocalMessagePipeEndpoint::CancelAllWaiters() { diff --git a/mojo/system/local_message_pipe_endpoint.h b/mojo/system/local_message_pipe_endpoint.h index 45dbe2a..d5c7203 100644 --- a/mojo/system/local_message_pipe_endpoint.h +++ b/mojo/system/local_message_pipe_endpoint.h @@ -27,7 +27,7 @@ class MOJO_SYSTEM_IMPL_EXPORT LocalMessagePipeEndpoint // |MessagePipeEndpoint| implementation: virtual void Close() OVERRIDE; virtual void OnPeerClose() OVERRIDE; - virtual MojoResult EnqueueMessage( + virtual void EnqueueMessage( scoped_ptr<MessageInTransit> message, std::vector<DispatcherTransport>* transports) OVERRIDE; diff --git a/mojo/system/message_pipe.cc b/mojo/system/message_pipe.cc index ed5b4ca..76c0fae 100644 --- a/mojo/system/message_pipe.cc +++ b/mojo/system/message_pipe.cc @@ -159,7 +159,9 @@ MojoResult MessagePipe::EnqueueMessage( } } - return endpoints_[port]->EnqueueMessage(message.Pass(), transports); + // The endpoint's |EnqueueMessage()| may not report failure. + endpoints_[port]->EnqueueMessage(message.Pass(), transports); + return MOJO_RESULT_OK; } void MessagePipe::Attach(unsigned port, diff --git a/mojo/system/message_pipe_endpoint.h b/mojo/system/message_pipe_endpoint.h index 5cad2e6..d4a002d 100644 --- a/mojo/system/message_pipe_endpoint.h +++ b/mojo/system/message_pipe_endpoint.h @@ -39,10 +39,11 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipeEndpoint { virtual void Close() = 0; virtual void OnPeerClose() = 0; // Implements |MessagePipe::EnqueueMessage()| (see its description for - // details). - virtual MojoResult EnqueueMessage( - scoped_ptr<MessageInTransit> message, - std::vector<DispatcherTransport>* transports) = 0; + // details). A major difference is that this |EnqueueMessage()| cannot report + // failure (if, e.g., a channel is torn down at this point, it should silently + // swallow the message). + virtual void EnqueueMessage(scoped_ptr<MessageInTransit> message, + 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). diff --git a/mojo/system/proxy_message_pipe_endpoint.cc b/mojo/system/proxy_message_pipe_endpoint.cc index 28abe9e..ddea878 100644 --- a/mojo/system/proxy_message_pipe_endpoint.cc +++ b/mojo/system/proxy_message_pipe_endpoint.cc @@ -53,7 +53,7 @@ void ProxyMessagePipeEndpoint::OnPeerClose() { 0, 0, NULL))); } -MojoResult ProxyMessagePipeEndpoint::EnqueueMessage( +void ProxyMessagePipeEndpoint::EnqueueMessage( scoped_ptr<MessageInTransit> message, std::vector<DispatcherTransport>* transports) { DCHECK(!transports || !transports->empty()); @@ -62,7 +62,6 @@ MojoResult ProxyMessagePipeEndpoint::EnqueueMessage( AttachAndCloseDispatchers(message.get(), transports); EnqueueMessageInternal(message.Pass()); - return MOJO_RESULT_OK; } void ProxyMessagePipeEndpoint::Attach(scoped_refptr<Channel> channel, diff --git a/mojo/system/proxy_message_pipe_endpoint.h b/mojo/system/proxy_message_pipe_endpoint.h index c99a60a..f395f03 100644 --- a/mojo/system/proxy_message_pipe_endpoint.h +++ b/mojo/system/proxy_message_pipe_endpoint.h @@ -47,7 +47,7 @@ class MOJO_SYSTEM_IMPL_EXPORT ProxyMessagePipeEndpoint // |MessagePipeEndpoint| implementation: virtual void Close() OVERRIDE; virtual void OnPeerClose() OVERRIDE; - virtual MojoResult EnqueueMessage( + virtual void EnqueueMessage( scoped_ptr<MessageInTransit> message, std::vector<DispatcherTransport>* transports) OVERRIDE; virtual void Attach(scoped_refptr<Channel> channel, |