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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.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
« no previous file with comments | « content/browser/loader/navigation_url_loader_unittest.cc ('k') | content/child/web_url_loader_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index da012a1c64c62c784e2b722d962a8f9cc9d2c3a4..ce9d8029d60a87f1de70d48064c9dbf8d20cc7c4 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1448,7 +1448,15 @@ void ResourceDispatcherHostImpl::BeginRequest(
: request_data.url,
request_data.priority, nullptr);
- new_request->set_method(request_data.method);
+ // PlzNavigate: Always set the method to GET when gaining access to the
+ // stream that contains the response body of a navigation. Otherwise the data
+ // that was already fetched by the browser will not be transmitted to the
+ // renderer.
+ if (is_navigation_stream_request)
+ new_request->set_method("GET");
+ else
+ new_request->set_method(request_data.method);
+
new_request->set_first_party_for_cookies(
request_data.first_party_for_cookies);
new_request->set_initiator(request_data.request_initiator);
@@ -2179,7 +2187,7 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest(
// needs to be checked relative to the child that /requested/ the
// navigation. It's where file upload checks, etc., come in.
(delegate_ && !delegate_->ShouldBeginRequest(
- info.begin_params.method,
+ info.common_params.method,
info.common_params.url,
resource_type,
resource_context))) {
@@ -2214,7 +2222,7 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest(
new_request = request_context->CreateRequest(
info.common_params.url, net::HIGHEST, nullptr);
- new_request->set_method(info.begin_params.method);
+ new_request->set_method(info.common_params.method);
new_request->set_first_party_for_cookies(
info.first_party_for_cookies);
new_request->set_initiator(info.request_initiator);
« no previous file with comments | « content/browser/loader/navigation_url_loader_unittest.cc ('k') | content/child/web_url_loader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698