Index: chrome/browser/renderer_host/browser_render_process_host.cc |
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc |
index 3a46d65ce097d0125438bd8df446b434d1839c42..9df384105922cc6df7fa3ce76c19fe52046535a6 100644 |
--- a/chrome/browser/renderer_host/browser_render_process_host.cc |
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc |
@@ -982,16 +982,26 @@ void BrowserRenderProcessHost::OnChannelError() { |
if (!channel_.get()) |
return; |
- // NULL in single process mode or if fast termination happened. |
- bool did_crash = |
- child_process_.get() ? child_process_->DidProcessCrash() : false; |
- |
- if (did_crash) { |
+ // child_process_ can be NULL in single process mode or if fast |
+ // termination happened. |
+ int exit_code = 0; |
+ base::TerminationStatus status = |
+ child_process_.get() ? |
+ child_process_->GetChildTerminationStatus(&exit_code) : |
+ base::TERMINATION_STATUS_NORMAL_TERMINATION; |
+ |
+ if (status == base::TERMINATION_STATUS_PROCESS_CRASHED || |
+ status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION) { |
UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.ChildCrashes", |
extension_process_ ? 2 : 1); |
} |
- RendererClosedDetails details(did_crash, extension_process_); |
+ if (status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED) { |
+ UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.ChildKills", |
+ extension_process_ ? 2 : 1); |
+ } |
+ |
+ RendererClosedDetails details(status, exit_code, extension_process_); |
NotificationService::current()->Notify( |
NotificationType::RENDERER_PROCESS_CLOSED, |
Source<RenderProcessHost>(this), |
@@ -1004,7 +1014,9 @@ void BrowserRenderProcessHost::OnChannelError() { |
IDMap<IPC::Channel::Listener>::iterator iter(&listeners_); |
while (!iter.IsAtEnd()) { |
iter.GetCurrentValue()->OnMessageReceived( |
- ViewHostMsg_RenderViewGone(iter.GetCurrentKey())); |
+ ViewHostMsg_RenderViewGone(iter.GetCurrentKey(), |
+ static_cast<int>(status), |
+ exit_code)); |
iter.Advance(); |
} |