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

Unified Diff: chrome/test/base/mojo_test_connector.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
« no previous file with comments | « chrome/installer/util/user_experiment.cc ('k') | chrome/test/chromedriver/chrome_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/mojo_test_connector.cc
diff --git a/chrome/test/base/mojo_test_connector.cc b/chrome/test/base/mojo_test_connector.cc
index d071475430405aeb36f5882a1124053cc6614668..8cd656b51d0985b4edae057c7f74b69f90cb5ed3 100644
--- a/chrome/test/base/mojo_test_connector.cc
+++ b/chrome/test/base/mojo_test_connector.cc
@@ -60,16 +60,12 @@ class MojoTestState : public content::TestState {
? switches::kMash
: switches::kMus);
- platform_channel_->PrepareToPassClientHandleToChildProcess(
- command_line, &handle_passing_info_);
#if defined(OS_WIN)
- test_launch_options->inherit_handles = true;
- test_launch_options->handles_to_inherit = &handle_passing_info_;
-#if defined(OFFICIAL_BUILD)
- CHECK(false) << "Launching mojo process with inherit_handles is insecure!";
-#endif
+ platform_channel_->PrepareToPassClientHandleToChildProcess(
+ command_line, &test_launch_options->handles_to_inherit);
#elif defined(OS_POSIX)
- test_launch_options->fds_to_remap = &handle_passing_info_;
+ platform_channel_->PrepareToPassClientHandleToChildProcess(
+ command_line, &test_launch_options->fds_to_remap);
#else
#error "Unsupported"
#endif
@@ -136,10 +132,6 @@ class MojoTestState : public content::TestState {
// which point |background_service_manager_| takes over ownership.
service_manager::mojom::ServicePtr service_;
- // NOTE: HandlePassingInformation must remain valid through process launch,
- // hence it lives here instead of within Init()'s stack.
- mojo::edk::HandlePassingInformation handle_passing_info_;
-
std::unique_ptr<mojo::edk::PlatformChannelPair> platform_channel_;
service_manager::mojom::PIDReceiverPtr pid_receiver_;
const scoped_refptr<base::TaskRunner> main_task_runner_;
« no previous file with comments | « chrome/installer/util/user_experiment.cc ('k') | chrome/test/chromedriver/chrome_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698