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

Unified Diff: Source/core/html/parser/CSSPreloadScanner.cpp

Issue 1235563004: Apply meta tag referrer policy for preloaded requests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: style fix Created 5 years, 5 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 | « Source/core/html/parser/CSSPreloadScanner.h ('k') | Source/core/html/parser/HTMLPreloadScanner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/CSSPreloadScanner.cpp
diff --git a/Source/core/html/parser/CSSPreloadScanner.cpp b/Source/core/html/parser/CSSPreloadScanner.cpp
index 034cb36fb3913a92972143f792fb1c97c9ac2717..d7fad12fa695d98da79499de7832e7176e07d912 100644
--- a/Source/core/html/parser/CSSPreloadScanner.cpp
+++ b/Source/core/html/parser/CSSPreloadScanner.cpp
@@ -37,6 +37,7 @@ namespace blink {
CSSPreloadScanner::CSSPreloadScanner()
: m_state(Initial)
, m_requests(0)
+ , m_referrerPolicy(ReferrerPolicyDefault)
{
}
@@ -76,6 +77,11 @@ void CSSPreloadScanner::scan(const String& tagName, const SegmentedString& sour
scanCommon(begin, begin + tagName.length(), source, requests);
}
+void CSSPreloadScanner::setReferrerPolicy(const ReferrerPolicy policy)
+{
+ m_referrerPolicy = policy;
+}
+
inline void CSSPreloadScanner::tokenize(UChar c, const SegmentedString& source)
{
// We are just interested in @import rules, no need for real tokenization here
@@ -215,7 +221,7 @@ void CSSPreloadScanner::emitRule(const SegmentedString& source)
if (!url.isEmpty()) {
KURL baseElementURL; // FIXME: This should be passed in from the HTMLPreloadScaner via scan()!
TextPosition position = TextPosition(source.currentLine(), source.currentColumn());
- OwnPtr<PreloadRequest> request = PreloadRequest::create(FetchInitiatorTypeNames::css, position, url, baseElementURL, Resource::CSSStyleSheet);
+ OwnPtr<PreloadRequest> request = PreloadRequest::create(FetchInitiatorTypeNames::css, position, url, baseElementURL, Resource::CSSStyleSheet, m_referrerPolicy);
// FIXME: Should this be including the charset in the preload request?
m_requests->append(request.release());
}
« no previous file with comments | « Source/core/html/parser/CSSPreloadScanner.h ('k') | Source/core/html/parser/HTMLPreloadScanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698