Chromium Code Reviews
DescriptionMake the site engagement service more robust to clock changes and time inconsistencies.
This CL adjusts the site engagement service's logic for rebasing last
engagement times when no engagement has been earned for some time.
This code was prone to errors when users changed their clocks, where
last engagement times could be moved into the future or into the past
based on a clock change. This has only recently become an issue because
the rebasing codepath now triggers if no engagement is earned for ~9
hours, as opposed to three weeks.
The code was also brittle if the overall last engagement time (a lossy
pref) became out of sync with any single engagement score's last
engagement time (a lossy content setting). It is theoretically possible
that the content setting would be written to prefs, but the overall last
engagement time would not due to the prefs system buffering the lossy
write and then failing to complete it before browser shutdown.
This CL changes the rebase logic to also sanely handle unexpected times
caused by changing clocks or pref writing race conditions. Time rebasing
now occurs when the last engagement time is detected to be in the future
as well as in the past. Regression tests are added to ensure the correct
behaviour.
BUG=654560
Review-Url: https://chromiumcodereview.appspot.com/2427343002
Cr-Commit-Position: refs/heads/master@{#426696}
(cherry picked from commit ed64b2a6aaeb060283ca5583abc1583a879b1ce1)
Committed: https://chromium.googlesource.com/chromium/src/+/932ce7acd24d0b4b2f1fd2eb17be6fe5594962cb
Patch Set 1 #
Messages
Total messages: 2 (1 generated)
|
|||||||||||||||||||||||||||||||||||||