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

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

Issue 10451060: sync: migrate invalidation state from syncable::Directory to InvalidationStorage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: include order Created 8 years, 7 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 e2eb055701f1c67c8781d6c5f750db58dee28932..e82dd0e08751366fd4c7476286baa743958a8fdd 100644
--- a/chrome/browser/sync/invalidations/invalidator_storage.cc
+++ b/chrome/browser/sync/invalidations/invalidator_storage.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/sync/invalidations/invalidator_storage.h"
+#include "base/base64.h"
#include "base/logging.h"
#include "base/string_number_conversions.h"
#include "base/values.h"
@@ -115,16 +116,19 @@ void InvalidatorStorage::SerializeMap(
}
std::string InvalidatorStorage::GetInvalidationState() const {
- DLOG(WARNING) << "TODO(tim): Wire this up. Bug 124140.";
- return pref_service_ ?
- pref_service_->GetString(prefs::kInvalidatorInvalidationState) : "";
+ std::string utf8_state(pref_service_ ?
+ pref_service_->GetString(prefs::kInvalidatorInvalidationState) : "");
+ std::string state_data;
+ base::Base64Decode(utf8_state, &state_data);
+ return state_data;
}
void InvalidatorStorage::SetInvalidationState(const std::string& state) {
- DLOG(WARNING) << "TODO(tim): Wire this up. Bug 124140.";
DCHECK(non_thread_safe_.CalledOnValidThread());
+ std::string utf8_state;
+ base::Base64Encode(state, &utf8_state);
pref_service_->SetString(prefs::kInvalidatorInvalidationState,
- state);
+ utf8_state);
}
void InvalidatorStorage::Clear() {

Powered by Google App Engine
This is Rietveld 408576698