OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/child_process_launcher.h" | 5 #include "content/browser/child_process_launcher.h" |
6 | 6 |
7 #include <utility> // For std::pair. | 7 #include <utility> // For std::pair. |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 | 213 |
214 #if defined(OS_ANDROID) | 214 #if defined(OS_ANDROID) |
215 // Android WebView runs in single process, ensure that we never get here | 215 // Android WebView runs in single process, ensure that we never get here |
216 // when running in single process mode. | 216 // when running in single process mode. |
217 CHECK(!cmd_line->HasSwitch(switches::kSingleProcess)); | 217 CHECK(!cmd_line->HasSwitch(switches::kSingleProcess)); |
218 | 218 |
219 GetContentClient()->browser()-> | 219 GetContentClient()->browser()-> |
220 GetAdditionalMappedFilesForChildProcess(*cmd_line, child_process_id, | 220 GetAdditionalMappedFilesForChildProcess(*cmd_line, child_process_id, |
221 &files_to_register); | 221 &files_to_register); |
222 | 222 |
223 StartChildProcess(cmd_line->argv(), files_to_register, | 223 StartChildProcess(cmd_line->argv(), child_process_id, files_to_register, |
224 base::Bind(&ChildProcessLauncher::Context::OnChildProcessStarted, | 224 base::Bind(&ChildProcessLauncher::Context::OnChildProcessStarted, |
225 this_object, client_thread_id, begin_launch_time)); | 225 this_object, client_thread_id, begin_launch_time)); |
226 | 226 |
227 #elif defined(OS_POSIX) | 227 #elif defined(OS_POSIX) |
228 base::ProcessHandle handle = base::kNullProcessHandle; | 228 base::ProcessHandle handle = base::kNullProcessHandle; |
229 // We need to close the client end of the IPC channel to reliably detect | 229 // We need to close the client end of the IPC channel to reliably detect |
230 // child termination. | 230 // child termination. |
231 file_util::ScopedFD ipcfd_closer(&ipcfd); | 231 file_util::ScopedFD ipcfd_closer(&ipcfd); |
232 | 232 |
233 #if !defined(OS_MACOSX) | 233 #if !defined(OS_MACOSX) |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 GetHandle(), background)); | 497 GetHandle(), background)); |
498 } | 498 } |
499 | 499 |
500 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 500 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
501 bool terminate_on_shutdown) { | 501 bool terminate_on_shutdown) { |
502 if (context_.get()) | 502 if (context_.get()) |
503 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 503 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
504 } | 504 } |
505 | 505 |
506 } // namespace content | 506 } // namespace content |
OLD | NEW |