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

Issue 2701093002: PlzNavigate: Cancel ongoing history navigations in the browser when we receive a navigation request… (Closed)

Created:
3 years, 10 months ago by ananta
Modified:
3 years, 7 months ago
Reviewers:
Charlie Reis, jam
CC:
chromium-reviews, blink-reviews, jam, nasko+codewatch_chromium.org, darin-cc_chromium.org, creis+watch_chromium.org, clamy
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

PlzNavigate: Cancel ongoing history navigations in the browser when we receive a navigation request from the renderer. This should fix the http/tests/navigation/back-to-dynamic-iframe.html layout test which initiates history navigations on the frame and in the process also changes the src tag on the frame in JS. The expectation is that the JS changes should win. In the PlzNavigate case the history navigations win because they are marked as browser initiated. Proposed fix with a lot of help from creis is to cancel ongoing history navigations for child frames when we receive a navigation request for a frame. Additionally we don't run unload handlers for history navigations for newly created child frames as they won't have any. BUG=691168 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2701093002 Cr-Commit-Position: refs/heads/master@{#451507} Committed: https://chromium.googlesource.com/chromium/src/+/232b610b1a9ae4893764f54a0c952f11e1619686

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address review comments #

Total comments: 2

Patch Set 3 : Move check for is_history_navigation_in_new_child up #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -4 lines) Patch
M content/browser/frame_host/navigator_impl.cc View 1 2 2 chunks +15 lines, -0 lines 2 comments Download
M third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation View 1 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 22 (13 generated)
ananta
3 years, 10 months ago (2017-02-17 23:57:28 UTC) #3
Charlie Reis
[CC clamy@] Thanks! LGTM with nits. Also, thanks for pointing out that skipping the beforeunload ...
3 years, 10 months ago (2017-02-18 00:05:24 UTC) #6
ananta
https://codereview.chromium.org/2701093002/diff/1/content/browser/frame_host/navigator_impl.cc File content/browser/frame_host/navigator_impl.cc (right): https://codereview.chromium.org/2701093002/diff/1/content/browser/frame_host/navigator_impl.cc#newcode1180 content/browser/frame_host/navigator_impl.cc:1180: // We don't want to dispatch an unload handler ...
3 years, 10 months ago (2017-02-18 00:17:52 UTC) #7
Charlie Reis
https://codereview.chromium.org/2701093002/diff/20001/content/browser/frame_host/navigator_impl.cc File content/browser/frame_host/navigator_impl.cc (right): https://codereview.chromium.org/2701093002/diff/20001/content/browser/frame_host/navigator_impl.cc#newcode1229 content/browser/frame_host/navigator_impl.cc:1229: !is_history_navigation_in_new_child) { Oh, sorry! I meant 1 line up ...
3 years, 10 months ago (2017-02-18 00:22:52 UTC) #8
ananta
https://codereview.chromium.org/2701093002/diff/20001/content/browser/frame_host/navigator_impl.cc File content/browser/frame_host/navigator_impl.cc (right): https://codereview.chromium.org/2701093002/diff/20001/content/browser/frame_host/navigator_impl.cc#newcode1229 content/browser/frame_host/navigator_impl.cc:1229: !is_history_navigation_in_new_child) { On 2017/02/18 00:22:52, Charlie Reis wrote: > ...
3 years, 10 months ago (2017-02-18 00:32:05 UTC) #9
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/2701093002/40001
3 years, 10 months ago (2017-02-19 00:39:31 UTC) #16
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/232b610b1a9ae4893764f54a0c952f11e1619686
3 years, 10 months ago (2017-02-19 03:31:25 UTC) #19
jam
https://codereview.chromium.org/2701093002/diff/40001/content/browser/frame_host/navigator_impl.cc File content/browser/frame_host/navigator_impl.cc (right): https://codereview.chromium.org/2701093002/diff/40001/content/browser/frame_host/navigator_impl.cc#newcode1009 content/browser/frame_host/navigator_impl.cc:1009: frame_tree_node->ResetNavigationRequest(false); btw I was tracing this code as part ...
3 years, 7 months ago (2017-05-16 20:13:12 UTC) #21
Charlie Reis
3 years, 7 months ago (2017-05-18 21:26:46 UTC) #22
Message was sent while issue was closed.
https://codereview.chromium.org/2701093002/diff/40001/content/browser/frame_h...
File content/browser/frame_host/navigator_impl.cc (right):

https://codereview.chromium.org/2701093002/diff/40001/content/browser/frame_h...
content/browser/frame_host/navigator_impl.cc:1009:
frame_tree_node->ResetNavigationRequest(false);
On 2017/05/16 20:13:11, jam wrote:
> btw I was tracing this code as part of
> https://codereview.chromium.org/2889703002/, but I don't see it being hit for
> the layout tests fixed here, or for any other layout or browser test. Is this
> still needed?

Yep, it's still needed, but some races mean we aren't hitting it in tests.  We
should add a test for this branch of the race if we can-- I've filed
https://crbug.com/724271.

See https://codereview.chromium.org/2890613002/#msg15 for details.

Powered by Google App Engine
This is Rietveld 408576698