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

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

Issue 2326743003: Do not call MemoryCache::prune() when a client/observer is removed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove justReleasedResource Created 4 years, 3 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
Index: third_party/WebKit/Source/core/fetch/MemoryCache.cpp
diff --git a/third_party/WebKit/Source/core/fetch/MemoryCache.cpp b/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
index b1f05615d0021fe40be02945be9b8e43f9b30b34..5d21d2125293a50664f3976db600ae11ba9d55e0 100644
--- a/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
+++ b/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
@@ -648,7 +648,7 @@ void MemoryCache::evictResources()
}
}
-void MemoryCache::prune(Resource* justReleasedResource)
+void MemoryCache::prune()
{
TRACE_EVENT0("renderer", "MemoryCache::prune()");
@@ -678,21 +678,6 @@ void MemoryCache::prune(Resource* justReleasedResource)
m_prunePending = true;
}
}
-
- if (m_prunePending && m_deadSize > m_maxDeferredPruneDeadCapacity && justReleasedResource) {
- // The following eviction does not respect LRU order, but it can be done
- // immediately in constant time, as opposed to pruneDeadResources, which
- // we would rather defer because it is O(N), which would make tear-down of N
- // objects O(N^2) if we pruned immediately. This immediate eviction is a
- // safeguard against runaway memory consumption by dead resources
- // while a prune is pending.
- if (MemoryCacheEntry* entry = getEntryForResource(justReleasedResource))
- evict(entry);
-
- // As a last resort, prune immediately
- if (m_deadSize > m_maxDeferredPruneDeadCapacity)
- pruneNow(currentTime, AutomaticPrune);
- }
}
void MemoryCache::willProcessTask()
« no previous file with comments | « third_party/WebKit/Source/core/fetch/MemoryCache.h ('k') | third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698