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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2689653003: PlzNavigate: Enforce 'form-action' CSP on the browser-side. (Closed)
Patch Set: Rebase. Created 3 years, 9 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/public/test/navigation_simulator.cc ('k') | content/test/BUILD.gn » ('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 c453e5a32a52886e809ecf5c17df82845f358a82..c9d8b6964d2c22790443d65d0657728c48c30358 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -6347,6 +6347,11 @@ void RenderFrameImpl::BeginNavigation(const NavigationPolicyInfo& info) {
net::LOAD_ONLY_FROM_CACHE | net::LOAD_DISABLE_CACHE);
load_flags |= net::LOAD_BYPASS_CACHE;
}
+
+ bool is_form_submission =
+ info.navigationType == blink::WebNavigationTypeFormSubmitted ||
+ info.navigationType == blink::WebNavigationTypeFormResubmitted;
+
BeginNavigationParams begin_navigation_params(
GetWebURLRequestHeaders(info.urlRequest), load_flags,
info.urlRequest.hasUserGesture(),
@@ -6354,7 +6359,7 @@ void RenderFrameImpl::BeginNavigation(const NavigationPolicyInfo& info) {
blink::WebURLRequest::ServiceWorkerMode::All,
GetRequestContextTypeForWebURLRequest(info.urlRequest),
GetMixedContentContextTypeForWebURLRequest(info.urlRequest),
- initiator_origin);
+ is_form_submission, initiator_origin);
if (!info.form.isNull()) {
WebSearchableFormData web_searchable_form_data(info.form);
« no previous file with comments | « content/public/test/navigation_simulator.cc ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698