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), |