|
|
Created:
3 years, 9 months ago by Avi (use Gerrit) Modified:
3 years, 9 months ago CC:
chromium-reviews, jam, nasko+codewatch_chromium.org, darin-cc_chromium.org, creis+watch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionMove beforeunload hang timer duties to its own timer.
BUG=418266
TEST=no user-visible change
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation
Review-Url: https://codereview.chromium.org/2727253005
Cr-Commit-Position: refs/heads/master@{#455140}
Committed: https://chromium.googlesource.com/chromium/src/+/ddd4c22cebfb3be9570877a7fcfebeca24c5f83b
Patch Set 1 #Patch Set 2 : rev #Patch Set 3 : rev #
Total comments: 10
Patch Set 4 : timeout values #
Dependent Patchsets: Messages
Total messages: 38 (24 generated)
The CQ bit was checked by avi@chromium.org to run a CQ dry run
Description was changed from ========== Move beforeunload hang timer duties to its own timer. BUG=418266 TEST=no user-visible change ========== to ========== Move beforeunload hang timer duties to its own timer. BUG=418266 TEST=no user-visible change CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation ==========
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by avi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_tsan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_site_isolation on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_site_isol...)
The CQ bit was checked by avi@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
avi@chromium.org changed reviewers: + creis@chromium.org, dtapuska@chromium.org
Charlie is OOO until Monday but I'd like his review. Dave, what do you think? Once the pending input event timeout is just for pending events, dealing with its correctness will be easier.
https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... content/browser/frame_host/render_frame_host_impl.cc:3474: "ChildProcess.HangRendererType", beforeunload_timeout_type_, Is this safe? Declaring the histogram twice? The macro is going to load the value into two different static fields. I imagine you probably want to make this code common.
https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... content/browser/frame_host/render_frame_host_impl.cc:3474: "ChildProcess.HangRendererType", beforeunload_timeout_type_, On 2017/03/06 18:23:46, dtapuska wrote: > Is this safe? Declaring the histogram twice? The macro is going to load the > value into two different static fields. I imagine you probably want to make this > code common. Wait.. you can't do this? I already did this in https://codereview.chromium.org/2725993002/... dammit. Is this a useful enumeration?
https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... content/browser/frame_host/render_frame_host_impl.cc:3474: "ChildProcess.HangRendererType", beforeunload_timeout_type_, On 2017/03/06 18:27:26, Avi wrote: > On 2017/03/06 18:23:46, dtapuska wrote: > > Is this safe? Declaring the histogram twice? The macro is going to load the > > value into two different static fields. I imagine you probably want to make > this > > code common. > > Wait.. you can't do this? I already did this in > https://codereview.chromium.org/2725993002/... dammit. > > Is this a useful enumeration? Ilya says in chat: "I see. That's fine, in terms of things working correctly. We do generally recommend refactoring the code so that there's a shared codepath, both to reduce on the amount of generated code (the macro expands to several lines) and to reduce the likelihood of different paths diverging from one another (basically the same motivation as the DRY principle in general)."
Nice. I love the simplification of detangling the timers, and I don't see immediate problems with splitting them apart. Looks good, with one question below. https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... content/browser/frame_host/render_frame_host_impl.cc:2628: : render_view_host_->GetWidget()->hung_renderer_delay()); In the new approach where the beforeunload timer is split out, what are we waiting for when |success| is false? Do we get a beforeunload ACK in that case as well? I'm just trying to understand why we use the longer delay (or use the timer at all) in that case. It'd be nice if this can be simplified, since the comment above doesn't seem to provide a strong reason for it. If there is a reason, though, I'm curious to understand it. https://codereview.chromium.org/2727253005/diff/40001/content/browser/rendere... File content/browser/renderer_host/render_widget_host_impl.h (left): https://codereview.chromium.org/2727253005/diff/40001/content/browser/rendere... content/browser/renderer_host/render_widget_host_impl.h:552: // RenderViewHostImpl can account for in-flight beforeunload/unload events. Yay!
https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... content/browser/frame_host/render_frame_host_impl.cc:2628: : render_view_host_->GetWidget()->hung_renderer_delay()); On 2017/03/06 21:10:44, Charlie Reis (OOO til Mar 6) wrote: > In the new approach where the beforeunload timer is split out, what are we > waiting for when |success| is false? Do we get a beforeunload ACK in that case > as well? We always get a beforeunload ACK, even when the user decides to stay on the page. (In fact, the beforeunload ack is how the render process tells us whether we need to stay or go.) > I'm just trying to understand why we use the longer delay (or use the timer at > all) in that case. In that case? Or ever? For "in that case", there's no reason to treat "stay" vs "leave" differently. In both cases, we run the beforeunload handler, get told to run a dialog or not, send the result back, and get an ack. For "ever", that's actually a very interesting question. The fact that we get told to run a dialog means that the page succeeded in running the beforeunload handler to completion. We totally could say, "hey, we've seen a dialog, so we know we didn't hang." That would be a change in what we do from today, and I would want to put that in a different CL so that it's didn't get caught up in this refactor. In addition, today we pass the result of the stay/go back to the render process, and get returned it via the FrameHostMsg_BeforeUnload_ACK, so there's some plumbing work that would need to be done. It's totally doable but I want to focus on one refactor at a time. https://codereview.chromium.org/2727253005/diff/40001/content/browser/rendere... File content/browser/renderer_host/render_widget_host_impl.h (left): https://codereview.chromium.org/2727253005/diff/40001/content/browser/rendere... content/browser/renderer_host/render_widget_host_impl.h:552: // RenderViewHostImpl can account for in-flight beforeunload/unload events. On 2017/03/06 21:10:44, Charlie Reis (OOO til Mar 6) wrote: > Yay! Acknowledged.
Thanks! LGTM with the change mentioned below. https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... content/browser/frame_host/render_frame_host_impl.cc:2628: : render_view_host_->GetWidget()->hung_renderer_delay()); On 2017/03/06 22:11:17, Avi wrote: > On 2017/03/06 21:10:44, Charlie Reis (OOO til Mar 6) wrote: > > In the new approach where the beforeunload timer is split out, what are we > > waiting for when |success| is false? Do we get a beforeunload ACK in that > case > > as well? > > We always get a beforeunload ACK, even when the user decides to stay on the > page. (In fact, the beforeunload ack is how the render process tells us whether > we need to stay or go.) > > > I'm just trying to understand why we use the longer delay (or use the timer at > > all) in that case. > > In that case? Or ever? > > For "in that case", there's no reason to treat "stay" vs "leave" differently. In > both cases, we run the beforeunload handler, get told to run a dialog or not, > send the result back, and get an ack. Great-- maybe we can use the shorter timeout for both just to simplify things a bit? No reason to use the long one now that we're distinct from input events. > For "ever", that's actually a very interesting question. The fact that we get > told to run a dialog means that the page succeeded in running the beforeunload > handler to completion. We totally could say, "hey, we've seen a dialog, so we > know we didn't hang." That would be a change in what we do from today, and I > would want to put that in a different CL so that it's didn't get caught up in > this refactor. In addition, today we pass the result of the stay/go back to the > render process, and get returned it via the FrameHostMsg_BeforeUnload_ACK, so > there's some plumbing work that would need to be done. > > It's totally doable but I want to focus on one refactor at a time. Cool. Let's consider that for later. (Agreed there's no reason to do it in this CL.)
The CQ bit was checked by avi@chromium.org to run a CQ dry run
https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... content/browser/frame_host/render_frame_host_impl.cc:2628: : render_view_host_->GetWidget()->hung_renderer_delay()); On 2017/03/06 23:47:56, Charlie Reis (OOO til Mar 8) wrote: > Great-- maybe we can use the shorter timeout for both just to simplify things a > bit? No reason to use the long one now that we're distinct from input events. Sure! https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... content/browser/frame_host/render_frame_host_impl.cc:3474: "ChildProcess.HangRendererType", beforeunload_timeout_type_, On 2017/03/06 18:23:46, dtapuska wrote: > I imagine you probably want to make this > code common. WebContentsImpl::RendererUnresponsive is a bunch of unrelated code, and ChildProcess.HangRendererType registered the value of which of the unrelated bits of code ran. This bug is about ripping apart RendererUnresponsive and moving its random bits of code to be with the other code they're related to. I want to entirely remove this enum as it doesn't make sense, but until then, I don't want to merge this code into somewhere common. The whole point is that there _is_ no common place to put it that makes sense. Given that Ilya says it's safe, I'm assuming you're ok proceeding here?
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
On 2017/03/06 23:59:15, Avi wrote: > https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... > File content/browser/frame_host/render_frame_host_impl.cc (right): > > https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... > content/browser/frame_host/render_frame_host_impl.cc:2628: : > render_view_host_->GetWidget()->hung_renderer_delay()); > On 2017/03/06 23:47:56, Charlie Reis (OOO til Mar 8) wrote: > > Great-- maybe we can use the shorter timeout for both just to simplify things > a > > bit? No reason to use the long one now that we're distinct from input events. > > Sure! > > https://codereview.chromium.org/2727253005/diff/40001/content/browser/frame_h... > content/browser/frame_host/render_frame_host_impl.cc:3474: > "ChildProcess.HangRendererType", beforeunload_timeout_type_, > On 2017/03/06 18:23:46, dtapuska wrote: > > I imagine you probably want to make this > > code common. > > WebContentsImpl::RendererUnresponsive is a bunch of unrelated code, and > ChildProcess.HangRendererType registered the value of which of the unrelated > bits of code ran. This bug is about ripping apart RendererUnresponsive and > moving its random bits of code to be with the other code they're related to. > > I want to entirely remove this enum as it doesn't make sense, but until then, I > don't want to merge this code into somewhere common. The whole point is that > there _is_ no common place to put it that makes sense. > > Given that Ilya says it's safe, I'm assuming you're ok proceeding here? Lgtm
The CQ bit was checked by avi@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from creis@chromium.org Link to the patchset: https://codereview.chromium.org/2727253005/#ps60001 (title: "timeout values")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by avi@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 60001, "attempt_start_ts": 1488902655927680, "parent_rev": "545222f357e150eec7c10740b2f752cc2b30a215", "commit_rev": "ddd4c22cebfb3be9570877a7fcfebeca24c5f83b"}
Message was sent while issue was closed.
Description was changed from ========== Move beforeunload hang timer duties to its own timer. BUG=418266 TEST=no user-visible change CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation ========== to ========== Move beforeunload hang timer duties to its own timer. BUG=418266 TEST=no user-visible change CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2727253005 Cr-Commit-Position: refs/heads/master@{#455140} Committed: https://chromium.googlesource.com/chromium/src/+/ddd4c22cebfb3be9570877a7fcfe... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/ddd4c22cebfb3be9570877a7fcfe...
Message was sent while issue was closed.
A revert of this CL (patchset #4 id:60001) has been created in https://codereview.chromium.org/2740493004/ by tmartino@chromium.org. The reason for reverting is: We're seeing reliable failures on Win7 as a result of this patch: BrowserTest.SingleBeforeUnloadAfterRedirect Specific error: [6776:6744:0307/133434.182:FATAL:render_frame_host_impl.cc(2555)] Check failed: is_waiting_for_beforeunload_ack_.. |