Index: chrome/browser/prefs/pref_hash_filter.cc |
diff --git a/chrome/browser/prefs/pref_hash_filter.cc b/chrome/browser/prefs/pref_hash_filter.cc |
index e35df37edb45769367d2673f109a1097ab88b4e1..bf6e70081d7cea70dce7ceaf9ed565651b26fc5e 100644 |
--- a/chrome/browser/prefs/pref_hash_filter.cc |
+++ b/chrome/browser/prefs/pref_hash_filter.cc |
@@ -64,26 +64,15 @@ PrefHashFilter::~PrefHashFilter() { |
void PrefHashFilter::RegisterProfilePrefs( |
user_prefs::PrefRegistrySyncable* registry) { |
// See GetResetTime for why this is a StringPref and not Int64Pref. |
- registry->RegisterStringPref( |
+ registry->RegisterInt64Pref( |
prefs::kPreferenceResetTime, |
- base::Int64ToString(base::Time().ToInternalValue()), |
+ base::Time().ToInternalValue(), |
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
} |
// static |
base::Time PrefHashFilter::GetResetTime(PrefService* user_prefs) { |
- // Provide our own implementation (identical to the PrefService::GetInt64) in |
- // order to ensure it remains consistent with the way we store this value |
- // (which we do via a PrefStore, preventing us from reusing |
- // PrefService::SetInt64). |
- int64 internal_value = base::Time().ToInternalValue(); |
- if (!base::StringToInt64( |
- user_prefs->GetString(prefs::kPreferenceResetTime), |
- &internal_value)) { |
- // Somehow the value stored on disk is not a valid int64. |
- NOTREACHED(); |
- return base::Time(); |
- } |
+ int64 internal_value = user_prefs->GetInt64(prefs::kPreferenceResetTime); |
return base::Time::FromInternalValue(internal_value); |
} |
@@ -170,9 +159,8 @@ bool PrefHashFilter::FilterOnLoad(base::DictionaryValue* pref_store_contents) { |
} |
if (did_reset) { |
- pref_store_contents->Set(prefs::kPreferenceResetTime, |
- new base::StringValue(base::Int64ToString( |
- base::Time::Now().ToInternalValue()))); |
+ pref_store_contents->SetInt64(prefs::kPreferenceResetTime, |
+ base::Time::Now().ToInternalValue()); |
} |
// TODO(gab): Remove this histogram by Feb 21 2014; after sufficient timing |