• Peter Boström's avatar
    Rewrite tab animation to use TimeTicks · 923f6277
    Peter Boström authored
    Avoids having additional high-frequency post tasking for no-op tasks in
    the background.
    
    To keep track of when to stop animating without an AnimationEnded
    callback, we keep track of the last-drawn animation state. This also has
    the side effect of allowing us to avoid repainting the loading-progress
    bar if would paint the same pixels we drew last time. This should avoid
    a lot of repaints for slow-loading sites.
    
    This also ends up fixing backwards-jumping indicators. Probably because
    the logic for clamping the loading-progress timer got easier.
    
    Bug: chromium:907044, chromium:905020, chromium:905452
    Change-Id: Ic83748bad83115ef2283c881a89ed65e3d3938ab
    Reviewed-on: https://chromium-review.googlesource.com/c/1346831Reviewed-by: default avatarSidney San Martín <sdy@chromium.org>
    Commit-Queue: Peter Boström <pbos@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#611234}
    923f6277
tab_unittest.cc 33.8 KB