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" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/posix/global_descriptors.h" | 14 #include "base/posix/global_descriptors.h" |
15 #include "base/process/kill.h" | 15 #include "base/process/kill.h" |
16 #include "base/process/launch.h" | 16 #include "base/process/launch.h" |
17 #include "base/task_runner.h" | 17 #include "base/task_runner.h" |
18 #include "base/task_runner_util.h" | 18 #include "base/task_runner_util.h" |
19 #include "base/thread_task_runner_handle.h" | 19 #include "base/thread_task_runner_handle.h" |
20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
21 #include "mojo/edk/base_edk/platform_task_runner_impl.h" | 21 #include "mojo/edk/base_edk/platform_task_runner_impl.h" |
22 #include "mojo/edk/embedder/multiprocess_embedder.h" | 22 #include "mojo/edk/embedder/multiprocess_embedder.h" |
23 #include "mojo/edk/embedder/platform_channel_pair.h" | 23 #include "mojo/edk/platform/platform_pipe.h" |
24 #include "mojo/edk/util/ref_ptr.h" | 24 #include "mojo/edk/util/ref_ptr.h" |
25 #include "mojo/public/cpp/system/message_pipe.h" | 25 #include "mojo/public/cpp/system/message_pipe.h" |
26 #include "shell/application_manager/native_application_options.h" | 26 #include "shell/application_manager/native_application_options.h" |
27 #include "shell/child_switches.h" | 27 #include "shell/child_switches.h" |
28 #include "shell/context.h" | 28 #include "shell/context.h" |
29 #include "shell/task_runners.h" | 29 #include "shell/task_runners.h" |
30 | 30 |
| 31 using mojo::platform::PlatformPipe; |
31 using mojo::util::MakeRefCounted; | 32 using mojo::util::MakeRefCounted; |
32 | 33 |
33 namespace shell { | 34 namespace shell { |
34 | 35 |
35 struct ChildProcessHost::LaunchData { | 36 struct ChildProcessHost::LaunchData { |
36 LaunchData() {} | 37 LaunchData() {} |
37 ~LaunchData() {} | 38 ~LaunchData() {} |
38 | 39 |
39 NativeApplicationOptions options; | 40 NativeApplicationOptions options; |
40 base::FilePath child_path; | 41 base::FilePath child_path; |
41 mojo::embedder::PlatformChannelPair platform_channel_pair; | 42 PlatformPipe platform_channel_pair; |
42 std::string child_connection_id; | 43 std::string child_connection_id; |
43 }; | 44 }; |
44 | 45 |
45 ChildProcessHost::ChildProcessHost(Context* context) | 46 ChildProcessHost::ChildProcessHost(Context* context) |
46 : context_(context), channel_info_(nullptr) { | 47 : context_(context), channel_info_(nullptr) { |
47 } | 48 } |
48 | 49 |
49 ChildProcessHost::~ChildProcessHost() { | 50 ChildProcessHost::~ChildProcessHost() { |
50 DCHECK(!child_process_.IsValid()); | 51 DCHECK(!child_process_.IsValid()); |
51 } | 52 } |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 on_app_complete_.reset(); | 169 on_app_complete_.reset(); |
169 on_app_complete.Run(result); | 170 on_app_complete.Run(result); |
170 } | 171 } |
171 } | 172 } |
172 | 173 |
173 void ChildProcessHost::OnConnectionError() { | 174 void ChildProcessHost::OnConnectionError() { |
174 AppCompleted(MOJO_RESULT_UNKNOWN); | 175 AppCompleted(MOJO_RESULT_UNKNOWN); |
175 } | 176 } |
176 | 177 |
177 } // namespace shell | 178 } // namespace shell |
OLD | NEW |