tree: 95f77589a8807d89fd52ca63e6dbb788a983fcec [path history] [tgz]
  1. app_list_specifics.proto
  2. app_notification_specifics.proto
  3. app_setting_specifics.proto
  4. app_specifics.proto
  5. arc_package_specifics.proto
  6. autofill_offer_specifics.proto
  7. autofill_specifics.proto
  8. bookmark_model_metadata.proto
  9. bookmark_specifics.proto
  10. BUILD.gn
  11. client_commands.proto
  12. client_debug_info.proto
  13. DEPS
  14. device_info_specifics.proto
  15. dictionary_specifics.proto
  16. encryption.proto
  17. entity_metadata.proto
  18. experiment_status.proto
  19. experiments_specifics.proto
  20. extension_setting_specifics.proto
  21. extension_specifics.proto
  22. favicon_image_specifics.proto
  23. favicon_tracking_specifics.proto
  24. gaia_password_reuse.proto
  25. get_updates_caller_info.proto
  26. history_delete_directive_specifics.proto
  27. history_status.proto
  28. local_trusted_vault.proto
  29. loopback_server.proto
  30. managed_user_setting_specifics.proto
  31. managed_user_shared_setting_specifics.proto
  32. managed_user_specifics.proto
  33. model_type_state.proto
  34. model_type_store_schema_descriptor.proto
  35. nigori_local_data.proto
  36. nigori_specifics.proto
  37. os_preference_specifics.proto
  38. os_priority_preference_specifics.proto
  39. OWNERS
  40. password_specifics.proto
  41. persisted_entity_data.proto
  42. preference_specifics.proto
  43. printer_specifics.proto
  44. priority_preference_specifics.proto
  45. proto_enum_conversions.cc
  46. proto_enum_conversions.h
  47. proto_enum_conversions_unittest.cc
  48. proto_memory_estimations.cc
  49. proto_memory_estimations.h
  50. proto_value_conversions.cc
  51. proto_value_conversions.h
  52. proto_value_conversions_unittest.cc
  53. proto_visitors.h
  54. protocol_sources.gni
  55. reading_list_specifics.proto
  56. README.md
  57. search_engine_specifics.proto
  58. security_event_specifics.proto
  59. send_tab_to_self_specifics.proto
  60. session_specifics.proto
  61. sharing_message_specifics.proto
  62. sync.proto
  63. sync_enums.proto
  64. sync_invalidations_payload.proto
  65. sync_protocol_error.cc
  66. sync_protocol_error.h
  67. synced_notification_app_info_specifics.proto
  68. synced_notification_specifics.proto
  69. test.proto
  70. theme_specifics.proto
  71. typed_url_specifics.proto
  72. unique_position.proto
  73. user_consent_specifics.proto
  74. user_consent_types.proto
  75. user_event_specifics.proto
  76. vault.proto
  77. web_app_specifics.proto
  78. wifi_configuration_specifics.proto
components/sync/protocol/README.md

Sync Protocol Style

General guidelines:

  • Follow the Protocol Buffers Style Guide
  • Follow the Proto Do‘s and Don’ts (sorry, Googlers only).
  • Maintain local consistency.
  • Use proto2 syntax.
  • Always get a review from someone in the OWNERS file in this folder. Don't use owners from higher-level folders, and never TBR changes!

Some specific guidelines on top of the general ones above, or just things that often come up:

  • Enum entries should be in ALL_CAPS (different from C++!), and for new code, the first entry should be a FOO_UNSPECIFIED = 0 one.
  • Proto changes also require corresponding changes in proto_visitors.h and (where appropriate) in proto_enum_conversions.h/cc.
  • Backwards compatibility: In general, all changes must be fully backwards-compatible - consider that a single user might be running different versions of the browser simultaneously! Also note that Sync supports clients up to a few years old, so deprecating/removing an existing field is typically a multi-year process.
    • As one special case, renaming a field within a specifics message is generally safe (unless there are special server-side integrations that depend on the name). However, never rename fields anywhere outside of specifics.
  • Deprecating fields:
    • If the field is still accessed: Mark it as [deprecated = true]. This is the common case, since the browser typically needs to continue supporting the old field for backwards compatibility reasons.
    • If the field is not accessed anymore (i.e. no non-ancient clients depend on the field being populated anymore, all migration code has been retired, etc): Remove the field, and add reserved entries for both its name and its tag number.
  • Deprecating enum values: This is particularly tricky, especially if the default value is not a FOO_UNSPECIFIED one (see above). A common pattern is prepending DEPRECATED_ to the entry name.