New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 665952 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Set has_user_gesture bit at NavigationHandle creation time

Project Member Reported by bmcquade@chromium.org, Nov 16 2016

Issue description

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.

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.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/318ecffe833701cfd6db2ac43491ace0a68e18af

commit 318ecffe833701cfd6db2ac43491ace0a68e18af
Author: bmcquade <bmcquade@chromium.org>
Date: Wed Nov 30 18:44:25 2016

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

Review-Url: https://codereview.chromium.org/2499313003
Cr-Commit-Position: refs/heads/master@{#435354}

[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/chrome/browser/extensions/extension_navigation_throttle_unittest.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/chrome/browser/plugins/flash_download_interception_unittest.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/components/navigation_interception/intercept_navigation_throttle_unittest.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/frame_host/interstitial_page_navigator_impl.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/frame_host/interstitial_page_navigator_impl.h
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/frame_host/navigation_controller_impl_unittest.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/frame_host/navigation_entry_impl.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/frame_host/navigation_handle_impl.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/frame_host/navigation_handle_impl.h
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/frame_host/navigation_handle_impl_unittest.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/frame_host/navigation_request.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/frame_host/navigator.h
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/frame_host/navigator_impl.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/frame_host/navigator_impl.h
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/frame_host/navigator_impl_unittest.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/frame_host/render_frame_host_impl.h
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/loader/navigation_resource_throttle.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/loader/navigation_url_loader_unittest.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/loader/resource_dispatcher_host_impl.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/loader/resource_dispatcher_host_unittest.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/browser/web_contents/web_contents_impl_unittest.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/common/frame_messages.h
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/common/navigation_params.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/common/navigation_params.h
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/public/browser/navigation_handle.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/public/browser/navigation_handle.h
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/public/test/render_view_test.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/318ecffe833701cfd6db2ac43491ace0a68e18af/content/test/test_render_frame_host.cc

Status: Fixed (was: Started)
Project Member

Comment 3 by bugdroid1@chromium.org, Dec 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bb887bb505f695aba03436ed8e5fd4b772265921

commit bb887bb505f695aba03436ed8e5fd4b772265921
Author: bmcquade <bmcquade@chromium.org>
Date: Tue Dec 13 13:01:17 2016

Revert of Set user_gesture bit at NavigationHandle creation time. (patchset #19 id:350001 of https://codereview.chromium.org/2499313003/ )

Reason for revert:
This patch broke UrlOverridingTest#testOpenWindowFromUserGesture. See http://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=chrome_public_test_apk&tests=org.chromium.chrome.browser.externalnav.UrlOverridingTest%23testOpenWindowFromUserGesture

Original issue's 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}

TBR=bauerb@chromium.org,clamy@chromium.org,michaelbai@chromium.org,rdevlin.cronin@chromium.org,tsepez@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG= 665952 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2557233002
Cr-Commit-Position: refs/heads/master@{#438147}

[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/chrome/browser/extensions/extension_navigation_throttle_unittest.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/chrome/browser/plugins/flash_download_interception_unittest.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/components/navigation_interception/intercept_navigation_throttle_unittest.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/frame_host/interstitial_page_navigator_impl.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/frame_host/interstitial_page_navigator_impl.h
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/frame_host/navigation_controller_impl_unittest.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/frame_host/navigation_entry_impl.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/frame_host/navigation_handle_impl.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/frame_host/navigation_handle_impl.h
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/frame_host/navigation_handle_impl_unittest.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/frame_host/navigation_request.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/frame_host/navigator.h
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/frame_host/navigator_impl.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/frame_host/navigator_impl.h
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/frame_host/navigator_impl_unittest.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/frame_host/render_frame_host_impl.h
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/loader/navigation_resource_throttle.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/loader/navigation_url_loader_unittest.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/loader/resource_dispatcher_host_impl.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/loader/resource_dispatcher_host_unittest.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/browser/web_contents/web_contents_impl_unittest.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/common/frame_messages.h
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/common/navigation_params.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/common/navigation_params.h
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/public/browser/navigation_handle.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/public/browser/navigation_handle.h
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/public/test/render_view_test.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/bb887bb505f695aba03436ed8e5fd4b772265921/content/test/test_render_frame_host.cc

Sign in to add a comment