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

Unified Diff: content/common/navigation_params.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: More tweaks of the DCHECKs in constructor of CommonNavigationParams. 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
« no previous file with comments | « content/browser/loader/resource_request_info_impl.cc ('k') | content/public/browser/navigation_handle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/navigation_params.cc
diff --git a/content/common/navigation_params.cc b/content/common/navigation_params.cc
index 39162ffe2bd06e52a2694616b60de3cf43042307..1955be396b1f15a9beed17bcb561a7c980c7d666 100644
--- a/content/common/navigation_params.cc
+++ b/content/common/navigation_params.cc
@@ -62,7 +62,25 @@ CommonNavigationParams::CommonNavigationParams(
lofi_state(lofi_state),
navigation_start(navigation_start),
method(method),
- post_data(post_data) {}
+ post_data(post_data) {
+ if (method == "POST") {
clamy 2016/05/30 16:40:43 As mentioned in navigator_impl.cc I'm really not s
Łukasz Anforowicz 2016/05/31 16:25:20 Done.
+ if (navigation_type != FrameMsg_Navigate_Type::NORMAL) {
+ // No data is sent for reloads and/or history navigations - in these cases
+ // the body is already present in the renderer process (see |is_reload|
+ // and |is_history_navigation| branches in
+ // RenderFrameImpl::NavigateInternal).
+ DCHECK(!post_data);
clamy 2016/05/30 16:40:43 This will break in PlzNavigate. We always send the
Łukasz Anforowicz 2016/05/31 16:25:20 Done (this branch of "if" statement was removed al
+ } else {
+ // |post_data| should be present when "POST" HTTP method is used.
+ // TODO(lukasza): Reenable this after fixing https://crbug.com/613004.
+ // (currently post data is lost after some cross-site transfers).
+ // DCHECK(post_data);
clamy 2016/05/30 16:40:43 Please don't add commented out code.
Łukasz Anforowicz 2016/05/31 16:25:20 Done (this branch of "if" statement was removed al
+ }
+ } else {
+ // |post_data| should be missing when HTTP method other than "POST" is used.
+ DCHECK(!post_data);
+ }
+}
CommonNavigationParams::CommonNavigationParams(
const CommonNavigationParams& other) = default;
« no previous file with comments | « content/browser/loader/resource_request_info_impl.cc ('k') | content/public/browser/navigation_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698