OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ | 7 #ifndef SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ |
8 #define SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ | 8 #define SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ |
9 | 9 |
10 #include "sync/base/sync_export.h" | 10 #include "sync/base/sync_export.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // TODO(akalin): Add has_* information. | 63 // TODO(akalin): Add has_* information. |
64 // | 64 // |
65 // TODO(akalin): Improve enum support. | 65 // TODO(akalin): Improve enum support. |
66 | 66 |
67 namespace syncer { | 67 namespace syncer { |
68 | 68 |
69 // Ownership of all returned DictionaryValues are transferred to the | 69 // Ownership of all returned DictionaryValues are transferred to the |
70 // caller. | 70 // caller. |
71 | 71 |
72 // TODO(akalin): Perhaps extend this to decrypt? | 72 // TODO(akalin): Perhaps extend this to decrypt? |
73 base::DictionaryValue* EncryptedDataToValue( | 73 SYNC_EXPORT_PRIVATE base::DictionaryValue* EncryptedDataToValue( |
74 const sync_pb::EncryptedData& encrypted_data); | 74 const sync_pb::EncryptedData& encrypted_data); |
75 | 75 |
76 // Sub-protocol of AppSpecifics. | 76 // Sub-protocol of AppSpecifics. |
77 base::DictionaryValue* AppSettingsToValue( | 77 SYNC_EXPORT_PRIVATE base::DictionaryValue* AppSettingsToValue( |
78 const sync_pb::AppNotificationSettings& app_notification_settings); | 78 const sync_pb::AppNotificationSettings& app_notification_settings); |
79 | 79 |
80 // Sub-protocols of SessionSpecifics. | 80 // Sub-protocols of SessionSpecifics. |
81 | 81 |
82 base::DictionaryValue* SessionHeaderToValue( | 82 SYNC_EXPORT_PRIVATE base::DictionaryValue* SessionHeaderToValue( |
83 const sync_pb::SessionHeader& session_header); | 83 const sync_pb::SessionHeader& session_header); |
84 | 84 |
85 base::DictionaryValue* SessionTabToValue( | 85 SYNC_EXPORT_PRIVATE base::DictionaryValue* SessionTabToValue( |
86 const sync_pb::SessionTab& session_tab); | 86 const sync_pb::SessionTab& session_tab); |
87 | 87 |
88 base::DictionaryValue* SessionWindowToValue( | 88 SYNC_EXPORT_PRIVATE base::DictionaryValue* SessionWindowToValue( |
89 const sync_pb::SessionWindow& session_window); | 89 const sync_pb::SessionWindow& session_window); |
90 | 90 |
91 base::DictionaryValue* TabNavigationToValue( | 91 SYNC_EXPORT_PRIVATE base::DictionaryValue* TabNavigationToValue( |
92 const sync_pb::TabNavigation& tab_navigation); | 92 const sync_pb::TabNavigation& tab_navigation); |
93 | 93 |
94 // Sub-protocol of PasswordSpecifics. | 94 // Sub-protocol of PasswordSpecifics. |
95 | 95 |
96 base::DictionaryValue* PasswordSpecificsDataToValue( | 96 SYNC_EXPORT_PRIVATE base::DictionaryValue* PasswordSpecificsDataToValue( |
97 const sync_pb::PasswordSpecificsData& password_specifics_data); | 97 const sync_pb::PasswordSpecificsData& password_specifics_data); |
98 | 98 |
99 // Sub-protocol of NigoriSpecifics. | 99 // Sub-protocol of NigoriSpecifics. |
100 | 100 |
101 base::DictionaryValue* DeviceInformationToValue( | 101 base::DictionaryValue* DeviceInformationToValue( |
102 const sync_pb::DeviceInformation& device_information); | 102 const sync_pb::DeviceInformation& device_information); |
103 | 103 |
104 // Sub-protocol of HistoryDeleteDirectiveSpecifics. | 104 // Sub-protocol of HistoryDeleteDirectiveSpecifics. |
105 | 105 |
106 base::DictionaryValue* GlobalIdDirectiveToValue( | 106 base::DictionaryValue* GlobalIdDirectiveToValue( |
107 const sync_pb::GlobalIdDirective& global_id_directive); | 107 const sync_pb::GlobalIdDirective& global_id_directive); |
108 | 108 |
109 base::DictionaryValue* TimeRangeDirectiveToValue( | 109 base::DictionaryValue* TimeRangeDirectiveToValue( |
110 const sync_pb::TimeRangeDirective& time_range_directive); | 110 const sync_pb::TimeRangeDirective& time_range_directive); |
111 | 111 |
112 // Sub-protocol of Experiments. | 112 // Sub-protocol of Experiments. |
113 | 113 |
114 base::DictionaryValue* KeystoreEncryptionToValue( | 114 base::DictionaryValue* KeystoreEncryptionToValue( |
115 const sync_pb::KeystoreEncryptionFlagsSpecifics& proto); | 115 const sync_pb::KeystoreEncryptionFlagsSpecifics& proto); |
116 | 116 |
117 // Main *SpecificsToValue functions. | 117 // Main *SpecificsToValue functions. |
118 | 118 |
119 base::DictionaryValue* AppNotificationToValue( | 119 SYNC_EXPORT_PRIVATE base::DictionaryValue* AppNotificationToValue( |
120 const sync_pb::AppNotification& app_notification_specifics); | 120 const sync_pb::AppNotification& app_notification_specifics); |
121 | 121 |
122 base::DictionaryValue* AppSettingSpecificsToValue( | 122 base::DictionaryValue* AppSettingSpecificsToValue( |
123 const sync_pb::AppSettingSpecifics& app_setting_specifics); | 123 const sync_pb::AppSettingSpecifics& app_setting_specifics); |
124 | 124 |
125 base::DictionaryValue* AppSpecificsToValue( | 125 SYNC_EXPORT_PRIVATE base::DictionaryValue* AppSpecificsToValue( |
126 const sync_pb::AppSpecifics& app_specifics); | 126 const sync_pb::AppSpecifics& app_specifics); |
127 | 127 |
128 base::DictionaryValue* AutofillSpecificsToValue( | 128 SYNC_EXPORT_PRIVATE base::DictionaryValue* AutofillSpecificsToValue( |
129 const sync_pb::AutofillSpecifics& autofill_specifics); | 129 const sync_pb::AutofillSpecifics& autofill_specifics); |
130 | 130 |
131 base::DictionaryValue* AutofillProfileSpecificsToValue( | 131 SYNC_EXPORT_PRIVATE base::DictionaryValue* AutofillProfileSpecificsToValue( |
132 const sync_pb::AutofillProfileSpecifics& autofill_profile_specifics); | 132 const sync_pb::AutofillProfileSpecifics& autofill_profile_specifics); |
133 | 133 |
134 base::DictionaryValue* BookmarkSpecificsToValue( | 134 SYNC_EXPORT_PRIVATE base::DictionaryValue* BookmarkSpecificsToValue( |
135 const sync_pb::BookmarkSpecifics& bookmark_specifics); | 135 const sync_pb::BookmarkSpecifics& bookmark_specifics); |
136 | 136 |
137 base::DictionaryValue* DeviceInfoSpecificsToValue( | 137 SYNC_EXPORT_PRIVATE base::DictionaryValue* DeviceInfoSpecificsToValue( |
138 const sync_pb::DeviceInfoSpecifics& device_info_specifics); | 138 const sync_pb::DeviceInfoSpecifics& device_info_specifics); |
139 | 139 |
140 base::DictionaryValue* ExperimentsSpecificsToValue( | 140 SYNC_EXPORT_PRIVATE base::DictionaryValue* ExperimentsSpecificsToValue( |
141 const sync_pb::ExperimentsSpecifics& proto); | 141 const sync_pb::ExperimentsSpecifics& proto); |
142 | 142 |
143 base::DictionaryValue* ExtensionSettingSpecificsToValue( | 143 SYNC_EXPORT_PRIVATE base::DictionaryValue* ExtensionSettingSpecificsToValue( |
144 const sync_pb::ExtensionSettingSpecifics& extension_setting_specifics); | 144 const sync_pb::ExtensionSettingSpecifics& extension_setting_specifics); |
145 | 145 |
146 base::DictionaryValue* ExtensionSpecificsToValue( | 146 SYNC_EXPORT_PRIVATE base::DictionaryValue* ExtensionSpecificsToValue( |
147 const sync_pb::ExtensionSpecifics& extension_specifics); | 147 const sync_pb::ExtensionSpecifics& extension_specifics); |
148 | 148 |
149 SYNC_EXPORT base::DictionaryValue* HistoryDeleteDirectiveSpecificsToValue( | 149 SYNC_EXPORT base::DictionaryValue* HistoryDeleteDirectiveSpecificsToValue( |
150 const sync_pb::HistoryDeleteDirectiveSpecifics& | 150 const sync_pb::HistoryDeleteDirectiveSpecifics& |
151 history_delete_directive_specifics); | 151 history_delete_directive_specifics); |
152 | 152 |
153 base::DictionaryValue* NigoriSpecificsToValue( | 153 SYNC_EXPORT_PRIVATE base::DictionaryValue* NigoriSpecificsToValue( |
154 const sync_pb::NigoriSpecifics& nigori_specifics); | 154 const sync_pb::NigoriSpecifics& nigori_specifics); |
155 | 155 |
156 base::DictionaryValue* PasswordSpecificsToValue( | 156 SYNC_EXPORT_PRIVATE base::DictionaryValue* PasswordSpecificsToValue( |
157 const sync_pb::PasswordSpecifics& password_specifics); | 157 const sync_pb::PasswordSpecifics& password_specifics); |
158 | 158 |
159 base::DictionaryValue* PreferenceSpecificsToValue( | 159 SYNC_EXPORT_PRIVATE base::DictionaryValue* PreferenceSpecificsToValue( |
160 const sync_pb::PreferenceSpecifics& password_specifics); | 160 const sync_pb::PreferenceSpecifics& password_specifics); |
161 | 161 |
162 base::DictionaryValue* SearchEngineSpecificsToValue( | 162 SYNC_EXPORT_PRIVATE base::DictionaryValue* SearchEngineSpecificsToValue( |
163 const sync_pb::SearchEngineSpecifics& search_engine_specifics); | 163 const sync_pb::SearchEngineSpecifics& search_engine_specifics); |
164 | 164 |
165 base::DictionaryValue* SessionSpecificsToValue( | 165 SYNC_EXPORT_PRIVATE base::DictionaryValue* SessionSpecificsToValue( |
166 const sync_pb::SessionSpecifics& session_specifics); | 166 const sync_pb::SessionSpecifics& session_specifics); |
167 | 167 |
168 base::DictionaryValue* ThemeSpecificsToValue( | 168 SYNC_EXPORT_PRIVATE base::DictionaryValue* ThemeSpecificsToValue( |
169 const sync_pb::ThemeSpecifics& theme_specifics); | 169 const sync_pb::ThemeSpecifics& theme_specifics); |
170 | 170 |
171 base::DictionaryValue* TypedUrlSpecificsToValue( | 171 SYNC_EXPORT_PRIVATE base::DictionaryValue* TypedUrlSpecificsToValue( |
172 const sync_pb::TypedUrlSpecifics& typed_url_specifics); | 172 const sync_pb::TypedUrlSpecifics& typed_url_specifics); |
173 | 173 |
174 // Any present extensions are mapped to sub-dictionary values with the | 174 // Any present extensions are mapped to sub-dictionary values with the |
175 // key equal to the extension name. | 175 // key equal to the extension name. |
176 base::DictionaryValue* EntitySpecificsToValue( | 176 SYNC_EXPORT_PRIVATE base::DictionaryValue* EntitySpecificsToValue( |
177 const sync_pb::EntitySpecifics& specifics); | 177 const sync_pb::EntitySpecifics& specifics); |
178 | 178 |
179 base::DictionaryValue* ClientToServerMessageToValue( | 179 SYNC_EXPORT_PRIVATE base::DictionaryValue* ClientToServerMessageToValue( |
180 const sync_pb::ClientToServerMessage& proto, | 180 const sync_pb::ClientToServerMessage& proto, |
181 bool include_specifics); | 181 bool include_specifics); |
182 | 182 |
183 base::DictionaryValue* ClientToServerResponseToValue( | 183 SYNC_EXPORT_PRIVATE base::DictionaryValue* ClientToServerResponseToValue( |
184 const sync_pb::ClientToServerResponse& proto, | 184 const sync_pb::ClientToServerResponse& proto, |
185 bool include_specifics); | 185 bool include_specifics); |
186 | 186 |
187 base::DictionaryValue* DatatypeAssociationStatsToValue( | 187 base::DictionaryValue* DatatypeAssociationStatsToValue( |
188 const sync_pb::DatatypeAssociationStats& proto); | 188 const sync_pb::DatatypeAssociationStats& proto); |
189 | 189 |
190 base::DictionaryValue* DebugEventInfoToValue( | 190 base::DictionaryValue* DebugEventInfoToValue( |
191 const sync_pb::DebugEventInfo& proto); | 191 const sync_pb::DebugEventInfo& proto); |
192 | 192 |
193 base::DictionaryValue* DebugInfoToValue( | 193 base::DictionaryValue* DebugInfoToValue( |
194 const sync_pb::DebugInfo& proto); | 194 const sync_pb::DebugInfo& proto); |
195 | 195 |
196 base::DictionaryValue* SyncCycleCompletedEventInfoToValue( | 196 base::DictionaryValue* SyncCycleCompletedEventInfoToValue( |
197 const sync_pb::SyncCycleCompletedEventInfo& proto); | 197 const sync_pb::SyncCycleCompletedEventInfo& proto); |
198 | 198 |
199 } // namespace syncer | 199 } // namespace syncer |
200 | 200 |
201 #endif // SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ | 201 #endif // SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ |
OLD | NEW |