Skip to content
  • bmcquade's avatar
    Reland: Buffer cross frame paint timing updates. · f576d151
    bmcquade authored
    This is a re-land of https://codereview.chromium.org/2901383002, which was
    reverted due to a timing dependency in ResourcePrefetchPredictorBrowserTest.
    SubresourceFcpOrder that has since been fixed (crbug.com/728176).
    
    Original change description:
    
    With the recent change to merge cross-frame paint timings, we sometimes encounter
    cases where these timings arrive out of order.
    
    For example, we may receive a first paint notification for frame A first,
    then a first paint notification for frame B, but frame B's first paint
    time may have happened before frame A's first paint time.
    
    In the current implementation, we dispatch a first paint notification to observers
    as soon as we receive a first paint notification from any frame in the page.
    
    This means we don't end up recording the true page-level first paint time on
    all pages.
    
    This change adds a 1s buffering period before we dispatch first paint notifications
    to observers. During this buffering period, we accumulate all first paint updates
    across all frames, and retain the minimum first paint time. We then dispatch the min
    observed first paint time across this window.
    
    This change should significantly reduce the frequency with which we log out of order
    paint timings. We have added new UMA to keep track of how often this continues to
    happen, even with the 1s buffering.
    
    BUG=728179
    TBR=isherman,mattcary
    
    Review-Url: https://codereview.chromium.org/2917693002
    Cr-Commit-Position: refs/heads/master@{#475955}
    f576d151