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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleResourceLoader.cpp

Issue 1487343002: Set credentials mode "same-origin" when crossOrigin=anonymous is set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years 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/css/resolver/StyleResourceLoader.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResourceLoader.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResourceLoader.cpp
index ce42d106b9a3067786a9a34d9c1bc1f495b202be..38d5148918ee28d1bc6f62a6749367ed6966b789 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleResourceLoader.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleResourceLoader.cpp
@@ -38,6 +38,7 @@
#include "core/style/StyleFetchedImageSet.h"
#include "core/style/StyleGeneratedImage.h"
#include "core/style/StylePendingImage.h"
+#include "platform/CrossOriginAttributeValue.h"
namespace blink {
@@ -77,10 +78,10 @@ void StyleResourceLoader::loadPendingSVGDocuments(ComputedStyle* computedStyle,
elementStyleResources.clearPendingSVGDocuments();
}
-static PassRefPtrWillBeRawPtr<StyleImage> doLoadPendingImage(Document* document, StylePendingImage* pendingImage, float deviceScaleFactor, const ResourceLoaderOptions& options)
+static PassRefPtrWillBeRawPtr<StyleImage> doLoadPendingImage(Document* document, StylePendingImage* pendingImage, float deviceScaleFactor, CrossOriginAttributeValue crossOrigin)
{
if (CSSImageValue* imageValue = pendingImage->cssImageValue())
- return imageValue->cacheImage(document, options);
+ return imageValue->cacheImage(document, crossOrigin);
if (CSSImageGeneratorValue* imageGeneratorValue = pendingImage->cssImageGeneratorValue()) {
imageGeneratorValue->loadSubimages(document);
@@ -91,14 +92,14 @@ static PassRefPtrWillBeRawPtr<StyleImage> doLoadPendingImage(Document* document,
return cursorImageValue->cacheImage(document, deviceScaleFactor);
if (CSSImageSetValue* imageSetValue = pendingImage->cssImageSetValue())
- return imageSetValue->cacheImageSet(document, deviceScaleFactor, options);
+ return imageSetValue->cacheImageSet(document, deviceScaleFactor, crossOrigin);
return nullptr;
}
PassRefPtrWillBeRawPtr<StyleImage> StyleResourceLoader::loadPendingImage(StylePendingImage* pendingImage, float deviceScaleFactor)
{
- return doLoadPendingImage(m_document, pendingImage, deviceScaleFactor, ResourceFetcher::defaultResourceOptions());
+ return doLoadPendingImage(m_document, pendingImage, deviceScaleFactor, CrossOriginAttributeNotSet);
}
void StyleResourceLoader::loadPendingShapeImage(ComputedStyle* computedStyle, ShapeValue* shapeValue, float deviceScaleFactor)
@@ -110,12 +111,7 @@ void StyleResourceLoader::loadPendingShapeImage(ComputedStyle* computedStyle, Sh
if (!image || !image->isPendingImage())
return;
- ResourceLoaderOptions options = ResourceFetcher::defaultResourceOptions();
- options.allowCredentials = DoNotAllowStoredCredentials;
- options.credentialsRequested = ClientDidNotRequestCredentials;
- options.corsEnabled = IsCORSEnabled;
-
- shapeValue->setImage(doLoadPendingImage(m_document, toStylePendingImage(image), deviceScaleFactor, options));
+ shapeValue->setImage(doLoadPendingImage(m_document, toStylePendingImage(image), deviceScaleFactor, CrossOriginAttributeAnonymous));
}
void StyleResourceLoader::loadPendingImages(ComputedStyle* style, ElementStyleResources& elementStyleResources)
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSImageValue.cpp ('k') | third_party/WebKit/Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698