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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 messages->push_back("Whitelist is not an array of strings."); | 106 messages->push_back("Whitelist is not an array of strings."); |
107 } | 107 } |
108 } | 108 } |
109 whitelist.origins = origins; | 109 whitelist.origins = origins; |
110 whitelists.push_back(whitelist); | 110 whitelists.push_back(whitelist); |
111 } | 111 } |
112 } | 112 } |
113 return whitelists; | 113 return whitelists; |
114 } | 114 } |
115 | 115 |
116 // TODO(lunalu): also take information of allowfullscreen and | |
117 // allowpaymentrequest into account when constructing the whitelist. | |
118 WebParsedFeaturePolicy getContainerPolicyFromAllowedFeatures( | |
119 const WebVector<WebFeaturePolicyFeature>& features, | |
120 RefPtr<SecurityOrigin> origin) { | |
121 Vector<WebParsedFeaturePolicyDeclaration> whitelists; | |
122 for (const WebFeaturePolicyFeature feature : features) { | |
123 WebParsedFeaturePolicyDeclaration whitelist; | |
124 whitelist.feature = feature; | |
125 whitelist.origins = | |
126 Vector<WebSecurityOrigin>(static_cast<size_t>(1), {origin}); | |
iclelland
2017/03/15 17:14:54
I think that "1UL" is usually enough to avoid the
| |
127 whitelists.push_back(whitelist); | |
128 } | |
129 return whitelists; | |
130 } | |
131 | |
116 } // namespace blink | 132 } // namespace blink |
OLD | NEW |