Chromium Code Reviews| 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..e9a485c94110d6536d23cfab53e91631f842abcc 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()) { \ |
|
rlarocque
2013/03/18 18:48:11
nit: align slashes.
Nicolas Zea
2013/03/18 19:12:18
Done.
|
| + 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; |
| } |