OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "shell/child_process_host.h" | 5 #include "shell/child_process_host.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 mojo::ScopedMessagePipeHandle handle(mojo::embedder::ConnectToSlave( | 71 mojo::ScopedMessagePipeHandle handle(mojo::embedder::ConnectToSlave( |
72 nullptr, launch_data->platform_pipe.handle0.Pass(), | 72 nullptr, launch_data->platform_pipe.handle0.Pass(), |
73 [this]() { DidConnectToSlave(); }, | 73 [this]() { DidConnectToSlave(); }, |
74 MakeRefCounted<base_edk::PlatformTaskRunnerImpl>( | 74 MakeRefCounted<base_edk::PlatformTaskRunnerImpl>( |
75 base::ThreadTaskRunnerHandle::Get()), | 75 base::ThreadTaskRunnerHandle::Get()), |
76 &launch_data->child_connection_id, &channel_info_)); | 76 &launch_data->child_connection_id, &channel_info_)); |
77 // TODO(vtl): We should destroy the channel on destruction (using | 77 // TODO(vtl): We should destroy the channel on destruction (using |
78 // |channel_info_|, but only after the callback has been called. | 78 // |channel_info_|, but only after the callback has been called. |
79 CHECK(channel_info_); | 79 CHECK(channel_info_); |
80 | 80 |
81 controller_.Bind(mojo::InterfacePtrInfo<ChildController>(handle.Pass(), 0u)); | 81 controller_.Bind(mojo::InterfaceHandle<ChildController>(handle.Pass(), 0u)); |
82 controller_.set_connection_error_handler([this]() { OnConnectionError(); }); | 82 controller_.set_connection_error_handler([this]() { OnConnectionError(); }); |
83 | 83 |
84 CHECK(base::PostTaskAndReplyWithResult( | 84 CHECK(base::PostTaskAndReplyWithResult( |
85 context_->task_runners()->blocking_pool(), FROM_HERE, | 85 context_->task_runners()->blocking_pool(), FROM_HERE, |
86 base::Bind(&ChildProcessHost::DoLaunch, base::Unretained(this), | 86 base::Bind(&ChildProcessHost::DoLaunch, base::Unretained(this), |
87 base::Passed(&launch_data)), | 87 base::Passed(&launch_data)), |
88 base::Bind(&ChildProcessHost::DidStart, base::Unretained(this)))); | 88 base::Bind(&ChildProcessHost::DidStart, base::Unretained(this)))); |
89 } | 89 } |
90 | 90 |
91 int ChildProcessHost::Join() { | 91 int ChildProcessHost::Join() { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 on_app_complete_.reset(); | 169 on_app_complete_.reset(); |
170 on_app_complete.Run(result); | 170 on_app_complete.Run(result); |
171 } | 171 } |
172 } | 172 } |
173 | 173 |
174 void ChildProcessHost::OnConnectionError() { | 174 void ChildProcessHost::OnConnectionError() { |
175 AppCompleted(MOJO_RESULT_UNKNOWN); | 175 AppCompleted(MOJO_RESULT_UNKNOWN); |
176 } | 176 } |
177 | 177 |
178 } // namespace shell | 178 } // namespace shell |
OLD | NEW |