Index: Source/core/fetch/MemoryCache.cpp |
diff --git a/Source/core/fetch/MemoryCache.cpp b/Source/core/fetch/MemoryCache.cpp |
index e6d24c93f54cd8d4da18a79b4657f2b1c4f322da..208ade0cfca0f96f8504c0522baee41ae5ecab34 100644 |
--- a/Source/core/fetch/MemoryCache.cpp |
+++ b/Source/core/fetch/MemoryCache.cpp |
@@ -327,13 +327,14 @@ MemoryCache::LRUList* MemoryCache::lruListFor(MemoryCacheEntry* entry) |
void MemoryCache::removeFromLRUList(Resource* resource) |
{ |
- // If we've never been accessed, then we're brand new and not in any list. |
- if (!resource->accessCount()) |
- return; |
- |
MemoryCacheEntry* entry = m_resources.get(resource->url()); |
ASSERT(entry->m_resource == resource); |
+ |
LRUList* list = lruListFor(entry); |
+ MemoryCacheEntry* next = entry->m_nextInAllResourcesList; |
+ MemoryCacheEntry* previous = entry->m_previousInAllResourcesList; |
+ if (!next && !previous && list->m_head != entry) |
+ return; |
#if !ASSERT_DISABLED |
// Verify that we are in fact in this list. |
@@ -347,9 +348,6 @@ void MemoryCache::removeFromLRUList(Resource* resource) |
ASSERT(found); |
#endif |
- MemoryCacheEntry* next = entry->m_nextInAllResourcesList; |
- MemoryCacheEntry* previous = entry->m_previousInAllResourcesList; |
- |
entry->m_nextInAllResourcesList = 0; |
entry->m_previousInAllResourcesList = 0; |
@@ -372,7 +370,6 @@ void MemoryCache::insertInLRUList(Resource* resource) |
// Make sure we aren't in some list already. |
ASSERT(!entry->m_nextInAllResourcesList && !entry->m_previousInAllResourcesList); |
ASSERT(resource->inCache()); |
- ASSERT(resource->accessCount() > 0); |
LRUList* list = lruListFor(entry); |