Index: chrome/browser/prefs/pref_metrics_service.cc |
diff --git a/chrome/browser/prefs/pref_metrics_service.cc b/chrome/browser/prefs/pref_metrics_service.cc |
index 6d2476292a9c0bf037be468e18100b81e3f0c686..6bbfa4aa0a7e61e98e8097d4662c3c2a15046e41 100644 |
--- a/chrome/browser/prefs/pref_metrics_service.cc |
+++ b/chrome/browser/prefs/pref_metrics_service.cc |
@@ -263,10 +263,14 @@ void PrefMetricsService::LogIntegerPrefChange(int boundary_value, |
} |
void PrefMetricsService::GetDeviceIdCallback(const std::string& device_id) { |
+#if !defined(OS_WIN) || defined(ENABLE_RLZ) |
+ // A device_id is expected in all scenarios except when RLZ is disabled on |
+ // Windows. |
+ DCHECK(!device_id.empty()); |
+#endif |
+ |
device_id_ = device_id; |
- // On Aura, this seems to be called twice. |
- if (!checked_tracked_prefs_) |
- CheckTrackedPreferences(); |
+ CheckTrackedPreferences(); |
} |
void PrefMetricsService::MarkNeedsEmptyValueForTrackedPreferences() { |
@@ -289,7 +293,9 @@ void PrefMetricsService::MarkNeedsEmptyValueForTrackedPreferences() { |
// profile. To make the system more resistant to spoofing, pref values are |
// hashed with the pref path and the device id. |
void PrefMetricsService::CheckTrackedPreferences() { |
+ // Make sure this is only called once per instance of this service. |
DCHECK(!checked_tracked_prefs_); |
+ checked_tracked_prefs_ = true; |
const base::DictionaryValue* pref_hash_dicts = |
local_state_->GetDictionary(prefs::kProfilePreferenceHashes); |
@@ -348,8 +354,6 @@ void PrefMetricsService::CheckTrackedPreferences() { |
} |
} |
- checked_tracked_prefs_ = true; |
- |
// Now that we've checked the incoming preferences, register for change |
// notifications, unless this is test code. |
// TODO(bbudge) Fix failing browser_tests and so we can remove this test. |