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 "mojo/runner/child_process_host.h" | 5 #include "mojo/runner/child_process_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "base/process/kill.h" | 13 #include "base/process/kill.h" |
14 #include "base/process/launch.h" | 14 #include "base/process/launch.h" |
15 #include "base/task_runner.h" | 15 #include "base/task_runner.h" |
16 #include "base/task_runner_util.h" | 16 #include "base/task_runner_util.h" |
17 #include "base/thread_task_runner_handle.h" | 17 #include "base/thread_task_runner_handle.h" |
18 #include "mojo/edk/embedder/embedder.h" | |
19 #include "mojo/public/cpp/bindings/interface_ptr_info.h" | 18 #include "mojo/public/cpp/bindings/interface_ptr_info.h" |
20 #include "mojo/public/cpp/system/core.h" | 19 #include "mojo/public/cpp/system/core.h" |
21 #include "mojo/runner/context.h" | 20 #include "mojo/runner/context.h" |
22 #include "mojo/runner/switches.h" | 21 #include "mojo/runner/switches.h" |
23 #include "mojo/runner/task_runners.h" | 22 #include "mojo/runner/task_runners.h" |
| 23 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" |
24 | 24 |
25 #if defined(OS_LINUX) && !defined(OS_ANDROID) | 25 #if defined(OS_LINUX) && !defined(OS_ANDROID) |
26 #include "sandbox/linux/services/namespace_sandbox.h" | 26 #include "sandbox/linux/services/namespace_sandbox.h" |
27 #endif | 27 #endif |
28 | 28 |
29 namespace mojo { | 29 namespace mojo { |
30 namespace runner { | 30 namespace runner { |
31 | 31 |
32 ChildProcessHost::ChildProcessHost(Context* context, | 32 ChildProcessHost::ChildProcessHost(Context* context, |
33 bool start_sandboxed, | 33 bool start_sandboxed, |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 if (!on_app_complete_.is_null()) { | 149 if (!on_app_complete_.is_null()) { |
150 auto on_app_complete = on_app_complete_; | 150 auto on_app_complete = on_app_complete_; |
151 on_app_complete_.reset(); | 151 on_app_complete_.reset(); |
152 on_app_complete.Run(result); | 152 on_app_complete.Run(result); |
153 } | 153 } |
154 } | 154 } |
155 | 155 |
156 void ChildProcessHost::DidCreateChannel(embedder::ChannelInfo* channel_info) { | 156 void ChildProcessHost::DidCreateChannel(embedder::ChannelInfo* channel_info) { |
157 DVLOG(2) << "AppChildProcessHost::DidCreateChannel()"; | 157 DVLOG(2) << "AppChildProcessHost::DidCreateChannel()"; |
158 | 158 |
159 CHECK(channel_info); | 159 DCHECK(channel_info || |
| 160 base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk")); |
160 channel_info_ = channel_info; | 161 channel_info_ = channel_info; |
161 } | 162 } |
162 | 163 |
163 } // namespace runner | 164 } // namespace runner |
164 } // namespace mojo | 165 } // namespace mojo |
OLD | NEW |