[LCP] Text: wrap largest text paint in a class
Currently, we are using flags (is_reporting_lcp_) to stop the largest-text-paint pipeline in TextPaintTimingDetector. However, the flag is hard to maintain and is error-prone. To fix this issue, we introduce a wrapper for the largest-text-paint part of code. Once we stop largest-text-paint, we set the wrapper instance to null. This way, any data structure and functions of this pipeline would no longer be accessible. In this patch, we also remove the timer. The removal is included in this patch because it's part of the largest-text-paint pipeline. Although the removal is a relatively separate part, we suggest including it here because making it two steps would complicate the middle state. The removal of timer has several benefits: 1) can avoid the complicated control logic of timer. 2) can make the metric result more precise, because we move the result update from the 1s-timer callback to the swap-time assignment callback. Bug:977181,977926,977952 Change-Id: I01821517ee9a01c70ad65dd901b0f3d687bbb1de Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1672113 Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org> Reviewed-by:Liquan (Max) Gu <maxlg@chromium.org> Reviewed-by:
Nicolás Peña Moreno <npm@chromium.org> Reviewed-by:
Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/heads/master@{#671941}
Showing
Please register or sign in to comment