tree: 3081b960ec410a879fa32891d32381b63e89acc9 [search]
  1. cycle/
  2. events/
  3. loopback_server/
  4. net/
  5. active_devices_invalidation_info.cc
  6. active_devices_invalidation_info.h
  7. backoff_delay_provider.cc
  8. backoff_delay_provider.h
  9. backoff_delay_provider_unittest.cc
  10. bookmark_update_preprocessing.cc
  11. bookmark_update_preprocessing.h
  12. bookmark_update_preprocessing_unittest.cc
  13. BUILD.gn
  14. cancelation_signal.cc
  15. cancelation_signal.h
  16. cancelation_signal_unittest.cc
  17. commit.cc
  18. commit.h
  19. commit_and_get_updates_types.cc
  20. commit_and_get_updates_types.h
  21. commit_contribution.h
  22. commit_contribution_impl.cc
  23. commit_contribution_impl.h
  24. commit_contribution_impl_unittest.cc
  25. commit_contributor.h
  26. commit_processor.cc
  27. commit_processor.h
  28. commit_processor_unittest.cc
  29. commit_queue.h
  30. commit_util.cc
  31. commit_util.h
  32. configure_reason.h
  33. connection_status.h
  34. cryptographer.cc
  35. cryptographer.h
  36. data_type_activation_response.cc
  37. data_type_activation_response.h
  38. data_type_configurer.cc
  39. data_type_configurer.h
  40. data_type_connector.h
  41. data_type_connector_proxy.cc
  42. data_type_connector_proxy.h
  43. data_type_processor.h
  44. data_type_processor_metrics.cc
  45. data_type_processor_metrics.h
  46. data_type_processor_proxy.cc
  47. data_type_processor_proxy.h
  48. data_type_registry.cc
  49. data_type_registry.h
  50. data_type_registry_unittest.cc
  51. data_type_worker.cc
  52. data_type_worker.h
  53. data_type_worker_unittest.cc
  54. debug_info_event_listener.cc
  55. debug_info_event_listener.h
  56. debug_info_event_listener_unittest.cc
  57. DEPS
  58. engine_components_factory.h
  59. engine_components_factory_impl.cc
  60. engine_components_factory_impl.h
  61. forwarding_data_type_processor.cc
  62. forwarding_data_type_processor.h
  63. get_updates_delegate.cc
  64. get_updates_delegate.h
  65. get_updates_processor.cc
  66. get_updates_processor.h
  67. get_updates_processor_unittest.cc
  68. keystore_keys_handler.h
  69. nudge_handler.h
  70. polling_constants.h
  71. README.md
  72. required_passphrase_verifier.h
  73. shutdown_reason.cc
  74. shutdown_reason.h
  75. sync_access_token_fetcher.h
  76. sync_credentials.h
  77. sync_cycle_event.cc
  78. sync_cycle_event.h
  79. sync_encryption_handler.h
  80. sync_engine.cc
  81. sync_engine.h
  82. sync_engine_event_listener.h
  83. sync_engine_host.h
  84. sync_manager.cc
  85. sync_manager.h
  86. sync_manager_factory.cc
  87. sync_manager_factory.h
  88. sync_manager_impl.cc
  89. sync_manager_impl.h
  90. sync_manager_impl_unittest.cc
  91. sync_protocol_error.cc
  92. sync_protocol_error.h
  93. sync_scheduler.h
  94. sync_scheduler_impl.cc
  95. sync_scheduler_impl.h
  96. sync_scheduler_impl_unittest.cc
  97. sync_status.cc
  98. sync_status.h
  99. sync_status_tracker.cc
  100. sync_status_tracker.h
  101. sync_string_conversions.cc
  102. sync_string_conversions.h
  103. syncer.cc
  104. syncer.h
  105. syncer_error.cc
  106. syncer_error.h
  107. syncer_proto_util.cc
  108. syncer_proto_util.h
  109. syncer_proto_util_unittest.cc
  110. syncer_unittest.cc
  111. traffic_logger.cc
  112. traffic_logger.h
  113. update_handler.h
components/sync/engine/README.md

Sync Engine (components/sync/engine/)

This directory implements the core Sync protocol engine (part B of the architecture overview). Unless noted otherwise, classes in this directory run on the dedicated Sync sequence (SequencedTaskRunner), isolated from the UI thread and individual model sequences.

Core Components

Authentication, Scheduling & Retry Hierarchy

Access token acquisition and retry behavior span the UI thread (SyncAuthManager) and the Sync sequence (SyncSchedulerImpl and SyncServerConnectionManager):

  1. Per-request short retries: On desktop, IdentityManager fetches access tokens directly; on mobile, the responsibility for fetching access tokens lies outside of Chrome (in the platform account manager). IdentityManager performs a bounded number of fast exponential retries (< ~30s total) before reporting a failure to SyncAuthManager, so brief transient network blips resolve at this layer without surfacing to Sync.
  2. Sync-side long-tail scheduling: Unbounded recovery over minutes or hours after fast retries are exhausted (as well as cross-platform backoff on mobile platforms where token-service backoff is disabled) is owned by Sync's own retry timers (SyncAuthManager and SyncSchedulerImpl).
  3. Token rejection (CONNECTION_AUTH_ERROR / HTTP 401): When the Sync server rejects a request with HTTP 401—or when SyncServerConnectionManager rejects an expired or missing token locally with HTTP 401 before sending a request—SyncAuthManager invalidates the cached token, and Sync-layer backoff rate-limits repeated retries.
  4. Local sync (ignore_auth_credentials_): Local sync operates without a signed-in account or access token.

Auth & Transport Metrics

Key histograms emitted along the scheduling and HTTP transport path include Sync.URLFetchAccessToken, Sync.URLFetchResponse, Sync.CommitResponse, Sync.PostedDataTypeCommitRequest, and Sync.PostedGetUpdatesOrigin.

Some metrics along this path are emitted before an actual network request is sent and may therefore be duplicated when a cycle is retried.