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

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

Issue 2797813002: Replicate feature policy container policies. (Closed)
Patch Set: Fix ODR violation 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.h
diff --git a/content/browser/frame_host/frame_tree_node.h b/content/browser/frame_host/frame_tree_node.h
index db332daed3c24c2608206e8a470473eba65a6f03..47d625938aaa7eecb32dda0ab1500d94cf7f46ce 100644
--- a/content/browser/frame_host/frame_tree_node.h
+++ b/content/browser/frame_host/frame_tree_node.h
@@ -206,9 +206,37 @@ class CONTENT_EXPORT FrameTreeNode {
// sandboxed, the parent's sandbox flags are combined with |sandbox_flags|.
void SetPendingSandboxFlags(blink::WebSandboxFlags sandbox_flags);
- // Set any pending sandbox flags as active, and return true if the sandbox
- // flags were changed.
- bool CommitPendingSandboxFlags();
+ // Returns the currently active container policy for this frame, which is set
+ // by the iframe allowfullscreen, allowpaymentrequest, and allow attributes,
+ // along with the origin of the iframe's src attribute (which may be different
+ // from the URL of the document currently loaded into the frame). This does
+ // not include policy changes that have been made by updating the containing
+ // iframe element attributes since the frame was last navigated.
+ const ParsedFeaturePolicyHeader& effective_container_policy() const {
+ return replication_state_.container_policy;
+ }
+
+ // Returns the latest computed container policy for this frame, which is set
+ // by the iframe allowfullscreen, allowpaymentrequest, and allow attributes,
+ // along with the origin of the iframe's src attribute (which may be different
+ // from the URL of the document currently loaded into the frame). The returned
+ // policy may not have taken effect, since the policy is snapshotted on
+ // navigation.
+ const ParsedFeaturePolicyHeader& pending_container_policy() const {
+ return pending_container_policy_;
+ }
+
+ // Update this frame's container policy. This is used when a parent frame
raymes 2017/04/05 05:24:38 nit: double space
iclelland 2017/04/05 14:51:12 Done.
+ // updates feature-policy attributes in the <iframe> element for this frame.
+ // These attributes include allow, allowfullscreen, allowpaymentrequest, and
+ // src. Updates to the container policy will not take effect until next
+ // navigation.
+ void SetPendingContainerPolicy(
+ const ParsedFeaturePolicyHeader& container_policy);
+
+ // Set any pending sandbox flags and container policy as active, and return
+ // true if either was changed.
+ bool CommitPendingFramePolicy();
const FrameOwnerProperties& frame_owner_properties() {
return frame_owner_properties_;
@@ -379,6 +407,12 @@ class CONTENT_EXPORT FrameTreeNode {
// navigation.
blink::WebSandboxFlags pending_sandbox_flags_;
+ // Tracks the computed container policy for this frame. When the iframe
+ // allowfullscreen, allowpaymentrequest, allow or src attributes are changed,
+ // the updated policy for the frame is stored here, and transferred into
+ // replication_state_.container_policy on the next frame navigation.
+ ParsedFeaturePolicyHeader pending_container_policy_;
raymes 2017/04/05 05:24:38 Were we still planning to try to rename ParsedFeat
iclelland 2017/04/05 14:51:12 I think that was one of the pending renames (pendi
+
// Tracks the scrolling and margin properties for this frame. These
// properties affect the child renderer but are stored on its parent's
// frame element. When this frame's parent dynamically updates these

Powered by Google App Engine
This is Rietveld 408576698