Bug 1227377: Change ImageRequest::mRequests hashtable to use more specific type in its key (s/nsISupports/nsIDocument/). r=khuey

This commit is contained in:
Daniel Holbert 2015-11-27 14:54:47 -08:00
parent 5ffe53a84d
commit 8bc3913e4d
2 changed files with 2 additions and 11 deletions

View File

@ -2480,18 +2480,9 @@ css::ImageValue::ImageValue(nsIURI* aURI, nsStringBuffer* aString,
css::ImageValue::~ImageValue()
{
for (auto iter = mRequests.Iter(); !iter.Done(); iter.Next()) {
nsISupports* key = iter.Key();
nsIDocument* doc = iter.Key();
RefPtr<imgRequestProxy>& proxy = iter.Data();
nsIDocument* doc = static_cast<nsIDocument*>(key);
#ifdef DEBUG
{
nsCOMPtr<nsIDocument> slowDoc = do_QueryInterface(key);
MOZ_ASSERT(slowDoc == doc);
}
#endif
if (doc) {
doc->StyleImageLoader()->DeregisterCSSImage(this);
}

View File

@ -147,7 +147,7 @@ private:
public:
// Inherit operator== from URLValue
nsRefPtrHashtable<nsPtrHashKey<nsISupports>, imgRequestProxy> mRequests;
nsRefPtrHashtable<nsPtrHashKey<nsIDocument>, imgRequestProxy> mRequests;
// Override AddRef and Release to not only log ourselves correctly, but
// also so that we delete correctly without a virtual destructor (assuming