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

Unified Diff: content/browser/frame_host/navigation_handle_impl.h

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
Index: content/browser/frame_host/navigation_handle_impl.h
diff --git a/content/browser/frame_host/navigation_handle_impl.h b/content/browser/frame_host/navigation_handle_impl.h
index 819d847e9abfd8fdb2875405a7a87722d0cb5e27..41bedf9300dac15f59c3448b550f5600123f9236 100644
--- a/content/browser/frame_host/navigation_handle_impl.h
+++ b/content/browser/frame_host/navigation_handle_impl.h
@@ -92,7 +92,8 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
const base::TimeTicks& navigation_start,
int pending_nav_entry_id,
bool started_from_context_menu,
- CSPDisposition should_check_main_world_csp);
+ CSPDisposition should_check_main_world_csp,
+ bool is_form_submission);
~NavigationHandleImpl() override;
// Used to track the state the navigation is currently in.
@@ -171,6 +172,11 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
// Used in tests.
State state_for_testing() const { return state_; }
+ // Whether or not the navigation has been initiated by a form submission.
+ // TODO(arthursonzogni): This value is correct only when PlzNavigate is
+ // enabled. Make it work in both modes.
+ bool is_form_submission() const { return is_form_submission_; }
+
// The NavigatorDelegate to notify/query for various navigation events.
// Normally this is the WebContents, except if this NavigationHandle was
// created during a navigation to an interstitial page. In this case it will
@@ -375,7 +381,8 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
const base::TimeTicks& navigation_start,
int pending_nav_entry_id,
bool started_from_context_menu,
- CSPDisposition should_check_main_world_csp);
+ CSPDisposition should_check_main_world_csp,
+ bool is_form_submission);
NavigationThrottle::ThrottleCheckResult CheckWillStartRequest();
NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest();
@@ -536,6 +543,9 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
// in the main world should not apply.
CSPDisposition should_check_main_world_csp_;
+ // Whether or not the navigation results from the submission of a form.
+ bool is_form_submission_;
+
base::WeakPtrFactory<NavigationHandleImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl);
« no previous file with comments | « content/browser/frame_host/interstitial_page_navigator_impl.cc ('k') | content/browser/frame_host/navigation_handle_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698