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

Unified Diff: third_party/WebKit/public/platform/WebFeaturePolicy.h

Issue 2651883008: Make content::FeaturePolicy implement WebFeaturePolicy, and use it in blink code (Closed)
Patch Set: Duplicate FP object rather than modifying in-place 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: third_party/WebKit/public/platform/WebFeaturePolicy.h
diff --git a/third_party/WebKit/public/platform/WebFeaturePolicy.h b/third_party/WebKit/public/platform/WebFeaturePolicy.h
index 5b8bdfb1f800fa29abd3846567dcaa32383d6111..93865643a42f9114710189f88492db74ebcb13c6 100644
--- a/third_party/WebKit/public/platform/WebFeaturePolicy.h
+++ b/third_party/WebKit/public/platform/WebFeaturePolicy.h
@@ -5,6 +5,7 @@
#ifndef WebFeaturePolicy_h
#define WebFeaturePolicy_h
+#include "WebCommon.h"
#include "WebSecurityOrigin.h"
#include "WebString.h"
#include "WebVector.h"
@@ -47,7 +48,7 @@ enum class WebFeaturePolicyFeature {
LAST_FEATURE = WebRTC
};
-struct WebParsedFeaturePolicyDeclaration {
+struct BLINK_PLATFORM_EXPORT WebParsedFeaturePolicyDeclaration {
WebParsedFeaturePolicyDeclaration() : matchesAllOrigins(false) {}
WebString featureName;
bool matchesAllOrigins;
@@ -59,6 +60,17 @@ struct WebParsedFeaturePolicyDeclaration {
using WebParsedFeaturePolicyHeader =
WebVector<WebParsedFeaturePolicyDeclaration>;
+// Composed full policy for a document. Stored in SecurityContext for each
+// document. This is essentially an opaque handle to an object in the embedder.
+class BLINK_PLATFORM_EXPORT WebFeaturePolicy {
+ public:
+ virtual ~WebFeaturePolicy() {}
+
+ // Returns whether or not the given feature is enabled for the origin of the
+ // document that owns the policy.
+ virtual bool IsFeatureEnabled(blink::WebFeaturePolicyFeature) const = 0;
+};
+
} // namespace blink
#endif // WebFeaturePolicy_h

Powered by Google App Engine
This is Rietveld 408576698