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

Unified Diff: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp

Issue 1707013002: [WIP][SVG 3/4] Allow invalid data: URLs to be served synchronously by Resource::load() Base URL: https://chromium.googlesource.com/chromium/src.git@Loader_SVGImage_Fix2
Patch Set: Created 4 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
index 8eea6d9313861d478d4c03ec0a5d697e28ee3c58..110400fd8e01287a981f1330dc78397bc396076d 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
@@ -336,8 +336,17 @@ PassRefPtrWillBeRawPtr<Resource> ResourceFetcher::resourceForStaticData(const Fe
if (!Platform::current()->canHandleDataURLRequestLocally(wrappedRequest))
return nullptr;
data = PassRefPtr<SharedBuffer>(Platform::current()->parseDataURL(url, mimetype, charset));
- if (!data)
- return nullptr;
+ if (!data) {
+ // We don't add |resource| to MemoryCache because it has an error,
+ // but make ResourceFetcher::requestResource() to return this
+ // Resource to make all data font URLs to be resolved synchronously.
+ // https://crbug.com/382170
+ RefPtrWillBeRawPtr<Resource> resource = factory.create(request.resourceRequest(), request.charset());
+ resource->setNeedsSynchronousCacheHit(substituteData.forceSynchronousLoad());
+ resource->setOptions(request.options());
Nate Chapin 2016/03/01 19:05:06 Can we do the this and the changes above it earlie
hiroshige 2016/03/01 22:13:14 Done.
+ resource->error(Resource::LoadError);
+ return resource.release();
+ }
}
ResourceResponse response(url, mimetype, data->size(), charset, String());
response.setHTTPStatusCode(200);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698