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

Unified Diff: sync/syncable/model_type_payload_map.cc

Issue 10197004: [Sync] Convert SyncSessionSnapshot to a copy-able class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 8 years, 8 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
« no previous file with comments | « sync/sync.gyp ('k') | sync/syncable/model_type_payload_map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/model_type_payload_map.cc
diff --git a/sync/syncable/model_type_payload_map.cc b/sync/syncable/model_type_payload_map.cc
index 99502b096db4da611d8f43ce96f93f624029b351..1485cec04843fee5db348794bcccd09201fdc833 100644
--- a/sync/syncable/model_type_payload_map.cc
+++ b/sync/syncable/model_type_payload_map.cc
@@ -6,6 +6,7 @@
#include <vector>
+#include "base/base64.h"
#include "base/json/json_writer.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
@@ -59,7 +60,11 @@ DictionaryValue* ModelTypePayloadMapToValue(
DictionaryValue* value = new DictionaryValue();
for (ModelTypePayloadMap::const_iterator it = type_payloads.begin();
it != type_payloads.end(); ++it) {
- value->SetString(syncable::ModelTypeToString(it->first), it->second);
+ // TODO(akalin): Unpack the value into a protobuf.
+ std::string base64_marker;
+ bool encoded = base::Base64Encode(it->second, &base64_marker);
+ DCHECK(encoded);
+ value->SetString(syncable::ModelTypeToString(it->first), base64_marker);
}
return value;
}
« no previous file with comments | « sync/sync.gyp ('k') | sync/syncable/model_type_payload_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698