| Index: shell/child_process_host.cc
|
| diff --git a/shell/child_process_host.cc b/shell/child_process_host.cc
|
| index 0a027ae146ae3fb59b7ea4f01477f76f5740fe0c..647f8fdb2376698e99db0a05a66076e5c53df22c 100644
|
| --- a/shell/child_process_host.cc
|
| +++ b/shell/child_process_host.cc
|
| @@ -35,9 +35,15 @@ ChildProcessHost::~ChildProcessHost() {
|
| void ChildProcessHost::Start() {
|
| DCHECK(!child_process_.IsValid());
|
|
|
| + // TODO(vtl): Add something for |slave_info|.
|
| + mojo::embedder::ScopedPlatformHandle platform_handle_for_channel;
|
| + std::string child_connection_id;
|
| + mojo::embedder::ConnectToSlave(
|
| + nullptr, platform_channel_pair_.PassServerHandle(),
|
| + &platform_handle_for_channel, &child_connection_id);
|
| +
|
| mojo::ScopedMessagePipeHandle handle(mojo::embedder::CreateChannel(
|
| - platform_channel_pair_.PassServerHandle(),
|
| - context_->task_runners()->io_runner(),
|
| + platform_handle_for_channel.Pass(), context_->task_runners()->io_runner(),
|
| base::Bind(&ChildProcessHost::DidCreateChannel, base::Unretained(this)),
|
| base::MessageLoop::current()->message_loop_proxy()));
|
|
|
| @@ -46,7 +52,8 @@ void ChildProcessHost::Start() {
|
|
|
| CHECK(base::PostTaskAndReplyWithResult(
|
| context_->task_runners()->blocking_pool(), FROM_HERE,
|
| - base::Bind(&ChildProcessHost::DoLaunch, base::Unretained(this)),
|
| + base::Bind(&ChildProcessHost::DoLaunch, base::Unretained(this),
|
| + child_connection_id),
|
| base::Bind(&ChildProcessHost::DidStart, base::Unretained(this))));
|
| }
|
|
|
| @@ -96,7 +103,7 @@ void ChildProcessHost::DidCreateChannel(
|
| channel_info_ = channel_info;
|
| }
|
|
|
| -bool ChildProcessHost::DoLaunch() {
|
| +bool ChildProcessHost::DoLaunch(const std::string& child_connection_id) {
|
| static const char* kForwardSwitches[] = {
|
| switches::kTraceToConsole, switches::kV, switches::kVModule,
|
| };
|
| @@ -105,7 +112,8 @@ bool ChildProcessHost::DoLaunch() {
|
| child_command_line.CopySwitchesFrom(*base::CommandLine::ForCurrentProcess(),
|
| kForwardSwitches,
|
| arraysize(kForwardSwitches));
|
| - child_command_line.AppendSwitch(switches::kChildProcess);
|
| + child_command_line.AppendSwitchASCII(switches::kChildConnectionId,
|
| + child_connection_id);
|
|
|
| mojo::embedder::HandlePassingInformation handle_passing_info;
|
| platform_channel_pair_.PrepareToPassClientHandleToChildProcess(
|
|
|