Bug 644431 - Adobe PDF Files Larger than 5 MB Won't Load in Browser. r=bz

This commit is contained in:
Jim Mathies 2011-04-08 12:53:55 -07:00
Родитель 8abd514bee
Коммит 82e5ced42f
2 изменённых файлов: 5 добавлений и 2 удалений

1
netwerk/cache/nsCacheService.cpp поставляемый
Просмотреть файл

@ -1827,6 +1827,7 @@ nsCacheService::EnsureEntryHasDevice(nsCacheEntry * entry)
if (mDiskDevice) {
// Bypass the cache if Content-Length says the entry will be too big
if (predictedDataSize != -1 &&
entry->StoragePolicy() != nsICache::STORE_ON_DISK_AS_FILE &&
mDiskDevice->EntryIsTooBig(predictedDataSize)) {
nsresult rv = nsCacheService::DoomEntry(entry);
NS_ASSERTION(NS_SUCCEEDED(rv),"DoomEntry() failed.");

6
netwerk/cache/nsDiskCacheDevice.cpp поставляемый
Просмотреть файл

@ -785,8 +785,10 @@ nsDiskCacheDevice::OnDataSizeChange(nsCacheEntry * entry, PRInt32 deltaSize)
PRUint32 newSizeK = ((newSize + 0x3FF) >> 10);
// If the new size is larger than max. file size or larger than
// 1/8 the cache capacity (which is in KiB's), doom the entry and abort
if (EntryIsTooBig(newSize)) {
// 1/8 the cache capacity (which is in KiB's), and the entry has
// not been marked for file storage, doom the entry and abort.
if (EntryIsTooBig(newSize) &&
entry->StoragePolicy() != nsICache::STORE_ON_DISK_AS_FILE) {
#ifdef DEBUG
nsresult rv =
#endif