[LongTasks] Change |enabled_| flag in PerformanceMonitor
Currently, |enabled_| is a boolean used as a performance optimization to avoid doing work when nothing is subscribing to violations that are reported by the PerformanceMonitor. This is often the case, so the optimization works well, although it is only slightly faster than just checking whether the corresponding |thresholds_| entry is_zero(). However, we plan to start buffering longtasks soon, which requires observing for them from the beginning regardless of the presence of a PerformanceObserver. With this change, |enabled_| would not work well as an optimization because it would be set to true most of the time. This CL changes its meaning so that it excludes longtasks, thus being false most of the time even after we start observing longtasks by default. Bug: 1016815 Change-Id: I06d8e8631c83663ead48f344ca08759472edf61c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1874048 Commit-Queue: Nicolás Peña Moreno <npm@chromium.org> Reviewed-by:Andrey Kosyakov <caseq@chromium.org> Reviewed-by:
David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/master@{#709066}
Showing
Please register or sign in to comment