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

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

Issue 580093004: Reset some UMA stability stats on a version change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/metrics/chrome_stability_metrics_provider.cc
diff --git a/chrome/browser/metrics/chrome_stability_metrics_provider.cc b/chrome/browser/metrics/chrome_stability_metrics_provider.cc
index fbe79a6685a628878df59c2d133e9ec266b9ebec..fcdc5d715840a1e8bb5a5774d99308ca97e48300 100644
--- a/chrome/browser/metrics/chrome_stability_metrics_provider.cc
+++ b/chrome/browser/metrics/chrome_stability_metrics_provider.cc
@@ -126,15 +126,28 @@ void ChromeStabilityMetricsProvider::ProvideStabilityMetrics(
}
}
+void ChromeStabilityMetricsProvider::ClearSavedStabilityMetrics() {
+ PrefService* local_state = g_browser_process->local_state();
+
+ // Clear all the prefs used in this class in UMA reports (which doesn't
+ // include |kUninstallMetricsPageLoadCount| as it's not sent up by UMA).
+ local_state->SetInteger(prefs::kStabilityChildProcessCrashCount, 0);
+ local_state->SetInteger(prefs::kStabilityExtensionRendererCrashCount, 0);
+ local_state->SetInteger(prefs::kStabilityPageLoadCount, 0);
+ local_state->SetInteger(prefs::kStabilityRendererCrashCount, 0);
+ local_state->SetInteger(prefs::kStabilityRendererHangCount, 0);
+}
+
// static
void ChromeStabilityMetricsProvider::RegisterPrefs(
PrefRegistrySimple* registry) {
- registry->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0);
- registry->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0);
+ registry->RegisterIntegerPref(prefs::kStabilityChildProcessCrashCount, 0);
registry->RegisterIntegerPref(prefs::kStabilityExtensionRendererCrashCount,
0);
+ registry->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0);
+ registry->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0);
registry->RegisterIntegerPref(prefs::kStabilityRendererHangCount, 0);
- registry->RegisterIntegerPref(prefs::kStabilityChildProcessCrashCount, 0);
+
registry->RegisterInt64Pref(prefs::kUninstallMetricsPageLoadCount, 0);
}

Powered by Google App Engine
This is Rietveld 408576698