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