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

Unified Diff: Source/core/css/CSSImageSetValue.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/CSSImageSetValue.h ('k') | Source/core/css/CSSImageValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSImageSetValue.cpp
diff --git a/Source/core/css/CSSImageSetValue.cpp b/Source/core/css/CSSImageSetValue.cpp
index 6273d636226fe185abd2f84381f9cd4e117447be..5d89de6b0663d753d0f26fe9c9ad4665ecf3c876 100644
--- a/Source/core/css/CSSImageSetValue.cpp
+++ b/Source/core/css/CSSImageSetValue.cpp
@@ -57,8 +57,8 @@ void CSSImageSetValue::fillImageSet()
size_t length = this->length();
size_t i = 0;
while (i < length) {
- CSSValue* imageValue = item(i);
- String imageURL = toCSSImageValue(imageValue)->url();
+ CSSImageValue* imageValue = toCSSImageValue(item(i));
+ String imageURL = imageValue->url();
++i;
ASSERT_WITH_SECURITY_IMPLICATION(i < length);
@@ -67,6 +67,7 @@ void CSSImageSetValue::fillImageSet()
ImageWithScale image;
image.imageURL = imageURL;
+ image.referrer = imageValue->referrer();
image.scaleFactor = scaleFactor;
m_imagesInSet.append(image);
++i;
@@ -104,6 +105,7 @@ StyleFetchedImageSet* CSSImageSetValue::cachedImageSet(ResourceFetcher* loader,
ImageWithScale image = bestImageForScaleFactor();
if (Document* document = loader->document()) {
FetchRequest request(ResourceRequest(document->completeURL(image.imageURL)), FetchInitiatorTypeNames::css, options);
+ request.mutableResourceRequest().setHTTPReferrer(image.referrer);
if (options.corsEnabled == IsCORSEnabled)
request.setCrossOriginAccessControl(loader->document()->securityOrigin(), options.allowCredentials, options.credentialsRequested);
« no previous file with comments | « Source/core/css/CSSImageSetValue.h ('k') | Source/core/css/CSSImageValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698