Bug 967310 - optimize call to CacheFileIOManager::UnscheduleMetadataWrite, r=michal

This commit is contained in:
Honza Bambas 2014-06-21 21:41:01 +02:00
parent e739653497
commit fab3e28fe1

View File

@ -1690,12 +1690,6 @@ CacheFile::WriteMetadataIfNeededLocked(bool aFireAndForget)
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);
}
if (NS_FAILED(mStatus))
return;
@ -1703,6 +1697,12 @@ CacheFile::WriteMetadataIfNeededLocked(bool aFireAndForget)
mWritingMetadata || mOpeningFile)
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);
}
LOG(("CacheFile::WriteMetadataIfNeededLocked() - Writing metadata [this=%p]",
this));