Skip to content

merge_pr_56743

Choose a tag to compare

@github-actions github-actions released this 16 Dec 17:34

[soft navs] Refactor pending ICP entry buffering

Currently, SoftNavigationContext tracks the current largest text and
image records, and uses those to emit the ICP performance entry and
update metrics if and when the soft navigation entry is emitted. This CL
changes this flow so that now we track the latest un-emitted
InteractionContentfulPaint object and emit that directly. To do this,
the LCP calculator continuously updates its state and calls the Delegate
EmitPerformanceEntry method, but actual ICP emission is guarded there,
where we either create and emit it synchronously or buffer it for later.

This is being done because:

  1. To unify ICP and LCP and to better control lifetime of
    PaintTimingRecords (in advance of strongifying some of its fields),
    we want to move the largest text and image tracking into the LCP
    calculator. We don't plan to expose these values, as the records
    themselves shouldn't be persisted beyond getting presentation
    feedback, but SNC needs to buffer the latest candidate indefinitely.

  2. We plan to guarantee the Node and MediaObject are alive through this
    callback, which might not be the case now if the node is removed,
    and capturing the state here ensures we have what we need for
    emission.

Bug: 454082771, 454082773
Change-Id: I093d37960f774e5ca8946d8a0aa27cd9d592125f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7120640
Reviewed-by: Michal Mocny mmocny@chromium.org
Commit-Queue: Scott Haseley shaseley@chromium.org
Cr-Commit-Position: refs/heads/main@{#1559386}