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

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

Issue 2424943002: Add ReferrerPolicy support to preload (Closed)
Patch Set: Test fix 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 9b402d3c27a141347a0b993a6164e753549fbd3b..fd8ab8b2dcbc3977ac920d86d948d44b9b672878 100644
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
@@ -39,6 +39,7 @@
#include "core/loader/FrameLoaderClient.h"
#include "core/loader/NetworkHintsInterface.h"
#include "core/origin_trials/OriginTrials.h"
+#include "platform/weborigin/SecurityPolicy.h"
#include "public/platform/WebIconSizesParser.h"
#include "public/platform/WebSize.h"
@@ -79,6 +80,10 @@ void HTMLLinkElement::parseAttribute(const QualifiedName& name,
} else if (name == asAttr) {
m_as = value;
process();
+ } else if (name == referrerpolicyAttr) {
+ m_referrerPolicy = ReferrerPolicyDefault;
+ if (!value.isNull())
+ SecurityPolicy::referrerPolicyFromString(value, &m_referrerPolicy);
} else if (name == sizesAttr) {
m_sizes->setValue(value);
} else if (name == mediaAttr) {
@@ -108,11 +113,13 @@ bool HTMLLinkElement::shouldLoadLink() {
bool HTMLLinkElement::loadLink(const String& type,
const String& as,
const String& media,
+ ReferrerPolicy 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() {
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLLinkElement.h ('k') | third_party/WebKit/Source/core/html/LinkStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698