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

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

Issue 2655663004: Introduce content-side Feature Policy object and maintain in parallel with renderer policy. (Closed)
Patch Set: Add comments for public enum members 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
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/common/feature_policy/feature_policy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 6c04e236e37ea42de06c2216980b7ff53d24524b..8e6dff68f781c09c66bcc9e570dea23f4e085ae7 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1850,6 +1850,8 @@ void RenderFrameHostImpl::OnDidChangeName(const std::string& name,
void RenderFrameHostImpl::OnDidSetFeaturePolicyHeader(
const ParsedFeaturePolicyHeader& parsed_header) {
frame_tree_node()->SetFeaturePolicyHeader(parsed_header);
+ ResetFeaturePolicy();
+ feature_policy_->SetHeaderPolicy(parsed_header);
}
void RenderFrameHostImpl::OnDidAddContentSecurityPolicy(
@@ -3391,6 +3393,14 @@ void RenderFrameHostImpl::DeleteWebBluetoothService(
web_bluetooth_services_.erase(it);
}
+void RenderFrameHostImpl::ResetFeaturePolicy() {
+ RenderFrameHostImpl* parent_frame_host = GetParent();
+ const FeaturePolicy* parent_policy =
+ parent_frame_host ? parent_frame_host->get_feature_policy() : nullptr;
+ feature_policy_ = FeaturePolicy::CreateFromParentPolicy(
+ parent_policy, last_committed_origin_);
+}
+
void RenderFrameHostImpl::Create(
const service_manager::Identity& remote_identity,
media::mojom::InterfaceFactoryRequest request) {
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/common/feature_policy/feature_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698