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

Unified Diff: sky/engine/core/fetch/MemoryCache.cpp

Issue 710383002: Remove preload support from the MemoryCache (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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: sky/engine/core/fetch/MemoryCache.cpp
diff --git a/sky/engine/core/fetch/MemoryCache.cpp b/sky/engine/core/fetch/MemoryCache.cpp
index bd5b79a4fa5c4118493e865c8d096c02b8f33a99..6c904b863496bc8312b3605b2193a530ce7d1d98 100644
--- a/sky/engine/core/fetch/MemoryCache.cpp
+++ b/sky/engine/core/fetch/MemoryCache.cpp
@@ -265,7 +265,6 @@ void MemoryCache::pruneDeadResources()
if (current->m_resource->wasPurged() && current->m_resource->canDelete()
&& current->m_resource->type() != Resource::MainResource) {
ASSERT(!current->m_resource->hasClients());
- ASSERT(!current->m_resource->isPreloaded());
bool wasEvicted = evict(current);
ASSERT_UNUSED(wasEvicted, wasEvicted);
}
@@ -285,7 +284,7 @@ void MemoryCache::pruneDeadResources()
// Protect 'previous' so it can't get deleted during destroyDecodedData().
MemoryCacheEntry* previous = current->m_previousInAllResourcesList;
ASSERT(!previous || contains(previous->m_resource.get()));
- if (!current->m_resource->hasClients() && !current->m_resource->isPreloaded() && current->m_resource->isLoaded()) {
+ if (!current->m_resource->hasClients() && current->m_resource->isLoaded()) {
// Destroy our decoded data. This will remove us from
// m_liveDecodedResources, and possibly move us to a different
// LRU list in m_allResources.
@@ -306,7 +305,7 @@ void MemoryCache::pruneDeadResources()
while (current) {
MemoryCacheEntry* previous = current->m_previousInAllResourcesList;
ASSERT(!previous || contains(previous->m_resource.get()));
- if (!current->m_resource->hasClients() && !current->m_resource->isPreloaded()
+ if (!current->m_resource->hasClients()
&& !current->m_resource->isCacheValidator() && current->m_resource->canDelete()
&& current->m_resource->type() != Resource::MainResource) {
// Main Resources in the cache are only substitue data that was

Powered by Google App Engine
This is Rietveld 408576698