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}
9 files changed