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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1956383003: Forwarding POST body into renderer after a cross-site transfer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Attempting to rebase on top of clamy@'s other CL. Created 4 years, 7 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/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index bc7731ae67f6d2c53a0703571ac60d13ee295803..615414ee94712c253668c7ef9b8e0995434b2746 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -546,7 +546,7 @@ WebURLRequest CreateURLRequestForNavigation(
// to the WebURLRequest used to commit the navigation. This ensures that the
// POST data will be in the PageState sent to the browser on commit.
void AddHTTPBodyToRequest(WebURLRequest* request,
- scoped_refptr<ResourceRequestBody> body) {
+ const scoped_refptr<ResourceRequestBody>& body) {
WebHTTPBody http_body;
http_body.initialize();
http_body.setIdentifier(body->identifier());
@@ -5426,18 +5426,9 @@ void RenderFrameImpl::NavigateInternal(
}
}
- if (common_params.method == "POST" && !browser_side_navigation) {
- // Set post data.
- WebHTTPBody http_body;
- http_body.initialize();
- const char* data = nullptr;
- if (start_params.browser_initiated_post_data.size()) {
- data = reinterpret_cast<const char*>(
- &start_params.browser_initiated_post_data.front());
- }
- http_body.appendData(
- WebData(data, start_params.browser_initiated_post_data.size()));
- request.setHTTPBody(http_body);
+ if (common_params.method == "POST" && !browser_side_navigation &&
clamy 2016/05/20 15:49:14 This means that the post data will only be added t
Łukasz Anforowicz 2016/05/20 22:18:47 Done. You're right - now that this handles not on
+ start_params.post_data) {
+ AddHTTPBodyToRequest(&request, start_params.post_data);
}
// A session history navigation should have been accompanied by state.

Powered by Google App Engine
This is Rietveld 408576698