Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: chrome/browser/renderer_host/browser_render_process_host.cc

Issue 3386014: This adds some plumbing for propagating the status and error code of a (Closed)
Patch Set: Fixed Mac code to handle both SEGV and BUS Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profile_import_process_host.cc ('k') | chrome/browser/renderer_host/render_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c380801a4aef8e05e9998dc72f21df2627e59f84..71ae53df423f734d23ac4a36bfcbb0ed956604e6 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -876,16 +876,20 @@ 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) {
UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.ChildCrashes",
extension_process_ ? 2 : 1);
}
- RendererClosedDetails details(did_crash, extension_process_);
+ RendererClosedDetails details(status, exit_code, extension_process_);
NotificationService::current()->Notify(
NotificationType::RENDERER_PROCESS_CLOSED,
Source<RenderProcessHost>(this),
@@ -898,7 +902,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();
}
« no previous file with comments | « chrome/browser/profile_import_process_host.cc ('k') | chrome/browser/renderer_host/render_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698