| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/invalidation/invalidator_storage.h" | 5 #include "components/invalidation/invalidator_storage.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 return value.Pass(); | 50 return value.Pass(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 } // namespace | 53 } // namespace |
| 54 | 54 |
| 55 namespace invalidation { | 55 namespace invalidation { |
| 56 | 56 |
| 57 // static | 57 // static |
| 58 void InvalidatorStorage::RegisterProfilePrefs( | 58 void InvalidatorStorage::RegisterProfilePrefs( |
| 59 user_prefs::PrefRegistrySyncable* registry) { | 59 user_prefs::PrefRegistrySyncable* registry) { |
| 60 registry->RegisterListPref(prefs::kInvalidatorSavedInvalidations, | 60 registry->RegisterListPref(prefs::kInvalidatorSavedInvalidations); |
| 61 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 61 registry->RegisterStringPref(prefs::kInvalidatorInvalidationState, |
| 62 registry->RegisterStringPref( | 62 std::string()); |
| 63 prefs::kInvalidatorInvalidationState, | 63 registry->RegisterStringPref(prefs::kInvalidatorClientId, std::string()); |
| 64 std::string(), | |
| 65 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 66 registry->RegisterStringPref( | |
| 67 prefs::kInvalidatorClientId, | |
| 68 std::string(), | |
| 69 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 70 | 64 |
| 71 // This pref is obsolete. We register it so we can clear it. | 65 // This pref is obsolete. We register it so we can clear it. |
| 72 // At some point in the future, it will be safe to remove this. | 66 // At some point in the future, it will be safe to remove this. |
| 73 registry->RegisterListPref(kInvalidatorMaxInvalidationVersions, | 67 registry->RegisterListPref(kInvalidatorMaxInvalidationVersions); |
| 74 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 75 } | 68 } |
| 76 | 69 |
| 77 // static | 70 // static |
| 78 void InvalidatorStorage::RegisterPrefs(PrefRegistrySimple* registry) { | 71 void InvalidatorStorage::RegisterPrefs(PrefRegistrySimple* registry) { |
| 79 registry->RegisterListPref(prefs::kInvalidatorSavedInvalidations); | 72 registry->RegisterListPref(prefs::kInvalidatorSavedInvalidations); |
| 80 registry->RegisterStringPref(prefs::kInvalidatorInvalidationState, | 73 registry->RegisterStringPref(prefs::kInvalidatorInvalidationState, |
| 81 std::string()); | 74 std::string()); |
| 82 registry->RegisterStringPref(prefs::kInvalidatorClientId, std::string()); | 75 registry->RegisterStringPref(prefs::kInvalidatorClientId, std::string()); |
| 83 } | 76 } |
| 84 | 77 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 130 } |
| 138 | 131 |
| 139 void InvalidatorStorage::Clear() { | 132 void InvalidatorStorage::Clear() { |
| 140 DCHECK(thread_checker_.CalledOnValidThread()); | 133 DCHECK(thread_checker_.CalledOnValidThread()); |
| 141 pref_service_->ClearPref(prefs::kInvalidatorSavedInvalidations); | 134 pref_service_->ClearPref(prefs::kInvalidatorSavedInvalidations); |
| 142 pref_service_->ClearPref(prefs::kInvalidatorClientId); | 135 pref_service_->ClearPref(prefs::kInvalidatorClientId); |
| 143 pref_service_->ClearPref(prefs::kInvalidatorInvalidationState); | 136 pref_service_->ClearPref(prefs::kInvalidatorInvalidationState); |
| 144 } | 137 } |
| 145 | 138 |
| 146 } // namespace invalidation | 139 } // namespace invalidation |
| OLD | NEW |