Skip to content
  • Bryan McQuade's avatar
    Unconditionally track and send page load metrics from the render process. · 1d51d85b
    Bryan McQuade authored
    In the current page load metrics implementation, we allow tracking of metrics
    in child frames on the page. This is used to collect and compute first contentful
    paint and other metrics at the whole page level (across all frames), among other
    things.
    
    We have some page-level metric tracking policy in place for deciding whether a
    page load is eligible for page load metrics tracking. For instance, we only track
    if the main page in an http or https URL, if the mime type is html or xhtml, etc.
    
    This policy should only be applied for the top-level frame, and then any child
    frames on a page should use the policy of the topmost frame when deciding whether
    to track metrics. So if for example a page with an https URL contains a frame
    with a non http/https scheme (e.g. a frame created via javascript, which is
    common for ads), we should track paint updates in that child towards the
    page-level first paint, even though its URL is not http or https.
    
    To address this, this change unconditionally tracks and sends metrics for all
    render frames, and policy about whether a given page load should be tracked is
    only enforced in the browser process.
    
    This both addresses the bug where metrics aren't tracked in some child frames of
    pages eligible for tracking, and makes it easier for us to be more flexible in
    allowing other page load metrics observers to track metrics in pages that don't
    meet the PLM tracking policy, for example, the NTP, or an extension page.
    
    This change also adds a histogram error code counter to count cases where we
    receive timing from a child frame but aren't tracking a page load.
    
    Bug: 759394
    Change-Id: I9cf3378b194b689bc0ab7dd35e00472471e41a91
    Reviewed-on: https://chromium-review.googlesource.com/641633
    
    
    Commit-Queue: Bryan McQuade <bmcquade@chromium.org>
    Reviewed-by: default avatarCharlie Harrison <csharrison@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#498261}
    1d51d85b