Bug 1079789 - Don't doom expired entries in the HTTP cache intermediate memory pool. r=michal, a=lmandel
authorHonza Bambas <honzab.moz@firemni.cz>
Thu, 12 Feb 2015 14:00:00 -0500
changeset 250301 eb42059e0728
parent 250300 a09088484ddf
child 250302 513cff18abaa
push id4541
push userryanvm@gmail.com
push date2015-03-09 19:01 +0000
treeherdermozilla-beta@58b004077c10 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmichal, lmandel
bugs1079789
milestone37.0
Bug 1079789 - Don't doom expired entries in the HTTP cache intermediate memory pool. r=michal, a=lmandel
netwerk/cache2/CacheStorageService.cpp
--- 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;
   }
 }