Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp

Issue 2739203002: Initial Implementation of Iframe Attribute for Feature Policy (Part 3) (Closed)
Patch Set: Codereview: added TODO comment for implementing allow* attributes in the container policy parser Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698