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

Unified Diff: Source/WebCore/loader/cache/CachedResourceLoader.cpp

Issue 7542020: Merge 91725 - REGRESSION (r39725?): Resources removed from document can not be freed until the do... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 5 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/WebCore/loader/cache/CachedResourceLoader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/loader/cache/CachedResourceLoader.cpp
===================================================================
--- Source/WebCore/loader/cache/CachedResourceLoader.cpp (revision 92201)
+++ Source/WebCore/loader/cache/CachedResourceLoader.cpp (working copy)
@@ -86,7 +86,6 @@
CachedResourceLoader::CachedResourceLoader(Document* document)
: m_document(document)
, m_requestCount(0)
- , m_garbageCollectDocumentResourcesTimer(this, &CachedResourceLoader::garbageCollectDocumentResourcesTimerFired)
, m_autoLoadImages(true)
, m_loadFinishing(false)
, m_allowStaleResources(false)
@@ -573,32 +572,8 @@
if (frame())
frame()->loader()->loadDone();
performPostLoadActions();
-
- if (!m_garbageCollectDocumentResourcesTimer.isActive())
- m_garbageCollectDocumentResourcesTimer.startOneShot(0);
}
-// Garbage collecting m_documentResources is a workaround for the
-// CachedResourceHandles on the RHS being strong references. Ideally this
-// would be a weak map, however CachedResourceHandles perform additional
-// bookkeeping on CachedResources, so instead pseudo-GC them -- when the
-// reference count reaches 1, m_documentResources is the only reference, so
-// remove it from the map.
-void CachedResourceLoader::garbageCollectDocumentResourcesTimerFired(Timer<CachedResourceLoader>* timer)
-{
- ASSERT_UNUSED(timer, timer == &m_garbageCollectDocumentResourcesTimer);
-
- Vector<String, 10> toDelete;
-
- for (DocumentResourceMap::iterator it = m_documentResources.begin(); it != m_documentResources.end(); ++it) {
- if (it->second->hasOneHandle())
- toDelete.append(it->first);
- }
-
- for (Vector<String, 10>::const_iterator idel = toDelete.begin(); idel != toDelete.end(); ++idel)
- m_documentResources.remove(*idel);
-}
-
void CachedResourceLoader::performPostLoadActions()
{
checkForPendingPreloads();
« no previous file with comments | « Source/WebCore/loader/cache/CachedResourceLoader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698