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 378939 417e1ec42d8f68c55e52c336cdf81e83323db88c
parent 378938 f4929c35e8b30a7d6b0011dd31af1c563445a26b
child 378940 2ee4473c729acb2ba7dc723e7affe79ce14bff85
push id21011
push usermak77@bonardo.net
push dateThu, 16 Jun 2016 13:40:45 +0000
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);
   }