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

Unified Diff: chrome/browser/metrics/metrics_service.cc

Issue 108683003: Store gpu crashes in the systemprofileproto (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Alexei comments1 Created 7 years 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/metrics/metrics_service.cc
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index 98543ebe40ed246c747dfdaf1cb586fdbb4dcee7..dfc8e5402204ad0235ad1f22db55e4ec301b9424 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -446,6 +446,7 @@ void MetricsService::RegisterPrefs(PrefRegistrySimple* registry) {
0);
registry->RegisterIntegerPref(prefs::kStabilityDebuggerPresent, 0);
registry->RegisterIntegerPref(prefs::kStabilityDebuggerNotPresent, 0);
+ registry->RegisterIntegerPref(prefs::kStabilityGpuCrashCount, 0);
#if defined(OS_CHROMEOS)
registry->RegisterIntegerPref(prefs::kStabilityOtherUserCrashCount, 0);
registry->RegisterIntegerPref(prefs::kStabilityKernelCrashCount, 0);
@@ -486,6 +487,7 @@ void MetricsService::DiscardOldStabilityStats(PrefService* local_state) {
local_state->SetInteger(prefs::kStabilityPageLoadCount, 0);
local_state->SetInteger(prefs::kStabilityRendererCrashCount, 0);
local_state->SetInteger(prefs::kStabilityRendererHangCount, 0);
+ local_state->SetInteger(prefs::kStabilityGpuCrashCount, 0);
local_state->SetInt64(prefs::kStabilityLaunchTimeSec, 0);
local_state->SetInt64(prefs::kStabilityLastTimestampSec, 0);
@@ -675,6 +677,8 @@ void MetricsService::SetUpNotifications(
content::NotificationService::AllSources());
registrar->Add(observer, content::NOTIFICATION_RENDERER_PROCESS_CLOSED,
content::NotificationService::AllSources());
+ registrar->Add(observer, content::NOTIFICATION_GPU_PROCESS_CLOSED_ABNORMALLY,
+ content::NotificationService::AllSources());
registrar->Add(observer, content::NOTIFICATION_RENDER_WIDGET_HOST_HANG,
content::NotificationService::AllSources());
registrar->Add(observer, chrome::NOTIFICATION_OMNIBOX_OPENED_URL,
@@ -751,6 +755,10 @@ void MetricsService::Observe(int type,
break;
}
+ case content::NOTIFICATION_GPU_PROCESS_CLOSED_ABNORMALLY:
+ LogGpuCrash();
+ break;
+
default:
NOTREACHED();
break;
@@ -1925,6 +1933,10 @@ void MetricsService::StartExternalMetrics() {
}
#endif
+void MetricsService::LogGpuCrash() {
+ IncrementPrefValue(prefs::kStabilityGpuCrashCount);
+}
+
// static
bool MetricsServiceHelper::IsMetricsReportingEnabled() {
bool result = false;

Powered by Google App Engine
This is Rietveld 408576698