bug 780750 - HTTP cache never gets used/fixed if wrong permissions on CACHE_MAP file. r=hurley

This commit is contained in:
Jason Duell 2012-08-07 15:46:33 -07:00
parent 71cc2053ee
commit 056b8973b8

View File

@ -989,11 +989,13 @@ nsDiskCacheDevice::OpenDiskCache()
nsDiskCache::CorruptCacheInfo corruptInfo;
rv = mCacheMap.Open(mCacheDirectory, &corruptInfo);
// move "corrupt" caches to trash
if (NS_SUCCEEDED(rv)) {
Telemetry::Accumulate(Telemetry::DISK_CACHE_CORRUPT_DETAILS,
corruptInfo);
} else if (rv == NS_ERROR_FILE_CORRUPTED) {
} else if (rv == NS_ERROR_ALREADY_INITIALIZED) {
NS_WARNING("nsDiskCacheDevice::OpenDiskCache: already open!");
} else {
// Consider cache corrupt: delete it
Telemetry::Accumulate(Telemetry::DISK_CACHE_CORRUPT_DETAILS,
corruptInfo);
// delay delete by 1 minute to avoid IO thrash at startup
@ -1001,10 +1003,6 @@ nsDiskCacheDevice::OpenDiskCache()
if (NS_FAILED(rv))
return rv;
exists = false;
} else {
// don't gather telemetry for "corrupt cache" for new profile
// where cache doesn't exist (most likely case if we're here).
return rv;
}
}