Chromium Code Reviews| 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 a2c03f79605f67d1a78cbbdc5b27ad6869d3a1f9..d5dbdf17c8e6688b42058623d6487454af6e24c7 100644 |
| --- a/third_party/WebKit/public/platform/WebFeaturePolicy.h |
| +++ b/third_party/WebKit/public/platform/WebFeaturePolicy.h |
| @@ -11,16 +11,59 @@ |
| namespace blink { |
| -struct WebFeaturePolicy { |
| - struct ParsedWhitelist { |
| - ParsedWhitelist() : matchesAllOrigins(false) {} |
| - WebString featureName; |
| - bool matchesAllOrigins; |
| - WebVector<WebSecurityOrigin> origins; |
| - }; |
| +enum class WebFeaturePolicyFeature { |
| + NotFound = 0, |
| + DocumentCookie, |
| + DocumentDomain, |
| + DocumentWrite, |
| + Geolocation, |
| + Fullscreen, |
| + MidiFeature, |
| + Notifications, |
| + Payment, |
| + Push, |
| + SyncScript, |
| + SyncXHR, |
| + Usermedia, |
| + Vibrate, |
| + WebRTC, |
| + LAST_FEATURE = WebRTC |
| }; |
| -using WebParsedFeaturePolicy = WebVector<WebFeaturePolicy::ParsedWhitelist>; |
| +// Structure common to WebParsedFeature and WebParsedFeaturePolicyItem. |
| +struct WebParsedWhitelist { |
| + WebParsedWhitelist() : matchesAllOrigins(false) {} |
| + bool matchesAllOrigins; |
| + WebVector<WebSecurityOrigin> origins; |
| +}; |
| + |
| +// Composed policy for a specific feature. |
| +struct WebParsedFeature { |
|
raymes
2017/01/19 02:40:57
Is this class used anymore?
iclelland
2017/01/19 05:40:40
Looks like not; It was only used during the refact
|
| + WebParsedFeature() : inherited(false) {} |
| + WebString featureName; |
| + bool inherited; |
| + WebParsedWhitelist whitelist; |
| +}; |
| + |
| +// Single item out of a declared header policy or iframe allow* attribute. |
| +struct WebParsedFeaturePolicyDeclaration { |
| + WebString featureName; |
| + WebParsedWhitelist whitelist; |
| +}; |
| + |
| +// Used in Blink code to represent parsed headers. Used for IPC between renderer |
| +// and browser. |
| +using WebParsedFeaturePolicyHeader = |
| + WebVector<WebParsedFeaturePolicyDeclaration>; |
| + |
| +using WebParsedFeaturePolicy = WebVector<WebParsedFeature>; |
| + |
| +// 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 WebFeaturePolicy { |
| + public: |
| + virtual ~WebFeaturePolicy() {} |
| +}; |
| } // namespace blink |