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

Unified Diff: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp

Issue 2923563003: Move container policy logic to frame owner classes. (Closed)
Patch Set: Add Frame element unit test Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
index 58d0410c0f97819b2c4f5a41663ef0ce7e2d2921..59e66aba8ca5defd684fdae021883ee691a1bd07 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
@@ -233,10 +233,21 @@ void HTMLFrameOwnerElement::DisposeFrameOrPluginSoon(
}
}
+Vector<WebParsedFeaturePolicyDeclaration>
+HTMLFrameOwnerElement::ConstructContainerPolicy() const {
+ RefPtr<SecurityOrigin> origin = GetOriginForFeaturePolicy();
+ Vector<WebParsedFeaturePolicyDeclaration> whitelists;
+ for (const WebFeaturePolicyFeature feature : AllowedFeatures()) {
+ WebParsedFeaturePolicyDeclaration whitelist;
+ whitelist.feature = feature;
+ whitelist.origins = Vector<WebSecurityOrigin>(1UL, {origin});
+ whitelists.push_back(whitelist);
+ }
+ return whitelists;
+}
raymes 2017/06/07 23:54:38 Is this actually needed or can this be a pure virt
iclelland 2017/06/12 17:32:17 i had expected that it would be common code to han
+
void HTMLFrameOwnerElement::UpdateContainerPolicy() {
- container_policy_ = GetContainerPolicyFromAllowedFeatures(
- AllowedFeatures(), AllowFullscreen(), AllowPaymentRequest(),
- GetOriginForFeaturePolicy());
+ container_policy_ = ConstructContainerPolicy();
// Don't notify about updates if ContentFrame() is null, for example when
// the subframe hasn't been created yet.
if (ContentFrame()) {

Powered by Google App Engine
This is Rietveld 408576698