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

Unified Diff: Source/core/css/StyleRuleImport.cpp

Issue 314893003: Set referrer for CSS resources (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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/css/CSSParserMode.cpp ('k') | Source/core/css/parser/CSSPropertyParser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/StyleRuleImport.cpp
diff --git a/Source/core/css/StyleRuleImport.cpp b/Source/core/css/StyleRuleImport.cpp
index 3a31c70e37f5c7b2082ee3ebec736572bd5ca759..72555577cc113a8fb82b60bce46d491543f53b54 100644
--- a/Source/core/css/StyleRuleImport.cpp
+++ b/Source/core/css/StyleRuleImport.cpp
@@ -74,12 +74,15 @@ void StyleRuleImport::setCSSStyleSheet(const String& href, const KURL& baseURL,
CSSParserContext context = m_parentStyleSheet ? m_parentStyleSheet->parserContext() : strictCSSParserContext();
context.setCharset(charset);
- if (!baseURL.isNull())
+ Document* document = m_parentStyleSheet ? m_parentStyleSheet->singleOwnerDocument() : 0;
+ if (!baseURL.isNull()) {
context.setBaseURL(baseURL);
+ if (document)
+ context.setReferrer(Referrer(baseURL.strippedForUseAsReferrer(), document->referrerPolicy()));
+ }
m_styleSheet = StyleSheetContents::create(this, href, context);
- Document* document = m_parentStyleSheet ? m_parentStyleSheet->singleOwnerDocument() : 0;
m_styleSheet->parseAuthorStyleSheet(cachedStyleSheet, document ? document->securityOrigin() : 0);
m_loading = false;
« no previous file with comments | « Source/core/css/CSSParserMode.cpp ('k') | Source/core/css/parser/CSSPropertyParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698