Bug 1253040 - Do not write metadata if CacheFile is killed, r=honzab a=ritu
authorMichal Novotny <michal.novotny@gmail.com>
Sun, 17 Apr 2016 16:23:49 +0200
changeset 324491 417e1ec42d8f68c55e52c336cdf81e83323db88c
parent 324490 f4929c35e8b30a7d6b0011dd31af1c563445a26b
child 324492 2ee4473c729acb2ba7dc723e7affe79ce14bff85
push id6031
push userkwierso@gmail.com
push dateThu, 26 May 2016 18:23:42 +0000
treeherdermozilla-beta@417e1ec42d8f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershonzab, ritu
bugs1253040
milestone47.0
Bug 1253040 - Do not write metadata if CacheFile is killed, r=honzab a=ritu
netwerk/cache2/CacheFile.cpp
--- a/netwerk/cache2/CacheFile.cpp
+++ b/netwerk/cache2/CacheFile.cpp
@@ -1873,17 +1873,17 @@ CacheFile::WriteMetadataIfNeededLocked(b
     MOZ_CRASH("Must have metadata here");
     return;
   }
 
   if (NS_FAILED(mStatus))
     return;
 
   if (!IsDirty() || mOutput || mInputs.Length() || mChunks.Count() ||
-      mWritingMetadata || mOpeningFile)
+      mWritingMetadata || mOpeningFile || mKill)
     return;
 
   if (!aFireAndForget) {
     // if aFireAndForget is set, we are called from dtor. Write
     // scheduler hard-refers CacheFile otherwise, so we cannot be here.
     CacheFileIOManager::UnscheduleMetadataWrite(this);
   }