Issue #2932 - Ensure that imgRequestProxy::CancelAndForgetObserver removes itself from the cache validator

https://hg-edge.mozilla.org/releases/mozilla-beta/rev/af82d0c33427
This commit is contained in:
mittorn committed 2026-02-06 23:14:54 +00:00
1 parent e96431e1c1
commit c6bc9d5a8c
3 files changed
+15 -2

No files matched your search

+6
View File
@@ -2730,6 +2730,12 @@ imgCacheValidator::AddProxy(imgRequestProxy* aProxy)
mProxies.AppendObject(aProxy);
}
void
imgCacheValidator::RemoveProxy(imgRequestProxy* aProxy)
{
mProxies.RemoveObject(aProxy);
}
/** nsIRequestObserver methods **/
NS_IMETHODIMP
+1
View File
@@ -541,6 +541,7 @@ public:
bool forcePrincipalCheckForCacheEntry);
void AddProxy(imgRequestProxy* aProxy);
void RemoveProxy(imgRequestProxy* aProxy);
NS_DECL_ISUPPORTS
NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
+8 -2
View File
@@ -342,8 +342,14 @@ imgRequestProxy::CancelAndForgetObserver(nsresult aStatus)
bool oldIsInLoadGroup = mIsInLoadGroup;
mIsInLoadGroup = false;
if (GetOwner()) {
GetOwner()->RemoveProxy(this, aStatus);
imgRequest* owner = GetOwner();
if (owner) {
imgCacheValidator* validator = owner->GetValidator();
if (validator) {
validator->RemoveProxy(this);
}
owner->RemoveProxy(this, aStatus);
}
mIsInLoadGroup = oldIsInLoadGroup;