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

Unified Diff: content/common/feature_policy/feature_policy.h

Issue 2655023004: Feature policy: Add basic algorithm for supporting frame policies. (Closed)
Patch Set: Addressing review comments 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/common/feature_policy/feature_policy.h
diff --git a/content/common/feature_policy/feature_policy.h b/content/common/feature_policy/feature_policy.h
index 44f9e11f2667a5f59dad7b5652fd8e4257ed0511..fc156dd3b28ba1545ae887065aa581d12761cd23 100644
--- a/content/common/feature_policy/feature_policy.h
+++ b/content/common/feature_policy/feature_policy.h
@@ -57,6 +57,13 @@ namespace content {
// embedded, or by the defaults for each feature in the case of the top-level
// document.
//
+// Container Policy
+// ----------------
+// A declared policy can be set on a specific frame by the embedding page using
+// the iframe "allow" attribute, or through attributes such as "allowfullscreen"
+// or "allowpaymentrequest". This is the container policy for the embedded
+// frame.
+//
// Defaults
// --------
// Each defined feature has a default policy, which determines whether the
@@ -159,6 +166,7 @@ class CONTENT_EXPORT FeaturePolicy {
static std::unique_ptr<FeaturePolicy> CreateFromParentPolicy(
const FeaturePolicy* parent_policy,
+ const ParsedFeaturePolicyHeader* container_policy,
const url::Origin& origin);
// Returns whether or not the given feature is enabled by this policy.
@@ -180,9 +188,15 @@ class CONTENT_EXPORT FeaturePolicy {
FeaturePolicy(url::Origin origin, const FeatureList& feature_list);
static std::unique_ptr<FeaturePolicy> CreateFromParentPolicy(
const FeaturePolicy* parent_policy,
+ const ParsedFeaturePolicyHeader* container_policy,
const url::Origin& origin,
const FeatureList& features);
+ // Updates the inherited policy with the declarations from the iframe allow*
+ // attributes.
+ void AddContainerPolicy(const ParsedFeaturePolicyHeader* container_policy,
+ const FeaturePolicy* parent_policy);
+
// Returns the list of features which can be controlled by Feature Policy.
static const FeatureList& GetDefaultFeatureList();
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/common/feature_policy/feature_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698