Bug 1291347 - Make CacheFileContextEvictor::EvictEntries shutdown aware, r=honzab
authorMichal Novotny <michal.novotny@gmail.com>
Tue, 09 Aug 2016 20:29:40 +0200
changeset 308848 000b263bb3834b57688618e93503282cc122bf80
parent 308847 9a6840ba62cd8324503a89c0a83b8accd3bc5441
child 308849 a7a1431b31bc484d3bf6e877682517c322e86812
push id20279
push usercbook@mozilla.com
push dateWed, 10 Aug 2016 14:04:43 +0000
treeherderfx-team@531100c1d950 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershonzab
bugs1291347
milestone51.0a1
Bug 1291347 - Make CacheFileContextEvictor::EvictEntries shutdown aware, r=honzab
netwerk/cache2/CacheFileContextEvictor.cpp
--- a/netwerk/cache2/CacheFileContextEvictor.cpp
+++ b/netwerk/cache2/CacheFileContextEvictor.cpp
@@ -548,16 +548,24 @@ CacheFileContextEvictor::EvictEntries()
 
   if (!mIndexIsUpToDate) {
     LOG(("CacheFileContextEvictor::EvictEntries() - Stopping evicting due to "
          "outdated index."));
     return NS_OK;
   }
 
   while (true) {
+    if (CacheObserver::ShuttingDown()) {
+      LOG(("CacheFileContextEvictor::EvictEntries() - Stopping evicting due to "
+           "shutdown."));
+      mEvicting = true; // We don't want to start eviction again during shutdown
+                        // process. Setting this flag to true ensures it.
+      return NS_OK;
+    }
+
     if (CacheIOThread::YieldAndRerun()) {
       LOG(("CacheFileContextEvictor::EvictEntries() - Breaking loop for higher "
            "level events."));
       mEvicting = true;
       return NS_OK;
     }
 
     if (mEntries.Length() == 0) {