Bug 1079789 - Don't doom expired entries in the HTTP cache intermediate memory pool. r=michal, a=lmandel
--- a/netwerk/cache2/CacheStorageService.cpp
+++ b/netwerk/cache2/CacheStorageService.cpp
@@ -1256,21 +1256,20 @@ CacheStorageService::MemoryPool::PurgeEx
for (uint32_t i = 0; mMemorySize > memoryLimit && i < mExpirationArray.Length();) {
if (CacheIOThread::YieldAndRerun())
return;
nsRefPtr<CacheEntry> entry = mExpirationArray[i];
uint32_t expirationTime = entry->GetExpirationTime();
- if (expirationTime > 0 && expirationTime <= now) {
- LOG((" dooming expired entry=%p, exptime=%u (now=%u)",
+ if (expirationTime > 0 && expirationTime <= now &&
+ entry->Purge(CacheEntry::PURGE_WHOLE)) {
+ LOG((" purged expired, entry=%p, exptime=%u (now=%u)",
entry.get(), entry->GetExpirationTime(), now));
-
- entry->PurgeAndDoom();
continue;
}
// not purged, move to the next one
++i;
}
}