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

Unified Diff: mojo/edk/test/multiprocess_test_helper.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: mojo/edk/test/multiprocess_test_helper.cc
diff --git a/mojo/edk/test/multiprocess_test_helper.cc b/mojo/edk/test/multiprocess_test_helper.cc
index ed96e1d0e98d1befca0a13f9f9bae9a1fed98ecb..5f020c2a796fe62a8c92151cafb05a73d5da36c1 100644
--- a/mojo/edk/test/multiprocess_test_helper.cc
+++ b/mojo/edk/test/multiprocess_test_helper.cc
@@ -108,10 +108,15 @@ ScopedMessagePipeHandle MultiprocessTestHelper::StartChildWithExtraSwitch(
PlatformChannelPair channel;
NamedPlatformHandle named_pipe;
- HandlePassingInformation handle_passing_info;
+ base::LaunchOptions options;
if (launch_type == LaunchType::CHILD || launch_type == LaunchType::PEER) {
+#if defined(OS_POSIX)
channel.PrepareToPassClientHandleToChildProcess(&command_line,
- &handle_passing_info);
+ &options.fds_to_remap);
+#else // Windows
+ channel.PrepareToPassClientHandleToChildProcess(
+ &command_line, &options.handles_to_inherit);
+#endif
} else if (launch_type == LaunchType::NAMED_CHILD ||
launch_type == LaunchType::NAMED_PEER) {
#if defined(OS_POSIX)
@@ -133,17 +138,8 @@ ScopedMessagePipeHandle MultiprocessTestHelper::StartChildWithExtraSwitch(
command_line.AppendSwitch(switch_string);
}
- base::LaunchOptions options;
-#if defined(OS_POSIX)
- options.fds_to_remap = &handle_passing_info;
-#elif defined(OS_WIN)
+#if defined(OS_WIN)
options.start_hidden = true;
- if (base::win::GetVersion() >= base::win::VERSION_VISTA)
- options.handles_to_inherit = &handle_passing_info;
- else
- options.inherit_handles = true;
-#else
-#error "Not supported yet."
#endif
// NOTE: In the case of named pipes, it's important that the server handle be
« no previous file with comments | « headless/lib/browser/headless_content_browser_client.cc ('k') | net/test/spawned_test_server/local_test_server_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698