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

Unified Diff: chrome/test/base/mojo_test_connector.cc

Issue 2950153002: Improve process launch handle sharing API. (Closed)
Patch Set: Fix Created 3 years, 6 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/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 e76c27071fb0a8e81d1b1509e9f7a53c51934348..32d145910113e829f81f4719d8cf486cea3d9693 100644
--- a/chrome/test/base/mojo_test_connector.cc
+++ b/chrome/test/base/mojo_test_connector.cc
@@ -56,16 +56,12 @@ class MojoTestState : public content::TestState {
command_line->AppendSwitch(MojoTestConnector::kTestSwitch);
command_line->AppendSwitchASCII(switches::kMusConfig, mus_config_switch);
- 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
@@ -130,10 +126,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_;

Powered by Google App Engine
This is Rietveld 408576698