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

Issue 2139143002: Standardize which page loads are tracked (Closed)

Created:
4 years, 5 months ago by Bryan McQuade
Modified:
4 years, 5 months ago
Reviewers:
Charlie Harrison
CC:
chromium-reviews, csharrison+watch_chromium.org, loading-reviews+metrics_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Standardize which page loads are tracked The current PLM implementation has a concept of 'renderer tracked' which indicates whether the given page load is expected to report metrics from the render process. Many page load observers filter out non-tracked navigations by returning early in OnComplete if the provided PageLoadTiming is empty, but this is non-obvious so some observers forget to do this, which results in them tracking e.g. non-HTML pages, but not receiving any metrics for those pages. See https://bugs.chromium.org/p/chromium/issues/detail?id=627536 for one example. Based on feedback from other observer implementers, there's a consistent request to avoid tracking the following: 1. error pages (4xx, 5xx) 2. non-HTTP/HTTPS pages 3. non-HTML pages Based on the above, this change gets rid of the 'renderer tracked' intermediate state, and updates DidStartNavigation and DidFinishNavigation to check to see if the given NavigationHandle meets any of the above criteria for not being tracked, and if so: * In DidStartNavigation, we do not create a PageLoadTracker * In DidFinishNavigation, we'll tell the existing PageLoadTracker (if any) that it should stop tracking metrics. If a PageLoadTracker has stopped tracking metrics, it will not invoke additional callbacks such as OnComplete on observers. Note that certain criteria, such as whether the page is HTML, or an error page, (or even a same page navigation) are not known until commit, and thus we begin tracking such page loads in DidStartNavigation but stop tracking at commit time. BUG=627585 Committed: https://crrev.com/26615f40a69f11cee759a0b546061ea84fff8ca8 Cr-Commit-Position: refs/heads/master@{#405774}

Patch Set 1 #

Patch Set 2 : ordering cleanup #

Patch Set 3 : add comment #

Patch Set 4 : fix #

Patch Set 5 : rename #

Patch Set 6 : fix broken tests #

Patch Set 7 : rename variable #

Patch Set 8 : updates #

Patch Set 9 : fixes #

Patch Set 10 : fix formatting #

Patch Set 11 : update test to reflect fix #

Patch Set 12 : update comments #

Patch Set 13 : Fixes #

Patch Set 14 : cleanup #

Patch Set 15 : fix #

Patch Set 16 : simplify #

Patch Set 17 : fix observers #

Patch Set 18 : fix #

Patch Set 19 : fix #

Patch Set 20 : address test failures #

Patch Set 21 : split out second half of change #

Patch Set 22 : fix test #

Patch Set 23 : revert engagement observer change #

Patch Set 24 : test fixes #

Patch Set 25 : cleanup #

Patch Set 26 : revert whitespace change #

Total comments: 7

Patch Set 27 : address comments #

Patch Set 28 : address comment #

Patch Set 29 : add tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+190 lines, -137 lines) Patch
M chrome/browser/page_load_metrics/observers/aborts_page_load_metrics_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 24 25 26 27 28 1 chunk +19 lines, -0 lines 0 comments Download
M chrome/browser/page_load_metrics/observers/https_engagement_metrics/https_engagement_page_load_metrics_observer_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +5 lines, -14 lines 0 comments Download
M chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M components/page_load_metrics/browser/metrics_web_contents_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4 chunks +19 lines, -4 lines 0 comments Download
M components/page_load_metrics/browser/metrics_web_contents_observer.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 24 25 26 27 28 11 chunks +95 lines, -79 lines 0 comments Download
M components/page_load_metrics/browser/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 24 4 chunks +25 lines, -21 lines 0 comments Download
M components/page_load_metrics/browser/page_load_metrics_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 4 chunks +22 lines, -18 lines 0 comments Download
M components/page_load_metrics/common/page_load_timing.h View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 60 (48 generated)
Bryan McQuade
PTAL
4 years, 5 months ago (2016-07-15 12:40:31 UTC) #38
Charlie Harrison
Looks good, thanks for the refactor. https://codereview.chromium.org/2139143002/diff/500001/components/page_load_metrics/browser/metrics_web_contents_observer.cc File components/page_load_metrics/browser/metrics_web_contents_observer.cc (right): https://codereview.chromium.org/2139143002/diff/500001/components/page_load_metrics/browser/metrics_web_contents_observer.cc#newcode758 components/page_load_metrics/browser/metrics_web_contents_observer.cc:758: committed_load_ && tracker) ...
4 years, 5 months ago (2016-07-15 13:01:17 UTC) #40
Bryan McQuade
Thanks! Addressed comment, and I added one question about when we should be invoking the ...
4 years, 5 months ago (2016-07-15 14:14:43 UTC) #43
Charlie Harrison
https://codereview.chromium.org/2139143002/diff/500001/components/page_load_metrics/browser/metrics_web_contents_observer.cc File components/page_load_metrics/browser/metrics_web_contents_observer.cc (right): https://codereview.chromium.org/2139143002/diff/500001/components/page_load_metrics/browser/metrics_web_contents_observer.cc#newcode758 components/page_load_metrics/browser/metrics_web_contents_observer.cc:758: committed_load_ && tracker) On 2016/07/15 14:14:42, Bryan McQuade wrote: ...
4 years, 5 months ago (2016-07-15 14:19:55 UTC) #44
Bryan McQuade
Moved the abort call to happen for all committed navs. PTAL, thanks!
4 years, 5 months ago (2016-07-15 15:02:27 UTC) #47
Charlie Harrison
Sorry should have mentioned it before but could you add a test which catches that ...
4 years, 5 months ago (2016-07-15 15:04:04 UTC) #48
Bryan McQuade
On 2016/07/15 at 15:04:04, csharrison wrote: > Sorry should have mentioned it before but could ...
4 years, 5 months ago (2016-07-15 15:37:30 UTC) #51
Charlie Harrison
Good find and it lgtm. Thanks for adding the tests.
4 years, 5 months ago (2016-07-15 15:44:08 UTC) #52
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/2139143002/560001
4 years, 5 months ago (2016-07-15 16:55:48 UTC) #56
commit-bot: I haz the power
Committed patchset #29 (id:560001)
4 years, 5 months ago (2016-07-15 17:00:42 UTC) #57
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-15 17:01:11 UTC) #58
commit-bot: I haz the power
4 years, 5 months ago (2016-07-15 17:02:14 UTC) #60
Message was sent while issue was closed.
Patchset 29 (id:??) landed as
https://crrev.com/26615f40a69f11cee759a0b546061ea84fff8ca8
Cr-Commit-Position: refs/heads/master@{#405774}

Powered by Google App Engine
This is Rietveld 408576698