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

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: Extra comments 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..e3f02862920a50303fec33aaccef8679d1541439 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,
+ content::NotificationService::AllSources());
registrar->Add(observer, content::NOTIFICATION_RENDER_WIDGET_HOST_HANG,
content::NotificationService::AllSources());
registrar->Add(observer, chrome::NOTIFICATION_OMNIBOX_OPENED_URL,
@@ -750,6 +754,10 @@ void MetricsService::Observe(int type,
*content::Details<OmniboxLog>(details).ptr());
break;
}
+ case content::NOTIFICATION_GPU_PROCESS_CLOSED: {
Alexei Svitkine (slow) 2013/12/13 22:37:22 Nit: blank line before this; also {}'s unnecessary
rkaplow 2013/12/13 23:54:03 ok, was following most of the style from this meth
+ LogGpuCrash();
+ break;
+ }
default:
NOTREACHED();
@@ -1730,6 +1738,10 @@ void MetricsService::RegisterSyntheticFieldTrial(
synthetic_trial_groups_.push_back(trial_group);
}
+void MetricsService::LogGpuCrash() {
+ IncrementPrefValue(prefs::kStabilityGpuCrashCount);
+}
+
void MetricsService::GetCurrentSyntheticFieldTrials(
std::vector<chrome_variations::ActiveGroupId>* synthetic_trials) {
DCHECK(synthetic_trials);

Powered by Google App Engine
This is Rietveld 408576698