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

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

Issue 1678303004: PlzNavigate: inform the renderer that a navigation is a POST (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 months 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 e45133bcfd436322384ff0de177721e129c16fab..3bf3c6f193b37cd362e2dd16543b49827c8b58d9 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -71,8 +71,6 @@ scoped_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
bool is_same_document_history_load,
const base::TimeTicks& navigation_start,
NavigationControllerImpl* controller) {
- std::string method = entry.GetHasPostData() ? "POST" : "GET";
-
// Copy existing headers and add necessary headers that may not be present
// in the RequestNavigationParams.
net::HttpRequestHeaders headers;
@@ -96,7 +94,7 @@ scoped_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
frame_tree_node, entry.ConstructCommonNavigationParams(
dest_url, dest_referrer, navigation_type, lofi_state,
navigation_start),
- BeginNavigationParams(method, headers.ToString(),
+ BeginNavigationParams(headers.ToString(),
LoadFlagFromNavigationType(navigation_type),
false, // has_user_gestures
false, // skip_service_worker
@@ -210,8 +208,10 @@ void NavigationRequest::BeginNavigation() {
// It's safe to use base::Unretained because this NavigationRequest owns
// the NavigationHandle where the callback will be stored.
// TODO(clamy): pass the real value for |is_external_protocol| if needed.
+ // TODO(clamy): pass the method to the NavigationHandle instead of a
+ // boolean.
navigation_handle_->WillStartRequest(
- begin_params_.method == "POST",
+ common_params_.method == "POST",
Referrer::SanitizeForRequest(common_params_.url,
common_params_.referrer),
begin_params_.has_user_gesture, common_params_.transition, false,
@@ -246,7 +246,7 @@ void NavigationRequest::OnRequestRedirected(
const net::RedirectInfo& redirect_info,
const scoped_refptr<ResourceResponse>& response) {
common_params_.url = redirect_info.new_url;
- begin_params_.method = redirect_info.new_method;
+ common_params_.method = redirect_info.new_method;
common_params_.referrer.url = GURL(redirect_info.new_referrer);
// TODO(clamy): Have CSP + security upgrade checks here.
@@ -256,7 +256,7 @@ void NavigationRequest::OnRequestRedirected(
// NavigationHandle where the callback will be stored.
// TODO(clamy): pass the real value for |is_external_protocol| if needed.
navigation_handle_->WillRedirectRequest(
- common_params_.url, begin_params_.method == "POST",
+ common_params_.url, common_params_.method == "POST",
common_params_.referrer.url, false, response->head.headers,
base::Bind(&NavigationRequest::OnRedirectChecksComplete,
base::Unretained(this)));
« no previous file with comments | « content/browser/frame_host/navigation_entry_impl.cc ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698