mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 473974. Don't DNS-prefetch nodes whose document went away. r+sr=bzbarsky
This commit is contained in:
parent
e67157cb19
commit
b231b7d252
@ -282,18 +282,22 @@ nsHTMLDNSPrefetch::nsDeferrals::SubmitQueue()
|
||||
if (!sDNSService) return;
|
||||
|
||||
while (mHead != mTail) {
|
||||
nsCOMPtr<nsIURI> hrefURI;
|
||||
mEntries[mTail].mElement->GetHrefURIForAnchors(getter_AddRefs(hrefURI));
|
||||
if (hrefURI)
|
||||
hrefURI->GetAsciiHost(hostName);
|
||||
|
||||
if (!hostName.IsEmpty()) {
|
||||
nsCOMPtr<nsICancelable> tmpOutstanding;
|
||||
|
||||
sDNSService->AsyncResolve(hostName,
|
||||
mEntries[mTail].mFlags,
|
||||
sDNSListener, nsnull, getter_AddRefs(tmpOutstanding));
|
||||
if (mEntries[mTail].mElement->GetOwnerDoc()) {
|
||||
nsCOMPtr<nsIURI> hrefURI;
|
||||
mEntries[mTail].mElement->GetHrefURIForAnchors(getter_AddRefs(hrefURI));
|
||||
if (hrefURI)
|
||||
hrefURI->GetAsciiHost(hostName);
|
||||
|
||||
if (!hostName.IsEmpty()) {
|
||||
nsCOMPtr<nsICancelable> tmpOutstanding;
|
||||
|
||||
sDNSService->AsyncResolve(hostName,
|
||||
mEntries[mTail].mFlags,
|
||||
sDNSListener, nsnull, getter_AddRefs(tmpOutstanding));
|
||||
}
|
||||
}
|
||||
|
||||
mEntries[mTail].mElement = nsnull;
|
||||
mTail = (mTail + 1) & sMaxDeferredMask;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user