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

Unified Diff: sync/engine/sync_scheduler_impl.h

Issue 1144443004: Revert of [Sync] Refactoring polling to be reliable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/engine/sync_scheduler.h ('k') | sync/engine/sync_scheduler_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/sync_scheduler_impl.h
diff --git a/sync/engine/sync_scheduler_impl.h b/sync/engine/sync_scheduler_impl.h
index b7d8d0beef277cea87bd14162fa60ff777c14c40..e3c505b26027c2422344263ea065fc736e9ecdff 100644
--- a/sync/engine/sync_scheduler_impl.h
+++ b/sync/engine/sync_scheduler_impl.h
@@ -51,7 +51,7 @@
// Calls Stop().
~SyncSchedulerImpl() override;
- void Start(Mode mode, base::Time last_poll_time) override;
+ void Start(Mode mode) override;
void ScheduleConfiguration(const ConfigurationParams& params) override;
void Stop() override;
void ScheduleLocalNudge(
@@ -151,10 +151,7 @@
// Invoke the syncer to perform a configuration job.
void DoConfigurationSyncSessionJob(JobPriority priority);
- // Helper function for Do{Nudge,Configuration,Poll}SyncSessionJob.
- void HandleSuccess();
-
- // Helper function for Do{Nudge,Configuration,Poll}SyncSessionJob.
+ // Helper function for Do{Nudge,Configuration}SyncSessionJob.
void HandleFailure(
const sessions::ModelNeutralState& model_neutral_state);
@@ -249,10 +246,8 @@
base::TimeDelta syncer_short_poll_interval_seconds_;
base::TimeDelta syncer_long_poll_interval_seconds_;
- // Timer for polling. Restarted on each successful poll, and when entering
- // normal sync mode or exiting an error state. Not active in configuration
- // mode.
- base::OneShotTimer<SyncSchedulerImpl> poll_timer_;
+ // Periodic timer for polling. See AdjustPolling.
+ base::RepeatingTimer<SyncSchedulerImpl> poll_timer_;
// The mode of operation.
Mode mode_;
@@ -295,6 +290,15 @@
// take place during a sync cycle. We call this out because such violations
// could result in tight sync loops hitting sync servers.
bool no_scheduling_allowed_;
+
+ // crbug/251307. This is a workaround for M29. crbug/259913 tracks proper fix
+ // for M30.
+ // The issue is that poll job runs after few hours of inactivity and therefore
+ // will always fail with auth error because of expired access token. Once
+ // fresh access token is requested poll job is not retried.
+ // The change is to remember that poll timer just fired and retry poll job
+ // after credentials are updated.
+ bool do_poll_after_credentials_updated_;
// TryJob might get called for multiple reasons. It should only call
// DoPollSyncSessionJob after some time since the last attempt.
« no previous file with comments | « sync/engine/sync_scheduler.h ('k') | sync/engine/sync_scheduler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698