| 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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 if (handle == base::kNullProcessHandle) { | 462 if (handle == base::kNullProcessHandle) { |
| 463 // Process is already gone, so return the cached termination status. | 463 // Process is already gone, so return the cached termination status. |
| 464 if (exit_code) | 464 if (exit_code) |
| 465 *exit_code = context_->exit_code_; | 465 *exit_code = context_->exit_code_; |
| 466 return context_->termination_status_; | 466 return context_->termination_status_; |
| 467 } | 467 } |
| 468 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 468 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 469 if (context_->zygote_) { | 469 if (context_->zygote_) { |
| 470 context_->termination_status_ = ZygoteHostImpl::GetInstance()-> | 470 context_->termination_status_ = ZygoteHostImpl::GetInstance()-> |
| 471 GetTerminationStatus(handle, known_dead, &context_->exit_code_); | 471 GetTerminationStatus(handle, known_dead, &context_->exit_code_); |
| 472 } else if (known_dead) { |
| 473 context_->termination_status_ = |
| 474 base::GetKnownDeadTerminationStatus(handle, &context_->exit_code_); |
| 472 } else { | 475 } else { |
| 473 #elif defined(OS_MACOSX) | 476 #elif defined(OS_MACOSX) |
| 474 if (known_dead) { | 477 if (known_dead) { |
| 475 context_->termination_status_ = | 478 context_->termination_status_ = |
| 476 base::GetKnownDeadTerminationStatus(handle, &context_->exit_code_); | 479 base::GetKnownDeadTerminationStatus(handle, &context_->exit_code_); |
| 477 } else { | 480 } else { |
| 478 #elif defined(OS_ANDROID) | 481 #elif defined(OS_ANDROID) |
| 479 if (IsChildProcessOomProtected(handle)) { | 482 if (IsChildProcessOomProtected(handle)) { |
| 480 context_->termination_status_ = base::TERMINATION_STATUS_OOM_PROTECTED; | 483 context_->termination_status_ = base::TERMINATION_STATUS_OOM_PROTECTED; |
| 481 } else { | 484 } else { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 509 GetHandle(), background)); | 512 GetHandle(), background)); |
| 510 } | 513 } |
| 511 | 514 |
| 512 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 515 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
| 513 bool terminate_on_shutdown) { | 516 bool terminate_on_shutdown) { |
| 514 if (context_.get()) | 517 if (context_.get()) |
| 515 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 518 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
| 516 } | 519 } |
| 517 | 520 |
| 518 } // namespace content | 521 } // namespace content |
| OLD | NEW |