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

Unified Diff: mojo/shell/runner/host/child_process_host.cc

Issue 1812523003: Add mach ports support to the Mojo shell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-mach-ports
Patch Set: Rebase Created 4 years, 9 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/shell/runner/host/child_process.cc ('k') | mojo/shell/runner/host/mach_broker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/runner/host/child_process_host.cc
diff --git a/mojo/shell/runner/host/child_process_host.cc b/mojo/shell/runner/host/child_process_host.cc
index f887dbd4adb9a321ab4ee724ed671b70bc92da68..19a5161dccb54a269ff6fae0d899957d57040ad2 100644
--- a/mojo/shell/runner/host/child_process_host.cc
+++ b/mojo/shell/runner/host/child_process_host.cc
@@ -16,6 +16,7 @@
#include "base/message_loop/message_loop.h"
#include "base/process/kill.h"
#include "base/process/launch.h"
+#include "base/synchronization/lock.h"
#include "base/task_runner.h"
#include "base/thread_task_runner_handle.h"
#include "mojo/edk/embedder/embedder.h"
@@ -33,6 +34,10 @@
#include "base/win/windows_version.h"
#endif
+#if defined(OS_MACOSX)
+#include "mojo/shell/runner/host/mach_broker.h"
+#endif
+
namespace mojo {
namespace shell {
@@ -179,7 +184,16 @@ void ChildProcessHost::DoLaunch(
}
} else
#endif
+ {
+#if defined(OS_MACOSX)
+ MachBroker* mach_broker = MachBroker::GetInstance();
+ base::AutoLock locker(mach_broker->GetLock());
+#endif
child_process_ = base::LaunchProcess(*child_command_line, options);
+#if defined(OS_MACOSX)
+ mach_broker->ExpectPid(child_process_.Handle());
+#endif
+ }
if (child_process_.IsValid()) {
if (mojo_ipc_channel_.get()) {
« no previous file with comments | « mojo/shell/runner/host/child_process.cc ('k') | mojo/shell/runner/host/mach_broker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698