Index: chrome/browser/browser_child_process_host.cc |
diff --git a/chrome/browser/browser_child_process_host.cc b/chrome/browser/browser_child_process_host.cc |
index 6ad0c44167d4ff1c39b0e94ee88192e360be894a..6b7d47b6a8467d6a04615cd827e9f9bd1869ca88 100644 |
--- a/chrome/browser/browser_child_process_host.cc |
+++ b/chrome/browser/browser_child_process_host.cc |
@@ -141,18 +141,34 @@ void BrowserChildProcessHost::Notify(NotificationType type) { |
BrowserThread::UI, FROM_HERE, new ChildNotificationTask(type, this)); |
} |
-bool BrowserChildProcessHost::DidChildCrash() { |
- return child_process_->DidProcessCrash(); |
+base::TerminationStatus BrowserChildProcessHost::GetChildTerminationStatus( |
+ int* exit_code) { |
+ return child_process_->GetChildTerminationStatus(exit_code); |
} |
void BrowserChildProcessHost::OnChildDied() { |
if (handle() != base::kNullProcessHandle) { |
- bool did_crash = DidChildCrash(); |
- if (did_crash) { |
- OnProcessCrashed(); |
- // Report that this child process crashed. |
- Notify(NotificationType::CHILD_PROCESS_CRASHED); |
- UMA_HISTOGRAM_COUNTS("ChildProcess.Crashes", this->type()); |
+ int exit_code; |
+ base::TerminationStatus status = GetChildTerminationStatus(&exit_code); |
+ switch (status) { |
+ case base::TERMINATION_STATUS_PROCESS_CRASHED: { |
+ OnProcessCrashed(exit_code); |
+ |
+ // Report that this child process crashed. |
+ Notify(NotificationType::CHILD_PROCESS_CRASHED); |
+ UMA_HISTOGRAM_COUNTS("ChildProcess.Crashes", this->type()); |
+ break; |
+ } |
+ case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: { |
+ OnProcessWasKilled(exit_code); |
+ |
+ // Report that this child process was killed. |
+ Notify(NotificationType::CHILD_PROCESS_WAS_KILLED); |
+ UMA_HISTOGRAM_COUNTS("ChildProcess.Kills", this->type()); |
+ break; |
+ } |
+ default: |
+ break; |
} |
// Notify in the main loop of the disconnection. |
Notify(NotificationType::CHILD_PROCESS_HOST_DISCONNECTED); |