| Index: chrome/browser/sync/invalidations/invalidator_storage.cc
|
| diff --git a/chrome/browser/sync/invalidations/invalidator_storage.cc b/chrome/browser/sync/invalidations/invalidator_storage.cc
|
| index b75d4ffc0c1d7d1f3286c6b03d47c86a45de3563..052aff1da11e179a6428cbc721963728b287d413 100644
|
| --- a/chrome/browser/sync/invalidations/invalidator_storage.cc
|
| +++ b/chrome/browser/sync/invalidations/invalidator_storage.cc
|
| @@ -94,25 +94,27 @@ DictionaryValue* ObjectIdAndStateToValue(
|
|
|
| } // namespace
|
|
|
| -InvalidatorStorage::InvalidatorStorage(PrefService* pref_service,
|
| - PrefRegistrySyncable* registry)
|
| - : pref_service_(pref_service) {
|
| - // TODO(tim): Create a Mock instead of maintaining the if(!pref_service_) case
|
| - // throughout this file. This is a problem now due to lack of injection at
|
| - // ProfileSyncService. Bug 130176.
|
| - if (registry) {
|
| - // TODO(joi): Move to registration function.
|
| - registry->RegisterListPref(prefs::kInvalidatorMaxInvalidationVersions,
|
| +// static
|
| +void InvalidatorStorage::RegisterUserPrefs(PrefRegistrySyncable* registry) {
|
| + registry->RegisterListPref(prefs::kInvalidatorMaxInvalidationVersions,
|
| + PrefRegistrySyncable::UNSYNCABLE_PREF);
|
| + registry->RegisterStringPref(prefs::kInvalidatorInvalidationState,
|
| + std::string(),
|
| PrefRegistrySyncable::UNSYNCABLE_PREF);
|
| - registry->RegisterStringPref(prefs::kInvalidatorInvalidationState,
|
| - std::string(),
|
| - PrefRegistrySyncable::UNSYNCABLE_PREF);
|
| - registry->RegisterStringPref(prefs::kInvalidatorClientId,
|
| + registry->RegisterStringPref(prefs::kInvalidatorClientId,
|
| std::string(),
|
| PrefRegistrySyncable::UNSYNCABLE_PREF);
|
| + registry->RegisterDictionaryPref(prefs::kSyncMaxInvalidationVersions,
|
| + PrefRegistrySyncable::UNSYNCABLE_PREF);
|
| +}
|
|
|
| - MigrateMaxInvalidationVersionsPref(registry);
|
| - }
|
| +InvalidatorStorage::InvalidatorStorage(PrefService* pref_service)
|
| + : pref_service_(pref_service) {
|
| + // TODO(tim): Create a Mock instead of maintaining the if(!pref_service_) case
|
| + // throughout this file. This is a problem now due to lack of injection at
|
| + // ProfileSyncService. Bug 130176.
|
| + if (pref_service_)
|
| + MigrateMaxInvalidationVersionsPref();
|
| }
|
|
|
| InvalidatorStorage::~InvalidatorStorage() {
|
| @@ -199,10 +201,7 @@ void InvalidatorStorage::SerializeToList(
|
| }
|
|
|
| // Legacy migration code.
|
| -void InvalidatorStorage::MigrateMaxInvalidationVersionsPref(
|
| - PrefRegistrySyncable* registry) {
|
| - registry->RegisterDictionaryPref(prefs::kSyncMaxInvalidationVersions,
|
| - PrefRegistrySyncable::UNSYNCABLE_PREF);
|
| +void InvalidatorStorage::MigrateMaxInvalidationVersionsPref() {
|
| const base::DictionaryValue* max_versions_dict =
|
| pref_service_->GetDictionary(prefs::kSyncMaxInvalidationVersions);
|
| CHECK(max_versions_dict);
|
|
|