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

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

Issue 2191633003: Move ResourceClient to Oilpan heap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@onheap-raw-resource-client
Patch Set: build fix Created 4 years, 4 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 97f0db938ddc79e65925c5dd485efbdbc57ad214..fdb74af0b95d6b6cbfb0d96338e11342d1fd0358 100644
--- a/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
+++ b/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
@@ -259,7 +259,7 @@ void MemoryCache::pruneLiveResources(PruneStrategy strategy)
while (current) {
Resource* resource = current->resource();
MemoryCacheEntry* previous = current->m_previousInLiveResourcesList;
- ASSERT(resource->hasClientsOrObservers());
+ DCHECK(resource->isAlive());
if (resource->isLoaded() && resource->decodedSize()) {
// Check to see if the remaining resources are too new to prune.
@@ -311,7 +311,7 @@ void MemoryCache::pruneDeadResources(PruneStrategy strategy)
continue;
}
- if (!resource->hasClientsOrObservers() && !resource->isPreloaded() && resource->isLoaded()) {
+ if (!resource->isAlive() && !resource->isPreloaded() && 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.
@@ -332,7 +332,7 @@ void MemoryCache::pruneDeadResources(PruneStrategy strategy)
current = previous;
continue;
}
- if (!resource->hasClientsOrObservers() && !resource->isPreloaded()) {
+ if (!resource->isAlive() && !resource->isPreloaded()) {
evict(current);
if (targetSize && m_deadSize <= targetSize)
return;
@@ -545,7 +545,7 @@ void MemoryCache::update(Resource* resource, size_t oldSize, size_t newSize, boo
insertInLRUList(entry, lruListFor(entry->m_accessCount, newSize));
ptrdiff_t delta = newSize - oldSize;
- if (resource->hasClientsOrObservers()) {
+ if (resource->isAlive()) {
ASSERT(delta >= 0 || m_liveSize >= static_cast<size_t>(-delta) );
m_liveSize += delta;
} else {
@@ -561,7 +561,7 @@ void MemoryCache::updateDecodedResource(Resource* resource, UpdateReason reason)
return;
removeFromLiveDecodedResourcesList(entry);
- if (resource->decodedSize() && resource->hasClientsOrObservers())
+ if (resource->decodedSize() && resource->isAlive())
insertInLiveDecodedResourcesList(entry);
if (reason != UpdateForAccess)
@@ -584,7 +584,7 @@ void MemoryCache::TypeStatistic::addResource(Resource* o)
{
count++;
size += o->size();
- liveSize += o->hasClientsOrObservers() ? o->size() : 0;
+ liveSize += o->isAlive() ? o->size() : 0;
decodedSize += o->decodedSize();
encodedSize += o->encodedSize();
encodedSizeDuplicatedInDataURLs += o->url().protocolIsData() ? o->encodedSize() : 0;
@@ -780,8 +780,8 @@ void MemoryCache::dumpLRULists(bool includeLive) const
MemoryCacheEntry* current = m_allResources[i].m_tail;
while (current) {
Resource* currentResource = current->resource();
- if (includeLive || !currentResource->hasClientsOrObservers())
- printf("(%.1fK, %.1fK, %uA, %dR); ", currentResource->decodedSize() / 1024.0f, (currentResource->encodedSize() + currentResource->overheadSize()) / 1024.0f, current->m_accessCount, currentResource->hasClientsOrObservers());
+ if (includeLive || !currentResource->isAlive())
+ printf("(%.1fK, %.1fK, %uA, %dR); ", currentResource->decodedSize() / 1024.0f, (currentResource->encodedSize() + currentResource->overheadSize()) / 1024.0f, current->m_accessCount, currentResource->isAlive());
current = current->m_previousInAllResourcesList;
}
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp ('k') | third_party/WebKit/Source/core/fetch/MockResourceClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698