| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WebFeaturePolicy_h | 5 #ifndef WebFeaturePolicy_h |
| 6 #define WebFeaturePolicy_h | 6 #define WebFeaturePolicy_h |
| 7 | 7 |
| 8 #include "WebCommon.h" | 8 #include "WebCommon.h" |
| 9 #include "WebSecurityOrigin.h" | 9 #include "WebSecurityOrigin.h" |
| 10 #include "WebString.h" | 10 #include "WebString.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 struct BLINK_PLATFORM_EXPORT WebParsedFeaturePolicyDeclaration { | 51 struct BLINK_PLATFORM_EXPORT WebParsedFeaturePolicyDeclaration { |
| 52 WebParsedFeaturePolicyDeclaration() : matchesAllOrigins(false) {} | 52 WebParsedFeaturePolicyDeclaration() : matchesAllOrigins(false) {} |
| 53 WebString featureName; | 53 WebString featureName; |
| 54 bool matchesAllOrigins; | 54 bool matchesAllOrigins; |
| 55 WebVector<WebSecurityOrigin> origins; | 55 WebVector<WebSecurityOrigin> origins; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 // Used in Blink code to represent parsed headers. Used for IPC between renderer | 58 // Used in Blink code to represent parsed headers. Used for IPC between renderer |
| 59 // and browser. | 59 // and browser. |
| 60 using WebParsedFeaturePolicyHeader = | 60 using WebParsedFeaturePolicy = WebVector<WebParsedFeaturePolicyDeclaration>; |
| 61 WebVector<WebParsedFeaturePolicyDeclaration>; | |
| 62 | 61 |
| 63 // Composed full policy for a document. Stored in SecurityContext for each | 62 // Composed full policy for a document. Stored in SecurityContext for each |
| 64 // document. This is essentially an opaque handle to an object in the embedder. | 63 // document. This is essentially an opaque handle to an object in the embedder. |
| 65 class BLINK_PLATFORM_EXPORT WebFeaturePolicy { | 64 class BLINK_PLATFORM_EXPORT WebFeaturePolicy { |
| 66 public: | 65 public: |
| 67 virtual ~WebFeaturePolicy() {} | 66 virtual ~WebFeaturePolicy() {} |
| 68 | 67 |
| 69 // Returns whether or not the given feature is enabled for the origin of the | 68 // Returns whether or not the given feature is enabled for the origin of the |
| 70 // document that owns the policy. | 69 // document that owns the policy. |
| 71 virtual bool IsFeatureEnabled(blink::WebFeaturePolicyFeature) const = 0; | 70 virtual bool IsFeatureEnabled(blink::WebFeaturePolicyFeature) const = 0; |
| 72 }; | 71 }; |
| 73 | 72 |
| 74 } // namespace blink | 73 } // namespace blink |
| 75 | 74 |
| 76 #endif // WebFeaturePolicy_h | 75 #endif // WebFeaturePolicy_h |
| OLD | NEW |