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

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

Issue 2797813002: Replicate feature policy container policies. (Closed)
Patch Set: Addressing review comments Created 3 years, 8 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/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 ffeda9e10c946b8f8c33b43ecf8a99042e65b63f..0fadcaa8afb6208aa9e8cc06439e864a03a492eb 100644
--- a/content/browser/frame_host/frame_tree_node.cc
+++ b/content/browser/frame_host/frame_tree_node.cc
@@ -321,6 +321,14 @@ void FrameTreeNode::SetPendingSandboxFlags(
pending_sandbox_flags_ |= parent()->effective_sandbox_flags();
}
+void FrameTreeNode::SetPendingContainerPolicy(
+ const ParsedFeaturePolicyHeader& container_policy) {
+ // This should only be called on subframes; container policy is not mutable on
+ // main frame.
+ DCHECK(!IsMainFrame());
+ pending_container_policy_ = container_policy;
+}
+
bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const {
if (!other || !other->child_count())
return false;
@@ -364,11 +372,16 @@ bool FrameTreeNode::IsLoading() const {
return current_frame_host->is_loading();
}
-bool FrameTreeNode::CommitPendingSandboxFlags() {
+bool FrameTreeNode::CommitPendingFramePolicy() {
bool did_change_flags =
pending_sandbox_flags_ != replication_state_.sandbox_flags;
- replication_state_.sandbox_flags = pending_sandbox_flags_;
- return did_change_flags;
+ bool did_change_container_policy =
+ pending_container_policy_ != replication_state_.container_policy;
+ if (did_change_flags)
+ replication_state_.sandbox_flags = pending_sandbox_flags_;
+ if (did_change_container_policy)
+ replication_state_.container_policy = pending_container_policy_;
+ return did_change_flags || did_change_container_policy;
}
void FrameTreeNode::CreatedNavigationRequest(
« no previous file with comments | « content/browser/frame_host/frame_tree_node.h ('k') | content/browser/frame_host/frame_tree_node_blame_context_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698