Chromium Code Reviews

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

Issue 2636843003: Move most Feature Policy code into content/ (Closed)
Patch Set: Addressing review comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « content/browser/frame_host/frame_tree_node.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/frame_tree_node.cc
diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc
index a67de695a205b85c456d5c8f63254140222ec10f..1a041d0d9dff9a0e4b8e23e7be2c686e3988dd28 100644
--- a/content/browser/frame_host/frame_tree_node.cc
+++ b/content/browser/frame_host/frame_tree_node.cc
@@ -256,12 +256,21 @@ void FrameTreeNode::SetFrameName(const std::string& name,
}
void FrameTreeNode::SetFeaturePolicyHeader(
- const ParsedFeaturePolicy& parsed_header) {
+ const FeaturePolicyHeader& parsed_header) {
+ ResetFeaturePolicy();
replication_state_.feature_policy_header = parsed_header;
+ feature_policy_->SetHeaderPolicy(parsed_header);
}
void FrameTreeNode::ResetFeaturePolicy() {
replication_state_.feature_policy_header.clear();
+ if (parent()) {
+ feature_policy_ = FeaturePolicy::CreateFromParentPolicy(
+ parent()->feature_policy_.get(), current_origin());
+ } else {
+ feature_policy_ =
+ FeaturePolicy::CreateFromParentPolicy(nullptr, current_origin());
+ }
}
void FrameTreeNode::AddContentSecurityPolicy(
« no previous file with comments | « content/browser/frame_host/frame_tree_node.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine