Chromium Code Reviews| 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_; |