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

Unified Diff: components/sync/engine_impl/sync_scheduler_impl.cc

Issue 2911603003: [Sync] Stop dropping pending restarts from interleaved nudges. (Closed)
Patch Set: Created 3 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 | « no previous file | components/sync/engine_impl/sync_scheduler_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/engine_impl/sync_scheduler_impl.cc
diff --git a/components/sync/engine_impl/sync_scheduler_impl.cc b/components/sync/engine_impl/sync_scheduler_impl.cc
index 4c5ebce331ecb2822cb4c6f3718f6af60dbc9d1b..c2055eb9f9a11099114bb9b9bf7cbce7a10f1a5b 100644
--- a/components/sync/engine_impl/sync_scheduler_impl.cc
+++ b/components/sync/engine_impl/sync_scheduler_impl.cc
@@ -774,14 +774,15 @@ void SyncSchedulerImpl::OnTypesUnblocked() {
void SyncSchedulerImpl::PerformDelayedNudge() {
// Circumstances may have changed since we scheduled this delayed nudge.
// We must check to see if it's OK to run the job before we do so.
- if (CanRunNudgeJobNow(NORMAL_PRIORITY))
+ if (CanRunNudgeJobNow(NORMAL_PRIORITY)) {
TrySyncCycleJob();
-
- // We're not responsible for setting up any retries here. The functions that
- // first put us into a state that prevents successful sync cycles (eg. global
- // throttling, type throttling, network errors, transient errors) will also
- // setup the appropriate retry logic (eg. retry after timeout, exponential
- // backoff, retry when the network changes).
+ } else {
+ // If we set |waiting_interal_| while this PerformDelayedNudge was pending
+ // callback scheduled to |retry_timer_|, it's possible we didn't re-schedule
+ // because this PerformDelayedNudge was going to execute sooner. If that's
+ // the case, we need to make sure we setup to waiting callback now.
+ RestartWaiting();
+ }
}
void SyncSchedulerImpl::ExponentialBackoffRetry() {
« no previous file with comments | « no previous file | components/sync/engine_impl/sync_scheduler_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698