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

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

Issue 1291883002: Use precaching for more data: urls than just images. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tweak determineRevalidationPolicy ordering Created 5 years, 4 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/fetch/ImageResource.h ('k') | Source/core/fetch/RawResource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ImageResource.cpp
diff --git a/Source/core/fetch/ImageResource.cpp b/Source/core/fetch/ImageResource.cpp
index 34f240fc2aca412835790b3397d231ba46ed1435..9151123f9e4c055c943f74353f60064f0818315c 100644
--- a/Source/core/fetch/ImageResource.cpp
+++ b/Source/core/fetch/ImageResource.cpp
@@ -45,34 +45,6 @@
namespace blink {
-void ImageResource::preCacheDataURIImage(const FetchRequest& request, ResourceFetcher* fetcher)
-{
- const KURL& url = request.resourceRequest().url();
- ASSERT(url.protocolIsData());
-
- const String cacheIdentifier = fetcher->getCacheIdentifier();
- if (memoryCache()->resourceForURL(url, cacheIdentifier))
- return;
-
- WebString mimetype;
- WebString charset;
- RefPtr<SharedBuffer> data = PassRefPtr<SharedBuffer>(Platform::current()->parseDataURL(url, mimetype, charset));
- if (!data)
- return;
- ResourceResponse response(url, mimetype, data->size(), charset, String());
-
- Resource* resource = new ImageResource(request.resourceRequest());
- resource->setOptions(request.options());
- // FIXME: We should provide a body stream here.
- resource->responseReceived(response, nullptr);
- if (data->size())
- resource->setResourceBuffer(data);
- resource->setCacheIdentifier(cacheIdentifier);
- resource->finish();
- memoryCache()->add(resource);
- fetcher->scheduleDocumentResourcesGC();
-}
-
ResourcePtr<ImageResource> ImageResource::fetch(FetchRequest& request, ResourceFetcher* fetcher)
{
if (request.resourceRequest().requestContext() == WebURLRequest::RequestContextUnspecified)
@@ -84,9 +56,6 @@ ResourcePtr<ImageResource> ImageResource::fetch(FetchRequest& request, ResourceF
return 0;
}
- if (request.resourceRequest().url().protocolIsData())
- ImageResource::preCacheDataURIImage(request, fetcher);
-
if (fetcher->clientDefersImage(request.resourceRequest().url()))
request.setDefer(FetchRequest::DeferredByClient);
« no previous file with comments | « Source/core/fetch/ImageResource.h ('k') | Source/core/fetch/RawResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698