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

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

Issue 133013006: Schedule GC of document resources when loading data URLs (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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/ResourceFetcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index 1a8398753b3b03449abadb778c1f37f659005a96..b46ab093ab569a23883b41b57f1a27bb7af5315c 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -294,8 +294,10 @@ void ResourceFetcher::preCacheDataURIImage(const FetchRequest& request)
if (memoryCache()->resourceForURL(url))
return;
- if (Resource* resource = resourceFromDataURIRequest(request.resourceRequest(), request.options()))
+ if (Resource* resource = resourceFromDataURIRequest(request.resourceRequest(), request.options())) {
memoryCache()->add(resource);
+ scheduleDocumentResourcesGC();
+ }
}
ResourcePtr<FontResource> ResourceFetcher::fetchFont(FetchRequest& request)
@@ -1008,7 +1010,11 @@ void ResourceFetcher::didLoadResource(Resource* resource)
if (frame())
frame()->loader().loadDone();
performPostLoadActions();
+ scheduleDocumentResourcesGC();
+}
+void ResourceFetcher::scheduleDocumentResourcesGC()
+{
if (!m_garbageCollectDocumentResourcesTimer.isActive())
m_garbageCollectDocumentResourcesTimer.startOneShot(0);
}
« no previous file with comments | « Source/core/fetch/ResourceFetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698