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

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

Issue 2797813002: Replicate feature policy container policies. (Closed)
Patch Set: Cleanup, reponding to review comments 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));
alexmos 2017/04/06 00:44:22 Is creating an origin directly from the src URL re
iclelland 2017/04/09 03:25:54 The way we have defined it in the spec, specifying
+ // 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();
lunalu1 2017/04/05 22:30:03 I don't think we need to update it here?
iclelland 2017/04/09 03:25:54 Thanks; that was older code from a previous iterat
// 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;
lunalu1 2017/04/05 22:30:03 it seems like this is the only place this url is u
iclelland 2017/04/09 03:25:54 Thanks for catching that -- we don't need to anymo
+ updateContainerPolicy();
+
LocalFrame* parentFrame = document().frame();
if (contentFrame()) {
contentFrame()->navigate(document(), url, replaceCurrentItem,

Powered by Google App Engine
This is Rietveld 408576698