Bug 1544037 - Skip exists check when trying to open startupcache zip file archive. r=froydnj
☠☠ backed out by acd39065fd9f ☠ ☠
authorMike Conley <mconley@mozilla.com>
Thu, 16 May 2019 18:53:59 +0000
changeset 474751 c19e86931d1a72f32f5cd239998abdc00fdb3c1c
parent 474750 ae7096d1add7bc70cd996485b423a18fe287a4e3
child 474752 8242c6c52f6c43eac5eee441a98a0742d553597f
push id36046
push useraiakab@mozilla.com
push dateTue, 21 May 2019 21:45:52 +0000
treeherdermozilla-central@257f2c96cef5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1544037
milestone69.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 1544037 - Skip exists check when trying to open startupcache zip file archive. r=froydnj Differential Revision: https://phabricator.services.mozilla.com/D31086
startupcache/StartupCache.cpp
--- a/startupcache/StartupCache.cpp
+++ b/startupcache/StartupCache.cpp
@@ -199,23 +199,23 @@ nsresult StartupCache::Init() {
 
 /**
  * LoadArchive can be called from the main thread or while reloading cache on
  * write thread.
  */
 nsresult StartupCache::LoadArchive() {
   if (gIgnoreDiskCache) return NS_ERROR_FAILURE;
 
-  bool exists;
-  mArchive = nullptr;
-  nsresult rv = mFile->Exists(&exists);
-  if (NS_FAILED(rv) || !exists) return NS_ERROR_FILE_NOT_FOUND;
-
   mArchive = new nsZipArchive();
   rv = mArchive->OpenArchive(mFile);
+
+  if (NS_FAILED(rv)) {
+    mArchive = nullptr;
+  }
+
   return rv;
 }
 
 namespace {
 
 nsresult GetBufferFromZipArchive(nsZipArchive* zip, bool doCRC, const char* id,
                                  UniquePtr<char[]>* outbuf, uint32_t* length) {
   if (!zip) return NS_ERROR_NOT_AVAILABLE;