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

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

Issue 12092091: Separate sync and invalidation client IDs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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..e3f70fd2456f689280f85d2e305051a2f353435f 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::kInvalidatorInvalidatorClientId,
+ std::string(),
+ PrefServiceSyncable::UNSYNCABLE_PREF);
MigrateMaxInvalidationVersionsPref();
}
@@ -256,6 +259,16 @@ void InvalidatorStorage::DeserializeMap(
}
}
+void InvalidatorStorage::SetInvalidatorClientId(const std::string& client_id) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ pref_service_->SetString(prefs::kInvalidatorInvalidatorClientId, client_id);
+}
+
+std::string InvalidatorStorage::GetInvalidatorClientId() const {
+ return pref_service_ ?
+ pref_service_->GetString(prefs::kInvalidatorInvalidatorClientId) : "";
+}
+
void InvalidatorStorage::SetBootstrapData(const std::string& data) {
DCHECK(thread_checker_.CalledOnValidThread());
std::string base64_data;
@@ -275,6 +288,7 @@ std::string InvalidatorStorage::GetBootstrapData() const {
void InvalidatorStorage::Clear() {
DCHECK(thread_checker_.CalledOnValidThread());
pref_service_->ClearPref(prefs::kInvalidatorMaxInvalidationVersions);
+ pref_service_->ClearPref(prefs::kInvalidatorInvalidatorClientId);
pref_service_->ClearPref(prefs::kInvalidatorInvalidationState);
}
« no previous file with comments | « chrome/browser/sync/invalidations/invalidator_storage.h ('k') | chrome/browser/sync/profile_sync_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698