Bug 1268922 - Don't insist on removal of cache2/doomed directory, causing cache responsiveness slowdown, r=michal a=lizzard
authorHonza Bambas <honzab.moz@firemni.cz>
Sat, 30 Apr 2016 14:24:20 +0200
changeset 378932 388772a2f7620727b3125c722c142abee8a74aa0
parent 378931 01575697ce9dca45c2304e28c63e41fe9e418027
child 378933 1c47a4f604c6c5cd4e2e1fe59c57a29d492154b0
push id21011
push usermak77@bonardo.net
push dateThu, 16 Jun 2016 13:40:45 +0000
reviewersmichal, lizzard
bugs1268922
milestone47.0
Bug 1268922 - Don't insist on removal of cache2/doomed directory, causing cache responsiveness slowdown, r=michal a=lizzard
netwerk/cache2/CacheFileIOManager.cpp
--- a/netwerk/cache2/CacheFileIOManager.cpp
+++ b/netwerk/cache2/CacheFileIOManager.cpp
@@ -3693,20 +3693,20 @@ CacheFileIOManager::CheckAndCreateDir(ns
   }
 
   if (aEnsureEmptyDir && NS_SUCCEEDED(rv) && exists) {
     bool isEmpty;
     rv = IsEmptyDirectory(file, &isEmpty);
     NS_ENSURE_SUCCESS(rv, rv);
 
     if (!isEmpty) {
-      rv = TrashDirectory(file);
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      exists = false;
+      // Don't check the result, if this fails, it's OK.  We do this
+      // only for the doomed directory that doesn't need to be deleted
+      // for the cost of completely disabling the whole browser.
+      TrashDirectory(file);
     }
   }
 
   if (NS_SUCCEEDED(rv) && !exists) {
     rv = file->Create(nsIFile::DIRECTORY_TYPE, 0700);
   }
   if (NS_FAILED(rv)) {
     NS_WARNING("Cannot create directory");