fix for bug 91795 "large downloads cause mozilla to consume too much memory".
Changed OnDataSizeChange() to abort when entry size exceeds cache capacity. r=dougt, sr=darin. git-svn-id: svn://10.0.0.236/trunk@121316 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -250,6 +250,12 @@ nsMemoryCacheDevice::OnDataSizeChange( nsCacheEntry * entry, PRInt32 deltaSize)
|
||||
{
|
||||
if (entry->IsStreamData()) {
|
||||
// we have the right to refuse or pre-evict
|
||||
PRUint32 newSize = entry->DataSize() + deltaSize;
|
||||
if (newSize > mSoftLimit) {
|
||||
nsresult rv = nsCacheService::GlobalInstance()->DoomEntry_Locked(entry);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv),"DoomEntry_Locked() failed.");
|
||||
return NS_ERROR_ABORT;
|
||||
}
|
||||
}
|
||||
|
||||
// adjust our totals
|
||||
|
||||
Reference in New Issue
Block a user