Bug 1291347 - Make CacheFileContextEvictor::EvictEntries shutdown aware, r=honzab
authorMichal Novotny <michal.novotny@gmail.com>
Tue, 09 Aug 2016 20:29:40 +0200
changeset 352346 000b263bb3834b57688618e93503282cc122bf80
parent 352345 9a6840ba62cd8324503a89c0a83b8accd3bc5441
child 352347 a7a1431b31bc484d3bf6e877682517c322e86812
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershonzab
bugs1291347
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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) {