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 #include "platform/feature_policy/FeaturePolicy.h" | 5 #include "platform/feature_policy/FeaturePolicy.h" |
6 | 6 |
7 #include "platform/RuntimeEnabledFeatures.h" | 7 #include "platform/RuntimeEnabledFeatures.h" |
8 #include "platform/json/JSONValues.h" | 8 #include "platform/json/JSONValues.h" |
9 #include "platform/network/HTTPParsers.h" | 9 #include "platform/network/HTTPParsers.h" |
10 #include "platform/weborigin/SecurityOrigin.h" | 10 #include "platform/weborigin/SecurityOrigin.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 messages->push_back("Whitelist is not an array of strings."); | 103 messages->push_back("Whitelist is not an array of strings."); |
104 } | 104 } |
105 } | 105 } |
106 whitelist.origins = origins; | 106 whitelist.origins = origins; |
107 whitelists.push_back(whitelist); | 107 whitelists.push_back(whitelist); |
108 } | 108 } |
109 } | 109 } |
110 return whitelists; | 110 return whitelists; |
111 } | 111 } |
112 | 112 |
| 113 // TODO(lunalu): also take information of allowfullscreen and |
| 114 // allowpaymentrequest into account when constructing the whitelist. |
| 115 WebParsedFeaturePolicy getContainerPolicyFromAllowedFeatures( |
| 116 const WebVector<WebFeaturePolicyFeature>& features, |
| 117 RefPtr<SecurityOrigin> origin) { |
| 118 Vector<WebParsedFeaturePolicyDeclaration> whitelists; |
| 119 for (const WebFeaturePolicyFeature feature : features) { |
| 120 WebParsedFeaturePolicyDeclaration whitelist; |
| 121 whitelist.feature = feature; |
| 122 whitelist.origins = Vector<WebSecurityOrigin>(1UL, {origin}); |
| 123 whitelists.push_back(whitelist); |
| 124 } |
| 125 return whitelists; |
| 126 } |
| 127 |
113 } // namespace blink | 128 } // namespace blink |
OLD | NEW |