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 333036 30919b955abda9c7c081e75b15a5ebd4a32c15d3
parent 333035 b0a5f5e149d2fa1aae0fd81801671369100a9580
child 333037 683a20539adac5be187179e8c0f32a503f9e91bf
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmichal, lizzard
bugs1268922
milestone48.0a2
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");