diff options
Diffstat (limited to 'ipc/chromium/src/mojo')
-rw-r--r-- | ipc/chromium/src/mojo/core/ports/node.cc | 9 | ||||
-rw-r--r-- | ipc/chromium/src/mojo/core/ports/node_delegate.h | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/ipc/chromium/src/mojo/core/ports/node.cc b/ipc/chromium/src/mojo/core/ports/node.cc index 935771eeb7..036c981cbb 100644 --- a/ipc/chromium/src/mojo/core/ports/node.cc +++ b/ipc/chromium/src/mojo/core/ports/node.cc @@ -837,6 +837,10 @@ int Node::OnObserveProxy(const PortRef& port_ref, MaybeResendAckRequest(port_ref); delegate_->PortStatusChanged(port_ref); + + if (event->proxy_target_node_name() != name_) { + delegate_->ObserveRemoteNode(event->proxy_target_node_name()); + } } return OK; @@ -1513,6 +1517,11 @@ int Node::AcceptPort(const PortName& port_name, mozilla::MakeUnique<PortAcceptedEvent>( port_descriptor.referring_port_name, kInvalidPortName, kInvalidSequenceNum)); + + if (port_descriptor.peer_node_name != name_) { + delegate_->ObserveRemoteNode(port_descriptor.peer_node_name); + } + return OK; } diff --git a/ipc/chromium/src/mojo/core/ports/node_delegate.h b/ipc/chromium/src/mojo/core/ports/node_delegate.h index 3172779c06..37fb67613a 100644 --- a/ipc/chromium/src/mojo/core/ports/node_delegate.h +++ b/ipc/chromium/src/mojo/core/ports/node_delegate.h @@ -29,6 +29,12 @@ class NodeDelegate { // to query the latest status of the port. Note, this event could be spurious // if another thread is simultaneously modifying the status of the port. virtual void PortStatusChanged(const PortRef& port_ref) = 0; + + // Called after receiving a port with a remote peer, or bypassing a proxy to a + // remote peer. Embedders can use this to ensure a connection to the remote + // peer, reducing message queueing and ensuring prompt notification of peer + // node death. + virtual void ObserveRemoteNode(const NodeName& node) = 0; }; } // namespace ports |