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

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

Issue 2651883008: Make content::FeaturePolicy implement WebFeaturePolicy, and use it in blink code (Closed)
Patch Set: Cleanup 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..8b2b6b0f4b2f190573021d3bb8ef391d85c1eac1 100644
--- a/content/common/feature_policy/feature_policy.h
+++ b/content/common/feature_policy/feature_policy.h
@@ -96,7 +96,7 @@ struct CONTENT_EXPORT ParsedFeaturePolicyDeclaration {
using ParsedFeaturePolicyHeader = std::vector<ParsedFeaturePolicyDeclaration>;
-class CONTENT_EXPORT FeaturePolicy {
+class CONTENT_EXPORT FeaturePolicy : public blink::WebFeaturePolicy {
public:
// Represents a collection of origins which make up a whitelist in a feature
// policy. This collection may be set to match every origin (corresponding to
@@ -155,7 +155,7 @@ class CONTENT_EXPORT FeaturePolicy {
using FeatureList =
std::map<blink::WebFeaturePolicyFeature, const FeaturePolicy::Feature*>;
- ~FeaturePolicy();
+ ~FeaturePolicy() override;
static std::unique_ptr<FeaturePolicy> CreateFromParentPolicy(
const FeaturePolicy* parent_policy,
@@ -173,6 +173,8 @@ class CONTENT_EXPORT FeaturePolicy {
// Unrecognized features will be ignored.
void SetHeaderPolicy(const ParsedFeaturePolicyHeader& parsed_header);
+ void SetOrigin(url::Origin origin) { origin_ = origin; }
+
private:
friend class FeaturePolicyTest;

Powered by Google App Engine
This is Rietveld 408576698