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

Unified Diff: chrome/browser/sync/invalidations/invalidator_storage.cc

Issue 12094113: Migrate invalidator client IDs out of sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review-related changes Created 7 years, 10 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/sync/invalidations/invalidator_storage.cc
diff --git a/chrome/browser/sync/invalidations/invalidator_storage.cc b/chrome/browser/sync/invalidations/invalidator_storage.cc
index b17ba509c05dab8b56cdb69c04799b4ee0e2fc6c..7802f403162dfbcee07e9a5477bccd36866461df 100644
--- a/chrome/browser/sync/invalidations/invalidator_storage.cc
+++ b/chrome/browser/sync/invalidations/invalidator_storage.cc
@@ -104,6 +104,9 @@ InvalidatorStorage::InvalidatorStorage(PrefServiceSyncable* pref_service)
pref_service_->RegisterStringPref(prefs::kInvalidatorInvalidationState,
std::string(),
PrefServiceSyncable::UNSYNCABLE_PREF);
+ pref_service_->RegisterStringPref(prefs::kInvalidatorClientId,
+ std::string(),
+ PrefServiceSyncable::UNSYNCABLE_PREF);
MigrateMaxInvalidationVersionsPref();
}
@@ -256,6 +259,17 @@ void InvalidatorStorage::DeserializeMap(
}
}
+void InvalidatorStorage::SetInvalidatorClientId(const std::string& client_id) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ pref_service_->SetString(prefs::kInvalidatorClientId, client_id);
+}
+
+std::string InvalidatorStorage::GetInvalidatorClientId() const {
+ return pref_service_ ?
+ pref_service_->GetString(prefs::kInvalidatorClientId) :
+ std::string();
tim (not reviewing) 2013/02/05 22:05:28 nit - indent 4 spaces from pref_service_.
rlarocque 2013/02/05 22:16:45 Done.
+}
+
void InvalidatorStorage::SetBootstrapData(const std::string& data) {
DCHECK(thread_checker_.CalledOnValidThread());
std::string base64_data;
@@ -275,6 +289,7 @@ std::string InvalidatorStorage::GetBootstrapData() const {
void InvalidatorStorage::Clear() {
DCHECK(thread_checker_.CalledOnValidThread());
pref_service_->ClearPref(prefs::kInvalidatorMaxInvalidationVersions);
+ pref_service_->ClearPref(prefs::kInvalidatorClientId);
pref_service_->ClearPref(prefs::kInvalidatorInvalidationState);
}

Powered by Google App Engine
This is Rietveld 408576698