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

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: Bug fix: frame owner does not always exist. 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698