Descriptionsync: GU retry with less explicit TimeTicks logic
For reasons described in crbug.com/338016, I changed my mind on explicit
time tracking. This is an attempt to clean up my mistake.
This new approach has the NudgeTracker keep track of the time when the
next retry GU is scheduled, and a flag that is set to true when we
should perform a retry GU at the next possible opportunity. Before a
sync cycle, the NudgeTracker is provided with a TimeTicks::Now() value
and asked to update the flag accordingly.
This does a better job of ensuring the value of
NudgeTracker::IsRetryRequired() is consistent. After this CL, we can
guarantee that its value will be the same before, during, and after the
sync cycle. The previous implementation relied on a call to
TimeTicks::Now() in download.cc, so it did not have this property.
There is one tricky part to this patch. We need to be careful that we
the call to RecordSuccessfulSyncCycle() after a sync cycle does not
overwrite pending retry state that may have been set by that sync
cycle's SyncSessionDelegate::OnReceivedRetryDelay() function. To avoid
that problem, we store the value from that call in the SyncScheduler and
act on it only after we've updated the NudgeTracker's state when the
sync cycle is complete.
BUG=338016
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=248611
Patch Set 1 #
Total comments: 8
Patch Set 2 : Simplify updates; add more tests #
Total comments: 2
Patch Set 3 : Fix logic bug and add test for it #Patch Set 4 : Update comments #Patch Set 5 : One more comment update #
Total comments: 2
Patch Set 6 : Fix logic in GU retry fail edge case #
Total comments: 2
Patch Set 7 : Update NudgeTracker before normal mode transition cycle #
Messages
Total messages: 26 (0 generated)
|