Index: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h |
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h |
index 2bda3b5c68f68642b59bda16d9d5817a261636f0..6583c92f7b38ce5c5342129e02eb7d900f792f5c 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h |
+++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h |
@@ -25,6 +25,7 @@ |
#include "core/dom/Document.h" |
#include "core/frame/FrameOwner.h" |
#include "core/html/HTMLElement.h" |
+#include "platform/feature_policy/FeaturePolicy.h" |
#include "platform/heap/Handle.h" |
#include "platform/scroll/ScrollTypes.h" |
#include "platform/weborigin/SecurityPolicy.h" |
@@ -93,6 +94,10 @@ class CORE_EXPORT HTMLFrameOwnerElement : public HTMLElement, |
bool IsDisplayNone() const override { return !widget_; } |
AtomicString Csp() const override { return g_null_atom; } |
const WebVector<WebFeaturePolicyFeature>& AllowedFeatures() const override; |
+ const WebParsedFeaturePolicy& ContainerPolicy() const override; |
+ |
+ // For unit tests, manually trigger the UpdateContainerPolicy method. |
+ void UpdateContainerPolicyForTests() { UpdateContainerPolicy(); } |
DECLARE_VIRTUAL_TRACE(); |
@@ -108,6 +113,19 @@ class CORE_EXPORT HTMLFrameOwnerElement : public HTMLElement, |
void DisposeWidgetSoon(FrameViewBase*); |
void FrameOwnerPropertiesChanged(); |
+ // Return the origin which is to be used for feature policy container |
+ // policies, when a specific origin is needed. This supports the "allow" |
+ // attribute, which uses the url specified by the parent document to determine |
+ // the origin when the frame is constructed. |
+ virtual const RefPtr<SecurityOrigin> GetOriginForFeaturePolicy() const { |
+ return SecurityOrigin::CreateUnique(); |
+ } |
+ |
+ // Construct a new feature policy container policy for this frame, based on |
+ // the frame attributes and the effective origin specified in the frame |
+ // attributes. |
+ void UpdateContainerPolicy(); |
+ |
private: |
// Intentionally private to prevent redundant checks when the type is |
// already HTMLFrameOwnerElement. |
@@ -123,6 +141,8 @@ class CORE_EXPORT HTMLFrameOwnerElement : public HTMLElement, |
Member<Frame> content_frame_; |
Member<FrameViewBase> widget_; |
SandboxFlags sandbox_flags_; |
+ |
+ WebParsedFeaturePolicy container_policy_; |
}; |
DEFINE_ELEMENT_TYPE_CASTS(HTMLFrameOwnerElement, IsFrameOwnerElement()); |