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

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

Issue 649213002: Oilpan: eager resource disposal on MemoryCache eviction. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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/MemoryCache.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/MemoryCache.cpp
diff --git a/Source/core/fetch/MemoryCache.cpp b/Source/core/fetch/MemoryCache.cpp
index 0f79f552f8d1941917dc39eb41e500d8746479ab..7e3c36bd0c9aab45fef9dff0b45d17db401a7252 100644
--- a/Source/core/fetch/MemoryCache.cpp
+++ b/Source/core/fetch/MemoryCache.cpp
@@ -85,6 +85,13 @@ void MemoryCacheEntry::trace(Visitor* visitor)
visitor->trace(m_nextInAllResourcesList);
}
+#if ENABLE(OILPAN)
+void MemoryCacheEntry::dispose()
+{
+ m_resource.clear();
+}
+#endif
+
void MemoryCacheLRUList::trace(Visitor* visitor)
{
visitor->trace(m_head);
@@ -372,11 +379,17 @@ bool MemoryCache::evict(MemoryCacheEntry* entry)
ResourceMap::iterator it = m_resources.find(resource->url());
ASSERT(it != m_resources.end());
-#if !ENABLE(OILPAN)
+#if ENABLE(OILPAN)
+ MemoryCacheEntry* entryPtr = it->value;
+#else
OwnPtr<MemoryCacheEntry> entryPtr;
entryPtr.swap(it->value);
#endif
m_resources.remove(it);
+#if ENABLE(OILPAN)
+ if (entryPtr)
+ entryPtr->dispose();
+#endif
return canDelete;
}
« no previous file with comments | « Source/core/fetch/MemoryCache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698