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

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

Issue 1685183004: Bootstrap Mojo IPC independent of Chrome IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/embedder/platform_channel_pair.h ('k') | 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 4c211acaf708b121f1da2d644fda90e99130beea..7f5d4c389930fcccfa0daa2cda6bd32afe7f32a7 100644
--- a/mojo/edk/system/node_controller.cc
+++ b/mojo/edk/system/node_controller.cc
@@ -180,6 +180,19 @@ void NodeController::ReservePort(const std::string& token,
void NodeController::MergePortIntoParent(const std::string& token,
const ports::PortRef& port) {
+ {
+ // This request may be coming from within the process that reserved the
+ // "parent" side (e.g. for Chrome single-process mode), so if this token is
+ // reserved locally, merge locally instead.
+ base::AutoLock lock(reserved_ports_lock_);
+ auto it = reserved_ports_.find(token);
+ if (it != reserved_ports_.end()) {
+ node_->MergePorts(port, name_, it->second.name());
+ reserved_ports_.erase(it);
+ return;
+ }
+ }
+
scoped_refptr<NodeChannel> parent = GetParentChannel();
if (parent) {
parent->RequestPortMerge(port.name(), token);
« no previous file with comments | « mojo/edk/embedder/platform_channel_pair.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698