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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // determined by the feature's default policy. (Again, see the comments in | 83 // determined by the feature's default policy. (Again, see the comments in |
84 // FeaturePolicy::DefaultPolicy for details) | 84 // FeaturePolicy::DefaultPolicy for details) |
85 | 85 |
86 // This struct holds feature policy whitelist data that needs to be replicated | 86 // This struct holds feature policy whitelist data that needs to be replicated |
87 // between a RenderFrame and any of its associated RenderFrameProxies. A list of | 87 // between a RenderFrame and any of its associated RenderFrameProxies. A list of |
88 // these form a ParsedFeaturePolicyHeader. | 88 // these form a ParsedFeaturePolicyHeader. |
89 // NOTE: These types are used for replication frame state between processes. | 89 // NOTE: These types are used for replication frame state between processes. |
90 // They exist only because we can't transfer WebVectors directly over IPC. | 90 // They exist only because we can't transfer WebVectors directly over IPC. |
91 struct CONTENT_EXPORT ParsedFeaturePolicyDeclaration { | 91 struct CONTENT_EXPORT ParsedFeaturePolicyDeclaration { |
92 ParsedFeaturePolicyDeclaration(); | 92 ParsedFeaturePolicyDeclaration(); |
93 ParsedFeaturePolicyDeclaration(std::string feature_name, | 93 ParsedFeaturePolicyDeclaration(blink::WebFeaturePolicyFeature feature, |
94 bool matches_all_origins, | 94 bool matches_all_origins, |
95 std::vector<url::Origin> origins); | 95 std::vector<url::Origin> origins); |
96 ParsedFeaturePolicyDeclaration(const ParsedFeaturePolicyDeclaration& rhs); | 96 ParsedFeaturePolicyDeclaration(const ParsedFeaturePolicyDeclaration& rhs); |
97 ~ParsedFeaturePolicyDeclaration(); | 97 ~ParsedFeaturePolicyDeclaration(); |
98 | 98 |
99 std::string feature_name; | 99 blink::WebFeaturePolicyFeature feature; |
100 bool matches_all_origins; | 100 bool matches_all_origins; |
101 std::vector<url::Origin> origins; | 101 std::vector<url::Origin> origins; |
102 }; | 102 }; |
103 | 103 |
104 using ParsedFeaturePolicyHeader = std::vector<ParsedFeaturePolicyDeclaration>; | 104 using ParsedFeaturePolicyHeader = std::vector<ParsedFeaturePolicyDeclaration>; |
105 | 105 |
106 class CONTENT_EXPORT FeaturePolicy : public blink::WebFeaturePolicy { | 106 class CONTENT_EXPORT FeaturePolicy : public blink::WebFeaturePolicy { |
107 public: | 107 public: |
108 // Represents a collection of origins which make up a whitelist in a feature | 108 // Represents a collection of origins which make up a whitelist in a feature |
109 // policy. This collection may be set to match every origin (corresponding to | 109 // policy. This collection may be set to match every origin (corresponding to |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 std::map<blink::WebFeaturePolicyFeature, bool> inherited_policies_; | 219 std::map<blink::WebFeaturePolicyFeature, bool> inherited_policies_; |
220 | 220 |
221 const FeatureList& feature_list_; | 221 const FeatureList& feature_list_; |
222 | 222 |
223 DISALLOW_COPY_AND_ASSIGN(FeaturePolicy); | 223 DISALLOW_COPY_AND_ASSIGN(FeaturePolicy); |
224 }; | 224 }; |
225 | 225 |
226 } // namespace content | 226 } // namespace content |
227 | 227 |
228 #endif // CONTENT_COMMON_FEATURE_POLICY_FEATURE_POLICY_H_ | 228 #endif // CONTENT_COMMON_FEATURE_POLICY_FEATURE_POLICY_H_ |
OLD | NEW |