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

Unified Diff: third_party/WebKit/Source/core/frame/Frame.cpp

Issue 2730303002: Move Feature Policy test to Frame (Closed)
Patch Set: Fix rebase 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/Frame.cpp
diff --git a/third_party/WebKit/Source/core/frame/Frame.cpp b/third_party/WebKit/Source/core/frame/Frame.cpp
index a1bdb34e7c9e41e6697771c7fae79a0474ce6193..9af871dd50b6622f86576dcd8ff27b9884dce1cb 100644
--- a/third_party/WebKit/Source/core/frame/Frame.cpp
+++ b/third_party/WebKit/Source/core/frame/Frame.cpp
@@ -402,6 +402,16 @@ void Frame::setDocumentHasReceivedUserGesture() {
parent->setDocumentHasReceivedUserGesture();
}
+bool Frame::isFeatureEnabled(WebFeaturePolicyFeature feature) const {
+ WebFeaturePolicy* featurePolicy = securityContext()->getFeaturePolicy();
+ // The policy should always be initialized before checking it to ensure we
+ // properly inherit the parent policy.
+ DCHECK(featurePolicy);
+
+ // Otherwise, check policy.
+ return featurePolicy->IsFeatureEnabled(feature);
+}
+
Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner)
: m_treeNode(this),
m_host(host),
« no previous file with comments | « third_party/WebKit/Source/core/frame/Frame.h ('k') | third_party/WebKit/Source/modules/payments/PaymentRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698