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

Issue 1282303002: PageLoadMetrics renderer and browser implementation (deprecated) (Closed)

Created:
5 years, 4 months ago by Bryan McQuade
Modified:
5 years, 2 months ago
CC:
chromium-reviews, blundell+watchlist_chromium.org, sdefresne+watchlist_chromium.org, jam, droger+watchlist_chromium.org, darin-cc_chromium.org, Charlie Harrison, Deprecated (see juliatuttle), kinuko, Kunihiko Sakamoto
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

csharrison has taken over this change. It has moved to https://codereview.chromium.org/1312213010/

Patch Set 1 : #

Total comments: 38

Patch Set 2 : #

Patch Set 3 : #

Total comments: 12

Patch Set 4 : refactor based on feedback #

Patch Set 5 : #

Total comments: 14
Unified diffs Side-by-side diffs Delta from patch set Stats (+1118 lines, -26 lines) Patch
M chrome/browser/ui/BUILD.gn View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/tab_helpers.cc View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/chrome_browser_ui.gypi View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_renderer.gypi View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/BUILD.gn View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/chrome_content_renderer_client.cc View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M components/BUILD.gn View 1 2 3 4 2 chunks +5 lines, -0 lines 0 comments Download
M components/OWNERS View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M components/components.gyp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M components/components_tests.gyp View 1 2 3 4 3 chunks +9 lines, -0 lines 0 comments Download
A components/page_load_metrics.gypi View 1 2 3 4 1 chunk +66 lines, -0 lines 0 comments Download
A + components/page_load_metrics/DEPS View 1 chunk +2 lines, -1 line 0 comments Download
A components/page_load_metrics/OWNERS View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
A components/page_load_metrics/README View 1 2 3 4 1 chunk +15 lines, -0 lines 0 comments Download
A + components/page_load_metrics/browser/BUILD.gn View 1 2 3 1 chunk +9 lines, -14 lines 0 comments Download
A components/page_load_metrics/browser/page_load_metrics_web_contents_observer.h View 1 2 3 1 chunk +55 lines, -0 lines 2 comments Download
A components/page_load_metrics/browser/page_load_metrics_web_contents_observer.cc View 1 2 3 4 1 chunk +109 lines, -0 lines 3 comments Download
A components/page_load_metrics/browser/page_load_metrics_web_contents_observer_unittest.cc View 1 2 3 1 chunk +80 lines, -0 lines 0 comments Download
A + components/page_load_metrics/common/BUILD.gn View 1 2 3 1 chunk +6 lines, -5 lines 0 comments Download
A components/page_load_metrics/common/page_load_metrics_messages.h View 1 2 3 4 1 chunk +26 lines, -0 lines 1 comment Download
A + components/page_load_metrics/common/page_load_metrics_messages.cc View 1 chunk +6 lines, -6 lines 0 comments Download
A components/page_load_metrics/common/page_load_timing.h View 1 2 3 4 1 chunk +43 lines, -0 lines 2 comments Download
A components/page_load_metrics/common/page_load_timing.cc View 1 2 3 4 1 chunk +20 lines, -0 lines 0 comments Download
A components/page_load_metrics/renderer/BUILD.gn View 1 2 3 1 chunk +36 lines, -0 lines 0 comments Download
A components/page_load_metrics/renderer/page_load_metrics_render_frame_observer.h View 1 2 3 1 chunk +52 lines, -0 lines 0 comments Download
A components/page_load_metrics/renderer/page_load_metrics_render_frame_observer.cc View 1 2 3 4 1 chunk +128 lines, -0 lines 4 comments Download
A components/page_load_metrics/renderer/page_load_metrics_render_frame_observer_unittest.cc View 1 2 3 1 chunk +165 lines, -0 lines 0 comments Download
A components/page_load_metrics/renderer/page_timing_metrics_sender.h View 1 2 3 1 chunk +49 lines, -0 lines 0 comments Download
A components/page_load_metrics/renderer/page_timing_metrics_sender.cc View 1 2 3 1 chunk +46 lines, -0 lines 2 comments Download
A components/page_load_metrics/renderer/page_timing_metrics_sender_unittest.cc View 1 2 3 1 chunk +139 lines, -0 lines 0 comments Download
M ipc/ipc_message_start.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 1 chunk +25 lines, -0 lines 0 comments Download

Messages

Total messages: 53 (41 generated)
Bryan McQuade
rdsmith: looking for your high level review on the overall change davidben: looking for your ...
5 years, 4 months ago (2015-08-17 13:06:24 UTC) #2
Randy Smith (Not in Mondays)
First pass review--I haven't reviewed tests or infrastructure files (DEPS/gn/gyp). I'll do those after a ...
5 years, 4 months ago (2015-08-17 19:31:08 UTC) #3
kinuko
https://codereview.chromium.org/1282303002/diff/440001/components/page_load_metrics/renderer/page_load_metrics_render_frame_observer.cc File components/page_load_metrics/renderer/page_load_metrics_render_frame_observer.cc (right): https://codereview.chromium.org/1282303002/diff/440001/components/page_load_metrics/renderer/page_load_metrics_render_frame_observer.cc#newcode73 components/page_load_metrics/renderer/page_load_metrics_render_frame_observer.cc:73: bool did_send_load_event_; So this object's created for each page/document ...
5 years, 4 months ago (2015-08-18 10:37:39 UTC) #5
davidben
+nasko. I've only really glanced at the one file, but this seems to have a ...
5 years, 4 months ago (2015-08-18 21:39:45 UTC) #8
Bryan McQuade
Thanks all for your comments. Will reply to remaining comments soon. https://codereview.chromium.org/1282303002/diff/440001/components/page_load_metrics/browser/page_load_metrics_web_contents_observer.cc File components/page_load_metrics/browser/page_load_metrics_web_contents_observer.cc (right): ...
5 years, 4 months ago (2015-08-19 11:45:14 UTC) #9
nasko
Some initial comments. https://codereview.chromium.org/1282303002/diff/480001/chrome/renderer/chrome_content_renderer_client.cc File chrome/renderer/chrome_content_renderer_client.cc (right): https://codereview.chromium.org/1282303002/diff/480001/chrome/renderer/chrome_content_renderer_client.cc#newcode588 chrome/renderer/chrome_content_renderer_client.cc:588: if (render_frame->GetRenderView()->GetMainRenderFrame() == render_frame) { The ...
5 years, 4 months ago (2015-08-20 00:22:18 UTC) #10
kinuko
On 2015/08/19 11:45:14, Bryan McQuade wrote: > Thanks all for your comments. Will reply to ...
5 years, 4 months ago (2015-08-20 12:43:24 UTC) #11
Bryan McQuade
On Thu, Aug 20, 2015 at 8:43 AM <kinuko@chromium.org> wrote: > On 2015/08/19 11:45:14, Bryan ...
5 years, 4 months ago (2015-08-25 13:46:19 UTC) #46
Bryan McQuade
Thanks all for your feedback so far. I made some somewhat substantial changes in response ...
5 years, 4 months ago (2015-08-25 13:53:36 UTC) #47
nasko
https://codereview.chromium.org/1282303002/diff/740001/components/page_load_metrics/browser/page_load_metrics_web_contents_observer.cc File components/page_load_metrics/browser/page_load_metrics_web_contents_observer.cc (right): https://codereview.chromium.org/1282303002/diff/740001/components/page_load_metrics/browser/page_load_metrics_web_contents_observer.cc#newcode27 components/page_load_metrics/browser/page_load_metrics_web_contents_observer.cc:27: PageLoadMetricsWebContentsObserver::~PageLoadMetricsWebContentsObserver() {} nit: Be consistent with the constructor. Either ...
5 years, 3 months ago (2015-08-26 17:27:25 UTC) #48
Bryan McQuade
Thanks for the feedback! We'll address these shortly. A couple quick comments in the interim. ...
5 years, 3 months ago (2015-08-26 18:28:01 UTC) #49
Randy Smith (Not in Mondays)
5 years, 3 months ago (2015-08-26 19:11:48 UTC) #51
Next round.  I'm not yet looking at the tests, because I think there are basic
things about the architecture that haven't been completely settled yet.

WRT the tests, I'll call out that I have a visceral reaction against "make some
methods protected to override them in tests" as I feel like that muddies class
interface contracts and produces fragile tests, but I won't object to the
pattern unless I have a reasonable alternative suggestion, which I don't yet. 
So take this as a possible warning about a future test comment :-}.

https://codereview.chromium.org/1282303002/diff/440001/chrome/renderer/chrome...
File chrome/renderer/chrome_content_renderer_client.cc (right):

https://codereview.chromium.org/1282303002/diff/440001/chrome/renderer/chrome...
chrome/renderer/chrome_content_renderer_client.cc:566: new
page_load_metrics::PageLoadMetricsRenderFrameObserver(render_frame);
On 2015/08/25 13:53:35, Bryan McQuade wrote:
> On 2015/08/17 19:31:07, rdsmith wrote:
> > This name is very long, and not particularly in keeping with the names of
the
> > other observers attached to the render_frame.  Based on common usage, I'd
> > suggest shrinking it to just "PageLoadMetrics" or PageLoadMetricsObserver". 

> > 
> > I have no opinion as to whether standard practice on the creation of a
> component
> > suggests the extra namespace, but I wouldn't add the namespace unless you
see
> > some evidence that it is a normal part of creating a component (and/or rely
> > heavily on guidance from a components/OWNER.)
> 
> Agree about shortening names. I used these very verbose names because I have
> seen the Windows linker blow up if two object files have the same name, and I
> wanted to choose sufficiently unique names to avoid that. But I don't actually
> know if Chromium windows builds suffer from this issue - I'll find out. If
not,
> my inclination is to name these page_load_metrics::MainRenderFrameObserver
> (there's some precedent for including 'RenderFrameObserver' in the names of
> these classes i.e. ChromeRenderFrameObserver,
> extensions::ExtensionsRenderFrameObserver) and
> page_load_metrics::WebContentsObserver (precedent:
> offline_pages::OfflinePageWebContentsObserver and
> extensions::ChromeExtensionWebContentsObserver). 
> 
> RE: the namespace,
>
https://www.chromium.org/developers/design-documents/browser-components/cookbook
> says that components should be enclosed in a namespace with the name of the
> component directory.

This all SG TM, though I don't consider myself the authority on these issues
(i.e. in case of disagreement, upvote hypnoOWNERS, ignore Randy :-}).

https://codereview.chromium.org/1282303002/diff/740001/components/page_load_m...
File components/page_load_metrics/common/page_load_timing.h (right):

https://codereview.chromium.org/1282303002/diff/740001/components/page_load_m...
components/page_load_metrics/common/page_load_timing.h:20: bool operator==(const
PageLoadTiming& other) const;
I have no objection, but document why this is needed and what semantics it
exports?  If it's all member equals, maybe = default
(http://chromium-cpp.appspot.com/ -> "Default Function Creation") would be
appropriate?

https://codereview.chromium.org/1282303002/diff/740001/components/page_load_m...
components/page_load_metrics/common/page_load_timing.h:35: base::Time
first_layout;
As I understand it (please correct me if I'm wrong) on any particular message
any of these may not have been set.  How is that signaled?  Null Time()? 
However it's signaled, I think that it should be documented, both that they can
be null and what they are if they're null.

https://codereview.chromium.org/1282303002/diff/740001/components/page_load_m...
File components/page_load_metrics/renderer/page_timing_metrics_sender.cc
(right):

https://codereview.chromium.org/1282303002/diff/740001/components/page_load_m...
components/page_load_metrics/renderer/page_timing_metrics_sender.cc:35: if
(!timer_->IsRunning())
It's not a lot of code complexity, so I don't object, but I do question whether
we really need to worry about coalescing IPCs.  This is three IPCs over the
course of a page load, none of which will contribute directly to user jank (i.e.
they aren't on any path the user waits on).  And if we do need coallescing, 1s
seems a random number.  So I'd vote against doing this without evidence that
it's needed.  Having said that, I think I should be outvoted by the people
requesting it, so consider this a quixotic comment :-}.

Powered by Google App Engine
This is Rietveld 408576698