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

Issue 2795283003: Simplify MetricsWebContentsObserver::OnTimingUpdated (Closed)

Created:
3 years, 8 months ago by nasko
Modified:
3 years, 8 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

Simplify MetricsWebContentsObserver::OnTimingUpdated The check for whether a frame has navigated away is a bit more complex than needed and uses RenderViewHost, which has been deprecated for a while. This CL moves the child frame check first, which allows the code to perform a simpler check using the WebContents::GetMainFrame(). BUG= Review-Url: https://codereview.chromium.org/2795283003 Cr-Commit-Position: refs/heads/master@{#461875} Committed: https://chromium.googlesource.com/chromium/src/+/0735c4618fe9c05775cf55be073f7fcb4c2e75ac

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -12 lines) Patch
M chrome/browser/page_load_metrics/metrics_web_contents_observer.cc View 2 chunks +10 lines, -12 lines 2 comments Download

Messages

Total messages: 17 (9 generated)
nasko
Hey Bryan, You asked me in the past about this and I noticed it while ...
3 years, 8 months ago (2017-04-04 19:54:21 UTC) #2
Charlie Harrison
drive-by LGTM
3 years, 8 months ago (2017-04-04 20:06:09 UTC) #6
Bryan McQuade
LGTM, thanks!
3 years, 8 months ago (2017-04-04 20:59:32 UTC) #7
nasko
https://codereview.chromium.org/2795283003/diff/1/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/2795283003/diff/1/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc#newcode528 chrome/browser/page_load_metrics/metrics_web_contents_observer.cc:528: if (render_frame_host->GetParent() != nullptr) { Dumping just a bit ...
3 years, 8 months ago (2017-04-04 22:18:14 UTC) #10
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/2795283003/1
3 years, 8 months ago (2017-04-04 22:20:47 UTC) #12
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/0735c4618fe9c05775cf55be073f7fcb4c2e75ac
3 years, 8 months ago (2017-04-04 22:43:33 UTC) #15
Bryan McQuade
A revert of this CL (patchset #1 id:1) has been created in https://codereview.chromium.org/2802693002/ by bmcquade@chromium.org. ...
3 years, 8 months ago (2017-04-05 13:02:25 UTC) #16
Bryan McQuade
3 years, 8 months ago (2017-04-06 18:46:34 UTC) #17
Message was sent while issue was closed.
https://codereview.chromium.org/2795283003/diff/1/chrome/browser/page_load_me...
File chrome/browser/page_load_metrics/metrics_web_contents_observer.cc (right):

https://codereview.chromium.org/2795283003/diff/1/chrome/browser/page_load_me...
chrome/browser/page_load_metrics/metrics_web_contents_observer.cc:528: if
(render_frame_host->GetParent() != nullptr) {
On 2017/04/04 at 22:18:14, nasko (out until Apr 17th) wrote:
> Dumping just a bit of context from chat with csharrison@. The check as it is
can receive data from a case that is a bit strange and I'm not sure how or
whether it has impact on these metrics. The case is:
> 
> * Main frame starts navigation and commits.
> * Subframe is navigated and commits in RFH_1, but does not complete the load.
> * Same subframe navigates again cross-process (possible with out-of-process
iframes) and commits in RFH_2, causing the old RFH_1 to be cleaned up.
> * As part of its cleanup, RFH_1 sends timing data from the renderer.
> 
> In this scenario, the code before would've ignored that IPC, since the for the
subframe the rfh->GetRenderViewHost()->GetMainFrame() will return nullptr. That
is obviously different than the WebContents::GetMainFrame(), so it would have
returned early.
> 
> With the new code, the IPC sent during RFH_1 cleanup (if such an IPC is
possibile) will actually be processed here.
> 
> csharrison@ indicated in chat that this is fine and the CL can be committed as
is, but I'm documenting it for historical record.

Thanks for this. It's helpful to know.

I'm assuming that, in addition to RFH_1 having
rfh->GetRenderViewHost()->GetMainFrame() returning nullptr, traversing the
parent chain of RFH_1 to find the topmost frame would similarly not find the
main frame's RFH because RFH_1 has been removed from the frame hierarchy. Is
that right?

Powered by Google App Engine
This is Rietveld 408576698