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

Unified Diff: sync/protocol/proto_value_conversions.cc

Issue 12700016: [Sync] Add favicon sync experiment (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nit Created 7 years, 9 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/protocol/experiments_specifics.proto ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/protocol/proto_value_conversions.cc
diff --git a/sync/protocol/proto_value_conversions.cc b/sync/protocol/proto_value_conversions.cc
index 648e1fc881113eb210052878fa45bbc4be924e8d..ebb4d9568a8833563beea0565e046b6b2dead5a0 100644
--- a/sync/protocol/proto_value_conversions.cc
+++ b/sync/protocol/proto_value_conversions.cc
@@ -105,6 +105,15 @@ base::ListValue* MakeRepeatedValue(const F& fields, V* (*converter_fn)(T)) {
std::string >, \
base::StringValue>(proto.field(), \
MakeStringValue))
+#define SET_EXPERIMENT_ENABLED_FIELD(field) \
+ do { \
+ if (proto.has_##field() && \
+ proto.field().has_enabled()) { \
+ value->Set(#field, \
+ new base::FundamentalValue( \
+ proto.field().enabled())); \
+ } \
+ } while (0)
#define SET_FIELD(field, fn) \
do { \
@@ -208,13 +217,6 @@ base::DictionaryValue* PasswordSpecificsDataToValue(
return value;
}
-base::DictionaryValue* KeystoreEncryptionFlagsToValue(
- const sync_pb::KeystoreEncryptionFlags& proto) {
- base::DictionaryValue* value = new base::DictionaryValue();
- SET_BOOL(enabled);
- return value;
-}
-
base::DictionaryValue* GlobalIdDirectiveToValue(
const sync_pb::GlobalIdDirective& proto) {
base::DictionaryValue* value = new base::DictionaryValue();
@@ -339,7 +341,10 @@ base::DictionaryValue* DictionarySpecificsToValue(
base::DictionaryValue* ExperimentsSpecificsToValue(
const sync_pb::ExperimentsSpecifics& proto) {
base::DictionaryValue* value = new base::DictionaryValue();
- SET(keystore_encryption, KeystoreEncryptionFlagsToValue);
+ SET_EXPERIMENT_ENABLED_FIELD(keystore_encryption);
+ SET_EXPERIMENT_ENABLED_FIELD(history_delete_directives);
+ SET_EXPERIMENT_ENABLED_FIELD(autofill_culling);
+ SET_EXPERIMENT_ENABLED_FIELD(favicon_sync);
return value;
}
« no previous file with comments | « sync/protocol/experiments_specifics.proto ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698