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

Issue 1473153002: PageLoadMetricsObservers observe individual page loads (Closed)

Created:
5 years, 1 month ago by Charlie Harrison
Modified:
5 years ago
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

Instead of PageLoadMetricsObservers observing load events occurring in a tab, this change makes observers observe individual page loads. This allows observers to keep a much simpler state of the world, because they only get notifications about a single load. This change forces observers lifetime to be scoped to a single page load. BUG=546116 Committed: https://crrev.com/63ecf201ac56577842fd86039002e93e8b6d0ebc Cr-Commit-Position: refs/heads/master@{#363480}

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : #

Patch Set 4 #

Patch Set 5 : #

Patch Set 6 : Observe on creation #

Total comments: 28

Patch Set 7 : responded to Randy's comments #

Patch Set 8 : #

Total comments: 4

Patch Set 9 : Bryan review #

Total comments: 3

Patch Set 10 : rebase on #362343 #

Total comments: 4

Patch Set 11 : Observers are owned by the PageLoadTracker #

Patch Set 12 : comments #

Patch Set 13 : rebase and update for s-w-r experiment #

Total comments: 9

Patch Set 14 : Randy review: comment + simpler destructor #

Total comments: 6

Patch Set 15 : Randy/Bryan review: needed to revert ~MWCO destructor for lifecycle reasons #

Total comments: 1

Patch Set 16 : destroy order #

Unified diffs Side-by-side diffs Delta from patch set Stats (+195 lines, -224 lines) Patch
M chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +1 line, -4 lines 0 comments Download
M chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -8 lines 0 comments Download
M chrome/browser/page_load_metrics/observers/google_captcha_observer.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -5 lines 0 comments Download
M chrome/browser/page_load_metrics/observers/google_captcha_observer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -13 lines 0 comments Download
M chrome/browser/page_load_metrics/observers/page_load_metrics_observers_unittest.cc View 1 2 3 4 5 6 7 8 9 10 9 chunks +35 lines, -30 lines 0 comments Download
M chrome/browser/page_load_metrics/observers/stale_while_revalidate_metrics_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -4 lines 0 comments Download
M chrome/browser/page_load_metrics/observers/stale_while_revalidate_metrics_observer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -8 lines 0 comments Download
M chrome/browser/page_load_metrics/page_load_metrics_initialize.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -2 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 2 chunks +17 lines, -27 lines 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 13 chunks +37 lines, -29 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 15 12 chunks +53 lines, -53 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 7 chunks +12 lines, -11 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 4 chunks +19 lines, -27 lines 0 comments Download
M components/page_load_metrics/browser/page_load_metrics_observer.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 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 1 chunk +2 lines, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 46 (14 generated)
Charlie Harrison
PTAL. This change reflects what we talked about in our sync today. That is, we ...
5 years ago (2015-11-24 22:10:07 UTC) #4
Charlie Harrison
On 2015/11/24 22:10:07, csharrison wrote: > PTAL. This change reflects what we talked about in ...
5 years ago (2015-11-24 22:10:35 UTC) #5
Randy Smith (Not in Mondays)
So I like the basic goal (which I take to be to allow consumers to ...
5 years ago (2015-11-28 22:03:14 UTC) #6
Charlie Harrison
Thanks for the review, Randy. Let me know if this is what you had in ...
5 years ago (2015-11-30 16:39:29 UTC) #7
Bryan McQuade
https://codereview.chromium.org/1473153002/diff/140001/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/1473153002/diff/140001/components/page_load_metrics/browser/metrics_web_contents_observer.cc#newcode113 components/page_load_metrics/browser/metrics_web_contents_observer.cc:113: : has_commit_(false), need to set renderer_tracked_ to false here ...
5 years ago (2015-11-30 17:00:53 UTC) #8
Charlie Harrison
https://codereview.chromium.org/1473153002/diff/140001/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/1473153002/diff/140001/components/page_load_metrics/browser/metrics_web_contents_observer.cc#newcode113 components/page_load_metrics/browser/metrics_web_contents_observer.cc:113: : has_commit_(false), On 2015/11/30 17:00:53, Bryan McQuade wrote: > ...
5 years ago (2015-11-30 17:49:40 UTC) #9
Bryan McQuade
https://codereview.chromium.org/1473153002/diff/160001/components/page_load_metrics/browser/page_load_metrics_observer.cc File components/page_load_metrics/browser/page_load_metrics_observer.cc (right): https://codereview.chromium.org/1473153002/diff/160001/components/page_load_metrics/browser/page_load_metrics_observer.cc#newcode32 components/page_load_metrics/browser/page_load_metrics_observer.cc:32: if (observable_) what happens if someone calls MWCO::RemoveObserver() directly, ...
5 years ago (2015-11-30 19:18:48 UTC) #10
Charlie Harrison
https://codereview.chromium.org/1473153002/diff/160001/components/page_load_metrics/browser/page_load_metrics_observer.cc File components/page_load_metrics/browser/page_load_metrics_observer.cc (right): https://codereview.chromium.org/1473153002/diff/160001/components/page_load_metrics/browser/page_load_metrics_observer.cc#newcode32 components/page_load_metrics/browser/page_load_metrics_observer.cc:32: if (observable_) On 2015/11/30 19:18:48, Bryan McQuade wrote: > ...
5 years ago (2015-11-30 22:22:02 UTC) #11
Randy Smith (Not in Mondays)
Ok, so with a bit of cleanup I can see that my primary quarrel with ...
5 years ago (2015-12-01 22:34:03 UTC) #12
Charlie Harrison
I'm in favor of forcing the observers to be owned by the PageLoadTracker. If a ...
5 years ago (2015-12-01 22:54:24 UTC) #13
Charlie Harrison
I convinced myself that the PageLoadTracker should explicitly own the observers. To expand on my ...
5 years ago (2015-12-02 01:30:29 UTC) #14
Bryan McQuade
+1 to making PLMObservers owned by PLMObservables. Thanks Charles and Randy! On Tue, Dec 1, ...
5 years ago (2015-12-02 15:16:56 UTC) #15
Randy Smith (Not in Mondays)
Very nice. Thank you for putting up with me. Could you bring the CL description ...
5 years ago (2015-12-03 01:20:42 UTC) #16
Charlie Harrison
Updated the description. Thanks! https://codereview.chromium.org/1473153002/diff/240001/chrome/browser/page_load_metrics/observers/page_load_metrics_observers_unittest.cc File chrome/browser/page_load_metrics/observers/page_load_metrics_observers_unittest.cc (right): https://codereview.chromium.org/1473153002/diff/240001/chrome/browser/page_load_metrics/observers/page_load_metrics_observers_unittest.cc#newcode22 chrome/browser/page_load_metrics/observers/page_load_metrics_observers_unittest.cc:22: class TestFromGWSPageLoadMetricsObserver On 2015/12/03 01:20:42, ...
5 years ago (2015-12-03 13:35:35 UTC) #18
Randy Smith (Not in Mondays)
A couple of suggestions WRT the CL description, then LGTM. * "makes observers to observe ...
5 years ago (2015-12-03 21:06:49 UTC) #19
Bryan McQuade
https://codereview.chromium.org/1473153002/diff/260001/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h File chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h (right): https://codereview.chromium.org/1473153002/diff/260001/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h#newcode26 chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h:26: bool navigation_from_gws_; can this be private? https://codereview.chromium.org/1473153002/diff/260001/chrome/browser/page_load_metrics/observers/google_captcha_observer.cc File chrome/browser/page_load_metrics/observers/google_captcha_observer.cc ...
5 years ago (2015-12-03 22:10:36 UTC) #21
Charlie Harrison
Randy: I had to revert the change to ~MetricsWebContentsObserver, because we need to be sure ...
5 years ago (2015-12-03 22:30:25 UTC) #23
Matt Welsh
> Matt: Can you review your observer changes? I added the SOLVED code to the ...
5 years ago (2015-12-03 22:37:58 UTC) #24
Bryan McQuade
lgtm
5 years ago (2015-12-03 22:43:37 UTC) #25
Charlie Harrison
On 2015/12/03 22:43:37, Bryan McQuade wrote: > lgtm Matt: sgtm, thanks!
5 years ago (2015-12-03 23:28:53 UTC) #26
Matt Welsh
On 2015/12/03 23:28:53, csharrison wrote: > On 2015/12/03 22:43:37, Bryan McQuade wrote: > > lgtm ...
5 years ago (2015-12-03 23:32:16 UTC) #27
Matt Welsh
Tested and works fine - lgtm
5 years ago (2015-12-04 17:00:12 UTC) #28
Charlie Harrison
Thanks, everyone. Randy, I removed the comment about longer-lived observers for now.
5 years ago (2015-12-04 17:05:59 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1473153002/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1473153002/280001
5 years ago (2015-12-04 17:06:52 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/125083)
5 years ago (2015-12-04 17:19:00 UTC) #34
Charlie Harrison
isherman@, can you take a look at the minor change to histograms.xml?
5 years ago (2015-12-04 17:20:46 UTC) #36
Ilya Sherman
histograms.xml lgtm
5 years ago (2015-12-05 02:45:57 UTC) #37
Randy Smith (Not in Mondays)
https://codereview.chromium.org/1473153002/diff/280001/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/1473153002/diff/280001/components/page_load_metrics/browser/metrics_web_contents_observer.cc#newcode398 components/page_load_metrics/browser/metrics_web_contents_observer.cc:398: // The PageLoadTrackers must be deleted before the |embedded_interface_|. ...
5 years ago (2015-12-05 14:13:28 UTC) #38
Charlie Harrison
I used your suggestion Randy, thanks!
5 years ago (2015-12-07 13:36:41 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1473153002/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1473153002/300001
5 years ago (2015-12-07 13:37:03 UTC) #42
commit-bot: I haz the power
Committed patchset #16 (id:300001)
5 years ago (2015-12-07 15:26:16 UTC) #44
commit-bot: I haz the power
5 years ago (2015-12-07 15:27:12 UTC) #46
Message was sent while issue was closed.
Patchset 16 (id:??) landed as
https://crrev.com/63ecf201ac56577842fd86039002e93e8b6d0ebc
Cr-Commit-Position: refs/heads/master@{#363480}

Powered by Google App Engine
This is Rietveld 408576698