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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 process.Terminate(RESULT_CODE_NORMAL_EXIT); | 524 process.Terminate(RESULT_CODE_NORMAL_EXIT); |
525 // On POSIX, we must additionally reap the child. | 525 // On POSIX, we must additionally reap the child. |
526 #if defined(OS_POSIX) | 526 #if defined(OS_POSIX) |
527 #if !defined(OS_MACOSX) | 527 #if !defined(OS_MACOSX) |
528 if (zygote) { | 528 if (zygote) { |
529 // If the renderer was created via a zygote, we have to proxy the reaping | 529 // If the renderer was created via a zygote, we have to proxy the reaping |
530 // through the zygote process. | 530 // through the zygote process. |
531 ZygoteHostImpl::GetInstance()->EnsureProcessTerminated(process.Handle()); | 531 ZygoteHostImpl::GetInstance()->EnsureProcessTerminated(process.Handle()); |
532 } else | 532 } else |
533 #endif // !OS_MACOSX | 533 #endif // !OS_MACOSX |
534 base::EnsureProcessTerminated(process.Handle()); | 534 base::EnsureProcessTerminated(process.Pass()); |
535 #endif // OS_POSIX | 535 #endif // OS_POSIX |
536 #endif // defined(OS_ANDROID) | 536 #endif // defined(OS_ANDROID) |
537 } | 537 } |
538 | 538 |
539 // ----------------------------------------------------------------------------- | 539 // ----------------------------------------------------------------------------- |
540 | 540 |
541 ChildProcessLauncher::ChildProcessLauncher( | 541 ChildProcessLauncher::ChildProcessLauncher( |
542 SandboxedProcessLauncherDelegate* delegate, | 542 SandboxedProcessLauncherDelegate* delegate, |
543 base::CommandLine* cmd_line, | 543 base::CommandLine* cmd_line, |
544 int child_process_id, | 544 int child_process_id, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 context_->SetProcessBackgrounded(background); | 594 context_->SetProcessBackgrounded(background); |
595 } | 595 } |
596 | 596 |
597 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 597 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
598 bool terminate_on_shutdown) { | 598 bool terminate_on_shutdown) { |
599 if (context_.get()) | 599 if (context_.get()) |
600 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 600 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
601 } | 601 } |
602 | 602 |
603 } // namespace content | 603 } // namespace content |
OLD | NEW |