зеркало из https://github.com/mozilla/gecko-dev.git
Bug 455606 - Remove old cache elements when pushing elements with the same key r/sr=stuart
This commit is contained in:
Родитель
8ffa1cf185
Коммит
15abb5060d
|
@ -643,15 +643,17 @@ PRBool imgLoader::PutIntoCache(nsIURI *key, imgCacheEntry *entry)
|
||||||
if (!tmpRequest->IsReusable(cacheId))
|
if (!tmpRequest->IsReusable(cacheId))
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
|
|
||||||
if (gCacheTracker)
|
// If it already exists, and we're putting the same key into the cache, we
|
||||||
gCacheTracker->MarkUsed(tmpCacheEntry);
|
// should remove the old version.
|
||||||
|
PR_LOG(gImgLog, PR_LOG_DEBUG,
|
||||||
|
("[this=%p] imgLoader::PutIntoCache -- Replacing cached element", nsnull));
|
||||||
|
|
||||||
return PR_TRUE;
|
RemoveFromCache(key);
|
||||||
|
} else {
|
||||||
|
PR_LOG(gImgLog, PR_LOG_DEBUG,
|
||||||
|
("[this=%p] imgLoader::PutIntoCache -- Element NOT already in the cache", nsnull));
|
||||||
}
|
}
|
||||||
|
|
||||||
PR_LOG(gImgLog, PR_LOG_DEBUG,
|
|
||||||
("[this=%p] imgLoader::PutIntoCache -- Element NOT already in the cache", nsnull));
|
|
||||||
|
|
||||||
if (!cache.Put(spec, entry))
|
if (!cache.Put(spec, entry))
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче