| Index: mojo/edk/system/node_controller.h
|
| diff --git a/mojo/edk/system/node_controller.h b/mojo/edk/system/node_controller.h
|
| index 11d5f196c335106d9cdef3e7a376d748134a2f14..648445a584f07bcec36a9da89c84b2b0c484ee6e 100644
|
| --- a/mojo/edk/system/node_controller.h
|
| +++ b/mojo/edk/system/node_controller.h
|
| @@ -85,6 +85,10 @@ class NodeController : public ports::NodeDelegate,
|
| // handshake.
|
| void ConnectToParent(ScopedPlatformHandle platform_handle);
|
|
|
| + // Connects this node to a peer node. On success, |port| will be merged with
|
| + // the corresponding port in the peer node.
|
| + void ConnectToPeer(ScopedPlatformHandle handle, const ports::PortRef& port);
|
| +
|
| // Sets a port's observer. If |observer| is null the port's current observer
|
| // is removed.
|
| void SetPortObserver(const ports::PortRef& port,
|
| @@ -146,6 +150,10 @@ class NodeController : public ports::NodeDelegate,
|
| const ProcessErrorCallback& process_error_callback);
|
| void ConnectToParentOnIOThread(ScopedPlatformHandle platform_handle);
|
|
|
| + void ConnectToPeerOnIOThread(ScopedPlatformHandle handle,
|
| + ports::NodeName token,
|
| + ports::PortRef port);
|
| +
|
| scoped_refptr<NodeChannel> GetPeerChannel(const ports::NodeName& name);
|
| scoped_refptr<NodeChannel> GetParentChannel();
|
| scoped_refptr<NodeChannel> GetBrokerChannel();
|
| @@ -206,6 +214,10 @@ class NodeController : public ports::NodeDelegate,
|
| const ports::NodeName& source_node,
|
| Channel::MessagePtr message) override;
|
| #endif
|
| + void OnAcceptPeer(const ports::NodeName& from_node,
|
| + const ports::NodeName& token,
|
| + const ports::NodeName& peer_name,
|
| + const ports::PortName& port_name) override;
|
| void OnChannelError(const ports::NodeName& from_node,
|
| NodeChannel* channel) override;
|
| #if defined(OS_MACOSX) && !defined(OS_IOS)
|
| @@ -303,6 +315,11 @@ class NodeController : public ports::NodeDelegate,
|
| // Channels to children during handshake.
|
| NodeMap pending_children_;
|
|
|
| + using PeerNodeMap =
|
| + std::unordered_map<ports::NodeName,
|
| + std::pair<scoped_refptr<NodeChannel>, ports::PortRef>>;
|
| + PeerNodeMap pending_peers_;
|
| +
|
| // Indicates whether this object should delete itself on IO thread shutdown.
|
| // Must only be accessed from the IO thread.
|
| bool destroy_on_io_thread_shutdown_ = false;
|
|
|