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

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

Issue 2797813002: Replicate feature policy container policies. (Closed)
Patch Set: Fix ODR violation Created 3 years, 8 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 097190ad126078692b3ade36bd3d0efe4c140a42..db5b4a6addb8db04e009a7567fff4254275eb0c6 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
@@ -206,9 +206,10 @@ void HTMLFrameOwnerElement::setSandboxFlags(SandboxFlags flags) {
m_sandboxFlags = flags;
// Don't notify about updates if contentFrame() is null, for example when
// the subframe hasn't been created yet.
- if (contentFrame())
- document().frame()->loader().client()->didChangeSandboxFlags(contentFrame(),
- flags);
+ if (contentFrame()) {
+ document().frame()->loader().client()->didChangeFramePolicy(
+ contentFrame(), m_sandboxFlags, m_containerPolicy);
+ }
}
bool HTMLFrameOwnerElement::isKeyboardFocusable() const {
@@ -223,7 +224,19 @@ void HTMLFrameOwnerElement::disposeWidgetSoon(FrameViewBase* frameViewBase) {
frameViewBase->dispose();
}
+void HTMLFrameOwnerElement::updateContainerPolicy() {
+ m_containerPolicy = getContainerPolicyFromAllowedFeatures(
+ allowedFeatures(), SecurityOrigin::create(m_absoluteURL));
raymes 2017/04/05 05:43:22 Hmm, how do payment request and fullscreen get fac
iclelland 2017/04/05 14:51:13 Luna was doing that separately in https://coderevi
+ // Don't notify about updates if contentFrame() is null, for example when
+ // the subframe hasn't been created yet.
+ if (contentFrame()) {
+ document().frame()->loader().client()->didChangeFramePolicy(
+ contentFrame(), m_sandboxFlags, m_containerPolicy);
+ }
+}
+
void HTMLFrameOwnerElement::frameOwnerPropertiesChanged() {
+ updateContainerPolicy();
// Don't notify about updates if contentFrame() is null, for example when
// the subframe hasn't been created yet.
if (contentFrame())
@@ -240,6 +253,10 @@ HTMLFrameOwnerElement::allowedFeatures() const {
return features;
}
+const WebParsedFeaturePolicy& HTMLFrameOwnerElement::containerPolicy() const {
+ return m_containerPolicy;
+}
+
Document* HTMLFrameOwnerElement::getSVGDocument(
ExceptionState& exceptionState) const {
Document* doc = contentDocument();
@@ -308,6 +325,9 @@ bool HTMLFrameOwnerElement::loadOrRedirectSubframe(
const KURL& url,
const AtomicString& frameName,
bool replaceCurrentItem) {
+ m_absoluteURL = url;
+ updateContainerPolicy();
+
LocalFrame* parentFrame = document().frame();
if (contentFrame()) {
contentFrame()->navigate(document(), url, replaceCurrentItem,

Powered by Google App Engine
This is Rietveld 408576698