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

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

Issue 2727633005: PlzNavigate: Enforce frame-src CSP on the browser. (Closed)
Patch Set: Addressed Alex's comments + trying to fix subframe swap issue Created 3 years, 10 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 e9cb20983e0c94bfd343b693d330b7b89ecdf3ad..6b3ff3f026338b781b6ca90526d6518b6a60a984 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 {
bool is_same_page,
const base::TimeTicks& navigation_start,
int pending_nav_entry_id,
- bool started_from_context_menu);
+ bool started_from_context_menu,
+ bool should_bypass_main_world_csp);
~NavigationHandleImpl() override;
// Used to track the state the navigation is currently in.
@@ -346,6 +347,10 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
response_headers_ = response_headers;
}
+ bool should_bypass_main_world_csp() const {
+ return should_bypass_main_world_csp_;
+ }
+
private:
friend class NavigationHandleImplTest;
@@ -356,7 +361,8 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
bool is_same_page,
const base::TimeTicks& navigation_start,
int pending_nav_entry_id,
- bool started_from_context_menu);
+ bool started_from_context_menu,
+ bool should_bypass_main_world_csp);
NavigationThrottle::ThrottleCheckResult CheckWillStartRequest();
NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest();
@@ -503,6 +509,11 @@ class CONTENT_EXPORT NavigationHandleImpl : public NavigationHandle {
net::HostPortPair socket_address_;
NavigationType navigation_type_;
+ // Whether or not the navigation has been issued by an isolated world, for
+ // instance from a chrome extension. When true, the navigation should not be
+ // blocked by the parent frame's CSP.
+ bool should_bypass_main_world_csp_;
+
base::WeakPtrFactory<NavigationHandleImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl);

Powered by Google App Engine
This is Rietveld 408576698