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

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: Addressed comments 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/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 172cd5efb478a1199f6d1d595a21af892f792928..689e8878c838d2852727d97f2a7edaa764024044 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1488,7 +1488,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);
@@ -2214,7 +2222,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))) {
@@ -2249,7 +2257,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);

Powered by Google App Engine
This is Rietveld 408576698