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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 9769011: Histogram times surrounding render crashes (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 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
Index: content/browser/renderer_host/render_process_host_impl.cc
===================================================================
--- content/browser/renderer_host/render_process_host_impl.cc (revision 127735)
+++ content/browser/renderer_host/render_process_host_impl.cc (working copy)
@@ -783,7 +783,11 @@
// Store the handle before it gets changed.
base::ProcessHandle handle = GetHandle();
rvargas (doing something else) 2012/03/22 22:16:30 nit: most of the time we don't keep an extra local
jar (doing other things) 2012/03/22 22:42:58 Done.
- ProcessDied(handle, base::TERMINATION_STATUS_NORMAL_TERMINATION, 0, false);
+ RendererClosedDetails details(handle);
+ details.status = base::TERMINATION_STATUS_NORMAL_TERMINATION;
rvargas (doing something else) 2012/03/22 22:16:30 these are the default values
jar (doing other things) 2012/03/22 22:42:58 Changed to a DCHECK to help with readability (not
+ details.exit_code = 0;
+ details.was_alive = false;
+ ProcessDied(&details);
fast_shutdown_started_ = true;
return true;
}
@@ -948,18 +952,16 @@
// Store the handle before it gets changed.
base::ProcessHandle handle = GetHandle();
rvargas (doing something else) 2012/03/22 22:16:30 I'd also remove this one. In fact, can we add a TO
jar (doing other things) 2012/03/22 22:42:58 Done.
-
+ RendererClosedDetails details(handle);
// child_process_launcher_ can be NULL in single process mode or if fast
// termination happened.
- int exit_code = 0;
- base::TerminationStatus status =
- child_process_launcher_.get() ?
- child_process_launcher_->GetChildTerminationStatus(&exit_code) :
+ details.status = child_process_launcher_.get() ?
+ child_process_launcher_->GetChildTerminationStatus(&details.exit_code) :
base::TERMINATION_STATUS_NORMAL_TERMINATION;
#if defined(OS_WIN)
if (!run_renderer_in_process()) {
- if (status == base::TERMINATION_STATUS_STILL_RUNNING) {
+ if (details.status == base::TERMINATION_STATUS_STILL_RUNNING) {
HANDLE process = child_process_launcher_->GetHandle();
child_process_watcher_.StartWatching(
new base::WaitableEvent(process), this);
@@ -967,19 +969,21 @@
}
}
#endif
- ProcessDied(handle, status, exit_code, false);
-}
+ details.was_alive = false;
+ ProcessDied(&details);
+ }
// Called when the renderer process handle has been signaled.
void RenderProcessHostImpl::OnWaitableEventSignaled(
base::WaitableEvent* waitable_event) {
#if defined (OS_WIN)
base::ProcessHandle handle = GetHandle();
- int exit_code = 0;
- base::TerminationStatus status =
- base::GetTerminationStatus(waitable_event->Release(), &exit_code);
+ RendererClosedDetails details(handle);
+ details.status = base::GetTerminationStatus(waitable_event->Release(),
+ &details.exit_code);
delete waitable_event;
- ProcessDied(handle, status, exit_code, true);
+ details.was_alive = true;
+ ProcessDied(&details);
#endif
}
@@ -1213,21 +1217,17 @@
return NULL;
}
-void RenderProcessHostImpl::ProcessDied(base::ProcessHandle handle,
- base::TerminationStatus status,
- int exit_code,
- bool was_alive) {
+void RenderProcessHostImpl::ProcessDied(RendererClosedDetails* details) {
// Our child process has died. If we didn't expect it, it's a crash.
// In any case, we need to let everyone know it's gone.
// The OnChannelError notification can fire multiple times due to nested sync
// calls to a renderer. If we don't have a valid channel here it means we
// already handled the error.
- RendererClosedDetails details(handle, status, exit_code, was_alive);
content::NotificationService::current()->Notify(
content::NOTIFICATION_RENDERER_PROCESS_CLOSED,
content::Source<RenderProcessHost>(this),
- content::Details<RendererClosedDetails>(&details));
+ content::Details<RendererClosedDetails>(details));
child_process_launcher_.reset();
channel_.reset();
@@ -1237,8 +1237,8 @@
while (!iter.IsAtEnd()) {
RenderWidgetHostImpl::From(iter.GetCurrentValue())->OnMessageReceived(
ViewHostMsg_RenderViewGone(iter.GetCurrentKey(),
- static_cast<int>(status),
- exit_code));
+ static_cast<int>(details->status),
+ details->exit_code));
iter.Advance();
}

Powered by Google App Engine
This is Rietveld 408576698