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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2423233002: Preserving extra http request headers in OpenURL navigation path [relanding]. (Closed)
Patch Set: This patchset is copied from https://crrev.com/2355023002 Created 4 years, 2 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/renderer/render_frame_impl.h ('k') | content/renderer/render_frame_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index d8b476c7b68335ca052cf30cd89d9c7515418c92..042939e7c562635c6d7f98d661e828796e0edcda 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -3163,7 +3163,8 @@ void RenderFrameImpl::loadURLExternally(const blink::WebURLRequest& request,
suggested_name));
} else {
OpenURL(request.url(), IsHttpPost(request),
- GetRequestBodyForWebURLRequest(request), referrer, policy,
+ GetRequestBodyForWebURLRequest(request),
+ GetWebURLRequestHeaders(request), referrer, policy,
should_replace_current_entry, false);
}
}
@@ -5092,7 +5093,8 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
render_view_->renderer_preferences_
.browser_handles_all_top_level_requests) {
OpenURL(url, IsHttpPost(info.urlRequest),
- GetRequestBodyForWebURLRequest(info.urlRequest), referrer,
+ GetRequestBodyForWebURLRequest(info.urlRequest),
+ GetWebURLRequestHeaders(info.urlRequest), referrer,
info.defaultPolicy, info.replacesCurrentHistoryItem, false);
return blink::WebNavigationPolicyIgnore; // Suppress the load here.
}
@@ -5112,7 +5114,8 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
// JavaScript on the page is trying to interrupt the history navigation.
if (!info.isClientRedirect) {
OpenURL(url, IsHttpPost(info.urlRequest),
- GetRequestBodyForWebURLRequest(info.urlRequest), referrer,
+ GetRequestBodyForWebURLRequest(info.urlRequest),
+ GetWebURLRequestHeaders(info.urlRequest), referrer,
info.defaultPolicy, info.replacesCurrentHistoryItem, true);
// Suppress the load in Blink but mark the frame as loading.
return blink::WebNavigationPolicyHandledByClient;
@@ -5173,6 +5176,7 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
if (should_fork) {
OpenURL(url, IsHttpPost(info.urlRequest),
GetRequestBodyForWebURLRequest(info.urlRequest),
+ GetWebURLRequestHeaders(info.urlRequest),
send_referrer ? referrer : Referrer(), info.defaultPolicy,
info.replacesCurrentHistoryItem, false);
return blink::WebNavigationPolicyIgnore; // Suppress the load here.
@@ -5214,7 +5218,8 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
if (is_fork) {
// Open the URL via the browser, not via WebKit.
OpenURL(url, IsHttpPost(info.urlRequest),
- GetRequestBodyForWebURLRequest(info.urlRequest), Referrer(),
+ GetRequestBodyForWebURLRequest(info.urlRequest),
+ GetWebURLRequestHeaders(info.urlRequest), Referrer(),
info.defaultPolicy, info.replacesCurrentHistoryItem, false);
return blink::WebNavigationPolicyIgnore;
}
@@ -5551,6 +5556,7 @@ void RenderFrameImpl::OpenURL(
const GURL& url,
bool uses_post,
const scoped_refptr<ResourceRequestBodyImpl>& resource_request_body,
+ const std::string& extra_headers,
const Referrer& referrer,
WebNavigationPolicy policy,
bool should_replace_current_entry,
@@ -5559,6 +5565,7 @@ void RenderFrameImpl::OpenURL(
params.url = url;
params.uses_post = uses_post;
params.resource_request_body = resource_request_body;
+ params.extra_headers = extra_headers;
params.referrer = referrer;
params.disposition = RenderViewImpl::NavigationPolicyToDisposition(policy);
@@ -6050,8 +6057,7 @@ void RenderFrameImpl::BeginNavigation(const NavigationPolicyInfo& info) {
REQUEST_CONTEXT_FRAME_TYPE_NESTED);
Send(new FrameHostMsg_BeginNavigation(
- routing_id_,
- MakeCommonNavigationParams(info),
+ routing_id_, MakeCommonNavigationParams(info),
BeginNavigationParams(
GetWebURLRequestHeaders(info.urlRequest),
GetLoadFlagsForWebURLRequest(info.urlRequest),
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_frame_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698