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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 bool zygote, | 515 bool zygote, |
516 #endif | 516 #endif |
517 base::Process process) { | 517 base::Process process) { |
518 #if defined(OS_ANDROID) | 518 #if defined(OS_ANDROID) |
519 VLOG(1) << "ChromeProcess: Stopping process with handle " | 519 VLOG(1) << "ChromeProcess: Stopping process with handle " |
520 << process.Handle(); | 520 << process.Handle(); |
521 StopChildProcess(process.Handle()); | 521 StopChildProcess(process.Handle()); |
522 #else | 522 #else |
523 // Client has gone away, so just kill the process. Using exit code 0 | 523 // Client has gone away, so just kill the process. Using exit code 0 |
524 // means that UMA won't treat this as a crash. | 524 // means that UMA won't treat this as a crash. |
525 process.Terminate(RESULT_CODE_NORMAL_EXIT); | 525 process.Terminate(RESULT_CODE_NORMAL_EXIT, false); |
526 // On POSIX, we must additionally reap the child. | 526 // On POSIX, we must additionally reap the child. |
527 #if defined(OS_POSIX) | 527 #if defined(OS_POSIX) |
528 #if !defined(OS_MACOSX) | 528 #if !defined(OS_MACOSX) |
529 if (zygote) { | 529 if (zygote) { |
530 // If the renderer was created via a zygote, we have to proxy the reaping | 530 // If the renderer was created via a zygote, we have to proxy the reaping |
531 // through the zygote process. | 531 // through the zygote process. |
532 ZygoteHostImpl::GetInstance()->EnsureProcessTerminated(process.Handle()); | 532 ZygoteHostImpl::GetInstance()->EnsureProcessTerminated(process.Handle()); |
533 } else | 533 } else |
534 #endif // !OS_MACOSX | 534 #endif // !OS_MACOSX |
535 base::EnsureProcessTerminated(process.Pass()); | 535 base::EnsureProcessTerminated(process.Pass()); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 context_->SetProcessBackgrounded(background); | 595 context_->SetProcessBackgrounded(background); |
596 } | 596 } |
597 | 597 |
598 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 598 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
599 bool terminate_on_shutdown) { | 599 bool terminate_on_shutdown) { |
600 if (context_.get()) | 600 if (context_.get()) |
601 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 601 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
602 } | 602 } |
603 | 603 |
604 } // namespace content | 604 } // namespace content |
OLD | NEW |