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

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

Issue 355043002: Fix loading of data: URI images wrt loadsImagesAutomatically setting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: A better approach 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
Index: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index cd15e1c78b0743685f832fb03db2a66fce09cfd5..d1cbfb042679fd42f2874e3272b91fbeaec1d136 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -1203,7 +1203,12 @@ void ResourceFetcher::requestPreload(Resource::Type type, FetchRequest& request,
request.setCharset(encoding);
request.setForPreload(true);
- ResourcePtr<Resource> resource = requestResource(type, request);
+ ResourcePtr<Resource> resource;
+ // Loading images involves several special cases, so use dedicated fetch method instead.
+ if (type == Resource::Image)
+ resource = fetchImage(request);
+ if (!resource)
+ resource = requestResource(type, request);
if (!resource || (m_preloads && m_preloads->contains(resource.get())))
return;
TRACE_EVENT_ASYNC_STEP_INTO0("net", "Resource", resource.get(), "Preload");

Powered by Google App Engine
This is Rietveld 408576698