| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Keep this file in sync with the .proto files in this directory. | 5 // Keep this file in sync with the .proto files in this directory. |
| 6 | 6 |
| 7 #include "sync/protocol/proto_value_conversions.h" | 7 #include "sync/protocol/proto_value_conversions.h" |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 const sync_pb::DataTypeProgressMarker& proto) { | 860 const sync_pb::DataTypeProgressMarker& proto) { |
| 861 base::DictionaryValue* value = new base::DictionaryValue(); | 861 base::DictionaryValue* value = new base::DictionaryValue(); |
| 862 SET_INT32(data_type_id); | 862 SET_INT32(data_type_id); |
| 863 SET_BYTES(token); | 863 SET_BYTES(token); |
| 864 SET_INT64(timestamp_token_for_migration); | 864 SET_INT64(timestamp_token_for_migration); |
| 865 SET_STR(notification_hint); | 865 SET_STR(notification_hint); |
| 866 SET(get_update_triggers, GetUpdateTriggersToValue); | 866 SET(get_update_triggers, GetUpdateTriggersToValue); |
| 867 return value; | 867 return value; |
| 868 } | 868 } |
| 869 | 869 |
| 870 base::DictionaryValue* DataTypeContextToValue( |
| 871 const sync_pb::DataTypeContext& proto) { |
| 872 base::DictionaryValue* value = new base::DictionaryValue(); |
| 873 SET_INT32(data_type_id); |
| 874 SET_STR(context); |
| 875 SET_INT64(version); |
| 876 return value; |
| 877 } |
| 878 |
| 870 base::DictionaryValue* GetUpdatesCallerInfoToValue( | 879 base::DictionaryValue* GetUpdatesCallerInfoToValue( |
| 871 const sync_pb::GetUpdatesCallerInfo& proto) { | 880 const sync_pb::GetUpdatesCallerInfo& proto) { |
| 872 base::DictionaryValue* value = new base::DictionaryValue(); | 881 base::DictionaryValue* value = new base::DictionaryValue(); |
| 873 SET_ENUM(source, GetUpdatesSourceString); | 882 SET_ENUM(source, GetUpdatesSourceString); |
| 874 SET_BOOL(notifications_enabled); | 883 SET_BOOL(notifications_enabled); |
| 875 return value; | 884 return value; |
| 876 } | 885 } |
| 877 | 886 |
| 878 base::DictionaryValue* GetUpdatesMessageToValue( | 887 base::DictionaryValue* GetUpdatesMessageToValue( |
| 879 const sync_pb::GetUpdatesMessage& proto) { | 888 const sync_pb::GetUpdatesMessage& proto) { |
| 880 base::DictionaryValue* value = new base::DictionaryValue(); | 889 base::DictionaryValue* value = new base::DictionaryValue(); |
| 881 SET(caller_info, GetUpdatesCallerInfoToValue); | 890 SET(caller_info, GetUpdatesCallerInfoToValue); |
| 882 SET_BOOL(fetch_folders); | 891 SET_BOOL(fetch_folders); |
| 883 SET_INT32(batch_size); | 892 SET_INT32(batch_size); |
| 884 SET_REP(from_progress_marker, DataTypeProgressMarkerToValue); | 893 SET_REP(from_progress_marker, DataTypeProgressMarkerToValue); |
| 885 SET_BOOL(streaming); | 894 SET_BOOL(streaming); |
| 886 SET_BOOL(need_encryption_key); | 895 SET_BOOL(need_encryption_key); |
| 887 SET_BOOL(create_mobile_bookmarks_folder); | 896 SET_BOOL(create_mobile_bookmarks_folder); |
| 888 SET_ENUM(get_updates_origin, GetUpdatesOriginString); | 897 SET_ENUM(get_updates_origin, GetUpdatesOriginString); |
| 898 SET_REP(client_contexts, DataTypeContextToValue); |
| 889 return value; | 899 return value; |
| 890 } | 900 } |
| 891 | 901 |
| 892 base::DictionaryValue* ClientStatusToValue(const sync_pb::ClientStatus& proto) { | 902 base::DictionaryValue* ClientStatusToValue(const sync_pb::ClientStatus& proto) { |
| 893 base::DictionaryValue* value = new base::DictionaryValue(); | 903 base::DictionaryValue* value = new base::DictionaryValue(); |
| 894 SET_BOOL(hierarchy_conflict_detected); | 904 SET_BOOL(hierarchy_conflict_detected); |
| 895 return value; | 905 return value; |
| 896 } | 906 } |
| 897 | 907 |
| 898 base::DictionaryValue* EntryResponseToValue( | 908 base::DictionaryValue* EntryResponseToValue( |
| (...skipping 18 matching lines...) Expand all Loading... |
| 917 } | 927 } |
| 918 | 928 |
| 919 base::DictionaryValue* GetUpdatesResponseToValue( | 929 base::DictionaryValue* GetUpdatesResponseToValue( |
| 920 const sync_pb::GetUpdatesResponse& proto, | 930 const sync_pb::GetUpdatesResponse& proto, |
| 921 bool include_specifics) { | 931 bool include_specifics) { |
| 922 base::DictionaryValue* value = new base::DictionaryValue(); | 932 base::DictionaryValue* value = new base::DictionaryValue(); |
| 923 value->Set("entries", | 933 value->Set("entries", |
| 924 SyncEntitiesToValue(proto.entries(), include_specifics)); | 934 SyncEntitiesToValue(proto.entries(), include_specifics)); |
| 925 SET_INT64(changes_remaining); | 935 SET_INT64(changes_remaining); |
| 926 SET_REP(new_progress_marker, DataTypeProgressMarkerToValue); | 936 SET_REP(new_progress_marker, DataTypeProgressMarkerToValue); |
| 937 SET_REP(context_mutations, DataTypeContextToValue); |
| 927 return value; | 938 return value; |
| 928 } | 939 } |
| 929 | 940 |
| 930 base::DictionaryValue* ClientCommandToValue( | 941 base::DictionaryValue* ClientCommandToValue( |
| 931 const sync_pb::ClientCommand& proto) { | 942 const sync_pb::ClientCommand& proto) { |
| 932 base::DictionaryValue* value = new base::DictionaryValue(); | 943 base::DictionaryValue* value = new base::DictionaryValue(); |
| 933 SET_INT32(set_sync_poll_interval); | 944 SET_INT32(set_sync_poll_interval); |
| 934 SET_INT32(set_sync_long_poll_interval); | 945 SET_INT32(set_sync_long_poll_interval); |
| 935 SET_INT32(max_commit_batch_size); | 946 SET_INT32(max_commit_batch_size); |
| 936 SET_INT32(sessions_commit_delay_seconds); | 947 SET_INT32(sessions_commit_delay_seconds); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 #undef SET_BYTES | 1078 #undef SET_BYTES |
| 1068 #undef SET_INT32 | 1079 #undef SET_INT32 |
| 1069 #undef SET_INT64 | 1080 #undef SET_INT64 |
| 1070 #undef SET_INT64_REP | 1081 #undef SET_INT64_REP |
| 1071 #undef SET_STR | 1082 #undef SET_STR |
| 1072 #undef SET_STR_REP | 1083 #undef SET_STR_REP |
| 1073 | 1084 |
| 1074 #undef SET_FIELD | 1085 #undef SET_FIELD |
| 1075 | 1086 |
| 1076 } // namespace syncer | 1087 } // namespace syncer |
| OLD | NEW |