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

Unified Diff: sync/engine/sync_scheduler_impl.h

Issue 10825439: sync: remove buggy freshness condition in SyncSchedulerImpl add defensive DCHECKs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: init Created 8 years, 4 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 | sync/engine/sync_scheduler_impl.cc » ('j') | sync/sessions/test_util.cc » ('J')
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 e5f3acf61d27aef8463e987beab557e914f059fc..e086c84d68ebe60e21303fc550b3bb91479e220f 100644
--- a/sync/engine/sync_scheduler_impl.h
+++ b/sync/engine/sync_scheduler_impl.h
@@ -313,9 +313,24 @@ class SyncSchedulerImpl : public SyncScheduler {
// The mode of operation.
Mode mode_;
- // TODO(tim): Bug 26339. This needs to track more than just time I think,
- // since the nudges could be for different types. Current impl doesn't care.
- base::TimeTicks last_sync_session_end_time_;
+ // Tracks the time that the last successful nudge or poll completed. This
+ // is an optimization to avoid performing unnecessary POLLs (if a nudge
+ // completed after the poll was scheduled to start) and unnecessary NUDGEs
+ // (if a POLL [which uses all data types] took place *after* the nudge was
rlarocque 2012/08/20 19:02:20 Can a POLL really replace a NUDGE? What if the NU
+ // supposed to start. Note that this does not result in dropping a NUDGE if
+ // another more recent NUDGE took place, because those NUDGEs would have
+ // been coalesced. The job will still be scheduled in that case (since we
+ // don't cancel outstanding jobs when coalescing), but this will be detected
+ // as a cancelled NUDGE by the session-equality check in DoSyncSessionJob).
+ // This excludes CONFIGURATION because 1) CONFIGURATION jobs are not subject
+ // to the freshness condition, and 2) a successful CONFIGURATION job should
+ // not trump a new NUDGE / POLL since there is no correlation between data
+ // types.
+ // TODO(tim): If NUDGEs are made to operate only on a subset of enabled types
+ // in the future, this will be insufficient as a NUDGE can't trump a full-
+ // datatype POLL. On the flip side, if POLLs are one day eliminated, this
+ // optimization is no longer necessary.
+ base::TimeTicks last_nudge_or_poll_end_time_;
// The latest connection code we got while trying to connect.
HttpResponse::ServerConnectionCode connection_code_;
« no previous file with comments | « no previous file | sync/engine/sync_scheduler_impl.cc » ('j') | sync/sessions/test_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698