[LCP] Browser: dump trace event once LCP changed
Currently, we dump the trace event on browser shutdown. This posed a challenge for Telemetry because Telemetry cannot retrieve the event after the tracing connection is shutdown. As a replacement, we dump the trace event whenever LCP-handler get updated. This way, Telemetry will see all the history candidates and the invalidation of them. Specifically, we use two events: 1. "NavStartToLargestContentfulPaint::Candidate::AllFrames::UKM" 2. "NavStartToLargestContentfulPaint::Invalidate::AllFrames::UKM" Telemetry needs to sort these events by the trace timestamp. And use the last one as the final result. Note that the LCP firing time is different from the trace timestamp. We store it in: event.args.data.durationInMilliseconds for the candidate event (1). This CL also adds the frame-type to the trace event. The frame-type indicates whether the content is from mainframe or subframe. Bug:967788 Change-Id: If9a75f6ce1f1c93af139557fdb199b096580a774 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1671027Reviewed-by:Liquan (Max) Gu <maxlg@chromium.org> Reviewed-by:
Bryan McQuade <bmcquade@chromium.org> Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org> Cr-Commit-Position: refs/heads/master@{#671936}
Showing
Please register or sign in to comment