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

Unified Diff: content/browser/frame_host/navigation_request.cc

Issue 2499313003: Set user_gesture bit at NavigationHandle creation time. (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index 4c24485495582a9779114f52df872e9a33ff8b8c..4c3e1de2a3c232ba1a7c6d9b115dd4ede3680223 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -159,7 +159,6 @@ std::unique_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
frame_entry, request_body, dest_url, dest_referrer,
navigation_type, lofi_state, navigation_start),
BeginNavigationParams(entry.extra_headers(), net::LOAD_NORMAL,
- false, // has_user_gestures
false, // skip_service_worker
REQUEST_CONTEXT_TYPE_LOCATION),
entry.ConstructRequestNavigationParams(
@@ -189,21 +188,20 @@ std::unique_ptr<NavigationRequest> NavigationRequest::CreateRendererInitiated(
// renderer and sent to the browser instead of being measured here.
// TODO(clamy): The pending history list offset should be properly set.
RequestNavigationParams request_params(
- false, // is_overriding_user_agent
- std::vector<GURL>(), // redirects
- false, // can_load_local_resources
- PageState(), // page_state
- 0, // nav_entry_id
- false, // is_same_document_history_load
- false, // is_history_navigation_in_new_child
- std::map<std::string, bool>(), // subframe_unique_names
+ false, // is_overriding_user_agent
+ std::vector<GURL>(), // redirects
+ false, // can_load_local_resources
+ PageState(), // page_state
+ 0, // nav_entry_id
+ false, // is_same_document_history_load
+ false, // is_history_navigation_in_new_child
+ std::map<std::string, bool>(), // subframe_unique_names
frame_tree_node->has_committed_real_load(),
- false, // intended_as_new_entry
- -1, // pending_history_list_offset
+ false, // intended_as_new_entry
+ -1, // pending_history_list_offset
current_history_list_offset, current_history_list_length,
- false, // is_view_source
- false, // should_clear_history_list
- begin_params.has_user_gesture);
+ false, // is_view_source
+ false); // should_clear_history_list
std::unique_ptr<NavigationRequest> navigation_request(
new NavigationRequest(frame_tree_node, common_params, begin_params,
request_params, false, nullptr, nullptr));
@@ -279,8 +277,7 @@ void NavigationRequest::BeginNavigation() {
common_params_.method, common_params_.post_data,
Referrer::SanitizeForRequest(common_params_.url,
common_params_.referrer),
- begin_params_.has_user_gesture, common_params_.transition, false,
- begin_params_.request_context_type,
+ common_params_.transition, false, begin_params_.request_context_type,
base::Bind(&NavigationRequest::OnStartChecksComplete,
base::Unretained(this)));
return;
@@ -310,6 +307,7 @@ void NavigationRequest::CreateNavigationHandle(int pending_nav_entry_id) {
false, // is_same_page
false, // is_srcdoc
common_params_.navigation_start, pending_nav_entry_id,
+ common_params_.gesture,
false); // started_in_context_menu
if (!begin_params_.searchable_form_url.is_empty()) {
@@ -598,8 +596,6 @@ void NavigationRequest::CommitNavigation() {
TransferNavigationHandleOwnership(render_frame_host);
- DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture);
-
render_frame_host->CommitNavigation(response_.get(), std::move(body_),
common_params_, request_params_,
is_view_source_);
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl_unittest.cc ('k') | content/browser/frame_host/navigator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698