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

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

Issue 213363004: Resetting metrics ids on clump detection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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: chrome/browser/metrics/metrics_service.h
diff --git a/chrome/browser/metrics/metrics_service.h b/chrome/browser/metrics/metrics_service.h
index f50934d0db5d53e72d624dcde35a735a02e18a23..9ee89e22b6e0e7ab48dc0ee197df83772c41adbf 100644
--- a/chrome/browser/metrics/metrics_service.h
+++ b/chrome/browser/metrics/metrics_service.h
@@ -368,6 +368,10 @@ class MetricsService
base::TimeDelta* incremental_uptime,
base::TimeDelta* uptime);
+ // Reset the client id and low entropy source if the kMetricsResetMetricIDs
+ // pref is true.
+ void ResetMetricsIDsIfNecessary();
+
// Returns the low entropy source for this client. This is a random value
// that is non-identifying amongst browser clients. This method will
// generate the entropy source value if it has not been called before.
@@ -523,6 +527,10 @@ class MetricsService
content::NotificationRegistrar registrar_;
+ // Set to true when |ResetMetricsIDsIfNecessary| is called for the first time.
+ // This prevents multiple resets within the same Chrome session.
+ bool metrics_ids_reset_check_performed_;
+
// Indicate whether recording and reporting are currently happening.
// These should not be set directly, but by calling SetRecording and
// SetReporting.
@@ -639,6 +647,7 @@ class MetricsService
FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest,
PermutedEntropyCacheClearedWhenLowEntropyReset);
FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, RegisterSyntheticTrial);
+ FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ResetMetricsIDs);
FRIEND_TEST_ALL_PREFIXES(MetricsServiceBrowserTest,
CheckLowEntropySourceUsed);
FRIEND_TEST_ALL_PREFIXES(MetricsServiceReportingTest,
« no previous file with comments | « chrome/browser/metrics/cloned_install_detector_unittest.cc ('k') | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698