Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Issue 2901383002: Buffer cross frame paint timing updates. (Closed)

Created:
3 years, 7 months ago by Bryan McQuade
Modified:
3 years, 6 months ago
CC:
chromium-reviews, csharrison+watch_chromium.org, loading-reviews+metrics_chromium.org, speed-metrics-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Buffer cross frame paint timing updates. With the recent change to merge cross-frame paint timings, we sometimes encounter cases where these timings arrive out of order. For example, we may receive a first paint notification for frame A first, then a first paint notification for frame B, but frame B's first paint time may have happened before frame A's first paint time. In the current implementation, we dispatch a first paint notification to observers as soon as we receive a first paint notification from any frame in the page. This means we don't end up recording the true page-level first paint time on all pages. This change adds a 1s buffering period before we dispatch first paint notifications to observers. During this buffering period, we accumulate all first paint updates across all frames, and retain the minimum first paint time. We then dispatch the min observed first paint time across this window. This change should significantly reduce the frequency with which we log out of order paint timings. We have added new UMA to keep track of how often this continues to happen, even with the 1s buffering. BUG=726387 Review-Url: https://codereview.chromium.org/2901383002 Cr-Commit-Position: refs/heads/master@{#475878} Committed: https://chromium.googlesource.com/chromium/src/+/457de7596c43cbce74ea3cbae7d9ab1e93fe9d5a

Patch Set 1 #

Patch Set 2 : clean up tests #

Patch Set 3 : test updates #

Patch Set 4 : test cleanups #

Patch Set 5 : remove unused method #

Patch Set 6 : remove unused method #

Patch Set 7 : cleanup #

Patch Set 8 : add comments #

Patch Set 9 : add comment #

Patch Set 10 : update histograms.xml #

Patch Set 11 : refactor to remove some test only getters #

Patch Set 12 : fix android build #

Patch Set 13 : revert a few unnecessary changes #

Patch Set 14 : fix android build #

Total comments: 18

Patch Set 15 : fix android build #

Total comments: 4

Patch Set 16 : address comments #

Patch Set 17 : address comments #

Patch Set 18 : cleanup #

Patch Set 19 : factor WeakMockTimer into a common location. #

Total comments: 21

Patch Set 20 : Factor out common test and utility code. #

Patch Set 21 : cleanup #

Patch Set 22 : cleanup #

Patch Set 23 : add missing include #

Total comments: 2

Patch Set 24 : address comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+516 lines, -480 lines) Patch
M chrome/browser/page_load_metrics/metrics_web_contents_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/page_load_metrics/metrics_web_contents_observer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +11 lines, -1 line 0 comments Download
M chrome/browser/page_load_metrics/metrics_web_contents_observer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 7 chunks +158 lines, -8 lines 0 comments Download
M chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +12 lines, -70 lines 0 comments Download
M chrome/browser/page_load_metrics/page_load_metrics_embedder_interface.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/page_load_metrics/page_load_metrics_initialize.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 5 chunks +9 lines, -6 lines 0 comments Download
M chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 8 chunks +124 lines, -31 lines 0 comments Download
M chrome/browser/page_load_metrics/page_load_metrics_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +1 line, -22 lines 0 comments Download
M chrome/browser/page_load_metrics/page_load_metrics_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +0 lines, -53 lines 0 comments Download
M chrome/browser/page_load_metrics/page_load_tracker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/prerender/prerender_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 9 chunks +8 lines, -15 lines 0 comments Download
M chrome/common/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +4 lines, -0 lines 0 comments Download
A chrome/common/page_load_metrics/page_load_metrics_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +40 lines, -0 lines 0 comments Download
A + chrome/common/page_load_metrics/page_load_metrics_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +3 lines, -95 lines 0 comments Download
A chrome/common/page_load_metrics/test/page_load_metrics_test_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +19 lines, -0 lines 0 comments Download
A + chrome/common/page_load_metrics/test/page_load_metrics_test_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +7 lines, -136 lines 0 comments Download
A chrome/common/page_load_metrics/test/weak_mock_timer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +44 lines, -0 lines 0 comments Download
A chrome/common/page_load_metrics/test/weak_mock_timer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +25 lines, -0 lines 0 comments Download
M chrome/renderer/page_load_metrics/metrics_render_frame_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/page_load_metrics/metrics_render_frame_observer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/renderer/page_load_metrics/metrics_render_frame_observer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 11 chunks +19 lines, -33 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +2 lines, -2 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 97 (80 generated)
Bryan McQuade
PTAL, thanks! This change builds on https://codereview.chromium.org/2903693004.
3 years, 7 months ago (2017-05-25 19:00:45 UTC) #28
Bryan McQuade
On 2017/05/25 at 19:00:45, Bryan McQuade wrote: > PTAL, thanks! This change builds on https://codereview.chromium.org/2903693004. ...
3 years, 7 months ago (2017-05-26 00:27:00 UTC) #37
Charlie Harrison
It looks pretty good so far https://codereview.chromium.org/2901383002/diff/240001/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc File chrome/browser/page_load_metrics/metrics_web_contents_observer.cc (right): https://codereview.chromium.org/2901383002/diff/240001/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc#newcode104 chrome/browser/page_load_metrics/metrics_web_contents_observer.cc:104: // PageLoadMetricsObservers can ...
3 years, 7 months ago (2017-05-26 19:31:34 UTC) #48
Bryan McQuade
https://codereview.chromium.org/2901383002/diff/240001/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc File chrome/browser/page_load_metrics/metrics_web_contents_observer.cc (right): https://codereview.chromium.org/2901383002/diff/240001/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc#newcode104 chrome/browser/page_load_metrics/metrics_web_contents_observer.cc:104: // PageLoadMetricsObservers can cause code to execute that wants ...
3 years, 7 months ago (2017-05-26 20:07:33 UTC) #51
Bryan McQuade
https://codereview.chromium.org/2901383002/diff/240001/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc File chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc (right): https://codereview.chromium.org/2901383002/diff/240001/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc#newcode327 chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc:327: DispatchTimingUpdates(); On 2017/05/26 at 20:07:32, Bryan McQuade wrote: > ...
3 years, 7 months ago (2017-05-26 21:51:33 UTC) #58
Bryan McQuade
On 2017/05/26 at 21:51:33, Bryan McQuade wrote: > https://codereview.chromium.org/2901383002/diff/240001/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc > File chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc (right): > > ...
3 years, 6 months ago (2017-05-30 13:08:28 UTC) #63
Charlie Harrison
LGTM % comments https://codereview.chromium.org/2901383002/diff/240001/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc File chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc (right): https://codereview.chromium.org/2901383002/diff/240001/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc#newcode222 chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc:222: class PaintTimingMerger { On 2017/05/26 20:07:32, ...
3 years, 6 months ago (2017-05-30 14:49:08 UTC) #66
Bryan McQuade
Thanks! Addressed comments. I also factored some common test code in PLMOTestHarness into a common ...
3 years, 6 months ago (2017-05-30 15:30:23 UTC) #73
Bryan McQuade
isherman, PTAL for histograms.xml, thanks! mattcary, PTAL for prerender_browsertest.cc, thanks!
3 years, 6 months ago (2017-05-30 15:31:14 UTC) #75
Charlie Harrison
Clarifying my argument below, still lgtm though https://codereview.chromium.org/2901383002/diff/340001/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc File chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc (right): https://codereview.chromium.org/2901383002/diff/340001/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc#newcode328 chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.cc:328: void PageLoadMetricsUpdateDispatcher::ShutDown() ...
3 years, 6 months ago (2017-05-30 16:33:15 UTC) #80
Bryan McQuade
On 2017/05/30 at 16:33:15, csharrison wrote: > Clarifying my argument below, still lgtm though > ...
3 years, 6 months ago (2017-05-30 16:37:43 UTC) #81
Ilya Sherman
Metrics LGTM % a question: https://codereview.chromium.org/2901383002/diff/420001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2901383002/diff/420001/tools/metrics/histograms/histograms.xml#newcode90778 tools/metrics/histograms/histograms.xml:90778: + label="Recorded after timing ...
3 years, 6 months ago (2017-05-30 19:31:38 UTC) #84
Bryan McQuade
https://codereview.chromium.org/2901383002/diff/420001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2901383002/diff/420001/tools/metrics/histograms/histograms.xml#newcode90778 tools/metrics/histograms/histograms.xml:90778: + label="Recorded after timing update buffering in the browser ...
3 years, 6 months ago (2017-05-31 01:05:30 UTC) #87
mattcary
lgtm for prerender_browsertest
3 years, 6 months ago (2017-05-31 07:38:05 UTC) #90
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2901383002/440001
3 years, 6 months ago (2017-05-31 11:36:23 UTC) #93
commit-bot: I haz the power
Committed patchset #24 (id:440001) as https://chromium.googlesource.com/chromium/src/+/457de7596c43cbce74ea3cbae7d9ab1e93fe9d5a
3 years, 6 months ago (2017-05-31 11:41:23 UTC) #96
Mathieu
3 years, 6 months ago (2017-05-31 14:03:26 UTC) #97
Message was sent while issue was closed.
On 2017/05/31 11:41:23, commit-bot: I haz the power wrote:
> Committed patchset #24 (id:440001) as
>
https://chromium.googlesource.com/chromium/src/+/457de7596c43cbce74ea3cbae7d9...

A revert has been created (manually, ugh):

https://chromium-review.googlesource.com/c/519363/

Powered by Google App Engine
This is Rietveld 408576698