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

Unified Diff: mojo/edk/system/ports/node.cc

Issue 2236473003: [mojo-edk] Revert ObserveProxy retransmission behavior (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 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 | « mojo/edk/system/ports/node.h ('k') | mojo/edk/system/ports/ports_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/ports/node.cc
diff --git a/mojo/edk/system/ports/node.cc b/mojo/edk/system/ports/node.cc
index 128ecdf4ca7189821d45213b642264ee1b090567..c7f42f6f8b319e8f685ffcc8dc49984e338ea8e0 100644
--- a/mojo/edk/system/ports/node.cc
+++ b/mojo/edk/system/ports/node.cc
@@ -64,10 +64,10 @@ Node::~Node() {
DLOG(WARNING) << "Unclean shutdown for node " << name_;
}
-bool Node::CanShutdownCleanly(bool allow_local_ports) {
+bool Node::CanShutdownCleanly(ShutdownPolicy policy) {
base::AutoLock ports_lock(ports_lock_);
- if (!allow_local_ports) {
+ if (policy == ShutdownPolicy::DONT_ALLOW_LOCAL_PORTS) {
#if DCHECK_IS_ON()
for (auto entry : ports_) {
DVLOG(2) << "Port " << entry.first << " referencing node "
@@ -78,6 +78,8 @@ bool Node::CanShutdownCleanly(bool allow_local_ports) {
return ports_.empty();
}
+ DCHECK_EQ(policy, ShutdownPolicy::ALLOW_LOCAL_PORTS);
+
// NOTE: This is not efficient, though it probably doesn't need to be since
// relatively few ports should be open during shutdown and shutdown doesn't
// need to be blazingly fast.
@@ -531,17 +533,6 @@ int Node::OnObserveProxy(const PortName& port_name,
scoped_refptr<Port> port = GetPort(port_name);
if (!port) {
DVLOG(1) << "ObserveProxy: " << port_name << "@" << name_ << " not found";
-
- if (port_name != event.proxy_port_name &&
- port_name != event.proxy_to_port_name) {
- // The receiving port may have been removed while this message was in
- // transit. In this case, we restart the ObserveProxy circulation from
- // the referenced proxy port to avoid leaking the proxy.
- delegate_->ForwardMessage(
- event.proxy_node_name,
- NewInternalMessage(
- event.proxy_port_name, EventType::kObserveProxy, event));
- }
return OK;
}
« no previous file with comments | « mojo/edk/system/ports/node.h ('k') | mojo/edk/system/ports/ports_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698