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

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: 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 d6957b64c424a1f5a1b4b2bb3aceb0568f612ba7..59640a8b03632627261ea8e25a7105fe33527fa2 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)
@@ -586,7 +586,7 @@ void MemoryCache::TypeStatistic::addResource(Resource* o)
size_t pageSize = (o->encodedSize() + o->overheadSize() + 4095) & ~4095;
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;
@@ -778,8 +778,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, %d); ", currentResource->decodedSize() / 1024.0f, (currentResource->encodedSize() + currentResource->overheadSize()) / 1024.0f, current->m_accessCount, currentResource->hasClientsOrObservers(), currentResource->isPurgeable());
+ if (includeLive || !currentResource->isAlive())
+ printf("(%.1fK, %.1fK, %uA, %dR, %d); ", currentResource->decodedSize() / 1024.0f, (currentResource->encodedSize() + currentResource->overheadSize()) / 1024.0f, current->m_accessCount, currentResource->isAlive(), currentResource->isPurgeable());
current = current->m_previousInAllResourcesList;
}

Powered by Google App Engine
This is Rietveld 408576698