| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
| 11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/process_util.h" |
| 14 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
| 15 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
| 16 #include "content/common/chrome_descriptors.h" | 17 #include "content/common/chrome_descriptors.h" |
| 17 #include "content/common/process_watcher.h" | |
| 18 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 19 #include "content/public/browser/content_browser_client.h" | 19 #include "content/public/browser/content_browser_client.h" |
| 20 #include "content/public/common/content_switches.h" | 20 #include "content/public/common/content_switches.h" |
| 21 #include "content/public/common/result_codes.h" | 21 #include "content/public/common/result_codes.h" |
| 22 | 22 |
| 23 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
| 24 #include "base/file_path.h" | 24 #include "base/file_path.h" |
| 25 #include "content/common/sandbox_policy.h" | 25 #include "content/common/sandbox_policy.h" |
| 26 #elif defined(OS_MACOSX) | 26 #elif defined(OS_MACOSX) |
| 27 #include "content/browser/mach_broker_mac.h" | 27 #include "content/browser/mach_broker_mac.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 // On POSIX, we must additionally reap the child. | 273 // On POSIX, we must additionally reap the child. |
| 274 #if defined(OS_POSIX) | 274 #if defined(OS_POSIX) |
| 275 #if !defined(OS_MACOSX) | 275 #if !defined(OS_MACOSX) |
| 276 if (zygote) { | 276 if (zygote) { |
| 277 // If the renderer was created via a zygote, we have to proxy the reaping | 277 // If the renderer was created via a zygote, we have to proxy the reaping |
| 278 // through the zygote process. | 278 // through the zygote process. |
| 279 ZygoteHost::GetInstance()->EnsureProcessTerminated(handle); | 279 ZygoteHost::GetInstance()->EnsureProcessTerminated(handle); |
| 280 } else | 280 } else |
| 281 #endif // !OS_MACOSX | 281 #endif // !OS_MACOSX |
| 282 { | 282 { |
| 283 ProcessWatcher::EnsureProcessTerminated(handle); | 283 base::EnsureProcessTerminated(handle); |
| 284 } | 284 } |
| 285 #endif // OS_POSIX | 285 #endif // OS_POSIX |
| 286 process.Close(); | 286 process.Close(); |
| 287 } | 287 } |
| 288 | 288 |
| 289 Client* client_; | 289 Client* client_; |
| 290 BrowserThread::ID client_thread_id_; | 290 BrowserThread::ID client_thread_id_; |
| 291 base::Process process_; | 291 base::Process process_; |
| 292 base::TerminationStatus termination_status_; | 292 base::TerminationStatus termination_status_; |
| 293 int exit_code_; | 293 int exit_code_; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 base::Bind( | 379 base::Bind( |
| 380 &ChildProcessLauncher::Context::SetProcessBackgrounded, | 380 &ChildProcessLauncher::Context::SetProcessBackgrounded, |
| 381 GetHandle(), background)); | 381 GetHandle(), background)); |
| 382 } | 382 } |
| 383 | 383 |
| 384 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 384 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
| 385 bool terminate_on_shutdown) { | 385 bool terminate_on_shutdown) { |
| 386 if (context_) | 386 if (context_) |
| 387 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 387 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
| 388 } | 388 } |
| OLD | NEW |