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

Unified Diff: chrome/browser/child_process_launcher.cc

Issue 549002: Mac: Other approach for IPCing child task_ts. (Closed)
Patch Set: '' Created 10 years, 11 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 | « base/process_util_posix.cc ('k') | chrome/browser/mach_broker_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/child_process_launcher.cc
diff --git a/chrome/browser/child_process_launcher.cc b/chrome/browser/child_process_launcher.cc
index 1ab66c63dec021b27bfd78b589bf2de0866caf37..91bc2e6228651d9289ec8edb07a3da4b38b93943 100644
--- a/chrome/browser/child_process_launcher.cc
+++ b/chrome/browser/child_process_launcher.cc
@@ -23,6 +23,10 @@
#include "chrome/browser/renderer_host/render_sandbox_host_linux.h"
#endif
+#if defined(OS_MACOSX)
+#include "chrome/browser/mach_broker_mac.h"
+#endif
+
#if defined(OS_POSIX)
#include "base/global_descriptors_posix.h"
#endif
@@ -161,10 +165,24 @@ class ChildProcessLauncher::Context
#endif // defined(OS_LINUX)
// Actually launch the app.
- if (!base::LaunchApp(cmd_line->argv(), env, fds_to_map, false, &handle))
+ bool launched;
+#if defined(OS_MACOSX)
+ task_t child_task;
+ launched = base::LaunchAppAndGetTask(
+ cmd_line->argv(), env, fds_to_map, false, &child_task, &handle);
+ if (launched && child_task != MACH_PORT_NULL) {
+ MachBroker::instance()->RegisterPid(
+ handle,
+ MachBroker::MachInfo().SetTask(child_task));
+ }
+#else
+ launched = base::LaunchApp(cmd_line->argv(), env, fds_to_map,
+ /* wait= */false, &handle);
+#endif
+ if (!launched)
handle = base::kNullProcessHandle;
}
-#endif
+#endif // else defined(OS_POSIX)
ChromeThread::PostTask(
client_thread_id_, FROM_HERE,
« no previous file with comments | « base/process_util_posix.cc ('k') | chrome/browser/mach_broker_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698