Issue #2928 - Avoid searching the image cache queue for an entry after we just popped it off the queue.

This commit is contained in:
Moonchild 2026-02-04 09:07:23 +01:00 committed by wuggy
commit 3b799da2f8
2 changed files with 30 additions and 6 deletions

View file

@ -316,7 +316,16 @@ public:
nsresult InitCache();
bool RemoveFromCache(const ImageCacheKey& aKey);
bool RemoveFromCache(imgCacheEntry* entry);
// Enumeration describing if a given entry is in the cache queue or not.
// There are some cases we know the entry is definitely not in the queue.
enum class QueueState {
MaybeExists,
AlreadyRemoved
};
bool RemoveFromCache(imgCacheEntry* entry,
QueueState aQueueState = QueueState::MaybeExists);
bool PutIntoCache(const ImageCacheKey& aKey, imgCacheEntry* aEntry);