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

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

Issue 2264543003: Adds sync brokering to Windows EDK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 3 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/node_controller.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 072d92b10391fd0abb112e38e8121577ee3031ca..a3cf0fa26bd20d9eed867713dc8167a782fc07bc 100644
--- a/mojo/edk/system/node_controller.cc
+++ b/mojo/edk/system/node_controller.cc
@@ -228,10 +228,9 @@ void NodeController::CloseChildPorts(const std::string& child_token) {
}
void NodeController::ConnectToParent(ScopedPlatformHandle platform_handle) {
-// TODO(amistry): Consider the need for a broker on Windows.
-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_NACL_SFI)
- // On posix, use the bootstrap channel for the broker and receive the node's
- // channel synchronously as the first message from the broker.
+#if !defined(OS_MACOSX) && !defined(OS_NACL_SFI)
+ // Use the bootstrap channel for the broker and receive the node's channel
+ // synchronously as the first message from the broker.
base::ElapsedTimer timer;
broker_.reset(new Broker(std::move(platform_handle)));
platform_handle = broker_->GetParentPlatformHandle();
@@ -356,7 +355,7 @@ int NodeController::MergeLocalPorts(const ports::PortRef& port0,
scoped_refptr<PlatformSharedBuffer> NodeController::CreateSharedBuffer(
size_t num_bytes) {
-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_NACL_SFI)
+#if !defined(OS_MACOSX) && !defined(OS_NACL_SFI)
// Shared buffer creation failure is fatal, so always use the broker when we
// have one. This does mean that a non-root process that has children will use
// the broker for shared buffer creation even though that process is
@@ -392,10 +391,11 @@ void NodeController::ConnectToChildOnIOThread(
const ProcessErrorCallback& process_error_callback) {
DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_NACL)
+#if !defined(OS_MACOSX) && !defined(OS_NACL)
PlatformChannelPair node_channel;
// BrokerHost owns itself.
- BrokerHost* broker_host = new BrokerHost(std::move(platform_handle));
+ BrokerHost* broker_host =
+ new BrokerHost(process_handle, std::move(platform_handle));
broker_host->SendChannel(node_channel.PassClientHandle());
scoped_refptr<NodeChannel> channel = NodeChannel::Create(
this, node_channel.PassServerHandle(), io_task_runner_,
« no previous file with comments | « mojo/edk/system/node_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698