| 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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 472 } else |
| 473 #elif defined(OS_MACOSX) | 473 #elif defined(OS_MACOSX) |
| 474 if (known_dead) { | 474 if (known_dead) { |
| 475 context_->termination_status_ = | 475 context_->termination_status_ = |
| 476 base::GetKnownDeadTerminationStatus(handle, &context_->exit_code_); | 476 base::GetKnownDeadTerminationStatus(handle, &context_->exit_code_); |
| 477 } else | 477 } else |
| 478 #elif defined(OS_ANDROID) |
| 479 if (IsChildProcessOomProtected(handle)) { |
| 480 context_->termination_status_ = base::TERMINATION_STATUS_OOM_PROTECTED; |
| 481 } else |
| 478 #endif | 482 #endif |
| 479 { | 483 { |
| 480 context_->termination_status_ = | 484 context_->termination_status_ = |
| 481 base::GetTerminationStatus(handle, &context_->exit_code_); | 485 base::GetTerminationStatus(handle, &context_->exit_code_); |
| 482 } | 486 } |
| 483 | 487 |
| 484 if (exit_code) | 488 if (exit_code) |
| 485 *exit_code = context_->exit_code_; | 489 *exit_code = context_->exit_code_; |
| 486 | 490 |
| 487 // POSIX: If the process crashed, then the kernel closed the socket | 491 // POSIX: If the process crashed, then the kernel closed the socket |
| (...skipping 16 matching lines...) Expand all Loading... |
| 504 GetHandle(), background)); | 508 GetHandle(), background)); |
| 505 } | 509 } |
| 506 | 510 |
| 507 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 511 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
| 508 bool terminate_on_shutdown) { | 512 bool terminate_on_shutdown) { |
| 509 if (context_.get()) | 513 if (context_.get()) |
| 510 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 514 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
| 511 } | 515 } |
| 512 | 516 |
| 513 } // namespace content | 517 } // namespace content |
| OLD | NEW |