summaryrefslogtreecommitdiffstats
path: root/ipc/chromium/src
diff options
context:
space:
mode:
Diffstat (limited to 'ipc/chromium/src')
-rw-r--r--ipc/chromium/src/base/revocable_store.cc4
-rw-r--r--ipc/chromium/src/mojo/core/ports/node.cc9
-rw-r--r--ipc/chromium/src/mojo/core/ports/node_delegate.h6
3 files changed, 16 insertions, 3 deletions
diff --git a/ipc/chromium/src/base/revocable_store.cc b/ipc/chromium/src/base/revocable_store.cc
index b3d7414ee2..0b8a0655bd 100644
--- a/ipc/chromium/src/base/revocable_store.cc
+++ b/ipc/chromium/src/base/revocable_store.cc
@@ -25,9 +25,7 @@ RevocableStore::~RevocableStore() {
owning_reference_->set_store(NULL);
}
-void RevocableStore::Add(Revocable* item) {
- DCHECK(!item->revoked());
-}
+void RevocableStore::Add(Revocable* item) { DCHECK(!item->revoked()); }
void RevocableStore::RevokeAll() {
// We revoke all the existing items in the store and reset our count.
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