Skip to content

Commit

Permalink
Bug 644431 - Fix for Adobe PDF Files Larger than 5 MB Won't Load in b…
Browse files Browse the repository at this point in the history
…rowser. r=bz, a2.0=dveditz
  • Loading branch information
jmathies committed Apr 13, 2011
1 parent b8f8109 commit 21c1907
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions netwerk/cache/nsCacheService.cpp
Expand Up @@ -1849,6 +1849,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.");
Expand Down
6 changes: 4 additions & 2 deletions netwerk/cache/nsDiskCacheDevice.cpp
Expand Up @@ -784,8 +784,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
Expand Down

0 comments on commit 21c1907

Please sign in to comment.