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

Unified Diff: mojo/edk/system/node_controller.cc

Issue 2126033002: [mojo-edk] Pump incoming messages in some missing places (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: oops Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/node_controller.cc
diff --git a/mojo/edk/system/node_controller.cc b/mojo/edk/system/node_controller.cc
index 5fc55f557d7063cd50071b398a17f90bdc5d320d..4c5c9e876dbba5fe4a7c9bd7a3b2843b9b34917d 100644
--- a/mojo/edk/system/node_controller.cc
+++ b/mojo/edk/system/node_controller.cc
@@ -545,6 +545,8 @@ void NodeController::DropPeer(const ports::NodeName& name) {
node_->ClosePort(port);
node_->LostConnectionToNode(name);
+
+ AcceptIncomingMessages();
}
void NodeController::SendPeerMessage(const ports::NodeName& name,
@@ -740,14 +742,16 @@ void NodeController::OnAcceptChild(const ports::NodeName& from_node,
scoped_refptr<NodeChannel> parent;
{
base::AutoLock lock(parent_lock_);
- if (!bootstrap_parent_channel_ || parent_name_ != ports::kInvalidNodeName) {
- DLOG(ERROR) << "Unexpected AcceptChild message from " << from_node;
- DropPeer(from_node);
- return;
+ if (bootstrap_parent_channel_ && parent_name_ == ports::kInvalidNodeName) {
+ parent_name_ = parent_name;
+ parent = bootstrap_parent_channel_;
}
+ }
- parent_name_ = parent_name;
- parent = bootstrap_parent_channel_;
+ if (!parent) {
+ DLOG(ERROR) << "Unexpected AcceptChild message from " << from_node;
+ DropPeer(from_node);
+ return;
}
parent->SetRemoteNodeName(parent_name);
@@ -996,6 +1000,8 @@ void NodeController::OnRequestPortMerge(
int rv = node_->MergePorts(local_port, from_node, connector_port_name);
if (rv != ports::OK)
DLOG(ERROR) << "MergePorts failed: " << rv;
+
+ AcceptIncomingMessages();
}
void NodeController::OnRequestIntroduction(const ports::NodeName& from_node,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698