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

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

Issue 2424943002: Add ReferrerPolicy support to preload (Closed)
Patch Set: Created 4 years, 2 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/HTMLLinkElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
index 4218572b31a22db8d713a0e464814c9481653d25..378553ebc8929d21080e940434ea9bbec60cfd9e 100644
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
@@ -103,6 +103,8 @@ void HTMLLinkElement::parseAttribute(const QualifiedName& name,
} else if (name == asAttr) {
m_as = value;
process();
+ } else if (name == referrerpolicyAttr) {
+ m_referrerPolicy = value;
} else if (name == sizesAttr) {
m_sizes->setValue(value);
} else if (name == mediaAttr) {
@@ -132,11 +134,13 @@ bool HTMLLinkElement::shouldLoadLink() {
bool HTMLLinkElement::loadLink(const String& type,
const String& as,
const String& media,
+ const String& referrerPolicy,
const KURL& url) {
return m_linkLoader->loadLink(
m_relAttribute,
crossOriginAttributeValue(fastGetAttribute(HTMLNames::crossoriginAttr)),
- type, as, media, url, document(), NetworkHintsInterfaceImpl());
+ type, as, media, referrerPolicy, url, document(),
+ NetworkHintsInterfaceImpl());
}
LinkResource* HTMLLinkElement::linkResourceToProcess() {
@@ -618,6 +622,7 @@ void LinkStyle::process() {
String type = m_owner->typeValue().lower();
String as = m_owner->asValue().lower();
String media = m_owner->media().lower();
+ String referrerPolicy = m_owner->referrerPolicy().lower();
LinkRequestBuilder builder(m_owner);
if (m_owner->relAttribute().getIconType() != InvalidIcon &&
@@ -634,7 +639,7 @@ void LinkStyle::process() {
m_owner->relAttribute().getIconType());
}
- if (!m_owner->loadLink(type, as, media, builder.url()))
+ if (!m_owner->loadLink(type, as, media, referrerPolicy, builder.url()))
return;
if (m_disabledState != Disabled && m_owner->relAttribute().isStyleSheet() &&

Powered by Google App Engine
This is Rietveld 408576698