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

Side by Side 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, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/navigation_params.h" 5 #include "content/common/navigation_params.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "content/common/service_worker/service_worker_types.h" 8 #include "content/common/service_worker/service_worker_types.h"
9 #include "content/public/common/browser_side_navigation_policy.h" 9 #include "content/public/common/browser_side_navigation_policy.h"
10 #include "content/public/common/url_constants.h" 10 #include "content/public/common/url_constants.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 navigation_type(navigation_type), 55 navigation_type(navigation_type),
56 allow_download(allow_download), 56 allow_download(allow_download),
57 should_replace_current_entry(should_replace_current_entry), 57 should_replace_current_entry(should_replace_current_entry),
58 ui_timestamp(ui_timestamp), 58 ui_timestamp(ui_timestamp),
59 report_type(report_type), 59 report_type(report_type),
60 base_url_for_data_url(base_url_for_data_url), 60 base_url_for_data_url(base_url_for_data_url),
61 history_url_for_data_url(history_url_for_data_url), 61 history_url_for_data_url(history_url_for_data_url),
62 lofi_state(lofi_state), 62 lofi_state(lofi_state),
63 navigation_start(navigation_start), 63 navigation_start(navigation_start),
64 method(method), 64 method(method),
65 post_data(post_data) {} 65 post_data(post_data) {
66 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.
67 if (navigation_type != FrameMsg_Navigate_Type::NORMAL) {
68 // No data is sent for reloads and/or history navigations - in these cases
69 // the body is already present in the renderer process (see |is_reload|
70 // and |is_history_navigation| branches in
71 // RenderFrameImpl::NavigateInternal).
72 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
73 } else {
74 // |post_data| should be present when "POST" HTTP method is used.
75 // TODO(lukasza): Reenable this after fixing https://crbug.com/613004.
76 // (currently post data is lost after some cross-site transfers).
77 // 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
78 }
79 } else {
80 // |post_data| should be missing when HTTP method other than "POST" is used.
81 DCHECK(!post_data);
82 }
83 }
66 84
67 CommonNavigationParams::CommonNavigationParams( 85 CommonNavigationParams::CommonNavigationParams(
68 const CommonNavigationParams& other) = default; 86 const CommonNavigationParams& other) = default;
69 87
70 CommonNavigationParams::~CommonNavigationParams() { 88 CommonNavigationParams::~CommonNavigationParams() {
71 } 89 }
72 90
73 BeginNavigationParams::BeginNavigationParams() 91 BeginNavigationParams::BeginNavigationParams()
74 : load_flags(0), 92 : load_flags(0),
75 has_user_gesture(false), 93 has_user_gesture(false),
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 const RequestNavigationParams& request_params) 202 const RequestNavigationParams& request_params)
185 : common_params(common_params), 203 : common_params(common_params),
186 start_params(start_params), 204 start_params(start_params),
187 request_params(request_params) { 205 request_params(request_params) {
188 } 206 }
189 207
190 NavigationParams::~NavigationParams() { 208 NavigationParams::~NavigationParams() {
191 } 209 }
192 210
193 } // namespace content 211 } // namespace content
OLDNEW
« 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