Index: mojo/edk/system/node_controller.cc |
diff --git a/mojo/edk/system/node_controller.cc b/mojo/edk/system/node_controller.cc |
index 11c3a3764366b78699ae50a0f7ba8a46bd7c9f79..25e2e580eda733cd57c50e8b7ec006c21f63626d 100644 |
--- a/mojo/edk/system/node_controller.cc |
+++ b/mojo/edk/system/node_controller.cc |
@@ -104,10 +104,6 @@ NodeController::ReservedPort::ReservedPort() {} |
NodeController::ReservedPort::~ReservedPort() {} |
-NodeController::PendingRemotePortConnection::PendingRemotePortConnection() {} |
- |
-NodeController::PendingRemotePortConnection::~PendingRemotePortConnection() {} |
- |
NodeController::~NodeController() {} |
NodeController::NodeController(Core* core) |
@@ -200,33 +196,6 @@ void NodeController::ConnectToParentPort(const ports::PortRef& local_port, |
base::Unretained(this), local_port, token, callback)); |
} |
-void NodeController::ConnectToRemotePort( |
- const ports::PortRef& local_port, |
- const ports::NodeName& remote_node_name, |
- const ports::PortName& remote_port_name, |
- const base::Closure& callback) { |
- if (remote_node_name == name_) { |
- // It's possible that two different code paths on the node are trying to |
- // bootstrap ports to each other (e.g. in Chrome single-process mode) |
- // without being aware of the fact. In this case we can initialize the port |
- // immediately (which can fail silently if it's already been initialized by |
- // the request on the other side), and invoke |callback|. |
- node_->InitializePort(local_port, name_, remote_port_name); |
- callback.Run(); |
- return; |
- } |
- |
- PendingRemotePortConnection connection; |
- connection.local_port = local_port; |
- connection.remote_node_name = remote_node_name; |
- connection.remote_port_name = remote_port_name; |
- connection.callback = callback; |
- io_task_runner_->PostTask( |
- FROM_HERE, |
- base::Bind(&NodeController::ConnectToRemotePortOnIOThread, |
- base::Unretained(this), connection)); |
-} |
- |
void NodeController::RequestShutdown(const base::Closure& callback) { |
{ |
base::AutoLock lock(shutdown_lock_); |
@@ -293,25 +262,6 @@ void NodeController::RequestParentPortConnectionOnIOThread( |
parent->RequestPortConnection(local_port.name(), token); |
} |
-void NodeController::ConnectToRemotePortOnIOThread( |
- const PendingRemotePortConnection& connection) { |
- scoped_refptr<NodeChannel> peer = GetPeerChannel(connection.remote_node_name); |
- if (peer) { |
- // It's safe to initialize the port since we already have a channel to its |
- // peer. No need to actually send them a message. |
- int rv = node_->InitializePort(connection.local_port, |
- connection.remote_node_name, |
- connection.remote_port_name); |
- DCHECK_EQ(rv, ports::OK); |
- connection.callback.Run(); |
- return; |
- } |
- |
- // Save this for later. We'll initialize the port once this:: peer is added. |
- pending_remote_port_connections_[connection.remote_node_name].push_back( |
- connection); |
-} |
- |
scoped_refptr<NodeChannel> NodeController::GetPeerChannel( |
const ports::NodeName& name) { |
base::AutoLock lock(peers_lock_); |
@@ -375,19 +325,6 @@ void NodeController::AddPeer(const ports::NodeName& name, |
static_cast<PortsMessage*>(message.get())->TakeChannelMessage()); |
pending_messages.pop(); |
} |
- |
- // Complete any pending port connections to this peer. |
- auto connections_it = pending_remote_port_connections_.find(name); |
- if (connections_it != pending_remote_port_connections_.end()) { |
- for (const auto& connection : connections_it->second) { |
- int rv = node_->InitializePort(connection.local_port, |
- connection.remote_node_name, |
- connection.remote_port_name); |
- DCHECK_EQ(rv, ports::OK); |
- connection.callback.Run(); |
- } |
- pending_remote_port_connections_.erase(connections_it); |
- } |
} |
void NodeController::DropPeer(const ports::NodeName& name) { |