Reland [Sync] Refactoring polling to be reliable.
commitb1133ac9da61c61238ddc112099cc9fbd883853e
authorzea <zea@chromium.org>
Fri, 15 May 2015 02:23:10 +0000 (14 19:23 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 15 May 2015 02:23:11 +0000 (15 02:23 +0000)
treec1ed65f24edb0c4be56c5c0210c603c3f21cf622
parentc2853886b599e6c25b4f565a6c1a1ce9dc8f78ee
Reland [Sync] Refactoring polling to be reliable.

This is a reland of https://codereview.chromium.org/1132013004/

Polling is now an important component of sync health, as it can sometimes be
the only time we'll query for certain datatypes. As such, the following
has changed:
- Polls that fail will be retried (with backoff).
- As such, the logic to force a poll after an auth error isn't needed anymore
- The last successful poll time will be persisted in the sync prefs.
- On startup, schedule the first poll for last_poll_time + poll_interval
  (or Now(), whichever is latest).
- Receiving a new poll interval from the server will update the poll timer
- The poll timer is now a one shot timer, and only restarts on success
- Some code cleanup to make the above more straightforward

BUG=482154

Review URL: https://codereview.chromium.org/1144543004

Cr-Commit-Position: refs/heads/master@{#330024}
35 files changed:
chrome/browser/sync/glue/sync_backend_host_core.cc
chrome/browser/sync/glue/sync_backend_host_core.h
chrome/browser/sync/glue/sync_backend_host_impl.cc
components/sync_driver/pref_names.cc
components/sync_driver/pref_names.h
components/sync_driver/sync_prefs.cc
components/sync_driver/sync_prefs.h
sync/engine/sync_scheduler.h
sync/engine/sync_scheduler_impl.cc
sync/engine/sync_scheduler_impl.h
sync/engine/sync_scheduler_unittest.cc
sync/engine/syncer.cc
sync/engine/syncer.h
sync/engine/syncer_unittest.cc
sync/internal_api/js_sync_manager_observer_unittest.cc
sync/internal_api/public/sessions/sync_session_snapshot.cc
sync/internal_api/public/sessions/sync_session_snapshot.h
sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc
sync/internal_api/public/sync_manager.h
sync/internal_api/public/test/fake_sync_manager.h
sync/internal_api/sync_manager_impl.cc
sync/internal_api/sync_manager_impl.h
sync/internal_api/sync_manager_impl_unittest.cc
sync/internal_api/sync_rollback_manager.cc
sync/internal_api/sync_rollback_manager.h
sync/internal_api/sync_rollback_manager_base.cc
sync/internal_api/sync_rollback_manager_base.h
sync/internal_api/sync_rollback_manager_unittest.cc
sync/internal_api/test/fake_sync_manager.cc
sync/sessions/status_controller.cc
sync/sessions/status_controller.h
sync/sessions/sync_session.cc
sync/test/engine/fake_sync_scheduler.cc
sync/test/engine/fake_sync_scheduler.h
sync/tools/sync_client.cc