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

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

Issue 2495313002: Add referrerpolicy to style and import (Closed)
Patch Set: Fixed import tests Created 3 years, 12 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/resources/pass-if-no-referrer.php ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/LinkResource.cpp
diff --git a/third_party/WebKit/Source/core/html/LinkResource.cpp b/third_party/WebKit/Source/core/html/LinkResource.cpp
index 7b14b00a4432f33baed9ef0da7f09a04fe2a42c7..3f3a12062c15607305a8d33f24b7ed7f54de4ced 100644
--- a/third_party/WebKit/Source/core/html/LinkResource.cpp
+++ b/third_party/WebKit/Source/core/html/LinkResource.cpp
@@ -34,6 +34,7 @@
#include "core/dom/Document.h"
#include "core/html/HTMLLinkElement.h"
#include "core/html/imports/HTMLImportsController.h"
+#include "platform/weborigin/SecurityPolicy.h"
namespace blink {
@@ -67,8 +68,13 @@ LinkRequestBuilder::LinkRequestBuilder(HTMLLinkElement* owner)
}
FetchRequest LinkRequestBuilder::build(bool lowPriority) const {
- FetchRequest request(ResourceRequest(m_owner->document().completeURL(m_url)),
- m_owner->localName(), m_charset);
+ ResourceRequest resourceRequest(m_owner->document().completeURL(m_url));
+ ReferrerPolicy referrerPolicy = m_owner->referrerPolicy();
+ if (referrerPolicy != ReferrerPolicyDefault) {
jochen (gone - plz use gerrit) 2017/01/03 08:41:49 why this if() ?
Yoav Weiss 2017/01/03 09:03:48 I was basing that code on ImageLoader.cpp:304 whic
+ resourceRequest.setHTTPReferrer(SecurityPolicy::generateReferrer(
+ referrerPolicy, m_url, m_owner->document().outgoingReferrer()));
+ }
+ FetchRequest request(resourceRequest, m_owner->localName(), m_charset);
if (lowPriority)
request.setDefer(FetchRequest::LazyLoad);
request.setContentSecurityPolicyNonce(
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/resources/pass-if-no-referrer.php ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698