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

Issue 659773002: New histogram to track overhead time spent around beforeunload event + fixes (Closed)

Created:
6 years, 2 months ago by carlosk
Modified:
6 years, 2 months ago
CC:
chromium-reviews, darin-cc_chromium.org, nasko+codewatch_chromium.org, jam, asvitkine+watch_chromium.org, creis+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Adds a new histogram to track the overhead time spent around handling the beforeunload event. Also fixes a couple issues with the shortcutting of RenderFrameHostImpl::OnBeforeUnloadACK in case there's no actual IPC call. The main issue was that when there was no active renderer these calls inside RenderFrameHostImpl::OnBeforeUnloadACK would be executed without the prior due mirror calls: render_view_host_->decrement_in_flight_event_count(); render_view_host_->StopHangMonitorTimeout(); BUG=416877 Committed: https://crrev.com/caf1a4bb5487a8f84a7a6aa57dbc118b6c95dc90 Cr-Commit-Position: refs/heads/master@{#300484}

Patch Set 1 #

Total comments: 5

Patch Set 2 : Addressing CR comments. #

Total comments: 12

Patch Set 3 : Addressed CR comments #

Patch Set 4 : Addressed CR comments #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -26 lines) Patch
M content/browser/frame_host/navigator_impl.cc View 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 6 chunks +27 lines, -25 lines 8 comments Download
M tools/metrics/histograms/histograms.xml View 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (3 generated)
carlosk
clamy, nasko: PTAL isherman: PTAL @ histograms.xml. This is the last Navigation histogram to add ...
6 years, 2 months ago (2014-10-15 12:29:04 UTC) #2
clamy
Thanks1 LGTM provided you change the histogram description (and the bots are fine with the ...
6 years, 2 months ago (2014-10-15 12:50:57 UTC) #3
Ilya Sherman
LGTM, thanks.
6 years, 2 months ago (2014-10-15 22:50:49 UTC) #4
carlosk
Thanks. This PS is just to fix the comment as clamy@ suggested. About the failing ...
6 years, 2 months ago (2014-10-16 07:43:41 UTC) #5
Charlie Reis
Thanks for catching that bug in the shortcutting logic! I do think we want to ...
6 years, 2 months ago (2014-10-16 22:12:00 UTC) #7
carlosk
Thanks Charlie. https://codereview.chromium.org/659773002/diff/20001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (left): https://codereview.chromium.org/659773002/diff/20001/content/browser/frame_host/render_frame_host_impl.cc#oldcode827 content/browser/frame_host/render_frame_host_impl.cc:827: if (GetParent()) { On 2014/10/16 22:12:00, Charlie ...
6 years, 2 months ago (2014-10-17 11:55:06 UTC) #8
Charlie Reis
Thanks for looking into it. LGTM with the suggestions below. https://codereview.chromium.org/659773002/diff/20001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (left): https://codereview.chromium.org/659773002/diff/20001/content/browser/frame_host/render_frame_host_impl.cc#oldcode827 ...
6 years, 2 months ago (2014-10-17 23:52:46 UTC) #9
carlosk
Thanks. creis@: just one more question in my replies for your comments before I can ...
6 years, 2 months ago (2014-10-20 17:40:34 UTC) #10
Charlie Reis
LGTM. https://codereview.chromium.org/659773002/diff/20001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (left): https://codereview.chromium.org/659773002/diff/20001/content/browser/frame_host/render_frame_host_impl.cc#oldcode827 content/browser/frame_host/render_frame_host_impl.cc:827: if (GetParent()) { On 2014/10/20 17:40:34, carlosk wrote: ...
6 years, 2 months ago (2014-10-20 18:22:21 UTC) #11
carlosk
Thanks again Charlie. I added a few comments (in code and as review comments) to ...
6 years, 2 months ago (2014-10-21 13:07:09 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/659773002/60001
6 years, 2 months ago (2014-10-21 13:23:15 UTC) #14
commit-bot: I haz the power
Committed patchset #4 (id:60001)
6 years, 2 months ago (2014-10-21 14:17:05 UTC) #15
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/caf1a4bb5487a8f84a7a6aa57dbc118b6c95dc90 Cr-Commit-Position: refs/heads/master@{#300484}
6 years, 2 months ago (2014-10-21 14:17:51 UTC) #16
Charlie Reis
Thanks, works for me. https://codereview.chromium.org/659773002/diff/60001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/659773002/diff/60001/content/browser/frame_host/render_frame_host_impl.cc#newcode710 content/browser/frame_host/render_frame_host_impl.cc:710: base::TimeTicks approx_renderer_start_time = send_before_unload_start_time_; On ...
6 years, 2 months ago (2014-10-21 18:21:49 UTC) #17
carlosk
6 years, 2 months ago (2014-10-22 09:08:56 UTC) #18
Message was sent while issue was closed.
Thanks.

https://codereview.chromium.org/659773002/diff/60001/content/browser/frame_ho...
File content/browser/frame_host/render_frame_host_impl.cc (right):

https://codereview.chromium.org/659773002/diff/60001/content/browser/frame_ho...
content/browser/frame_host/render_frame_host_impl.cc:710: base::TimeTicks
approx_renderer_start_time = send_before_unload_start_time_;
On 2014/10/21 18:21:48, Charlie Reis wrote:
> On 2014/10/21 13:07:09, carlosk wrote:
> > I'm making this copy because it was unsafe to pass a reference to
> > send_before_unload_start_time_ as that value could be reset anytime.
> 
> "Could be reset anytime" doesn't seem relevant here.  It only seems like this
is
> needed if OnBeforeUnloadACK resets send_before_unload_start_time_ before
> accessing renderer_before_unload_start_time, since they're aliased.
> 
> That said, this is safer against future changes, so it's fine.

Yeah I agree with that: it isn't really required. But future-proofing was
exactly what drove me to do it. In fact in a previous version of the code I did
precisely what you described and suddenly renderer_before_unload_start_time was
unexpectedly turning up as 0. :)

https://codereview.chromium.org/659773002/diff/60001/content/browser/frame_ho...
content/browser/frame_host/render_frame_host_impl.cc:895: // Resets beforeunload
waiting state.
On 2014/10/21 18:21:48, Charlie Reis wrote:
> nit: There should have been a blank line before this because it's separate
from
> the block above.  (Not worth its own CL, but for future reference.)

Acknowledged.

Powered by Google App Engine
This is Rietveld 408576698