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

Unified Diff: Source/core/html/HTMLFrameOwnerElement.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/HTMLFrameOwnerElement.cpp
diff --git a/Source/core/html/HTMLFrameOwnerElement.cpp b/Source/core/html/HTMLFrameOwnerElement.cpp
index 1833cc61cb2a899e2bb4319a450b82f0a8fdb14b..439bfd06c85b0025cdf15ab3a823aaaac3394201 100644
--- a/Source/core/html/HTMLFrameOwnerElement.cpp
+++ b/Source/core/html/HTMLFrameOwnerElement.cpp
@@ -35,6 +35,7 @@
#include "core/loader/FrameLoaderClient.h"
#include "core/plugins/PluginView.h"
#include "platform/weborigin/SecurityOrigin.h"
+#include "platform/weborigin/SecurityPolicy.h"
namespace blink {
@@ -261,7 +262,14 @@ bool HTMLFrameOwnerElement::loadOrRedirectSubframe(const KURL& url, const Atomic
if (document().frame()->host()->subframeCount() >= FrameHost::maxNumberOfFrames)
return false;
- return parentFrame->loader().client()->createFrame(FrameLoadRequest(&document(), url, "_self", CheckContentSecurityPolicy), frameName, this);
+ FrameLoadRequest frameLoadRequest(&document(), url, "_self", CheckContentSecurityPolicy);
+
+ ReferrerPolicy policy;
+ if (referrerPolicyAttribute(&policy)) {
Yoav Weiss 2015/09/08 09:55:08 I think it would be cleaner to change referrerPoli
estark 2015/09/08 14:40:34 Done.
+ frameLoadRequest.resourceRequest().setHTTPReferrer(SecurityPolicy::generateReferrer(policy, url, document().outgoingReferrer()));
+ }
+
+ return parentFrame->loader().client()->createFrame(frameLoadRequest, frameName, this);
}
DEFINE_TRACE(HTMLFrameOwnerElement)

Powered by Google App Engine
This is Rietveld 408576698