Clear PaintTimingDetectors when not needed Currently, none of the memory in PaintTimingDetector is cleared ever. This means that all of the memory is kept long after the numbers have been used to compute metrics. This CL fixes this by resetting the memebers of PaintTimingDetector when they are deemed no longer needed. This is done instead of resetting PaintTimingDetector to keep the change more contained to the relevant classes (the PaintTimingDetector itself is accessed from a variety of locations in the code). In ImagePaintTimingDetector, UpdateCandidate() is called during OnPaintFinished() as a result of recording, or during the swap promises queued on OnPaintFinished(). Thus, looking at those two is sufficient to know if it will be updated. In TextPaintTimingDetector, UpdateCandidate() is called similarly during updates at OnPaintFinished(), or when the timer is fired. Thus, again looking at those is sufficient to know when the largest text information is final. The outputs from Image and Text are stored in PaintTimingDetector so they can be queried even after the specific detectors are destroyed. Change-Id: Ic835808c73e889800a63cb70993279f07b8d00e7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1588165 Commit-Queue: Nicolás Peña Moreno <npm@chromium.org> Reviewed-by: Steve Kobes <skobes@chromium.org> Reviewed-by: Liquan (Max) Gu <maxlg@chromium.org> Cr-Commit-Position: refs/heads/master@{#656125}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .