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

Issue 1901303004: [ Don't commit ] Add FromGWS variants to the AbortTiming metrics (Closed)

Created:
4 years, 8 months ago by Charlie Harrison
Modified:
4 years, 8 months ago
Reviewers:
Bryan McQuade
CC:
asvitkine+watch_chromium.org, 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

Add FromGWS variants to the AbortTiming metrics BUG=605259

Patch Set 1 #

Patch Set 2 : Tweaks #

Total comments: 16

Patch Set 3 : Fix/Add tests #

Total comments: 8

Patch Set 4 : bmcquade@ review, cleanup #

Unified diffs Side-by-side diffs Delta from patch set Stats (+502 lines, -127 lines) Patch
M chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h View 1 2 3 4 chunks +21 lines, -10 lines 0 comments Download
M chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc View 1 2 3 4 chunks +198 lines, -66 lines 0 comments Download
M chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer_unittest.cc View 1 2 3 5 chunks +175 lines, -13 lines 0 comments Download
M components/page_load_metrics/browser/metrics_web_contents_observer.h View 1 2 3 2 chunks +4 lines, -1 line 0 comments Download
M components/page_load_metrics/browser/metrics_web_contents_observer.cc View 1 2 3 6 chunks +19 lines, -7 lines 0 comments Download
M components/page_load_metrics/browser/page_load_metrics_observer.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/page_load_metrics/renderer/metrics_render_frame_observer.cc View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M components/page_load_metrics/renderer/metrics_render_frame_observer_unittest.cc View 1 2 3 5 chunks +31 lines, -8 lines 0 comments Download
M components/page_load_metrics/renderer/page_timing_metrics_sender.h View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M components/page_load_metrics/renderer/page_timing_metrics_sender.cc View 1 2 3 3 chunks +12 lines, -6 lines 0 comments Download
M components/page_load_metrics/renderer/page_timing_metrics_sender_unittest.cc View 1 2 3 3 chunks +14 lines, -13 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 1 chunk +21 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (2 generated)
Charlie Harrison
PTAL. I ended up doing a couple tweaks after a lot of testing. I'm also ...
4 years, 8 months ago (2016-04-21 20:04:30 UTC) #2
Charlie Harrison
That is, manual testing. I can add unit tests to this tomorrow.
4 years, 8 months ago (2016-04-21 20:05:06 UTC) #3
Bryan McQuade
thanks! I haven't made it all the way through but i left some initial comments. ...
4 years, 8 months ago (2016-04-21 20:50:41 UTC) #4
Charlie Harrison
Thanks for the prompt review. Mostly ACKed your comments. https://codereview.chromium.org/1901303004/diff/20001/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc File chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc (right): https://codereview.chromium.org/1901303004/diff/20001/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc#newcode381 chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc:381: ...
4 years, 8 months ago (2016-04-21 21:09:24 UTC) #5
Charlie Harrison
FYI I am hugely supportive of not having observers know about the opener. That means ...
4 years, 8 months ago (2016-04-21 21:26:55 UTC) #6
Bryan McQuade
On 2016/04/21 at 21:26:55, csharrison wrote: > FYI I am hugely supportive of not having ...
4 years, 8 months ago (2016-04-21 21:46:52 UTC) #7
Charlie Harrison
On 2016/04/21 21:46:52, Bryan McQuade wrote: > On 2016/04/21 at 21:26:55, csharrison wrote: > > ...
4 years, 8 months ago (2016-04-21 21:50:28 UTC) #8
Charlie Harrison
Added some tests. PTAL.
4 years, 8 months ago (2016-04-22 16:32:48 UTC) #9
Bryan McQuade
Thanks! A few comments. https://codereview.chromium.org/1901303004/diff/40001/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc File chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc (right): https://codereview.chromium.org/1901303004/diff/40001/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc#newcode377 chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc:377: switch (navigation_type) { there are ...
4 years, 8 months ago (2016-04-25 22:38:44 UTC) #10
Bryan McQuade
Can we split this into 2 or 3 changes? 1. abort metrics 2. opener 3. ...
4 years, 8 months ago (2016-04-26 14:52:59 UTC) #11
Charlie Harrison
4 years, 8 months ago (2016-04-26 16:53:35 UTC) #12
Ok here's the latest fix that I'll split up. I'll review the ping logic / opener
in that cl.

https://codereview.chromium.org/1901303004/diff/40001/chrome/browser/page_loa...
File
chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc
(right):

https://codereview.chromium.org/1901303004/diff/40001/chrome/browser/page_loa...
chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc:377:
switch (navigation_type) {
On 2016/04/25 22:38:44, Bryan McQuade wrote:
> there are few enough types in this enum now that I think it's reasonable to
just
> inline the logic that computes the enum in this function and get rid of the
> enum.
> 
> i know that complicates the tests a little bit but i think that's ok. we can
> audit that certain histograms get logged rather than inspecting the navigation
> type in the tests, which is probably arguably better anyway since it's testing
> what really matters.

Fair enough. Done.

https://codereview.chromium.org/1901303004/diff/40001/chrome/browser/page_loa...
File
chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h
(right):

https://codereview.chromium.org/1901303004/diff/40001/chrome/browser/page_loa...
chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h:58:
static bool IsUrlFromGWS(const GURL& url);
On 2016/04/25 22:38:44, Bryan McQuade wrote:
> if this one is also only public for testing, let's move it below the comment
> below.

Moved to private.

https://codereview.chromium.org/1901303004/diff/40001/chrome/browser/page_loa...
chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h:83:
internal::NavigationFromGWSType GetNavigationFromGWSType(
On 2016/04/25 22:38:44, Bryan McQuade wrote:
> it feels funny to be returning a type in the internal namespace in the public
> API of the class. see my comment below about removing this, but if you decide
we
> can't remove it let's move the enum declaration out of the internal namespace.

It's true, but it is only used for tests, which is also the reasoning behind the
internal namespace. I removed it per your other comment, though.

https://codereview.chromium.org/1901303004/diff/40001/chrome/browser/page_loa...
File
chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer_unittest.cc
(right):

https://codereview.chromium.org/1901303004/diff/40001/chrome/browser/page_loa...
chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer_unittest.cc:13:
const char kExampleFromGWS[] = "https://www.google.com/webhp?q=d";
On 2016/04/25 22:38:44, Bryan McQuade wrote:
> nit: let's call this kGwsUrl or kGoogleSearchResultsUrl - the 'example' part
of
> kExampleUrl was to indicate it was for http://example.com.

Haha. Done. That's autopilot for you :)

Powered by Google App Engine
This is Rietveld 408576698