proto_visitors.h 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478
  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. #ifndef COMPONENTS_SYNC_PROTOCOL_PROTO_VISITORS_H_
  5. #define COMPONENTS_SYNC_PROTOCOL_PROTO_VISITORS_H_
  6. #include "components/sync/base/model_type.h"
  7. #include "components/sync/protocol/app_list_specifics.pb.h"
  8. #include "components/sync/protocol/app_setting_specifics.pb.h"
  9. #include "components/sync/protocol/app_specifics.pb.h"
  10. #include "components/sync/protocol/arc_package_specifics.pb.h"
  11. #include "components/sync/protocol/autofill_offer_specifics.pb.h"
  12. #include "components/sync/protocol/autofill_specifics.pb.h"
  13. #include "components/sync/protocol/autofill_wallet_usage_specifics.pb.h"
  14. #include "components/sync/protocol/bookmark_specifics.pb.h"
  15. #include "components/sync/protocol/contact_info_specifics.pb.h"
  16. #include "components/sync/protocol/data_type_progress_marker.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/entity_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/history_delete_directive_specifics.pb.h"
  24. #include "components/sync/protocol/history_specifics.pb.h"
  25. #include "components/sync/protocol/model_type_state.pb.h"
  26. #include "components/sync/protocol/nigori_local_data.pb.h"
  27. #include "components/sync/protocol/nigori_specifics.pb.h"
  28. #include "components/sync/protocol/os_preference_specifics.pb.h"
  29. #include "components/sync/protocol/os_priority_preference_specifics.pb.h"
  30. #include "components/sync/protocol/password_specifics.pb.h"
  31. #include "components/sync/protocol/persisted_entity_data.pb.h"
  32. #include "components/sync/protocol/preference_specifics.pb.h"
  33. #include "components/sync/protocol/printer_specifics.pb.h"
  34. #include "components/sync/protocol/printers_authorization_server_specifics.pb.h"
  35. #include "components/sync/protocol/priority_preference_specifics.pb.h"
  36. #include "components/sync/protocol/proto_enum_conversions.h"
  37. #include "components/sync/protocol/reading_list_specifics.pb.h"
  38. #include "components/sync/protocol/saved_tab_group_specifics.pb.h"
  39. #include "components/sync/protocol/search_engine_specifics.pb.h"
  40. #include "components/sync/protocol/send_tab_to_self_specifics.pb.h"
  41. #include "components/sync/protocol/session_specifics.pb.h"
  42. #include "components/sync/protocol/sharing_message_specifics.pb.h"
  43. #include "components/sync/protocol/sync.pb.h"
  44. #include "components/sync/protocol/sync_entity.pb.h"
  45. #include "components/sync/protocol/sync_invalidations_payload.pb.h"
  46. #include "components/sync/protocol/theme_specifics.pb.h"
  47. #include "components/sync/protocol/typed_url_specifics.pb.h"
  48. #include "components/sync/protocol/unique_position.pb.h"
  49. #include "components/sync/protocol/user_consent_specifics.pb.h"
  50. #include "components/sync/protocol/user_event_specifics.pb.h"
  51. #include "components/sync/protocol/web_app_specifics.pb.h"
  52. #include "components/sync/protocol/webauthn_credential_specifics.pb.h"
  53. #include "components/sync/protocol/workspace_desk_specifics.pb.h"
  54. // This file implements VisitProtoFields() functions for sync protos.
  55. //
  56. // VisitProtoFields(visitor, proto) calls |visitor| for each field in
  57. // |proto|. When called, |visitor| gets passed |proto|, field name and
  58. // field value.
  59. //
  60. // VisitProtoFields() used to implement two distinctive features:
  61. // 1. Serialization into base::DictionaryValue
  62. // 2. Proto memory usage estimation
  63. //
  64. // To achieve that it's very important for VisitProtoFields() to be free
  65. // of any logic. It must just call visitor for each field in a proto.
  66. //
  67. // Logic (like clobbering sensitive fields) must be implemented in visitors.
  68. // For example see how ToValueVisitor (from proto_value_conversions.cc)
  69. // implements various customizations.
  70. #define VISIT_(Kind, field) \
  71. if (proto.has_##field()) \
  72. visitor.Visit##Kind(proto, #field, proto.field())
  73. // Generic version, calls visitor.Visit(). Handles almost everything except
  74. // for special cases below.
  75. #define VISIT(field) VISIT_(, field)
  76. // 'bytes' protobuf type maps to std::string, and is indistinguishable
  77. // from 'string' type. To solve that 'bytes' fields are special cased to
  78. // call visitor.VisitBytes().
  79. #define VISIT_BYTES(field) VISIT_(Bytes, field)
  80. // We could use template magic (std::is_enum) to handle enums, but that would
  81. // complicate visitors, and besides we already have special case for 'bytes',
  82. // so just add one more special case. Calls visitor.VisitEnum().
  83. #define VISIT_ENUM(field) VISIT_(Enum, field)
  84. // Repeated fields are always present, so there are no 'has_<field>' methods.
  85. // This macro unconditionally calls visitor.Visit().
  86. #define VISIT_REP(field) visitor.Visit(proto, #field, proto.field());
  87. #define VISIT_PROTO_FIELDS(proto) \
  88. template <class V> \
  89. void VisitProtoFields(V& visitor, proto)
  90. namespace syncer {
  91. VISIT_PROTO_FIELDS(const sync_pb::AppListSpecifics& proto) {
  92. VISIT(item_id);
  93. VISIT_ENUM(item_type);
  94. VISIT(item_name);
  95. VISIT(parent_id);
  96. VISIT(item_ordinal);
  97. VISIT(item_pin_ordinal);
  98. }
  99. VISIT_PROTO_FIELDS(const sync_pb::AppNotificationSettings& proto) {
  100. VISIT(initial_setup_done);
  101. VISIT(disabled);
  102. VISIT(oauth_client_id);
  103. }
  104. VISIT_PROTO_FIELDS(const sync_pb::AppSettingSpecifics& proto) {
  105. VISIT(extension_setting);
  106. }
  107. VISIT_PROTO_FIELDS(const sync_pb::AppSpecifics& proto) {
  108. VISIT(extension);
  109. VISIT(notification_settings);
  110. VISIT(app_launch_ordinal);
  111. VISIT(page_ordinal);
  112. VISIT_ENUM(launch_type);
  113. VISIT_REP(linked_app_icons);
  114. }
  115. VISIT_PROTO_FIELDS(const sync_pb::ArcPackageSpecifics& proto) {
  116. VISIT(package_name);
  117. VISIT(package_version);
  118. VISIT(last_backup_android_id);
  119. VISIT(last_backup_time);
  120. }
  121. VISIT_PROTO_FIELDS(const sync_pb::AutofillOfferSpecifics& proto) {
  122. VISIT(id);
  123. VISIT(offer_details_url);
  124. VISIT_REP(merchant_domain);
  125. VISIT_REP(merchant_app_package);
  126. VISIT(offer_expiry_date);
  127. VISIT(card_linked_offer_data);
  128. VISIT(promo_code_offer_data);
  129. VISIT(display_strings);
  130. VISIT(percentage_reward);
  131. VISIT(fixed_amount_reward);
  132. }
  133. VISIT_PROTO_FIELDS(
  134. const sync_pb::AutofillOfferSpecifics::CardLinkedOfferData& proto) {
  135. VISIT_REP(instrument_id);
  136. }
  137. VISIT_PROTO_FIELDS(
  138. const sync_pb::AutofillOfferSpecifics::PromoCodeOfferData& proto) {
  139. VISIT(promo_code);
  140. }
  141. VISIT_PROTO_FIELDS(
  142. const sync_pb::AutofillOfferSpecifics::DisplayStrings& proto) {
  143. VISIT(value_prop_text);
  144. VISIT(see_details_text_mobile);
  145. VISIT(see_details_text_desktop);
  146. VISIT(usage_instructions_text_mobile);
  147. VISIT(usage_instructions_text_desktop);
  148. }
  149. VISIT_PROTO_FIELDS(
  150. const sync_pb::AutofillOfferSpecifics::PercentageReward& proto) {
  151. VISIT(percentage);
  152. }
  153. VISIT_PROTO_FIELDS(
  154. const sync_pb::AutofillOfferSpecifics::FixedAmountReward& proto) {
  155. VISIT(amount);
  156. }
  157. VISIT_PROTO_FIELDS(const sync_pb::AutofillProfileSpecifics& proto) {
  158. VISIT(guid);
  159. VISIT(origin);
  160. VISIT(use_count);
  161. VISIT(use_date);
  162. VISIT(profile_label);
  163. VISIT_REP(name_honorific);
  164. VISIT_REP(name_first);
  165. VISIT_REP(name_middle);
  166. VISIT_REP(name_last_first);
  167. VISIT_REP(name_last_conjunction);
  168. VISIT_REP(name_last_second);
  169. VISIT_REP(name_last);
  170. VISIT_REP(name_full);
  171. VISIT_REP(name_full_with_honorific);
  172. VISIT_REP(name_honorific_status);
  173. VISIT_REP(name_first_status);
  174. VISIT_REP(name_middle_status);
  175. VISIT_REP(name_last_first_status);
  176. VISIT_REP(name_last_conjunction_status);
  177. VISIT_REP(name_last_second_status);
  178. VISIT_REP(name_last_status);
  179. VISIT_REP(name_full_status);
  180. VISIT_REP(name_full_with_honorific_status);
  181. VISIT_REP(email_address);
  182. VISIT(company_name);
  183. VISIT(address_home_line1);
  184. VISIT(address_home_line2);
  185. VISIT(address_home_city);
  186. VISIT(address_home_state);
  187. VISIT(address_home_zip);
  188. VISIT(address_home_country);
  189. VISIT(address_home_street_address);
  190. VISIT(address_home_sorting_code);
  191. VISIT(address_home_dependent_locality);
  192. VISIT(address_home_thoroughfare_name);
  193. VISIT(address_home_thoroughfare_number);
  194. VISIT(address_home_dependent_thoroughfare_name);
  195. VISIT(address_home_premise_name);
  196. VISIT(address_home_subpremise_name);
  197. VISIT_ENUM(address_home_city_status);
  198. VISIT_ENUM(address_home_state_status);
  199. VISIT_ENUM(address_home_zip_status);
  200. VISIT_ENUM(address_home_country_status);
  201. VISIT_ENUM(address_home_street_address_status);
  202. VISIT_ENUM(address_home_sorting_code_status);
  203. VISIT_ENUM(address_home_dependent_locality_status);
  204. VISIT_ENUM(address_home_thoroughfare_name_status);
  205. VISIT_ENUM(address_home_thoroughfare_number_status);
  206. VISIT_ENUM(address_home_dependent_thoroughfare_name_status);
  207. VISIT_ENUM(address_home_premise_name_status);
  208. VISIT_ENUM(address_home_subpremise_name_status);
  209. VISIT(address_home_language_code);
  210. VISIT_REP(phone_home_whole_number);
  211. VISIT(validity_state_bitfield);
  212. VISIT(disallow_settings_visible_updates);
  213. VISIT(birthdate_day);
  214. VISIT(birthdate_month);
  215. VISIT(birthdate_year);
  216. }
  217. VISIT_PROTO_FIELDS(const sync_pb::AutofillSpecifics& proto) {
  218. VISIT(name);
  219. VISIT(value);
  220. VISIT_REP(usage_timestamp);
  221. VISIT(profile);
  222. }
  223. VISIT_PROTO_FIELDS(const sync_pb::AutofillWalletUsageSpecifics& proto) {
  224. VISIT(guid);
  225. VISIT_ENUM(virtual_card_usage_data);
  226. VISIT_REP(retrieval_time_unix_epoch_micros);
  227. }
  228. VISIT_PROTO_FIELDS(
  229. const sync_pb::AutofillWalletUsageSpecifics::VirtualCardUsageData& proto) {
  230. VISIT(instrument_id);
  231. VISIT(virtual_card_last_four);
  232. VISIT(merchant_url);
  233. VISIT(merchant_app_package);
  234. }
  235. VISIT_PROTO_FIELDS(const sync_pb::AutofillWalletSpecifics& proto) {
  236. VISIT_ENUM(type);
  237. VISIT(masked_card);
  238. VISIT(address);
  239. VISIT(customer_data);
  240. VISIT(cloud_token_data);
  241. }
  242. VISIT_PROTO_FIELDS(const sync_pb::BookmarkSpecifics& proto) {
  243. VISIT(url);
  244. VISIT_BYTES(favicon);
  245. VISIT(guid);
  246. VISIT(legacy_canonicalized_title);
  247. VISIT(creation_time_us);
  248. VISIT(icon_url);
  249. VISIT_REP(meta_info);
  250. VISIT(full_title);
  251. VISIT(parent_guid);
  252. VISIT_ENUM(type);
  253. VISIT(unique_position);
  254. VISIT(last_used_time_us);
  255. }
  256. VISIT_PROTO_FIELDS(const sync_pb::ChromiumExtensionsActivity& proto) {
  257. VISIT(extension_id);
  258. VISIT(bookmark_writes_since_last_commit);
  259. }
  260. VISIT_PROTO_FIELDS(const sync_pb::ContactInfoSpecifics& proto) {
  261. VISIT(guid);
  262. VISIT(source);
  263. VISIT(use_count);
  264. VISIT(use_date_windows_epoch_micros);
  265. VISIT(profile_label);
  266. VISIT(name_honorific);
  267. VISIT(name_first);
  268. VISIT(name_middle);
  269. VISIT(name_last);
  270. VISIT(name_last_first);
  271. VISIT(name_last_conjunction);
  272. VISIT(name_last_second);
  273. VISIT(name_full);
  274. VISIT(name_full_with_honorific);
  275. VISIT(email_address);
  276. VISIT(company_name);
  277. VISIT(address_city);
  278. VISIT(address_state);
  279. VISIT(address_zip);
  280. VISIT(address_country);
  281. VISIT(address_street_address);
  282. VISIT(address_sorting_code);
  283. VISIT(address_dependent_locality);
  284. VISIT(address_language_code);
  285. VISIT(address_thoroughfare_name);
  286. VISIT(address_thoroughfare_number);
  287. VISIT(address_dependent_thoroughfare_name);
  288. VISIT(address_thoroughfare_and_dependent_thoroughfare_name);
  289. VISIT(address_premise_name);
  290. VISIT(address_subpremise_name);
  291. VISIT(address_apt_num);
  292. VISIT(address_floor);
  293. VISIT(phone_home_whole_number);
  294. VISIT(birthdate_day);
  295. VISIT(birthdate_month);
  296. VISIT(birthdate_year);
  297. }
  298. VISIT_PROTO_FIELDS(const sync_pb::ContactInfoSpecifics::TokenMetadata& proto) {
  299. VISIT_ENUM(status);
  300. }
  301. VISIT_PROTO_FIELDS(const sync_pb::ContactInfoSpecifics::StringToken& proto) {
  302. VISIT(value);
  303. VISIT(metadata);
  304. }
  305. VISIT_PROTO_FIELDS(const sync_pb::ContactInfoSpecifics::IntegerToken& proto) {
  306. VISIT(value);
  307. VISIT(metadata);
  308. }
  309. VISIT_PROTO_FIELDS(const sync_pb::CustomNudgeDelay& proto) {
  310. VISIT(datatype_id);
  311. VISIT(delay_ms);
  312. }
  313. VISIT_PROTO_FIELDS(const sync_pb::ClientCommand& proto) {
  314. VISIT(set_sync_poll_interval);
  315. VISIT(max_commit_batch_size);
  316. VISIT(sessions_commit_delay_seconds);
  317. VISIT(throttle_delay_seconds);
  318. VISIT(client_invalidation_hint_buffer_size);
  319. VISIT(gu_retry_delay_seconds);
  320. VISIT_REP(custom_nudge_delays);
  321. VISIT(extension_types_max_tokens);
  322. VISIT(extension_types_refill_interval_seconds);
  323. VISIT(extension_types_depleted_quota_nudge_delay_seconds);
  324. }
  325. VISIT_PROTO_FIELDS(const sync_pb::ClientConfigParams& proto) {
  326. VISIT_REP(enabled_type_ids);
  327. VISIT(tabs_datatype_enabled);
  328. VISIT(cookie_jar_mismatch);
  329. VISIT(single_client);
  330. VISIT_REP(devices_fcm_registration_tokens);
  331. VISIT(single_client_with_standalone_invalidations);
  332. VISIT_REP(fcm_registration_tokens_for_interested_clients);
  333. }
  334. VISIT_PROTO_FIELDS(const sync_pb::ClientStatus& proto) {
  335. VISIT(hierarchy_conflict_detected);
  336. VISIT(is_sync_feature_enabled);
  337. }
  338. VISIT_PROTO_FIELDS(const sync_pb::ClientToServerMessage& proto) {
  339. VISIT(share);
  340. VISIT(protocol_version);
  341. VISIT(commit);
  342. VISIT(get_updates);
  343. VISIT(store_birthday);
  344. VISIT(sync_problem_detected);
  345. VISIT(debug_info);
  346. VISIT(client_status);
  347. VISIT(invalidator_client_id);
  348. }
  349. VISIT_PROTO_FIELDS(const sync_pb::ClientToServerResponse& proto) {
  350. VISIT(commit);
  351. VISIT(get_updates);
  352. VISIT(error);
  353. VISIT_ENUM(error_code);
  354. VISIT(error_message);
  355. VISIT(store_birthday);
  356. VISIT(client_command);
  357. VISIT_REP(migrated_data_type_id);
  358. }
  359. VISIT_PROTO_FIELDS(const sync_pb::ClientToServerResponse::Error& proto) {
  360. VISIT_ENUM(error_type);
  361. VISIT(error_description);
  362. VISIT_ENUM(action);
  363. VISIT_REP(error_data_type_ids);
  364. }
  365. VISIT_PROTO_FIELDS(const sync_pb::CommitMessage& proto) {
  366. VISIT_REP(entries);
  367. VISIT(cache_guid);
  368. VISIT_REP(extensions_activity);
  369. VISIT(config_params);
  370. VISIT_REP(client_contexts);
  371. }
  372. VISIT_PROTO_FIELDS(const sync_pb::CommitResponse& proto) {
  373. VISIT_REP(entryresponse);
  374. }
  375. VISIT_PROTO_FIELDS(const sync_pb::CommitResponse::EntryResponse& proto) {
  376. VISIT_ENUM(response_type);
  377. VISIT(id_string);
  378. VISIT(version);
  379. VISIT(error_message);
  380. VISIT(mtime);
  381. }
  382. VISIT_PROTO_FIELDS(const sync_pb::DataTypeContext& proto) {
  383. VISIT(data_type_id);
  384. VISIT(context);
  385. VISIT(version);
  386. }
  387. VISIT_PROTO_FIELDS(const sync_pb::DataTypeProgressMarker& proto) {
  388. VISIT(data_type_id);
  389. VISIT_BYTES(token);
  390. VISIT(get_update_triggers);
  391. VISIT(gc_directive);
  392. }
  393. VISIT_PROTO_FIELDS(const sync_pb::GarbageCollectionDirective& proto) {
  394. VISIT(version_watermark);
  395. VISIT(age_watermark_in_days);
  396. }
  397. VISIT_PROTO_FIELDS(const sync_pb::DebugEventInfo& proto) {
  398. VISIT_ENUM(singleton_event);
  399. VISIT(sync_cycle_completed_event_info);
  400. VISIT(nudging_datatype);
  401. VISIT_REP(datatypes_notified_from_server);
  402. }
  403. VISIT_PROTO_FIELDS(const sync_pb::DebugInfo& proto) {
  404. VISIT_REP(events);
  405. VISIT(cryptographer_ready);
  406. VISIT(cryptographer_has_pending_keys);
  407. VISIT(events_dropped);
  408. }
  409. VISIT_PROTO_FIELDS(const sync_pb::DeviceInfoSpecifics& proto) {
  410. VISIT(cache_guid);
  411. VISIT(client_name);
  412. VISIT_ENUM(device_type);
  413. VISIT(sync_user_agent);
  414. VISIT(chrome_version);
  415. VISIT(signin_scoped_device_id);
  416. VISIT(model);
  417. VISIT(manufacturer);
  418. VISIT(last_updated_timestamp);
  419. VISIT(feature_fields);
  420. VISIT(sharing_fields);
  421. VISIT(invalidation_fields);
  422. VISIT(paask_fields);
  423. VISIT(full_hardware_class);
  424. VISIT(chrome_version_info);
  425. VISIT(google_play_services_version_info);
  426. }
  427. VISIT_PROTO_FIELDS(const sync_pb::FeatureSpecificFields& proto) {
  428. VISIT(send_tab_to_self_receiving_enabled);
  429. }
  430. VISIT_PROTO_FIELDS(const sync_pb::SharingSpecificFields& proto) {
  431. VISIT(vapid_fcm_token);
  432. VISIT_BYTES(vapid_p256dh);
  433. VISIT_BYTES(vapid_auth_secret);
  434. VISIT_REP(enabled_features);
  435. VISIT(sender_id_fcm_token_v2);
  436. VISIT_BYTES(sender_id_p256dh_v2);
  437. VISIT_BYTES(sender_id_auth_secret_v2);
  438. }
  439. VISIT_PROTO_FIELDS(const sync_pb::PhoneAsASecurityKeySpecificFields& proto) {
  440. VISIT(tunnel_server_domain);
  441. VISIT_BYTES(contact_id);
  442. VISIT(id);
  443. VISIT_BYTES(peer_public_key_x962);
  444. // |secret| is deliberately omitted to avoid including sensitive information
  445. // in debugging output, which might be included in bug reports etc.
  446. }
  447. VISIT_PROTO_FIELDS(const sync_pb::ChromeVersionInfo& proto) {
  448. VISIT(version_number);
  449. }
  450. VISIT_PROTO_FIELDS(const sync_pb::GooglePlayServicesVersionInfo& proto) {
  451. VISIT(apk_version_name);
  452. }
  453. VISIT_PROTO_FIELDS(const sync_pb::DictionarySpecifics& proto) {
  454. VISIT(word);
  455. }
  456. VISIT_PROTO_FIELDS(const sync_pb::EncryptedData& proto) {
  457. VISIT(key_name);
  458. VISIT_BYTES(blob);
  459. }
  460. VISIT_PROTO_FIELDS(const sync_pb::EntityMetadata& proto) {
  461. VISIT(client_tag_hash);
  462. VISIT(server_id);
  463. VISIT(is_deleted);
  464. VISIT(sequence_number);
  465. VISIT(acked_sequence_number);
  466. VISIT(server_version);
  467. VISIT(creation_time);
  468. VISIT(modification_time);
  469. VISIT(specifics_hash);
  470. VISIT(base_specifics_hash);
  471. VISIT(possibly_trimmed_base_specifics);
  472. }
  473. VISIT_PROTO_FIELDS(const sync_pb::EntitySpecifics& proto) {
  474. static_assert(40 == GetNumModelTypes(),
  475. "When adding a new protocol type, you will likely need to add "
  476. "it here as well.");
  477. VISIT(encrypted);
  478. VISIT(app);
  479. VISIT(app_list);
  480. VISIT(app_setting);
  481. VISIT(arc_package);
  482. VISIT(autofill);
  483. VISIT(autofill_offer);
  484. VISIT(autofill_profile);
  485. VISIT(autofill_wallet);
  486. VISIT(bookmark);
  487. VISIT(contact_info);
  488. VISIT(device_info);
  489. VISIT(dictionary);
  490. VISIT(extension);
  491. VISIT(extension_setting);
  492. VISIT(history);
  493. VISIT(history_delete_directive);
  494. VISIT(managed_user_setting);
  495. VISIT(nigori);
  496. VISIT(os_preference);
  497. VISIT(os_priority_preference);
  498. VISIT(password);
  499. VISIT(preference);
  500. VISIT(printer);
  501. VISIT(printers_authorization_server);
  502. VISIT(priority_preference);
  503. VISIT(reading_list);
  504. VISIT(search_engine);
  505. VISIT(security_event);
  506. VISIT(send_tab_to_self);
  507. VISIT(session);
  508. VISIT(sharing_message);
  509. VISIT(theme);
  510. VISIT(typed_url);
  511. VISIT(user_consent);
  512. VISIT(user_event);
  513. VISIT(wallet_metadata);
  514. VISIT(web_app);
  515. VISIT(wifi_configuration);
  516. VISIT(workspace_desk);
  517. VISIT(webauthn_credential);
  518. }
  519. VISIT_PROTO_FIELDS(const sync_pb::ExtensionSettingSpecifics& proto) {
  520. VISIT(extension_id);
  521. VISIT(key);
  522. VISIT(value);
  523. }
  524. VISIT_PROTO_FIELDS(const sync_pb::ExtensionSpecifics& proto) {
  525. VISIT(id);
  526. VISIT(version);
  527. VISIT(update_url);
  528. VISIT(enabled);
  529. VISIT(incognito_enabled);
  530. VISIT(remote_install);
  531. VISIT(all_urls_enabled);
  532. VISIT(disable_reasons);
  533. }
  534. VISIT_PROTO_FIELDS(const sync_pb::GetUpdateTriggers& proto) {
  535. VISIT_REP(notification_hint);
  536. VISIT(client_dropped_hints);
  537. VISIT(invalidations_out_of_sync);
  538. VISIT(local_modification_nudges);
  539. VISIT(datatype_refresh_nudges);
  540. VISIT(server_dropped_hints);
  541. VISIT(initial_sync_in_progress);
  542. VISIT(sync_for_resolve_conflict_in_progress);
  543. }
  544. VISIT_PROTO_FIELDS(const sync_pb::GetUpdatesCallerInfo& proto) {
  545. VISIT(notifications_enabled);
  546. }
  547. VISIT_PROTO_FIELDS(const sync_pb::GetUpdatesMessage& proto) {
  548. VISIT(caller_info);
  549. VISIT(fetch_folders);
  550. VISIT_REP(from_progress_marker);
  551. VISIT(streaming);
  552. VISIT(need_encryption_key);
  553. VISIT(create_mobile_bookmarks_folder);
  554. VISIT_ENUM(get_updates_origin);
  555. VISIT(is_retry);
  556. VISIT_REP(client_contexts);
  557. }
  558. VISIT_PROTO_FIELDS(const sync_pb::GetUpdatesResponse& proto) {
  559. VISIT_REP(entries)
  560. VISIT(changes_remaining);
  561. VISIT_REP(new_progress_marker);
  562. VISIT_REP(context_mutations);
  563. }
  564. VISIT_PROTO_FIELDS(const sync_pb::GlobalIdDirective& proto) {
  565. VISIT_REP(global_id);
  566. VISIT(start_time_usec);
  567. VISIT(end_time_usec);
  568. }
  569. VISIT_PROTO_FIELDS(const sync_pb::HistoryDeleteDirectiveSpecifics& proto) {
  570. VISIT(global_id_directive);
  571. VISIT(time_range_directive);
  572. VISIT(url_directive);
  573. }
  574. VISIT_PROTO_FIELDS(const sync_pb::InvalidationSpecificFields& proto) {
  575. VISIT(instance_id_token);
  576. VISIT_REP(interested_data_type_ids);
  577. }
  578. VISIT_PROTO_FIELDS(const sync_pb::LinkedAppIconInfo& proto) {
  579. VISIT(url);
  580. VISIT(size);
  581. }
  582. VISIT_PROTO_FIELDS(const sync_pb::ManagedUserSettingSpecifics& proto) {
  583. VISIT(name);
  584. VISIT(value);
  585. }
  586. VISIT_PROTO_FIELDS(const sync_pb::MetaInfo& proto) {
  587. VISIT(key);
  588. VISIT(value);
  589. }
  590. VISIT_PROTO_FIELDS(const sync_pb::ModelTypeState& proto) {
  591. VISIT(progress_marker);
  592. VISIT(type_context);
  593. VISIT(encryption_key_name);
  594. VISIT(initial_sync_done);
  595. VISIT(cache_guid);
  596. VISIT(authenticated_account_id);
  597. }
  598. VISIT_PROTO_FIELDS(const sync_pb::NavigationRedirect& proto) {
  599. VISIT(url);
  600. }
  601. VISIT_PROTO_FIELDS(const sync_pb::ReplacedNavigation& proto) {
  602. VISIT(first_committed_url);
  603. VISIT(first_timestamp_msec);
  604. VISIT_ENUM(first_page_transition);
  605. }
  606. VISIT_PROTO_FIELDS(const sync_pb::CryptographerData& proto) {
  607. VISIT(key_bag);
  608. VISIT(default_key_name);
  609. }
  610. VISIT_PROTO_FIELDS(const sync_pb::CustomPassphraseKeyDerivationParams& proto) {
  611. VISIT(custom_passphrase_key_derivation_method);
  612. VISIT(custom_passphrase_key_derivation_salt);
  613. }
  614. VISIT_PROTO_FIELDS(const sync_pb::NigoriModel& proto) {
  615. VISIT(cryptographer_data);
  616. VISIT(current_keystore_key_name);
  617. VISIT(pending_keys);
  618. VISIT(passphrase_type);
  619. VISIT(keystore_migration_time);
  620. VISIT(custom_passphrase_time);
  621. VISIT(custom_passphrase_key_derivation_params);
  622. VISIT(encrypt_everything);
  623. VISIT_REP(encrypted_types_specifics_field_number);
  624. VISIT_REP(keystore_key);
  625. VISIT(pending_keystore_decryptor_token);
  626. VISIT(last_default_trusted_vault_key_name);
  627. VISIT(trusted_vault_debug_info);
  628. }
  629. VISIT_PROTO_FIELDS(const sync_pb::NigoriLocalData& proto) {
  630. VISIT(model_type_state);
  631. VISIT(entity_metadata);
  632. VISIT(nigori_model);
  633. }
  634. VISIT_PROTO_FIELDS(const sync_pb::NigoriSpecifics& proto) {
  635. VISIT(encryption_keybag);
  636. VISIT(keybag_is_frozen);
  637. VISIT(encrypt_bookmarks);
  638. VISIT(encrypt_preferences);
  639. VISIT(encrypt_autofill_profile);
  640. VISIT(encrypt_autofill);
  641. VISIT(encrypt_themes);
  642. VISIT(encrypt_typed_urls);
  643. VISIT(encrypt_extension_settings);
  644. VISIT(encrypt_extensions);
  645. VISIT(encrypt_sessions);
  646. VISIT(encrypt_app_settings);
  647. VISIT(encrypt_apps);
  648. VISIT(encrypt_search_engines);
  649. VISIT(encrypt_dictionary);
  650. VISIT(encrypt_app_list);
  651. VISIT(encrypt_arc_package);
  652. VISIT(encrypt_reading_list);
  653. VISIT(encrypt_everything);
  654. VISIT(server_only_was_missing_keystore_migration_time);
  655. VISIT(sync_tab_favicons);
  656. VISIT(passphrase_type);
  657. VISIT(keystore_decryptor_token);
  658. VISIT(keystore_migration_time);
  659. VISIT(custom_passphrase_time);
  660. VISIT(custom_passphrase_key_derivation_method);
  661. VISIT(custom_passphrase_key_derivation_salt);
  662. VISIT(trusted_vault_debug_info);
  663. }
  664. VISIT_PROTO_FIELDS(const sync_pb::WebauthnCredentialSpecifics& proto) {
  665. VISIT_BYTES(sync_id);
  666. VISIT_BYTES(credential_id);
  667. VISIT(rp_id);
  668. VISIT_BYTES(user_id);
  669. VISIT_REP(newly_shadowed_credential_ids);
  670. VISIT(creation_time);
  671. VISIT(user_name);
  672. VISIT(user_display_name);
  673. VISIT(third_party_payments_support);
  674. // |private_key| is deliberately omitted to avoid including sensitive
  675. // information in debugging output, which might be included in bug reports
  676. // etc.
  677. }
  678. VISIT_PROTO_FIELDS(const sync_pb::HistorySpecifics::PageTransition& proto) {
  679. VISIT_ENUM(core_transition);
  680. VISIT(blocked);
  681. VISIT(forward_back);
  682. VISIT(from_address_bar);
  683. VISIT(home_page);
  684. }
  685. VISIT_PROTO_FIELDS(const sync_pb::HistorySpecifics::RedirectEntry& proto) {
  686. VISIT(originator_visit_id);
  687. VISIT(url);
  688. VISIT(title);
  689. VISIT(hidden);
  690. VISIT_ENUM(redirect_type);
  691. }
  692. VISIT_PROTO_FIELDS(const sync_pb::HistorySpecifics& proto) {
  693. VISIT(visit_time_windows_epoch_micros);
  694. VISIT(originator_cache_guid);
  695. VISIT_REP(redirect_entries);
  696. VISIT(page_transition);
  697. VISIT(originator_referring_visit_id);
  698. VISIT(originator_opener_visit_id);
  699. VISIT(visit_duration_micros);
  700. VISIT_ENUM(browser_type);
  701. VISIT(window_id);
  702. VISIT(tab_id);
  703. VISIT(task_id);
  704. VISIT(root_task_id);
  705. VISIT(parent_task_id);
  706. VISIT(http_response_code);
  707. VISIT(page_language);
  708. VISIT_ENUM(password_state);
  709. }
  710. VISIT_PROTO_FIELDS(
  711. const sync_pb::NigoriSpecifics::TrustedVaultDebugInfo& proto) {
  712. VISIT(migration_time);
  713. VISIT(key_version);
  714. }
  715. VISIT_PROTO_FIELDS(const sync_pb::OsPreferenceSpecifics& proto) {
  716. VISIT(preference);
  717. }
  718. VISIT_PROTO_FIELDS(const sync_pb::OsPriorityPreferenceSpecifics& proto) {
  719. VISIT(preference);
  720. }
  721. VISIT_PROTO_FIELDS(const sync_pb::PasswordSpecifics& proto) {
  722. VISIT(encrypted);
  723. VISIT(unencrypted_metadata);
  724. VISIT(client_only_encrypted_data);
  725. VISIT(encrypted_notes_backup);
  726. }
  727. VISIT_PROTO_FIELDS(const sync_pb::PasswordSpecificsData& proto) {
  728. VISIT(scheme);
  729. VISIT(signon_realm);
  730. VISIT(origin);
  731. VISIT(action);
  732. VISIT(username_element);
  733. VISIT(username_value);
  734. VISIT(password_element);
  735. VISIT(password_value);
  736. VISIT(preferred);
  737. VISIT(date_created);
  738. VISIT(blacklisted);
  739. VISIT(type);
  740. VISIT(times_used);
  741. VISIT(display_name);
  742. VISIT(avatar_url);
  743. VISIT(federation_url);
  744. VISIT(date_last_used);
  745. VISIT(password_issues);
  746. VISIT(date_password_modified_windows_epoch_micros);
  747. VISIT(notes);
  748. }
  749. VISIT_PROTO_FIELDS(const sync_pb::PasswordSpecificsData_PasswordIssues& proto) {
  750. VISIT(leaked_password_issue);
  751. VISIT(reused_password_issue);
  752. VISIT(weak_password_issue);
  753. VISIT(phished_password_issue);
  754. }
  755. VISIT_PROTO_FIELDS(
  756. const sync_pb::PasswordSpecificsData_PasswordIssues_PasswordIssue& proto) {
  757. VISIT(date_first_detection_microseconds);
  758. VISIT(is_muted);
  759. }
  760. VISIT_PROTO_FIELDS(const sync_pb::PasswordSpecificsData_Notes& proto) {
  761. VISIT_REP(note);
  762. }
  763. VISIT_PROTO_FIELDS(const sync_pb::PasswordSpecificsData_Notes_Note& proto) {
  764. VISIT(unique_display_name);
  765. VISIT(value);
  766. VISIT(date_created_windows_epoch_micros);
  767. VISIT(hide_by_default);
  768. }
  769. VISIT_PROTO_FIELDS(const sync_pb::PasswordSpecificsMetadata& proto) {
  770. VISIT(url);
  771. }
  772. VISIT_PROTO_FIELDS(const sync_pb::PersistedEntityData& proto) {
  773. VISIT(name);
  774. VISIT(specifics);
  775. }
  776. VISIT_PROTO_FIELDS(const sync_pb::PreferenceSpecifics& proto) {
  777. VISIT(name);
  778. VISIT(value);
  779. }
  780. VISIT_PROTO_FIELDS(const sync_pb::PrinterPPDReference& proto) {
  781. VISIT(user_supplied_ppd_url);
  782. VISIT(effective_make_and_model);
  783. VISIT(autoconf);
  784. }
  785. VISIT_PROTO_FIELDS(const sync_pb::PrinterSpecifics& proto) {
  786. VISIT(id);
  787. VISIT(display_name);
  788. VISIT(description);
  789. VISIT(manufacturer);
  790. VISIT(model);
  791. VISIT(uri);
  792. VISIT(uuid);
  793. VISIT(ppd_reference);
  794. VISIT(make_and_model);
  795. }
  796. VISIT_PROTO_FIELDS(const sync_pb::PrintersAuthorizationServerSpecifics& proto) {
  797. VISIT(uri);
  798. }
  799. VISIT_PROTO_FIELDS(const sync_pb::PriorityPreferenceSpecifics& proto) {
  800. VISIT(preference);
  801. }
  802. VISIT_PROTO_FIELDS(const sync_pb::ReadingListSpecifics& proto) {
  803. VISIT(entry_id);
  804. VISIT(title);
  805. VISIT(url);
  806. VISIT(creation_time_us);
  807. VISIT(update_time_us);
  808. VISIT_ENUM(status);
  809. VISIT(first_read_time_us);
  810. VISIT(update_title_time_us);
  811. VISIT(estimated_read_time_seconds);
  812. }
  813. VISIT_PROTO_FIELDS(const sync_pb::SavedTabGroupSpecifics& proto) {
  814. VISIT(guid);
  815. VISIT(creation_time_windows_epoch_micros);
  816. VISIT(update_time_windows_epoch_micros);
  817. VISIT(group);
  818. VISIT(tab);
  819. }
  820. VISIT_PROTO_FIELDS(const sync_pb::SavedTabGroup& proto) {
  821. VISIT(position);
  822. VISIT(title);
  823. VISIT(color);
  824. }
  825. VISIT_PROTO_FIELDS(const sync_pb::SavedTabGroupTab& proto) {
  826. VISIT(position);
  827. VISIT(group_guid);
  828. VISIT(url);
  829. }
  830. VISIT_PROTO_FIELDS(const sync_pb::SearchEngineSpecifics& proto) {
  831. VISIT(short_name);
  832. VISIT(keyword);
  833. VISIT(favicon_url);
  834. VISIT(url);
  835. VISIT(safe_for_autoreplace);
  836. VISIT(originating_url);
  837. VISIT(date_created);
  838. VISIT(input_encodings);
  839. VISIT(suggestions_url);
  840. VISIT(prepopulate_id);
  841. VISIT(autogenerate_keyword);
  842. VISIT(last_modified);
  843. VISIT(sync_guid);
  844. VISIT_REP(alternate_urls);
  845. VISIT(image_url);
  846. VISIT(search_url_post_params);
  847. VISIT(suggestions_url_post_params);
  848. VISIT(image_url_post_params);
  849. VISIT(new_tab_url);
  850. VISIT_ENUM(is_active);
  851. VISIT(starter_pack_id);
  852. }
  853. VISIT_PROTO_FIELDS(const sync_pb::SendTabToSelfSpecifics& proto) {
  854. VISIT(guid);
  855. VISIT(title);
  856. VISIT(url);
  857. VISIT(shared_time_usec);
  858. VISIT(device_name);
  859. VISIT(target_device_sync_cache_guid);
  860. VISIT(opened);
  861. VISIT(notification_dismissed);
  862. }
  863. VISIT_PROTO_FIELDS(const sync_pb::SessionHeader& proto) {
  864. VISIT_REP(window);
  865. VISIT(client_name);
  866. VISIT_ENUM(device_type);
  867. }
  868. VISIT_PROTO_FIELDS(const sync_pb::SessionSpecifics& proto) {
  869. VISIT(session_tag);
  870. VISIT(header);
  871. VISIT(tab);
  872. VISIT(tab_node_id);
  873. }
  874. VISIT_PROTO_FIELDS(const sync_pb::SessionTab& proto) {
  875. VISIT(tab_id);
  876. VISIT(window_id);
  877. VISIT(tab_visual_index);
  878. VISIT(current_navigation_index);
  879. VISIT(pinned);
  880. VISIT(extension_app_id);
  881. VISIT_REP(navigation);
  882. VISIT_BYTES(favicon);
  883. VISIT_ENUM(favicon_type);
  884. VISIT(favicon_source);
  885. VISIT_REP(variation_id);
  886. VISIT_ENUM(browser_type);
  887. }
  888. VISIT_PROTO_FIELDS(const sync_pb::SessionWindow& proto) {
  889. VISIT(window_id);
  890. VISIT(selected_tab_index);
  891. VISIT_REP(tab);
  892. VISIT_ENUM(browser_type);
  893. }
  894. VISIT_PROTO_FIELDS(const sync_pb::SharingMessageSpecifics& proto) {
  895. VISIT(message_id);
  896. VISIT(channel_configuration);
  897. VISIT_BYTES(payload);
  898. }
  899. VISIT_PROTO_FIELDS(const sync_pb::SharingMessageSpecifics::
  900. ChannelConfiguration::FCMChannelConfiguration& proto) {
  901. VISIT(token);
  902. VISIT(ttl);
  903. VISIT(priority);
  904. }
  905. VISIT_PROTO_FIELDS(
  906. const sync_pb::SharingMessageSpecifics::ChannelConfiguration& proto) {
  907. VISIT(fcm);
  908. VISIT_BYTES(server);
  909. }
  910. VISIT_PROTO_FIELDS(const sync_pb::SyncCycleCompletedEventInfo& proto) {
  911. VISIT(num_encryption_conflicts);
  912. VISIT(num_hierarchy_conflicts);
  913. VISIT(num_server_conflicts);
  914. VISIT(num_updates_downloaded);
  915. VISIT(num_reflected_updates_downloaded);
  916. VISIT(caller_info);
  917. VISIT_ENUM(get_updates_origin);
  918. }
  919. VISIT_PROTO_FIELDS(const sync_pb::SyncEntity& proto) {
  920. VISIT(id_string);
  921. VISIT(parent_id_string);
  922. VISIT(version);
  923. VISIT(mtime);
  924. VISIT(ctime);
  925. VISIT(name);
  926. VISIT(non_unique_name);
  927. VISIT(server_defined_unique_tag);
  928. VISIT(unique_position);
  929. VISIT(deleted);
  930. VISIT(originator_cache_guid);
  931. VISIT(originator_client_item_id);
  932. VISIT(specifics);
  933. VISIT(folder);
  934. VISIT(client_defined_unique_tag);
  935. }
  936. VISIT_PROTO_FIELDS(const sync_pb::SyncInvalidationsPayload& proto) {
  937. VISIT_REP(data_type_invalidations);
  938. VISIT_BYTES(hint);
  939. VISIT(version);
  940. }
  941. VISIT_PROTO_FIELDS(
  942. const sync_pb::SyncInvalidationsPayload::DataTypeInvalidation& proto) {
  943. VISIT(data_type_id);
  944. }
  945. VISIT_PROTO_FIELDS(const sync_pb::SecurityEventSpecifics& proto) {
  946. VISIT(gaia_password_reuse_event);
  947. VISIT(event_time_usec);
  948. }
  949. VISIT_PROTO_FIELDS(const sync_pb::GaiaPasswordReuse& proto) {
  950. VISIT(reuse_detected);
  951. VISIT(reuse_lookup);
  952. VISIT(dialog_interaction);
  953. // TODO(markusheintz): Remove.
  954. VISIT(password_captured);
  955. }
  956. VISIT_PROTO_FIELDS(
  957. const sync_pb::GaiaPasswordReuse::PasswordReuseDetected& proto) {
  958. VISIT(status);
  959. }
  960. VISIT_PROTO_FIELDS(
  961. const sync_pb::GaiaPasswordReuse::PasswordReuseDetected::SafeBrowsingStatus&
  962. proto) {
  963. VISIT(enabled);
  964. VISIT_ENUM(safe_browsing_reporting_population);
  965. }
  966. VISIT_PROTO_FIELDS(
  967. const sync_pb::GaiaPasswordReuse::PasswordReuseDialogInteraction& proto) {
  968. VISIT_ENUM(interaction_result);
  969. }
  970. VISIT_PROTO_FIELDS(
  971. const sync_pb::GaiaPasswordReuse::PasswordReuseLookup& proto) {
  972. VISIT_ENUM(lookup_result);
  973. VISIT_ENUM(verdict);
  974. VISIT(verdict_token);
  975. }
  976. // TODO(markusheintz): Remove.
  977. VISIT_PROTO_FIELDS(const sync_pb::GaiaPasswordReuse::PasswordCaptured& proto) {
  978. VISIT_ENUM(event_trigger);
  979. }
  980. VISIT_PROTO_FIELDS(
  981. const sync_pb::UserEventSpecifics::GaiaPasswordCaptured& proto) {
  982. VISIT_ENUM(event_trigger);
  983. }
  984. VISIT_PROTO_FIELDS(const sync_pb::UserEventSpecifics::FlocIdComputed& proto) {
  985. VISIT(floc_id);
  986. }
  987. VISIT_PROTO_FIELDS(const sync_pb::TabNavigation& proto) {
  988. VISIT(virtual_url);
  989. VISIT(referrer);
  990. VISIT(title);
  991. VISIT_ENUM(page_transition);
  992. VISIT_ENUM(redirect_type);
  993. VISIT(unique_id);
  994. VISIT(timestamp_msec);
  995. VISIT(navigation_forward_back);
  996. VISIT(navigation_from_address_bar);
  997. VISIT(navigation_home_page);
  998. VISIT(navigation_chain_start);
  999. VISIT(navigation_chain_end);
  1000. VISIT(global_id);
  1001. VISIT(favicon_url);
  1002. VISIT_ENUM(blocked_state);
  1003. VISIT(http_status_code);
  1004. VISIT(obsolete_referrer_policy);
  1005. VISIT(is_restored);
  1006. VISIT_REP(navigation_redirect);
  1007. VISIT(last_navigation_redirect_url);
  1008. VISIT(correct_referrer_policy);
  1009. VISIT(page_language);
  1010. VISIT_ENUM(password_state);
  1011. VISIT(task_id);
  1012. VISIT_REP(ancestor_task_id);
  1013. VISIT(replaced_navigation);
  1014. }
  1015. VISIT_PROTO_FIELDS(const sync_pb::ThemeSpecifics& proto) {
  1016. VISIT(use_custom_theme);
  1017. VISIT(use_system_theme_by_default);
  1018. VISIT(custom_theme_name);
  1019. VISIT(custom_theme_id);
  1020. VISIT(custom_theme_update_url);
  1021. VISIT(autogenerated_theme);
  1022. }
  1023. VISIT_PROTO_FIELDS(const sync_pb::ThemeSpecifics::AutogeneratedTheme& proto) {
  1024. VISIT(color);
  1025. }
  1026. VISIT_PROTO_FIELDS(const sync_pb::TimeRangeDirective& proto) {
  1027. VISIT(start_time_usec);
  1028. VISIT(end_time_usec);
  1029. }
  1030. VISIT_PROTO_FIELDS(const sync_pb::UrlDirective& proto) {
  1031. VISIT(url);
  1032. VISIT(end_time_usec);
  1033. }
  1034. VISIT_PROTO_FIELDS(const sync_pb::TypeHint& proto) {
  1035. VISIT(data_type_id);
  1036. VISIT(has_valid_hint);
  1037. }
  1038. VISIT_PROTO_FIELDS(const sync_pb::TypedUrlSpecifics& proto) {
  1039. VISIT(url);
  1040. VISIT(title);
  1041. VISIT(hidden);
  1042. VISIT_REP(visits);
  1043. VISIT_REP(visit_transitions);
  1044. }
  1045. VISIT_PROTO_FIELDS(const sync_pb::UniquePosition& proto) {
  1046. VISIT_BYTES(value);
  1047. VISIT_BYTES(compressed_value);
  1048. VISIT(uncompressed_length);
  1049. VISIT_BYTES(custom_compressed_v1);
  1050. }
  1051. VISIT_PROTO_FIELDS(const sync_pb::UserConsentSpecifics& proto) {
  1052. VISIT(locale);
  1053. VISIT(client_consent_time_usec);
  1054. VISIT(account_id);
  1055. VISIT(sync_consent);
  1056. VISIT(arc_backup_and_restore_consent);
  1057. VISIT(arc_location_service_consent);
  1058. VISIT(arc_play_terms_of_service_consent);
  1059. VISIT(assistant_activity_control_consent);
  1060. VISIT(account_passwords_consent);
  1061. VISIT(autofill_assistant_consent);
  1062. }
  1063. VISIT_PROTO_FIELDS(
  1064. const sync_pb::UserConsentTypes::ArcBackupAndRestoreConsent& proto) {
  1065. VISIT_REP(description_grd_ids);
  1066. VISIT_ENUM(status);
  1067. }
  1068. VISIT_PROTO_FIELDS(
  1069. const sync_pb::UserConsentTypes::ArcGoogleLocationServiceConsent& proto) {
  1070. VISIT_REP(description_grd_ids);
  1071. VISIT_ENUM(status);
  1072. }
  1073. VISIT_PROTO_FIELDS(
  1074. const sync_pb::UserConsentTypes::ArcPlayTermsOfServiceConsent& proto) {
  1075. VISIT(play_terms_of_service_text_length);
  1076. VISIT(play_terms_of_service_hash);
  1077. VISIT(confirmation_grd_id);
  1078. VISIT_ENUM(status);
  1079. }
  1080. VISIT_PROTO_FIELDS(
  1081. const sync_pb::UserConsentTypes::AssistantActivityControlConsent& proto) {
  1082. VISIT(ui_audit_key);
  1083. VISIT_ENUM(status);
  1084. VISIT_ENUM(setting_type);
  1085. }
  1086. VISIT_PROTO_FIELDS(const sync_pb::UserConsentTypes::SyncConsent& proto) {
  1087. VISIT_REP(description_grd_ids);
  1088. VISIT(confirmation_grd_id);
  1089. VISIT_ENUM(status);
  1090. }
  1091. VISIT_PROTO_FIELDS(const sync_pb::UserConsentTypes::UnifiedConsent& proto) {
  1092. VISIT_REP(description_grd_ids);
  1093. VISIT(confirmation_grd_id);
  1094. VISIT_ENUM(status);
  1095. }
  1096. VISIT_PROTO_FIELDS(
  1097. const sync_pb::UserConsentTypes::AccountPasswordsConsent& proto) {
  1098. VISIT_REP(description_grd_ids);
  1099. VISIT(confirmation_grd_id);
  1100. VISIT_ENUM(status);
  1101. }
  1102. VISIT_PROTO_FIELDS(
  1103. const sync_pb::UserConsentTypes::AutofillAssistantConsent& proto) {
  1104. VISIT_REP(description_grd_ids);
  1105. VISIT(confirmation_grd_id);
  1106. VISIT_ENUM(status);
  1107. }
  1108. VISIT_PROTO_FIELDS(const sync_pb::UserEventSpecifics& proto) {
  1109. VISIT(event_time_usec);
  1110. VISIT(navigation_id);
  1111. VISIT(session_id);
  1112. VISIT(test_event);
  1113. VISIT(gaia_password_reuse_event);
  1114. VISIT(gaia_password_captured_event);
  1115. VISIT(floc_id_computed_event);
  1116. }
  1117. VISIT_PROTO_FIELDS(const sync_pb::UserEventSpecifics::Test& proto) {}
  1118. VISIT_PROTO_FIELDS(const sync_pb::CloudTokenData& proto) {
  1119. VISIT(suffix);
  1120. VISIT(exp_month);
  1121. VISIT(exp_year);
  1122. VISIT(art_fife_url);
  1123. VISIT(instrument_token);
  1124. }
  1125. VISIT_PROTO_FIELDS(const sync_pb::CardIssuer& proto) {
  1126. VISIT_ENUM(issuer);
  1127. }
  1128. VISIT_PROTO_FIELDS(const sync_pb::WalletMaskedCreditCard& proto) {
  1129. VISIT(id);
  1130. VISIT_ENUM(status);
  1131. VISIT(name_on_card);
  1132. VISIT_ENUM(type);
  1133. VISIT(last_four);
  1134. VISIT(exp_month);
  1135. VISIT(exp_year);
  1136. VISIT(billing_address_id);
  1137. VISIT(bank_name);
  1138. VISIT(nickname);
  1139. VISIT(card_issuer);
  1140. VISIT(instrument_id);
  1141. VISIT_ENUM(virtual_card_enrollment_state);
  1142. VISIT(card_art_url);
  1143. VISIT(product_description);
  1144. }
  1145. VISIT_PROTO_FIELDS(const sync_pb::WalletMetadataSpecifics& proto) {
  1146. VISIT_ENUM(type);
  1147. VISIT(id);
  1148. VISIT(use_count);
  1149. VISIT(use_date);
  1150. VISIT(card_billing_address_id);
  1151. VISIT(address_has_converted);
  1152. }
  1153. VISIT_PROTO_FIELDS(const sync_pb::WalletPostalAddress& proto) {
  1154. VISIT(id);
  1155. VISIT(recipient_name);
  1156. VISIT(company_name);
  1157. VISIT_REP(street_address);
  1158. VISIT(address_1);
  1159. VISIT(address_2);
  1160. VISIT(address_3);
  1161. VISIT(address_4);
  1162. VISIT(postal_code);
  1163. VISIT(sorting_code);
  1164. VISIT(country_code);
  1165. VISIT(phone_number);
  1166. VISIT(language_code);
  1167. }
  1168. VISIT_PROTO_FIELDS(const sync_pb::PaymentsCustomerData& proto) {
  1169. VISIT(id);
  1170. }
  1171. VISIT_PROTO_FIELDS(const sync_pb::WalletCreditCardCloudTokenData& proto) {
  1172. VISIT(masked_card_id);
  1173. VISIT(suffix);
  1174. VISIT(exp_month);
  1175. VISIT(exp_year);
  1176. VISIT(art_fife_url);
  1177. VISIT(instrument_token);
  1178. }
  1179. VISIT_PROTO_FIELDS(const sync_pb::WebAppIconInfo& proto) {
  1180. VISIT(size_in_px);
  1181. VISIT(url);
  1182. VISIT_ENUM(purpose);
  1183. }
  1184. VISIT_PROTO_FIELDS(const sync_pb::WebAppSpecifics& proto) {
  1185. VISIT(start_url);
  1186. VISIT(name);
  1187. VISIT_ENUM(user_display_mode);
  1188. VISIT(theme_color);
  1189. VISIT(scope);
  1190. VISIT_REP(icon_infos);
  1191. VISIT(user_page_ordinal);
  1192. VISIT(user_launch_ordinal);
  1193. VISIT(manifest_id);
  1194. }
  1195. VISIT_PROTO_FIELDS(const sync_pb::WifiConfigurationSpecifics::
  1196. ProxyConfiguration::ManualProxyConfiguration& proto) {
  1197. VISIT(http_proxy_url);
  1198. VISIT(http_proxy_port);
  1199. VISIT(secure_http_proxy_url);
  1200. VISIT(secure_http_proxy_port);
  1201. VISIT(socks_host_url);
  1202. VISIT(socks_host_port);
  1203. VISIT_REP(excluded_domains);
  1204. }
  1205. VISIT_PROTO_FIELDS(
  1206. const sync_pb::WifiConfigurationSpecifics::ProxyConfiguration& proto) {
  1207. VISIT_ENUM(proxy_option);
  1208. VISIT(autoconfiguration_url);
  1209. VISIT(manual_proxy_configuration);
  1210. }
  1211. VISIT_PROTO_FIELDS(const sync_pb::WifiConfigurationSpecifics& proto) {
  1212. VISIT_BYTES(hex_ssid);
  1213. VISIT_ENUM(security_type);
  1214. VISIT_BYTES(passphrase);
  1215. VISIT_ENUM(automatically_connect);
  1216. VISIT_ENUM(is_preferred);
  1217. VISIT(proxy_configuration);
  1218. VISIT_REP(custom_dns);
  1219. VISIT(last_connected_timestamp);
  1220. }
  1221. VISIT_PROTO_FIELDS(const sync_pb::WorkspaceDeskSpecifics& proto) {
  1222. VISIT(uuid);
  1223. VISIT(name);
  1224. VISIT(created_time_windows_epoch_micros);
  1225. VISIT(updated_time_windows_epoch_micros);
  1226. VISIT(desk);
  1227. VISIT_ENUM(desk_type);
  1228. }
  1229. VISIT_PROTO_FIELDS(const sync_pb::WorkspaceDeskSpecifics::App& proto) {
  1230. VISIT(window_bound);
  1231. VISIT_ENUM(window_state);
  1232. VISIT(z_index);
  1233. VISIT(app);
  1234. VISIT(window_id);
  1235. VISIT(display_id);
  1236. VISIT_ENUM(pre_minimized_window_state);
  1237. VISIT(snap_percentage);
  1238. VISIT_ENUM(container);
  1239. VISIT_ENUM(disposition);
  1240. VISIT(app_name);
  1241. VISIT(title);
  1242. }
  1243. VISIT_PROTO_FIELDS(const sync_pb::WorkspaceDeskSpecifics::AppOneOf& proto) {
  1244. VISIT(browser_app_window);
  1245. VISIT(chrome_app);
  1246. VISIT(progress_web_app);
  1247. VISIT(arc_app);
  1248. }
  1249. VISIT_PROTO_FIELDS(
  1250. const sync_pb::WorkspaceDeskSpecifics::BrowserAppWindow& proto) {
  1251. VISIT_REP(tabs);
  1252. VISIT(active_tab_index);
  1253. VISIT(show_as_app);
  1254. VISIT_REP(tab_groups);
  1255. VISIT(first_non_pinned_tab_index);
  1256. }
  1257. VISIT_PROTO_FIELDS(
  1258. const sync_pb::WorkspaceDeskSpecifics::BrowserAppWindow::BrowserAppTab&
  1259. proto) {
  1260. VISIT(url);
  1261. VISIT(title);
  1262. }
  1263. VISIT_PROTO_FIELDS(const sync_pb::WorkspaceDeskSpecifics::ChromeApp& proto) {
  1264. VISIT(app_id);
  1265. }
  1266. VISIT_PROTO_FIELDS(const sync_pb::WorkspaceDeskSpecifics::Desk& proto) {
  1267. VISIT_REP(apps);
  1268. }
  1269. VISIT_PROTO_FIELDS(
  1270. const sync_pb::WorkspaceDeskSpecifics::ProgressiveWebApp& proto) {
  1271. VISIT(app_id);
  1272. }
  1273. VISIT_PROTO_FIELDS(const sync_pb::WorkspaceDeskSpecifics::WindowBound& proto) {
  1274. VISIT(top);
  1275. VISIT(left);
  1276. VISIT(width);
  1277. VISIT(height);
  1278. }
  1279. VISIT_PROTO_FIELDS(const sync_pb::WorkspaceDeskSpecifics::ArcApp& proto) {
  1280. VISIT(app_id);
  1281. VISIT(minimum_size);
  1282. VISIT(maximum_size);
  1283. VISIT(bounds_in_root);
  1284. }
  1285. VISIT_PROTO_FIELDS(
  1286. const sync_pb::WorkspaceDeskSpecifics::ArcApp::WindowSize& proto) {
  1287. VISIT(width);
  1288. VISIT(height);
  1289. }
  1290. VISIT_PROTO_FIELDS(
  1291. const sync_pb::WorkspaceDeskSpecifics::BrowserAppWindow::TabGroup& proto) {
  1292. VISIT(first_index);
  1293. VISIT(last_index);
  1294. VISIT(title);
  1295. VISIT_ENUM(color);
  1296. VISIT(is_collapsed);
  1297. }
  1298. } // namespace syncer
  1299. #undef VISIT_
  1300. #undef VISIT_BYTES
  1301. #undef VISIT_ENUM
  1302. #undef VISIT
  1303. #undef VISIT_REP
  1304. #endif // COMPONENTS_SYNC_PROTOCOL_PROTO_VISITORS_H_