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

Unified Diff: Source/core/html/HTMLIFrameElement.cpp

Issue 1328183002: Implement referrerpolicy attr for iframes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: move referrerpolicy retrieval to subclass Created 5 years, 3 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: Source/core/html/HTMLIFrameElement.cpp
diff --git a/Source/core/html/HTMLIFrameElement.cpp b/Source/core/html/HTMLIFrameElement.cpp
index ef5413c522711007db13895f5ceceafad5062fee..38bbfc892ae4ab978a58a2aea49c1853fb3d6073 100644
--- a/Source/core/html/HTMLIFrameElement.cpp
+++ b/Source/core/html/HTMLIFrameElement.cpp
@@ -32,6 +32,7 @@
#include "core/html/HTMLDocument.h"
#include "core/inspector/ConsoleMessage.h"
#include "core/layout/LayoutIFrame.h"
+#include "platform/RuntimeEnabledFeatures.h"
namespace blink {
@@ -120,6 +121,10 @@ void HTMLIFrameElement::parseAttribute(const QualifiedName& name, const AtomicSt
} else if (name == sandboxAttr) {
m_sandbox->setValue(value);
UseCounter::count(document(), UseCounter::SandboxViaIFrame);
+ } else if (RuntimeEnabledFeatures::referrerPolicyAttributeEnabled() && name == referrerpolicyAttr) {
+ m_referrerPolicy = ReferrerPolicyDefault;
+ if (!value.isNull())
+ SecurityPolicy::referrerPolicyFromString(value, &m_referrerPolicy);
} else {
HTMLFrameElementBase::parseAttribute(name, value);
}
@@ -173,4 +178,12 @@ void HTMLIFrameElement::valueChanged()
setSynchronizedLazyAttribute(sandboxAttr, m_sandbox->value());
}
+bool HTMLIFrameElement::referrerPolicyAttribute(ReferrerPolicy* policy)
Yoav Weiss 2015/09/08 09:55:08 Like I wrote at the caller site, it'd be better to
estark 2015/09/08 14:40:34 Done.
estark 2015/09/08 14:40:34 Done.
+{
+ if (!RuntimeEnabledFeatures::referrerPolicyAttributeEnabled())
+ return false;
+
+ *policy = m_referrerPolicy;
+ return true;
+}
}

Powered by Google App Engine
This is Rietveld 408576698