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

Issue 1825523002: Do not reset navigation state when BeforeUnload is cancelled by a commit (Closed)

Created:
4 years, 9 months ago by clamy
Modified:
4 years, 8 months ago
Reviewers:
Charlie Reis, carlosk, nasko
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, Peter Beverloo, nasko+codewatch_chromium.org, jam, darin-cc_chromium.org, mkwst+moarreviews-shell_chromium.org, jochen+watch_chromium.org, carlosk
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Do not reset navigation state when BeforeUnload is cancelled by a commit It is possible for a cross-site navigation to commit while a BeforeUnload confirmation dialog is showing. This will destroy dialog and call WebContentsImpl::OnDialogClosed. This function should not reset the navigatin state if the RenderFrameHost that was showing the dialog is no longer the current RenderFrameHost. BUG=589365 Committed: https://crrev.com/bc6f4150a3eef02b926611404e7cdd44c9d67635 Cr-Commit-Position: refs/heads/master@{#384674}

Patch Set 1 #

Patch Set 2 : #

Total comments: 8

Patch Set 3 : Rebase #

Patch Set 4 : Addressed comments #

Total comments: 32

Patch Set 5 : Rebase #

Patch Set 6 : Addressed comments #

Total comments: 7

Patch Set 7 : Rebase + addressed nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+241 lines, -5 lines) Patch
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 1 chunk +5 lines, -2 lines 0 comments Download
M content/browser/web_contents/web_contents_impl_browsertest.cc View 1 2 3 4 5 1 chunk +46 lines, -0 lines 0 comments Download
M content/shell/browser/shell_javascript_dialog_manager.h View 1 2 3 4 5 2 chunks +9 lines, -0 lines 0 comments Download
M content/shell/browser/shell_javascript_dialog_manager.cc View 1 2 3 4 5 3 chunks +12 lines, -3 lines 0 comments Download
M content/test/content_browser_test_utils_internal.h View 1 2 3 4 5 6 4 chunks +48 lines, -0 lines 0 comments Download
M content/test/content_browser_test_utils_internal.cc View 1 2 3 4 5 6 3 chunks +91 lines, -0 lines 0 comments Download
A content/test/data/hang_before_unload.html View 1 2 3 4 5 1 chunk +29 lines, -0 lines 0 comments Download
M testing/buildbot/filters/browser-side-navigation.linux.content_browsertests.filter View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 36 (14 generated)
clamy
@nasko: PTAL. This is the fix for the BeforeUnload dialog issue that is causing the ...
4 years, 9 months ago (2016-03-22 16:33:46 UTC) #3
nasko
Hey Charlie, Could you help review this one? I won't have the bandwidth to review ...
4 years, 9 months ago (2016-03-24 19:52:49 UTC) #5
Charlie Reis
Haven't looked closely at the test yet, but I have a concern about the fix. ...
4 years, 9 months ago (2016-03-24 21:50:41 UTC) #6
clamy
https://codereview.chromium.org/1825523002/diff/20001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/1825523002/diff/20001/content/browser/web_contents/web_contents_impl.cc#newcode4695 content/browser/web_contents/web_contents_impl.cc:4695: if (is_showing_before_unload_dialog_ && !success && rfh == GetMainFrame()) { ...
4 years, 9 months ago (2016-03-25 13:43:48 UTC) #7
Charlie Reis
Thanks. Another suggestion below. https://codereview.chromium.org/1825523002/diff/20001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/1825523002/diff/20001/content/browser/web_contents/web_contents_impl.cc#newcode4695 content/browser/web_contents/web_contents_impl.cc:4695: if (is_showing_before_unload_dialog_ && !success && ...
4 years, 9 months ago (2016-03-25 23:59:43 UTC) #8
clamy
Thanks! https://codereview.chromium.org/1825523002/diff/20001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/1825523002/diff/20001/content/browser/web_contents/web_contents_impl.cc#newcode4695 content/browser/web_contents/web_contents_impl.cc:4695: if (is_showing_before_unload_dialog_ && !success && rfh == GetMainFrame()) ...
4 years, 8 months ago (2016-03-29 13:01:50 UTC) #9
Charlie Reis
Nasko, can you review the new test class? I'd like to get your input on ...
4 years, 8 months ago (2016-03-29 18:33:22 UTC) #10
nasko
Super excited about utilizing the throttle in test code! Bunch more nits from me. https://codereview.chromium.org/1825523002/diff/60001/content/browser/web_contents/web_contents_impl.cc ...
4 years, 8 months ago (2016-03-29 20:19:06 UTC) #11
clamy
Thanks! https://codereview.chromium.org/1825523002/diff/60001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/1825523002/diff/60001/content/browser/web_contents/web_contents_impl.cc#newcode4680 content/browser/web_contents/web_contents_impl.cc:4680: // It is possible for the RenderFrameHost to ...
4 years, 8 months ago (2016-03-30 13:31:11 UTC) #12
nasko
I have one comment about the API for TestNavigationManager, but I'm ok with addressing its ...
4 years, 8 months ago (2016-03-30 15:47:52 UTC) #13
Charlie Reis
Thanks, LGTM. https://codereview.chromium.org/1825523002/diff/100001/content/test/content_browser_test_utils_internal.h File content/test/content_browser_test_utils_internal.h (right): https://codereview.chromium.org/1825523002/diff/100001/content/test/content_browser_test_utils_internal.h#newcode135 content/test/content_browser_test_utils_internal.h:135: void ResumeNavigation(); nit: Let's list this between ...
4 years, 8 months ago (2016-03-30 19:04:58 UTC) #14
carlosk
Thanks. https://codereview.chromium.org/1825523002/diff/100001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/1825523002/diff/100001/content/browser/web_contents/web_contents_impl.cc#newcode4695 content/browser/web_contents/web_contents_impl.cc:4695: controller_.DiscardNonCommittedEntries(); This used to be called even if ...
4 years, 8 months ago (2016-03-31 09:48:59 UTC) #16
clamy
Thanks! https://codereview.chromium.org/1825523002/diff/100001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/1825523002/diff/100001/content/browser/web_contents/web_contents_impl.cc#newcode4695 content/browser/web_contents/web_contents_impl.cc:4695: controller_.DiscardNonCommittedEntries(); On 2016/03/31 09:48:58, carlosk wrote: > This ...
4 years, 8 months ago (2016-04-01 10:19:00 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1825523002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1825523002/120001
4 years, 8 months ago (2016-04-01 10:19:22 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/139068)
4 years, 8 months ago (2016-04-01 11:55:00 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1825523002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1825523002/120001
4 years, 8 months ago (2016-04-01 12:38:39 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/139112)
4 years, 8 months ago (2016-04-01 14:19:14 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1825523002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1825523002/120001
4 years, 8 months ago (2016-04-01 14:30:28 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/139154)
4 years, 8 months ago (2016-04-01 16:11:30 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1825523002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1825523002/120001
4 years, 8 months ago (2016-04-01 19:21:16 UTC) #32
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 8 months ago (2016-04-01 20:14:38 UTC) #34
commit-bot: I haz the power
4 years, 8 months ago (2016-04-01 20:16:44 UTC) #36
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/bc6f4150a3eef02b926611404e7cdd44c9d67635
Cr-Commit-Position: refs/heads/master@{#384674}

Powered by Google App Engine
This is Rietveld 408576698