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

Side by Side Diff: components/sync/protocol/proto_visitors.h

Issue 2374223003: Sync MDP: reimplement value conversions ontop of visitors
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « components/sync/protocol/proto_value_conversions_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Keep this file in sync with the .proto files in this directory.
6
7 #ifndef COMPONENTS_SYNC_PROTOCOL_PROTO_VALUE_VISITOR_CONVERSIONS_H_
8 #define COMPONENTS_SYNC_PROTOCOL_PROTO_VALUE_VISITOR_CONVERSIONS_H_
9
10 #include "components/sync/protocol/app_list_specifics.pb.h"
11 #include "components/sync/protocol/app_notification_specifics.pb.h"
12 #include "components/sync/protocol/app_setting_specifics.pb.h"
13 #include "components/sync/protocol/app_specifics.pb.h"
14 #include "components/sync/protocol/arc_package_specifics.pb.h"
15 #include "components/sync/protocol/autofill_specifics.pb.h"
16 #include "components/sync/protocol/bookmark_specifics.pb.h"
17 #include "components/sync/protocol/dictionary_specifics.pb.h"
18 #include "components/sync/protocol/encryption.pb.h"
19 #include "components/sync/protocol/entity_metadata.pb.h"
20 #include "components/sync/protocol/experiments_specifics.pb.h"
21 #include "components/sync/protocol/extension_setting_specifics.pb.h"
22 #include "components/sync/protocol/extension_specifics.pb.h"
23 #include "components/sync/protocol/favicon_image_specifics.pb.h"
24 #include "components/sync/protocol/favicon_tracking_specifics.pb.h"
25 #include "components/sync/protocol/history_delete_directive_specifics.pb.h"
26 #include "components/sync/protocol/nigori_specifics.pb.h"
27 #include "components/sync/protocol/password_specifics.pb.h"
28 #include "components/sync/protocol/preference_specifics.pb.h"
29 #include "components/sync/protocol/printer_specifics.pb.h"
30 #include "components/sync/protocol/priority_preference_specifics.pb.h"
31 #include "components/sync/protocol/proto_enum_conversions.h"
32 #include "components/sync/protocol/reading_list_specifics.pb.h"
33 #include "components/sync/protocol/search_engine_specifics.pb.h"
34 #include "components/sync/protocol/session_specifics.pb.h"
35 #include "components/sync/protocol/sync.pb.h"
36 #include "components/sync/protocol/theme_specifics.pb.h"
37 #include "components/sync/protocol/typed_url_specifics.pb.h"
38 #include "components/sync/protocol/unique_position.pb.h"
39
40 #define VISIT_(Kind, field) \
41 if (proto.has_##field()) \
42 visitor.Visit##Kind(proto, #field, proto.field())
43
44 #define VISIT_BYTES(field) VISIT_(Bytes, field)
45 #define VISIT_ENUM(field) VISIT_(Enum, field)
46 #define VISIT(field) VISIT_(, field)
47
48 #define VISIT_REP(field) \
49 visitor.Visit(proto, #field, proto.field());
50
51 // TODO(dskiba): undef VISIT_* at the end
52
53 namespace syncer {
54
55 template <class V>
56 void VisitProtoFields(V& visitor, const sync_pb::EncryptedData& proto) {
57 VISIT(key_name);
58 // TODO(akalin): Shouldn't blob be of type bytes instead of string?
59 VISIT_BYTES(blob);
60 }
61
62 template <class V>
63 void VisitProtoFields(V& visitor, const sync_pb::PasswordSpecificsMetadata& prot o) {
64 VISIT(url);
65 }
66
67 template <class V>
68 void VisitProtoFields(V& visitor, const sync_pb::AppNotificationSettings& proto) {
69 VISIT(initial_setup_done);
70 VISIT(disabled);
71 VISIT(oauth_client_id);
72 }
73
74 template <class V>
75 void VisitProtoFields(V& visitor, const sync_pb::SessionHeader& proto) {
76 VISIT_REP(window);
77 VISIT(client_name);
78 VISIT_ENUM(device_type);
79 }
80
81 template <class V>
82 void VisitProtoFields(V& visitor, const sync_pb::SessionTab& proto) {
83 VISIT(tab_id);
84 VISIT(window_id);
85 VISIT(tab_visual_index);
86 VISIT(current_navigation_index);
87 VISIT(pinned);
88 VISIT(extension_app_id);
89 VISIT_REP(navigation);
90 VISIT_BYTES(favicon);
91 VISIT_ENUM(favicon_type);
92 VISIT(favicon_source);
93 VISIT_REP(variation_id);
94 }
95
96 template <class V>
97 void VisitProtoFields(V& visitor, const sync_pb::SessionWindow& proto) {
98 VISIT(window_id);
99 VISIT(selected_tab_index);
100 VISIT_REP(tab);
101 VISIT_ENUM(browser_type);
102 }
103
104 template <class V>
105 void VisitProtoFields(V& visitor, const sync_pb::TabNavigation& proto) {
106 VISIT(virtual_url);
107 VISIT(referrer);
108 VISIT(title);
109 VISIT_ENUM(page_transition);
110 VISIT_ENUM(redirect_type);
111 VISIT(unique_id);
112 VISIT(timestamp_msec);
113 VISIT(navigation_forward_back);
114 VISIT(navigation_from_address_bar);
115 VISIT(navigation_home_page);
116 VISIT(navigation_chain_start);
117 VISIT(navigation_chain_end);
118 VISIT(global_id);
119 VISIT(search_terms);
120 VISIT(favicon_url);
121 VISIT_ENUM(blocked_state);
122 VISIT_REP(content_pack_categories);
123 VISIT(http_status_code);
124 VISIT(obsolete_referrer_policy);
125 VISIT(is_restored);
126 VISIT_REP(navigation_redirect);
127 VISIT(last_navigation_redirect_url);
128 VISIT(correct_referrer_policy);
129 VISIT_ENUM(password_state);
130 }
131
132 template <class V>
133 void VisitProtoFields(V& visitor, const sync_pb::NavigationRedirect& proto) {
134 VISIT(url);
135 }
136
137 template <class V>
138 void VisitProtoFields(V& visitor, const sync_pb::PasswordSpecificsData& proto) {
139 VISIT(scheme);
140 VISIT(signon_realm);
141 VISIT(origin);
142 VISIT(action);
143 VISIT(username_element);
144 VISIT(username_value);
145 VISIT(password_element);
146 VISIT(preferred);
147 VISIT(date_created);
148 VISIT(blacklisted);
149 VISIT(type);
150 VISIT(times_used);
151 VISIT(display_name);
152 VISIT(avatar_url);
153 VISIT(federation_url);
154 }
155
156 template <class V>
157 void VisitProtoFields(V& visitor, const sync_pb::GlobalIdDirective& proto) {
158 VISIT_REP(global_id);
159 VISIT(start_time_usec);
160 VISIT(end_time_usec);
161 }
162
163 template <class V>
164 void VisitProtoFields(V& visitor, const sync_pb::TimeRangeDirective& proto) {
165 VISIT(start_time_usec);
166 VISIT(end_time_usec);
167 }
168
169 template <class V>
170 void VisitProtoFields(V& visitor, const sync_pb::AppListSpecifics& proto) {
171 VISIT(item_id);
172 VISIT_ENUM(item_type);
173 VISIT(item_name);
174 VISIT(parent_id);
175 VISIT(item_ordinal);
176 VISIT(item_pin_ordinal);
177 }
178
179 template <class V>
180 void VisitProtoFields(V& visitor, const sync_pb::ArcPackageSpecifics& proto) {
181 VISIT(package_name);
182 VISIT(package_version);
183 VISIT(last_backup_android_id);
184 VISIT(last_backup_time);
185 }
186
187 template <class V>
188 void VisitProtoFields(V& visitor, const sync_pb::PrinterPPDData& proto) {
189 VISIT(id);
190 VISIT(file_name);
191 VISIT(version_number);
192 VISIT(from_quirks_server);
193 }
194
195 template <class V>
196 void VisitProtoFields(V& visitor, const sync_pb::ReadingListSpecifics& proto) {
197 VISIT(entry_id);
198 VISIT(title);
199 VISIT(url);
200 VISIT(creation_time_us);
201 VISIT(update_time_us);
202 VISIT_ENUM(status);
203 }
204
205 template <class V>
206 void VisitProtoFields(V& visitor, const sync_pb::AppNotification& proto) {
207 VISIT(guid);
208 VISIT(app_id);
209 VISIT(creation_timestamp_ms);
210 VISIT(title);
211 VISIT(body_text);
212 VISIT(link_url);
213 VISIT(link_text);
214 }
215
216 template <class V>
217 void VisitProtoFields(V& visitor, const sync_pb::AppSettingSpecifics& proto) {
218 VISIT(extension_setting);
219 }
220
221 template <class V>
222 void VisitProtoFields(V& visitor, const sync_pb::LinkedAppIconInfo& proto) {
223 VISIT(url);
224 VISIT(size);
225 }
226
227 template <class V>
228 void VisitProtoFields(V& visitor, const sync_pb::AppSpecifics& proto) {
229 VISIT(extension);
230 VISIT(notification_settings);
231 VISIT(app_launch_ordinal);
232 VISIT(page_ordinal);
233 VISIT_ENUM(launch_type);
234 VISIT(bookmark_app_url);
235 VISIT(bookmark_app_description);
236 VISIT(bookmark_app_icon_color);
237 VISIT_REP(linked_app_icons);
238
239 }
240
241 template <class V>
242 void VisitProtoFields(V& visitor, const sync_pb::AutofillSpecifics& proto) {
243 VISIT(name);
244 VISIT(value);
245 VISIT_REP(usage_timestamp);
246 VISIT(profile);
247 }
248
249 template <class V>
250 void VisitProtoFields(V& visitor, const sync_pb::AutofillProfileSpecifics& proto ) {
251 VISIT(guid);
252 VISIT(origin);
253 VISIT(use_count);
254 VISIT(use_date);
255
256 VISIT_REP(name_first);
257 VISIT_REP(name_middle);
258 VISIT_REP(name_last);
259 VISIT_REP(name_full);
260 VISIT_REP(email_address);
261 VISIT(company_name);
262
263 VISIT(address_home_line1);
264 VISIT(address_home_line2);
265 VISIT(address_home_city);
266 VISIT(address_home_state);
267 VISIT(address_home_zip);
268 VISIT(address_home_country);
269
270 VISIT(address_home_street_address);
271 VISIT(address_home_sorting_code);
272 VISIT(address_home_dependent_locality);
273 VISIT(address_home_language_code);
274
275 VISIT_REP(phone_home_whole_number);
276 }
277
278 template <class V>
279 void VisitProtoFields(V& visitor, const sync_pb::WalletMetadataSpecifics& proto) {
280 VISIT_ENUM(type);
281 VISIT(id);
282 VISIT(use_count);
283 VISIT(use_date);
284 }
285
286 template <class V>
287 void VisitProtoFields(V& visitor, const sync_pb::AutofillWalletSpecifics& proto) {
288 VISIT_ENUM(type);
289 VISIT(masked_card);
290 VISIT(address);
291 }
292
293 template <class V>
294 void VisitProtoFields(V& visitor, const sync_pb::MetaInfo& proto) {
295 VISIT(key);
296 VISIT(value);
297 }
298
299 template <class V>
300 void VisitProtoFields(V& visitor, const sync_pb::BookmarkSpecifics& proto) {
301 VISIT(url);
302 VISIT_BYTES(favicon);
303 VISIT(title);
304 VISIT(creation_time_us);
305 VISIT(icon_url);
306 VISIT_REP(meta_info);
307 }
308
309 template <class V>
310 void VisitProtoFields(V& visitor, const sync_pb::DeviceInfoSpecifics& proto) {
311 VISIT(cache_guid);
312 VISIT(client_name);
313 VISIT_ENUM(device_type);
314 VISIT(sync_user_agent);
315 VISIT(chrome_version);
316 VISIT(signin_scoped_device_id);
317 }
318
319 template <class V>
320 void VisitProtoFields(V& visitor, const sync_pb::DictionarySpecifics& proto) {
321 VISIT(word);
322 }
323
324 template <class V>
325 void VisitProtoFields(V& visitor, const sync_pb::FaviconSyncFlags& proto) {
326 VISIT(enabled);
327 VISIT(favicon_sync_limit);
328 }
329
330 template <class V>
331 void VisitProtoFields(V& visitor, const sync_pb::KeystoreEncryptionFlags& proto) {
332 VISIT(enabled);
333 }
334
335 template <class V>
336 void VisitProtoFields(V& visitor, const sync_pb::HistoryDeleteDirectives& proto) {
337 VISIT(enabled);
338 }
339
340 template <class V>
341 void VisitProtoFields(V& visitor, const sync_pb::AutofillCullingFlags& proto) {
342 VISIT(enabled);
343 }
344
345 template <class V>
346 void VisitProtoFields(V& visitor, const sync_pb::PreCommitUpdateAvoidanceFlags& proto) {
347 VISIT(enabled);
348 }
349
350 template <class V>
351 void VisitProtoFields(V& visitor, const sync_pb::GcmChannelFlags& proto) {
352 VISIT(enabled);
353 }
354
355 template <class V>
356 void VisitProtoFields(V& visitor, const sync_pb::GcmInvalidationsFlags& proto) {
357 VISIT(enabled);
358 }
359
360 template <class V>
361 void VisitProtoFields(V& visitor, const sync_pb::ExperimentsSpecifics& proto) {
362 VISIT(keystore_encryption);
363 VISIT(history_delete_directives);
364 VISIT(autofill_culling);
365 VISIT(pre_commit_update_avoidance);
366 VISIT(favicon_sync);
367 VISIT(gcm_channel);
368 VISIT(gcm_invalidations);
369 }
370
371 template <class V>
372 void VisitProtoFields(V& visitor, const sync_pb::ExtensionSettingSpecifics& prot o) {
373 VISIT(extension_id);
374 VISIT(key);
375 VISIT(value);
376 }
377
378 template <class V>
379 void VisitProtoFields(V& visitor, const sync_pb::ExtensionSpecifics& proto) {
380 VISIT(id);
381 VISIT(version);
382 VISIT(update_url);
383 VISIT(enabled);
384 VISIT(incognito_enabled);
385 VISIT(name);
386 VISIT(remote_install);
387 VISIT(installed_by_custodian);
388 VISIT(all_urls_enabled);
389 VISIT(disable_reasons);
390 }
391
392 template <class V>
393 void VisitProtoFields(V& visitor, const sync_pb::FaviconData& proto) {
394 VISIT_BYTES(favicon);
395 VISIT(width);
396 VISIT(height);
397 }
398
399 template <class V>
400 void VisitProtoFields(V& visitor, const sync_pb::FaviconImageSpecifics& proto) {
401 VISIT(favicon_url);
402 VISIT(favicon_web);
403 VISIT(favicon_web_32);
404 VISIT(favicon_touch_64);
405 VISIT(favicon_touch_precomposed_64);
406 }
407
408 template <class V>
409 void VisitProtoFields(V& visitor, const sync_pb::FaviconTrackingSpecifics& proto ) {
410 VISIT(favicon_url);
411 VISIT(last_visit_time_ms);
412 VISIT(is_bookmarked);
413 }
414
415 template <class V>
416 void VisitProtoFields(V& visitor, const sync_pb::HistoryDeleteDirectiveSpecifics & proto) {
417 VISIT(global_id_directive);
418 VISIT(time_range_directive);
419 }
420
421 template <class V>
422 void VisitProtoFields(V& visitor, const sync_pb::ManagedUserSettingSpecifics& pr oto) {
423 VISIT(name);
424 VISIT(value);
425 }
426
427 template <class V>
428 void VisitProtoFields(V& visitor, const sync_pb::ManagedUserSpecifics& proto) {
429 VISIT(id);
430 VISIT(name);
431 VISIT(acknowledged);
432 VISIT(master_key);
433 VISIT(chrome_avatar);
434 VISIT(chromeos_avatar);
435 }
436
437 template <class V>
438 void VisitProtoFields(V& visitor, const sync_pb::ManagedUserSharedSettingSpecifi cs& proto) {
439 VISIT(mu_id);
440 VISIT(key);
441 VISIT(value);
442 VISIT(acknowledged);
443 }
444
445 template <class V>
446 void VisitProtoFields(V& visitor, const sync_pb::ManagedUserWhitelistSpecifics& proto) {
447 VISIT(id);
448 VISIT(name);
449 }
450
451 template <class V>
452 void VisitProtoFields(V& visitor, const sync_pb::NigoriSpecifics& proto) {
453 VISIT(encryption_keybag);
454 VISIT(keybag_is_frozen);
455 VISIT(encrypt_bookmarks);
456 VISIT(encrypt_preferences);
457 VISIT(encrypt_autofill_profile);
458 VISIT(encrypt_autofill);
459 VISIT(encrypt_themes);
460 VISIT(encrypt_typed_urls);
461 VISIT(encrypt_extension_settings);
462 VISIT(encrypt_extensions);
463 VISIT(encrypt_sessions);
464 VISIT(encrypt_app_settings);
465 VISIT(encrypt_apps);
466 VISIT(encrypt_search_engines);
467 VISIT(encrypt_dictionary);
468 VISIT(encrypt_articles);
469 VISIT(encrypt_app_list);
470 VISIT(encrypt_arc_package);
471 VISIT(encrypt_reading_list);
472 VISIT(encrypt_everything);
473 VISIT(server_only_was_missing_keystore_migration_time);
474 VISIT(sync_tab_favicons);
475 VISIT_ENUM(passphrase_type);
476 VISIT(keystore_decryptor_token);
477 VISIT(keystore_migration_time);
478 VISIT(custom_passphrase_time);
479 }
480
481 template <class V>
482 void VisitProtoFields(V& visitor, const sync_pb::ArticlePage& proto) {
483 VISIT(url);
484 }
485
486 template <class V>
487 void VisitProtoFields(V& visitor, const sync_pb::ArticleSpecifics& proto) {
488 VISIT(entry_id);
489 VISIT(title);
490 VISIT_REP(pages);
491 }
492
493 template <class V>
494 void VisitProtoFields(V& visitor, const sync_pb::PasswordSpecifics& proto) {
495 VISIT(encrypted);
496 VISIT(unencrypted_metadata);
497 }
498
499 template <class V>
500 void VisitProtoFields(V& visitor, const sync_pb::PreferenceSpecifics& proto) {
501 VISIT(name);
502 VISIT(value);
503 }
504
505 template <class V>
506 void VisitProtoFields(V& visitor, const sync_pb::PrinterSpecifics& proto) {
507 VISIT(id);
508 VISIT(display_name);
509 VISIT(description);
510 VISIT(manufacturer);
511 VISIT(model);
512 VISIT(uri);
513 VISIT(uuid);
514 VISIT(ppd);
515 }
516
517 template <class V>
518 void VisitProtoFields(V& visitor, const sync_pb::PriorityPreferenceSpecifics& pr oto) {
519 VISIT(preference);
520 }
521
522 template <class V>
523 void VisitProtoFields(V& visitor, const sync_pb::SyncedNotificationAppInfoSpecif ics& proto) {
524 }
525
526 template <class V>
527 void VisitProtoFields(V& visitor, const sync_pb::SyncedNotificationSpecifics& pr oto) {
528 }
529
530 template <class V>
531 void VisitProtoFields(V& visitor, const sync_pb::SearchEngineSpecifics& proto) {
532 VISIT(short_name);
533 VISIT(keyword);
534 VISIT(favicon_url);
535 VISIT(url);
536 VISIT(safe_for_autoreplace);
537 VISIT(originating_url);
538 VISIT(date_created);
539 VISIT(input_encodings);
540 VISIT(show_in_default_list);
541 VISIT(suggestions_url);
542 VISIT(prepopulate_id);
543 VISIT(autogenerate_keyword);
544 VISIT(instant_url);
545 VISIT(last_modified);
546 VISIT(sync_guid);
547 VISIT_REP(alternate_urls);
548 VISIT(search_terms_replacement_key);
549 VISIT(image_url);
550 VISIT(search_url_post_params);
551 VISIT(suggestions_url_post_params);
552 VISIT(instant_url_post_params);
553 VISIT(image_url_post_params);
554 VISIT(new_tab_url);
555 }
556
557 template <class V>
558 void VisitProtoFields(V& visitor, const sync_pb::SessionSpecifics& proto) {
559 VISIT(session_tag);
560 VISIT(header);
561 VISIT(tab);
562 VISIT(tab_node_id);
563 }
564
565 template <class V>
566 void VisitProtoFields(V& visitor, const sync_pb::ThemeSpecifics& proto) {
567 VISIT(use_custom_theme);
568 VISIT(use_system_theme_by_default);
569 VISIT(custom_theme_name);
570 VISIT(custom_theme_id);
571 VISIT(custom_theme_update_url);
572 }
573
574 template <class V>
575 void VisitProtoFields(V& visitor, const sync_pb::TypedUrlSpecifics& proto) {
576 VISIT(url);
577 VISIT(title);
578 VISIT(hidden);
579 VISIT_REP(visits);
580 VISIT_REP(visit_transitions);
581 }
582
583 template <class V>
584 void VisitProtoFields(V& visitor, const sync_pb::WalletMaskedCreditCard& proto) {
585 VISIT(id);
586 VISIT_ENUM(status);
587 VISIT(name_on_card);
588 VISIT_ENUM(type);
589 VISIT(last_four);
590 VISIT(exp_month);
591 VISIT(exp_year);
592 VISIT(billing_address_id);
593 }
594
595 template <class V>
596 void VisitProtoFields(V& visitor, const sync_pb::WalletPostalAddress& proto) {
597 VISIT(id);
598 VISIT(recipient_name);
599 VISIT(company_name);
600 VISIT_REP(street_address);
601 VISIT(address_1);
602 VISIT(address_2);
603 VISIT(address_3);
604 VISIT(address_4);
605 VISIT(postal_code);
606 VISIT(sorting_code);
607 VISIT(country_code);
608 VISIT(phone_number);
609 VISIT(language_code);
610 }
611
612 template <class V>
613 void VisitProtoFields(V& visitor, const sync_pb::WifiCredentialSpecifics& proto) {
614 VISIT_BYTES(ssid);
615 VISIT_ENUM(security_class);
616 VISIT_BYTES(passphrase);
617 }
618
619 template <class V>
620 void VisitProtoFields(V& visitor, const sync_pb::EntitySpecifics& proto) {
621 VISIT(app);
622 VISIT(app_list);
623 VISIT(app_notification);
624 VISIT(app_setting);
625 VISIT(arc_package);
626 VISIT(article);
627 VISIT(autofill);
628 VISIT(autofill_profile);
629 VISIT(autofill_wallet);
630 VISIT(wallet_metadata);
631 VISIT(bookmark);
632 VISIT(device_info);
633 VISIT(dictionary);
634 VISIT(experiments);
635 VISIT(extension);
636 VISIT(extension_setting);
637 VISIT(favicon_image);
638 VISIT(favicon_tracking);
639 VISIT(history_delete_directive);
640 VISIT(managed_user_setting);
641 VISIT(managed_user_shared_setting);
642 VISIT(managed_user);
643 VISIT(managed_user_whitelist);
644 VISIT(nigori);
645 VISIT(password);
646 VISIT(preference);
647 VISIT(printer);
648 VISIT(priority_preference);
649 VISIT(reading_list);
650 VISIT(search_engine);
651 VISIT(session);
652 VISIT(synced_notification);
653 VISIT(synced_notification_app_info);
654 VISIT(theme);
655 VISIT(typed_url);
656 VISIT(wifi_credential);
657 }
658
659 template <class V>
660 void VisitProtoFields(V& visitor, const sync_pb::SyncEntity& proto) {
661 VISIT(id_string);
662 VISIT(parent_id_string);
663 VISIT(old_parent_id);
664 VISIT(version);
665 VISIT(mtime);
666 VISIT(ctime);
667 VISIT(name);
668 VISIT(non_unique_name);
669 VISIT(sync_timestamp);
670 VISIT(server_defined_unique_tag);
671 VISIT(position_in_parent);
672 VISIT(unique_position);
673 VISIT(insert_after_item_id);
674 VISIT(deleted);
675 VISIT(originator_cache_guid);
676 VISIT(originator_client_item_id);
677 VISIT(specifics);
678 VISIT(folder);
679 VISIT(client_defined_unique_tag);
680 VISIT_REP(attachment_id);
681 }
682
683 template <class V>
684 void VisitProtoFields(V& visitor, const sync_pb::ChromiumExtensionsActivity& pro to) {
685 VISIT(extension_id);
686 VISIT(bookmark_writes_since_last_commit);
687 }
688
689 template <class V>
690 void VisitProtoFields(V& visitor, const sync_pb::CommitMessage& proto) {
691 VISIT_REP(entries);
692 VISIT(cache_guid);
693 VISIT_REP(extensions_activity);
694 VISIT(config_params);
695 }
696
697 template <class V>
698 void VisitProtoFields(V& visitor, const sync_pb::GetUpdateTriggers& proto) {
699 VISIT_REP(notification_hint);
700 VISIT(client_dropped_hints);
701 VISIT(invalidations_out_of_sync);
702 VISIT(local_modification_nudges);
703 VISIT(datatype_refresh_nudges);
704 }
705
706 template <class V>
707 void VisitProtoFields(V& visitor, const sync_pb::DataTypeProgressMarker& proto) {
708 VISIT(data_type_id);
709 VISIT_BYTES(token);
710 VISIT(timestamp_token_for_migration);
711 VISIT(notification_hint);
712 VISIT(get_update_triggers);
713 }
714
715 template <class V>
716 void VisitProtoFields(V& visitor, const sync_pb::DataTypeContext& proto) {
717 VISIT(data_type_id);
718 VISIT(context);
719 VISIT(version);
720 }
721
722 template <class V>
723 void VisitProtoFields(V& visitor, const sync_pb::GetUpdatesCallerInfo& proto) {
724 VISIT_ENUM(source);
725 VISIT(notifications_enabled);
726 }
727
728 template <class V>
729 void VisitProtoFields(V& visitor, const sync_pb::GetUpdatesMessage& proto) {
730 VISIT(caller_info);
731 VISIT(fetch_folders);
732 VISIT(batch_size);
733 VISIT_REP(from_progress_marker);
734 VISIT(streaming);
735 VISIT(need_encryption_key);
736 VISIT(create_mobile_bookmarks_folder);
737 VISIT_ENUM(get_updates_origin);
738 VISIT_REP(client_contexts);
739 }
740
741 template <class V>
742 void VisitProtoFields(V& visitor, const sync_pb::ClientStatus& proto) {
743 VISIT(hierarchy_conflict_detected);
744 }
745
746 template <class V>
747 void VisitProtoFields(V& visitor, const sync_pb::CommitResponse::EntryResponse& proto) {
748 VISIT_ENUM(response_type);
749 VISIT(id_string);
750 VISIT(parent_id_string);
751 VISIT(position_in_parent);
752 VISIT(version);
753 VISIT(name);
754 VISIT(error_message);
755 VISIT(mtime);
756 }
757
758 template <class V>
759 void VisitProtoFields(V& visitor, const sync_pb::CommitResponse& proto) {
760 VISIT_REP(entryresponse);
761 }
762
763 template <class V>
764 void VisitProtoFields(V& visitor, const sync_pb::GetUpdatesResponse& proto) {
765 VISIT_REP(entries)
766 VISIT(changes_remaining);
767 VISIT_REP(new_progress_marker);
768 VISIT_REP(context_mutations);
769 }
770
771 template <class V>
772 void VisitProtoFields(V& visitor, const sync_pb::ClientCommand& proto) {
773 VISIT(set_sync_poll_interval);
774 VISIT(set_sync_long_poll_interval);
775 VISIT(max_commit_batch_size);
776 VISIT(sessions_commit_delay_seconds);
777 VISIT(throttle_delay_seconds);
778 VISIT(client_invalidation_hint_buffer_size);
779 }
780
781 template <class V>
782 void VisitProtoFields(V& visitor, const sync_pb::ClientToServerResponse::Error& proto) {
783 VISIT_ENUM(error_type);
784 VISIT(error_description);
785 VISIT(url);
786 VISIT_ENUM(action);
787 }
788
789 template <class V>
790 void VisitProtoFields(V& visitor, const sync_pb::ClientToServerResponse& proto) {
791 VISIT(commit);
792 VISIT(get_updates);
793 VISIT(error);
794 VISIT_ENUM(error_code);
795 VISIT(error_message);
796 VISIT(store_birthday);
797 VISIT(client_command);
798 VISIT_REP(migrated_data_type_id);
799 }
800
801 template <class V>
802 void VisitProtoFields(V& visitor, const sync_pb::ClientToServerMessage& proto) {
803 VISIT(share);
804 VISIT(protocol_version);
805 VISIT(commit);
806 VISIT(get_updates);
807 VISIT(store_birthday);
808 VISIT(sync_problem_detected);
809 VISIT(debug_info);
810 VISIT(client_status);
811 }
812
813 template <class V>
814 void VisitProtoFields(V& visitor, const sync_pb::DatatypeAssociationStats& proto ) {
815 VISIT(data_type_id);
816 VISIT(num_local_items_before_association);
817 VISIT(num_sync_items_before_association);
818 VISIT(num_local_items_after_association);
819 VISIT(num_sync_items_after_association);
820 VISIT(num_local_items_added);
821 VISIT(num_local_items_deleted);
822 VISIT(num_local_items_modified);
823 VISIT(num_sync_items_added);
824 VISIT(num_sync_items_deleted);
825 VISIT(num_sync_items_modified);
826 VISIT(local_version_pre_association);
827 VISIT(sync_version_pre_association);
828 VISIT(had_error);
829 VISIT(download_wait_time_us);
830 VISIT(download_time_us);
831 VISIT(association_wait_time_for_high_priority_us);
832 VISIT(association_wait_time_for_same_priority_us);
833 }
834
835 template <class V>
836 void VisitProtoFields(V& visitor, const sync_pb::DebugEventInfo& proto) {
837 VISIT_ENUM(singleton_event);
838 VISIT(sync_cycle_completed_event_info);
839 VISIT(nudging_datatype);
840 VISIT_REP(datatypes_notified_from_server);
841 VISIT(datatype_association_stats);
842 }
843
844 template <class V>
845 void VisitProtoFields(V& visitor, const sync_pb::DebugInfo& proto) {
846 VISIT_REP(events);
847 VISIT(cryptographer_ready);
848 VISIT(cryptographer_has_pending_keys);
849 VISIT(events_dropped);
850 }
851
852 template <class V>
853 void VisitProtoFields(V& visitor, const sync_pb::SyncCycleCompletedEventInfo& pr oto) {
854 VISIT(num_encryption_conflicts);
855 VISIT(num_hierarchy_conflicts);
856 VISIT(num_server_conflicts);
857 VISIT(num_updates_downloaded);
858 VISIT(num_reflected_updates_downloaded);
859 VISIT(caller_info);
860 }
861
862 template <class V>
863 void VisitProtoFields(V& visitor, const sync_pb::ClientConfigParams& proto) {
864 VISIT_REP(enabled_type_ids);
865 VISIT(tabs_datatype_enabled);
866 VISIT(cookie_jar_mismatch);
867 }
868
869 template <class V>
870 void VisitProtoFields(V& visitor, const sync_pb::AttachmentIdProto& proto) {
871 VISIT(unique_id);
872 }
873
874 template <class V>
875 void VisitProtoFields(V& visitor, const sync_pb::EntityMetadata& proto) {
876 VISIT(client_tag_hash);
877 VISIT(server_id);
878 VISIT(is_deleted);
879 VISIT(sequence_number);
880 VISIT(acked_sequence_number);
881 VISIT(server_version);
882 VISIT(creation_time);
883 VISIT(modification_time);
884 VISIT(specifics_hash);
885 VISIT(base_specifics_hash);
886 }
887
888 } // namespace syncer
889
890 #endif // COMPONENTS_SYNC_PROTOCOL_PROTO_VALUE_VISITOR_CONVERSIONS_H_
OLDNEW
« no previous file with comments | « components/sync/protocol/proto_value_conversions_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698