Bug 1253040 - Do not write metadata if CacheFile is killed, r=honzab
authorMichal Novotny <michal.novotny@gmail.com>
Sun, 17 Apr 2016 16:23:49 +0200
changeset 331416 c6f69694a1f9b35c59ca33d6cc2ba430f39dcdf6
parent 331415 3fd104ef3d0362c40e5dea1c263f6a8b4da60c4f
child 331417 37ae3a4b4185ff3b9cb0066cddf5500fdd976081
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)
reviewershonzab
bugs1253040
milestone48.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 1253040 - Do not write metadata if CacheFile is killed, r=honzab
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);
   }