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 "services/shell/runner/host/child_process_host.h" | 5 #include "services/shell/runner/host/child_process_host.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 mojom::ServicePtr ChildProcessHost::Start( | 66 mojom::ServicePtr ChildProcessHost::Start( |
67 const Identity& target, | 67 const Identity& target, |
68 const ProcessReadyCallback& callback, | 68 const ProcessReadyCallback& callback, |
69 const base::Closure& quit_closure) { | 69 const base::Closure& quit_closure) { |
70 DCHECK(!child_process_.IsValid()); | 70 DCHECK(!child_process_.IsValid()); |
71 | 71 |
72 const base::CommandLine* parent_command_line = | 72 const base::CommandLine* parent_command_line = |
73 base::CommandLine::ForCurrentProcess(); | 73 base::CommandLine::ForCurrentProcess(); |
74 base::FilePath target_path = parent_command_line->GetProgram(); | 74 base::FilePath target_path = parent_command_line->GetProgram(); |
75 // |app_path_| can be empty in tests. | 75 // |app_path_| can be empty in tests. |
76 if (!app_path_.MatchesExtension(FILE_PATH_LITERAL(".mojo")) && | 76 if (!app_path_.MatchesExtension(FILE_PATH_LITERAL(".library")) && |
77 !app_path_.empty()) { | 77 !app_path_.empty()) { |
78 target_path = app_path_; | 78 target_path = app_path_; |
79 } | 79 } |
80 | 80 |
81 std::unique_ptr<base::CommandLine> child_command_line( | 81 std::unique_ptr<base::CommandLine> child_command_line( |
82 new base::CommandLine(target_path)); | 82 new base::CommandLine(target_path)); |
83 | 83 |
84 child_command_line->AppendArguments(*parent_command_line, false); | 84 child_command_line->AppendArguments(*parent_command_line, false); |
85 | 85 |
86 #ifndef NDEBUG | 86 #ifndef NDEBUG |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 child_process_.Handle(), | 205 child_process_.Handle(), |
206 mojo::edk::ScopedPlatformHandle(mojo::edk::PlatformHandle( | 206 mojo::edk::ScopedPlatformHandle(mojo::edk::PlatformHandle( |
207 mojo_ipc_channel_->PassServerHandle().release().handle)), | 207 mojo_ipc_channel_->PassServerHandle().release().handle)), |
208 child_token_); | 208 child_token_); |
209 } | 209 } |
210 } | 210 } |
211 start_child_process_event_.Signal(); | 211 start_child_process_event_.Signal(); |
212 } | 212 } |
213 | 213 |
214 } // namespace shell | 214 } // namespace shell |
OLD | NEW |