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

Unified Diff: chrome/browser/profiling_host/profiling_process_host.cc

Issue 2950153002: Improve process launch handle sharing API. (Closed)
Patch Set: Merge Created 3 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
Index: chrome/browser/profiling_host/profiling_process_host.cc
diff --git a/chrome/browser/profiling_host/profiling_process_host.cc b/chrome/browser/profiling_host/profiling_process_host.cc
index 86a583482c8751d1ab3b1c685ee4f76b126f7cd3..99c71b04a8f8304ab83ce7a0b5a1d2acfe03492d 100644
--- a/chrome/browser/profiling_host/profiling_process_host.cc
+++ b/chrome/browser/profiling_host/profiling_process_host.cc
@@ -144,12 +144,18 @@ void ProfilingProcessHost::RequestProcessDump(base::ProcessId pid) {
void ProfilingProcessHost::Launch() {
mojo::edk::PlatformChannelPair control_channel;
- mojo::edk::HandlePassingInformation handle_passing_info;
+ base::LaunchOptions options;
+ mojo::edk::HandlePassingInformation* handle_passing_info =
+#if defined(OS_WIN)
+ &options.handles_to_inherit;
+#else
+ &options.fds_to_remap;
+#endif
// Create the socketpair for the low level memlog pipe.
mojo::edk::PlatformChannelPair data_channel;
pipe_id_ = data_channel.PrepareToPassClientHandleToChildProcessAsString(
- &handle_passing_info);
+ handle_passing_info);
mojo::edk::ScopedPlatformHandle child_end = data_channel.PassClientHandle();
@@ -158,15 +164,12 @@ void ProfilingProcessHost::Launch() {
// Keep the server handle, pass the client handle to the child.
pending_control_connection_ = control_channel.PassServerHandle();
control_channel.PrepareToPassClientHandleToChildProcess(&profiling_cmd,
- &handle_passing_info);
+ handle_passing_info);
- base::LaunchOptions options;
#if defined(OS_WIN)
- options.handles_to_inherit = &handle_passing_info;
std::string local_pipe_string = base::IntToString(
reinterpret_cast<int>(data_channel.PassServerHandle().release().handle));
#elif defined(OS_POSIX)
- options.fds_to_remap = &handle_passing_info;
std::string local_pipe_string =
base::IntToString(data_channel.PassServerHandle().release().handle);
#if defined(OS_LINUX)
« no previous file with comments | « chrome/browser/mac/relauncher.mm ('k') | chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698