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

Issue 2499313003: Set user_gesture bit at NavigationHandle creation time. (Closed)

Created:
4 years, 1 month ago by Bryan McQuade
Modified:
4 years ago
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, extensions-reviews_chromium.org, jam, loading-reviews_chromium.org, mlamouri+watch-content_chromium.org, mmenke, nasko+codewatch_chromium.org, Randy Smith (Not in Mondays)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Set user_gesture bit at NavigationHandle creation time. Previously, the user_gesture bit was set at different places and could be updated during the lifetime of a navigation, such as in WillStartNavigation and at commit time. In practice, whether a navigation was initiated by user gesture is known at the time a NavigationHandle is created. This change makes has_user_gesture_ a const member of NavigationHandleImpl, and sets it once at construction time. clamy suggested that we could set the user gesture bit at NavHandle construction time in the following places: - PlzNavigate: we have it when we create the handle. - Regular navs: we add the parameter to DidStartProvisionalLoad. - same-page navs: we create the NavigationHandle in DidCommitProvisionalLoad, where we have the information. This patch makes the following changes: - adds a gesture param to NavigationHandleImpl::Create - adds a gesture boolean param to FrameHostMsg_DidStartProvisionalLoad, which is passed to RenderFrameHostImpl::OnDidStartProvisionalLoad - removes the has_user_gesture boolean param from NavigationHandleImpl::WillStartRequest For the time being, we continue to update the gesture_ value at commit time. Once crbug.com/667572 is addressed, gesture_ can be made a const member and we can stop updating it at commit time. BUG=665952 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af Cr-Commit-Position: refs/heads/master@{#435354}

Patch Set 1 #

Patch Set 2 : fix test #

Patch Set 3 : fix content tests #

Patch Set 4 : fix failing test #

Patch Set 5 : rebase #

Patch Set 6 : add comment noting that user gesture is false for browser-side navs #

Patch Set 7 : comments #

Total comments: 8

Patch Set 8 : address comments #

Total comments: 8

Patch Set 9 : address comments #

Patch Set 10 : disable dcheck #

Patch Set 11 : fix android build #

Patch Set 12 : reenable dcheck #

Patch Set 13 : Make TestRenderFrameHost commit without user gesture. #

Patch Set 14 : TestRenderFrameHost uses user gesture by default. #

Patch Set 15 : remove gesture dcheck #

Total comments: 2

Patch Set 16 : address comments #

Total comments: 4

Patch Set 17 : address comments #

Patch Set 18 : rebase #

Patch Set 19 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+170 lines, -154 lines) Patch
M chrome/browser/extensions/extension_navigation_throttle_unittest.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/plugins/flash_download_interception_unittest.cc View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M components/navigation_interception/intercept_navigation_throttle_unittest.cc View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/frame_host/interstitial_page_navigator_impl.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -4 lines 0 comments Download
M content/browser/frame_host/interstitial_page_navigator_impl.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -2 lines 0 comments Download
M content/browser/frame_host/navigation_controller_impl_unittest.cc View 1 2 3 4 5 6 7 3 chunks +12 lines, -11 lines 0 comments Download
M content/browser/frame_host/navigation_entry_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +6 lines, -6 lines 0 comments Download
M content/browser/frame_host/navigation_handle_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +3 lines, -3 lines 0 comments Download
M content/browser/frame_host/navigation_handle_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 8 chunks +14 lines, -10 lines 0 comments Download
M content/browser/frame_host/navigation_handle_impl_unittest.cc View 1 2 3 4 5 6 7 2 chunks +7 lines, -3 lines 0 comments Download
M content/browser/frame_host/navigation_request.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +14 lines, -18 lines 0 comments Download
M content/browser/frame_host/navigator.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -4 lines 0 comments Download
M content/browser/frame_host/navigator_impl.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -4 lines 0 comments Download
M content/browser/frame_host/navigator_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +7 lines, -4 lines 0 comments Download
M content/browser/frame_host/navigator_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 7 chunks +7 lines, -7 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +3 lines, -3 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +11 lines, -8 lines 0 comments Download
M content/browser/loader/navigation_resource_throttle.cc View 3 chunks +4 lines, -5 lines 0 comments Download
M content/browser/loader/navigation_url_loader_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/loader/resource_dispatcher_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/web_contents/web_contents_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -3 lines 0 comments Download
M content/common/frame_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +4 lines, -4 lines 0 comments Download
M content/common/navigation_params.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 7 chunks +6 lines, -9 lines 0 comments Download
M content/common/navigation_params.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 7 chunks +6 lines, -9 lines 0 comments Download
M content/public/browser/navigation_handle.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +2 lines, -2 lines 0 comments Download
M content/public/browser/navigation_handle.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -1 line 0 comments Download
M content/public/test/render_view_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +4 lines, -4 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 7 chunks +16 lines, -12 lines 0 comments Download
M content/test/test_render_frame_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +9 lines, -6 lines 0 comments Download

Messages

Total messages: 125 (100 generated)
Bryan McQuade
clamy, here's the change we discussed in email that sets the user gesture bit when ...
4 years, 1 month ago (2016-11-16 19:22:19 UTC) #36
clamy
Thanks! This looks mostly good, a few comments below. https://codereview.chromium.org/2499313003/diff/120001/content/browser/frame_host/navigation_handle_impl.cc File content/browser/frame_host/navigation_handle_impl.cc (right): https://codereview.chromium.org/2499313003/diff/120001/content/browser/frame_host/navigation_handle_impl.cc#newcode524 content/browser/frame_host/navigation_handle_impl.cc:524: ...
4 years, 1 month ago (2016-11-17 14:30:04 UTC) #37
Bryan McQuade
https://codereview.chromium.org/2499313003/diff/120001/content/browser/frame_host/navigation_handle_impl.cc File content/browser/frame_host/navigation_handle_impl.cc (right): https://codereview.chromium.org/2499313003/diff/120001/content/browser/frame_host/navigation_handle_impl.cc#newcode524 content/browser/frame_host/navigation_handle_impl.cc:524: method_ = params.method; On 2016/11/17 at 14:30:04, clamy (ooo ...
4 years, 1 month ago (2016-11-19 20:21:39 UTC) #68
clamy
Thanks! https://codereview.chromium.org/2499313003/diff/120001/content/browser/frame_host/navigation_handle_impl.cc File content/browser/frame_host/navigation_handle_impl.cc (right): https://codereview.chromium.org/2499313003/diff/120001/content/browser/frame_host/navigation_handle_impl.cc#newcode524 content/browser/frame_host/navigation_handle_impl.cc:524: method_ = params.method; On 2016/11/19 20:21:38, Bryan McQuade ...
4 years, 1 month ago (2016-11-21 16:50:46 UTC) #69
Bryan McQuade
Thanks! Addressed comments. PTAL. https://codereview.chromium.org/2499313003/diff/120001/content/browser/frame_host/navigation_handle_impl.cc File content/browser/frame_host/navigation_handle_impl.cc (right): https://codereview.chromium.org/2499313003/diff/120001/content/browser/frame_host/navigation_handle_impl.cc#newcode524 content/browser/frame_host/navigation_handle_impl.cc:524: method_ = params.method; On 2016/11/21 ...
4 years, 1 month ago (2016-11-22 14:13:03 UTC) #74
clamy
Thanks! Lgtm provided the comments below are addressed. https://codereview.chromium.org/2499313003/diff/290001/content/browser/frame_host/navigation_handle_impl.cc File content/browser/frame_host/navigation_handle_impl.cc (left): https://codereview.chromium.org/2499313003/diff/290001/content/browser/frame_host/navigation_handle_impl.cc#oldcode547 content/browser/frame_host/navigation_handle_impl.cc:547: has_user_gesture_ ...
4 years ago (2016-11-24 12:20:02 UTC) #75
Bryan McQuade
Thanks! Addressed comments. PTAL. https://codereview.chromium.org/2499313003/diff/290001/content/browser/frame_host/navigation_handle_impl.cc File content/browser/frame_host/navigation_handle_impl.cc (left): https://codereview.chromium.org/2499313003/diff/290001/content/browser/frame_host/navigation_handle_impl.cc#oldcode547 content/browser/frame_host/navigation_handle_impl.cc:547: has_user_gesture_ = (params.gesture == NavigationGestureUser); ...
4 years ago (2016-11-28 01:41:03 UTC) #80
Bryan McQuade
On 2016/11/28 at 01:41:03, Bryan McQuade wrote: > Thanks! Addressed comments. PTAL. > > https://codereview.chromium.org/2499313003/diff/290001/content/browser/frame_host/navigation_handle_impl.cc ...
4 years ago (2016-11-28 01:41:53 UTC) #81
Bryan McQuade
bauerb, PTAL for flash_download_interception_unittest.cc michaelbai, PTAL for intercept_navigation_throttle_unittest.cc rdevlin.cronin, PTAL for extension_navigation_throttle_unittest.cc Thanks!
4 years ago (2016-11-28 15:13:19 UTC) #84
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/2499313003/310001
4 years ago (2016-11-28 15:18:56 UTC) #88
Devlin
extension_navigation_throttle_unittest.cc lgtm
4 years ago (2016-11-28 15:48:50 UTC) #89
Bernhard Bauer
LGTM
4 years ago (2016-11-28 17:06:57 UTC) #90
michaelbai
components/navigation_interception/ LGTM
4 years ago (2016-11-29 00:55:11 UTC) #92
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/2499313003/310001
4 years ago (2016-11-29 16:56:26 UTC) #95
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/314590)
4 years ago (2016-11-29 17:07:33 UTC) #97
Bryan McQuade
tsepez, PTAL for frame_messages.h, thanks!
4 years ago (2016-11-29 19:14:09 UTC) #99
Tom Sepez
lgtm
4 years ago (2016-11-29 20:11:44 UTC) #100
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/2499313003/310001
4 years ago (2016-11-29 20:16:36 UTC) #102
commit-bot: I haz the power
Failed to apply patch for content/browser/loader/resource_dispatcher_host_impl.cc: While running git apply --index -p1; error: patch failed: ...
4 years ago (2016-11-29 20:36:24 UTC) #104
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/2499313003/330001
4 years ago (2016-11-30 15:20:53 UTC) #111
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/315420)
4 years ago (2016-11-30 15:27:41 UTC) #113
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/2499313003/350001
4 years ago (2016-11-30 18:39:02 UTC) #120
commit-bot: I haz the power
Committed patchset #19 (id:350001)
4 years ago (2016-11-30 18:45:02 UTC) #122
commit-bot: I haz the power
Patchset 19 (id:??) landed as https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af Cr-Commit-Position: refs/heads/master@{#435354}
4 years ago (2016-11-30 18:49:18 UTC) #124
Bryan McQuade
4 years ago (2016-12-08 01:27:03 UTC) #125
Message was sent while issue was closed.
A revert of this CL (patchset #19 id:350001) has been created in
https://codereview.chromium.org/2557233002/ by bmcquade@chromium.org.

The reason for reverting is: This patch broke
UrlOverridingTest#testOpenWindowFromUserGesture. See
http://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=....

Powered by Google App Engine
This is Rietveld 408576698