DescriptionSet 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 #Messages
Total messages: 125 (100 generated)
|