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

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 2655663004: Introduce content-side Feature Policy object and maintain in parallel with renderer policy. (Closed)
Patch Set: Simplify FP mirroring logic; move most of it to RFHI 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/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 0c34b760f629ae56c9c4c8fa0b69852949bee897..8f16e68f811b4ab6a07b08a8b50ce7d6f472e65a 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -582,7 +582,7 @@ void NavigatorImpl::DidNavigate(
// <meta> elements - we need to reset CSP and Feature Policy.
if (!is_navigation_within_page) {
render_frame_host->frame_tree_node()->ResetContentSecurityPolicy();
- render_frame_host->frame_tree_node()->ResetFeaturePolicy();
+ render_frame_host->frame_tree_node()->ResetFeaturePolicyHeader();
}
// When using --site-per-process, we notify the RFHM for all navigations,
@@ -652,6 +652,10 @@ void NavigatorImpl::DidNavigate(
if (!params.url_is_unreachable)
render_frame_host->set_last_successful_url(params.url);
+ // After setting the last committed origin, reset the feature policy in the
+ // RenderFrameHost to a blank policy based on the parent frame.
+ render_frame_host->ResetFeaturePolicy();
+
// Send notification about committed provisional loads. This notification is
// different from the NAV_ENTRY_COMMITTED notification which doesn't include
// the actual URL navigated to and isn't sent for AUTO_SUBFRAME navigations.

Powered by Google App Engine
This is Rietveld 408576698