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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 // Process is already gone, so return the cached termination status. | 458 // Process is already gone, so return the cached termination status. |
459 if (exit_code) | 459 if (exit_code) |
460 *exit_code = context_->exit_code_; | 460 *exit_code = context_->exit_code_; |
461 return context_->termination_status_; | 461 return context_->termination_status_; |
462 } | 462 } |
463 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 463 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
464 if (context_->zygote_) { | 464 if (context_->zygote_) { |
465 context_->termination_status_ = ZygoteHostImpl::GetInstance()-> | 465 context_->termination_status_ = ZygoteHostImpl::GetInstance()-> |
466 GetTerminationStatus(handle, known_dead, &context_->exit_code_); | 466 GetTerminationStatus(handle, known_dead, &context_->exit_code_); |
467 } else | 467 } else |
| 468 #elif defined(OS_MACOSX) |
| 469 if (known_dead) { |
| 470 context_->termination_status_ = |
| 471 base::GetKnownDeadTerminationStatus(handle, &context_->exit_code_); |
| 472 } else |
468 #endif | 473 #endif |
469 { | 474 { |
470 context_->termination_status_ = | 475 context_->termination_status_ = |
471 base::GetTerminationStatus(handle, &context_->exit_code_); | 476 base::GetTerminationStatus(handle, &context_->exit_code_); |
472 } | 477 } |
473 | 478 |
474 if (exit_code) | 479 if (exit_code) |
475 *exit_code = context_->exit_code_; | 480 *exit_code = context_->exit_code_; |
476 | 481 |
477 // POSIX: If the process crashed, then the kernel closed the socket | 482 // POSIX: If the process crashed, then the kernel closed the socket |
(...skipping 16 matching lines...) Expand all Loading... |
494 GetHandle(), background)); | 499 GetHandle(), background)); |
495 } | 500 } |
496 | 501 |
497 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 502 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
498 bool terminate_on_shutdown) { | 503 bool terminate_on_shutdown) { |
499 if (context_.get()) | 504 if (context_.get()) |
500 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 505 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
501 } | 506 } |
502 | 507 |
503 } // namespace content | 508 } // namespace content |
OLD | NEW |