Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Unified Diff: mojo/system/channel.cc

Issue 577313002: Mojo: Give ChannelEndpoint the remote ID and ProxyMessagePipeEndpoint the ChannelEndpoint. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/system/channel_endpoint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/channel.cc
diff --git a/mojo/system/channel.cc b/mojo/system/channel.cc
index 66ca8b0edc677c396f213c9dc93c8fb2a6b25bc3..3a87b01401808981ea98ac9ad42974abbe112a06 100644
--- a/mojo/system/channel.cc
+++ b/mojo/system/channel.cc
@@ -113,12 +113,13 @@ MessageInTransit::EndpointId Channel::AttachMessagePipeEndpoint(
local_id = next_local_id_;
next_local_id_++;
- endpoint = new ChannelEndpoint(message_pipe.get(), port, this, local_id);
+ endpoint = new ChannelEndpoint(message_pipe.get(), port);
local_id_to_endpoint_map_[local_id] = endpoint;
}
+ endpoint->AttachToChannel(this, local_id);
// This might fail if that port got an |OnPeerClose()| before attaching.
- if (message_pipe->Attach(port, scoped_refptr<Channel>(this), local_id))
+ if (message_pipe->Attach(port, endpoint.get(), this, local_id))
return local_id;
// Note: If it failed, quite possibly the endpoint info was removed from that
@@ -147,6 +148,7 @@ MessageInTransit::EndpointId Channel::AttachMessagePipeEndpoint(
bool Channel::RunMessagePipeEndpoint(MessageInTransit::EndpointId local_id,
MessageInTransit::EndpointId remote_id) {
+ scoped_refptr<ChannelEndpoint> endpoint;
ChannelEndpoint::State state;
scoped_refptr<MessagePipe> message_pipe;
unsigned port;
@@ -160,6 +162,7 @@ bool Channel::RunMessagePipeEndpoint(MessageInTransit::EndpointId local_id,
local_id_to_endpoint_map_.find(local_id);
if (it == local_id_to_endpoint_map_.end())
return false;
+ endpoint = it->second;
state = it->second->state_;
message_pipe = it->second->message_pipe_;
port = it->second->port_;
@@ -175,6 +178,8 @@ bool Channel::RunMessagePipeEndpoint(MessageInTransit::EndpointId local_id,
// TODO(vtl): FIXME -- We need to handle the case that message pipe is already
// running when we're here due to |kSubtypeChannelRunMessagePipeEndpoint|).
+ endpoint->Run(remote_id);
+ // TODO(vtl): Get rid of this.
message_pipe->Run(port, remote_id);
return true;
}
« no previous file with comments | « no previous file | mojo/system/channel_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698