OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 CONTENT_COMMON_FEATURE_POLICY_FEATURE_POLICY_H_ | 5 #ifndef CONTENT_COMMON_FEATURE_POLICY_FEATURE_POLICY_H_ |
6 #define CONTENT_COMMON_FEATURE_POLICY_FEATURE_POLICY_H_ | 6 #define CONTENT_COMMON_FEATURE_POLICY_FEATURE_POLICY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 ParsedFeaturePolicyDeclaration(const ParsedFeaturePolicyDeclaration& rhs); | 95 ParsedFeaturePolicyDeclaration(const ParsedFeaturePolicyDeclaration& rhs); |
96 ~ParsedFeaturePolicyDeclaration(); | 96 ~ParsedFeaturePolicyDeclaration(); |
97 | 97 |
98 blink::WebFeaturePolicyFeature feature; | 98 blink::WebFeaturePolicyFeature feature; |
99 bool matches_all_origins; | 99 bool matches_all_origins; |
100 std::vector<url::Origin> origins; | 100 std::vector<url::Origin> origins; |
101 }; | 101 }; |
102 | 102 |
103 using ParsedFeaturePolicyHeader = std::vector<ParsedFeaturePolicyDeclaration>; | 103 using ParsedFeaturePolicyHeader = std::vector<ParsedFeaturePolicyDeclaration>; |
104 | 104 |
| 105 bool CONTENT_EXPORT operator==(const ParsedFeaturePolicyDeclaration& lhs, |
| 106 const ParsedFeaturePolicyDeclaration& rhs); |
| 107 |
105 class CONTENT_EXPORT FeaturePolicy : public blink::WebFeaturePolicy { | 108 class CONTENT_EXPORT FeaturePolicy : public blink::WebFeaturePolicy { |
106 public: | 109 public: |
107 // Represents a collection of origins which make up a whitelist in a feature | 110 // Represents a collection of origins which make up a whitelist in a feature |
108 // policy. This collection may be set to match every origin (corresponding to | 111 // policy. This collection may be set to match every origin (corresponding to |
109 // the "*" syntax in the policy string, in which case the Contains() method | 112 // the "*" syntax in the policy string, in which case the Contains() method |
110 // will always return true. | 113 // will always return true. |
111 class Whitelist final { | 114 class Whitelist final { |
112 public: | 115 public: |
113 Whitelist(); | 116 Whitelist(); |
114 Whitelist(const Whitelist& rhs); | 117 Whitelist(const Whitelist& rhs); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 std::map<blink::WebFeaturePolicyFeature, bool> inherited_policies_; | 208 std::map<blink::WebFeaturePolicyFeature, bool> inherited_policies_; |
206 | 209 |
207 const FeatureList& feature_list_; | 210 const FeatureList& feature_list_; |
208 | 211 |
209 DISALLOW_COPY_AND_ASSIGN(FeaturePolicy); | 212 DISALLOW_COPY_AND_ASSIGN(FeaturePolicy); |
210 }; | 213 }; |
211 | 214 |
212 } // namespace content | 215 } // namespace content |
213 | 216 |
214 #endif // CONTENT_COMMON_FEATURE_POLICY_FEATURE_POLICY_H_ | 217 #endif // CONTENT_COMMON_FEATURE_POLICY_FEATURE_POLICY_H_ |
OLD | NEW |