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()); |
} |