Index: content/renderer/render_frame_impl.cc |
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc |
index 612fc59ff8b283cbb988e42110e7476f96f8107f..58dc04c4fdc7499d68afccadfeaaf893a3dcef02 100644 |
--- a/content/renderer/render_frame_impl.cc |
+++ b/content/renderer/render_frame_impl.cc |
@@ -800,6 +800,10 @@ bool IsContentWithCertificateErrorsRelevantToUI( |
ssl_status.connection_status); |
} |
+bool IsHttpPost(const blink::WebURLRequest& request) { |
+ return request.httpMethod().utf8() == "POST"; |
+} |
+ |
#if defined(OS_ANDROID) |
// Returns true if WMPI should be used for playback, false otherwise. |
// |
@@ -2916,8 +2920,9 @@ void RenderFrameImpl::loadURLExternally(const blink::WebURLRequest& request, |
request.url(), referrer, |
suggested_name)); |
} else { |
- OpenURL(request.url(), referrer, policy, should_replace_current_entry, |
- false); |
+ OpenURL(request.url(), IsHttpPost(request), |
+ GetRequestBodyForWebURLRequest(request), referrer, policy, |
+ should_replace_current_entry, false); |
} |
} |
@@ -4783,8 +4788,9 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( |
if (is_content_initiated && IsTopLevelNavigation(frame_) && |
render_view_->renderer_preferences_ |
.browser_handles_all_top_level_requests) { |
- OpenURL(url, referrer, info.defaultPolicy, info.replacesCurrentHistoryItem, |
- false); |
+ OpenURL(url, IsHttpPost(info.urlRequest), |
+ GetRequestBodyForWebURLRequest(info.urlRequest), referrer, |
+ info.defaultPolicy, info.replacesCurrentHistoryItem, false); |
return blink::WebNavigationPolicyIgnore; // Suppress the load here. |
} |
@@ -4793,8 +4799,9 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( |
// FrameNavigationEntry. If none is found, fall back to the default url. |
if (SiteIsolationPolicy::UseSubframeNavigationEntries() && |
info.isHistoryNavigationInNewChildFrame && is_content_initiated) { |
- OpenURL(url, referrer, info.defaultPolicy, info.replacesCurrentHistoryItem, |
- true); |
+ OpenURL(url, IsHttpPost(info.urlRequest), |
+ GetRequestBodyForWebURLRequest(info.urlRequest), referrer, |
+ info.defaultPolicy, info.replacesCurrentHistoryItem, true); |
// Suppress the load in Blink but mark the frame as loading. |
return blink::WebNavigationPolicyHandledByClient; |
} |
@@ -4857,7 +4864,9 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( |
} |
if (should_fork) { |
- OpenURL(url, send_referrer ? referrer : Referrer(), info.defaultPolicy, |
+ OpenURL(url, IsHttpPost(info.urlRequest), |
+ GetRequestBodyForWebURLRequest(info.urlRequest), |
+ send_referrer ? referrer : Referrer(), info.defaultPolicy, |
info.replacesCurrentHistoryItem, false); |
return blink::WebNavigationPolicyIgnore; // Suppress the load here. |
} |
@@ -4897,8 +4906,9 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( |
if (is_fork) { |
// Open the URL via the browser, not via WebKit. |
- OpenURL(url, Referrer(), info.defaultPolicy, |
- info.replacesCurrentHistoryItem, false); |
+ OpenURL(url, IsHttpPost(info.urlRequest), |
+ GetRequestBodyForWebURLRequest(info.urlRequest), Referrer(), |
+ info.defaultPolicy, info.replacesCurrentHistoryItem, false); |
return blink::WebNavigationPolicyIgnore; |
} |
@@ -5264,13 +5274,18 @@ void RenderFrameImpl::OnSelectPopupMenuItems( |
#endif |
#endif |
-void RenderFrameImpl::OpenURL(const GURL& url, |
- const Referrer& referrer, |
- WebNavigationPolicy policy, |
- bool should_replace_current_entry, |
- bool is_history_navigation_in_new_child) { |
+void RenderFrameImpl::OpenURL( |
+ const GURL& url, |
+ bool uses_post, |
+ const scoped_refptr<ResourceRequestBodyImpl>& resource_request_body, |
+ const Referrer& referrer, |
+ WebNavigationPolicy policy, |
+ bool should_replace_current_entry, |
+ bool is_history_navigation_in_new_child) { |
FrameHostMsg_OpenURL_Params params; |
params.url = url; |
+ params.uses_post = uses_post; |
+ params.resource_request_body = resource_request_body; |
params.referrer = referrer; |
params.disposition = RenderViewImpl::NavigationPolicyToDisposition(policy); |