summaryrefslogtreecommitdiffstats
path: root/mojo/system/proxy_message_pipe_endpoint.cc
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-26 02:44:00 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-26 02:44:00 +0000
commitb88dfa09e7687fe4cde771e2993dc15d7ca65816 (patch)
tree78747917ff7743e04510b8287261ff001f34aa39 /mojo/system/proxy_message_pipe_endpoint.cc
parent73eb4fedbcf0826ade8b4ce7a1bb8a21eef6e625 (diff)
downloadchromium_src-b88dfa09e7687fe4cde771e2993dc15d7ca65816.zip
chromium_src-b88dfa09e7687fe4cde771e2993dc15d7ca65816.tar.gz
chromium_src-b88dfa09e7687fe4cde771e2993dc15d7ca65816.tar.bz2
Mojo: Attach dispatchers to message earlier.
In particular, ProxyMessagePipeEndpoint::EnqueueMessage() gets a message with dispatchers already attached. It will be up to the Channel to force them into a serialized state. Note that this is a bit less optimal (especially right now), since we means we have to create duplicate dispatchers even for things that will be serialized immediately. However, this structure makes things more flexible, since we can defer serialization if we want (e.g., we don't want Channel to send everything to RawChannel in a serialized state immediately). R=yzshen@chromium.org Review URL: https://codereview.chromium.org/177073015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253331 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/system/proxy_message_pipe_endpoint.cc')
-rw-r--r--mojo/system/proxy_message_pipe_endpoint.cc26
1 files changed, 7 insertions, 19 deletions
diff --git a/mojo/system/proxy_message_pipe_endpoint.cc b/mojo/system/proxy_message_pipe_endpoint.cc
index ddea878..61a2448 100644
--- a/mojo/system/proxy_message_pipe_endpoint.cc
+++ b/mojo/system/proxy_message_pipe_endpoint.cc
@@ -54,12 +54,13 @@ void ProxyMessagePipeEndpoint::OnPeerClose() {
}
void ProxyMessagePipeEndpoint::EnqueueMessage(
- scoped_ptr<MessageInTransit> message,
- std::vector<DispatcherTransport>* transports) {
- DCHECK(!transports || !transports->empty());
-
- if (transports)
- AttachAndCloseDispatchers(message.get(), transports);
+ scoped_ptr<MessageInTransit> message) {
+ if (message->dispatchers() && !message->dispatchers()->empty()) {
+ // Since the dispatchers are attached to the message, they'll be closed on
+ // message destruction.
+ LOG(ERROR) << "Sending handles over remote message pipes not yet supported "
+ "(sent handles will simply be closed)";
+ }
EnqueueMessageInternal(message.Pass());
}
@@ -96,19 +97,6 @@ void ProxyMessagePipeEndpoint::Run(MessageInTransit::EndpointId remote_id) {
paused_message_queue_.clear();
}
-void ProxyMessagePipeEndpoint::AttachAndCloseDispatchers(
- MessageInTransit* message,
- std::vector<DispatcherTransport>* transports) {
- DCHECK(transports);
- DCHECK(!transports->empty());
-
- // TODO(vtl)
- LOG(ERROR) << "Sending handles over remote message pipes not yet supported "
- "(closing sent handles)";
- for (size_t i = 0; i < transports->size(); i++)
- (*transports)[i].Close();
-}
-
// Note: We may have to enqueue messages even when our (local) peer isn't open
// -- it may have been written to and closed immediately, before we were ready.
// This case is handled in |Run()| (which will call us).