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

Unified Diff: chrome/browser/performance_monitor/performance_monitor.cc

Issue 10987040: Fix CPM casting issue; refactor renderer crash events (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
Index: chrome/browser/performance_monitor/performance_monitor.cc
diff --git a/chrome/browser/performance_monitor/performance_monitor.cc b/chrome/browser/performance_monitor/performance_monitor.cc
index effe47037faf8291af004ef279f04c8245073596..27e86155d14eef66958c4f8b4c2165d170765803 100644
--- a/chrome/browser/performance_monitor/performance_monitor.cc
+++ b/chrome/browser/performance_monitor/performance_monitor.cc
@@ -486,14 +486,12 @@ void PerformanceMonitor::Observe(int type,
break;
}
case content::NOTIFICATION_RENDERER_PROCESS_HANG: {
- content::WebContents* contents =
- content::Source<content::WebContents>(source).ptr();
- AddEvent(util::CreateRendererFreezeEvent(base::Time::Now(),
- contents->GetURL().spec()));
+ AddEvent(util::CreateRendererFailureEvent(base::Time::Now(),
+ EVENT_RENDERER_HANG));
break;
}
case content::NOTIFICATION_RENDERER_PROCESS_CLOSED: {
- AddCrashEvent(*content::Details<
+ AddRendererClosedEvent(*content::Details<
content::RenderProcessHost::RendererClosedDetails>(details).ptr());
break;
}
@@ -549,7 +547,7 @@ void PerformanceMonitor::AddExtensionEvent(EventType type,
extension->description()));
}
-void PerformanceMonitor::AddCrashEvent(
+void PerformanceMonitor::AddRendererClosedEvent(
const content::RenderProcessHost::RendererClosedDetails& details) {
// We only care if this is an invalid termination.
if (details.status == base::TERMINATION_STATUS_NORMAL_TERMINATION ||
@@ -559,9 +557,9 @@ void PerformanceMonitor::AddCrashEvent(
// Determine the type of crash.
EventType type =
details.status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED ?
- EVENT_KILLED_BY_OS_CRASH : EVENT_RENDERER_CRASH;
+ EVENT_RENDERER_KILLED : EVENT_RENDERER_CRASH;
- AddEvent(util::CreateCrashEvent(base::Time::Now(), type));
+ AddEvent(util::CreateRendererFailureEvent(base::Time::Now(), type));
}
} // namespace performance_monitor

Powered by Google App Engine
This is Rietveld 408576698