Bug 1203430 - Intermittent crash in PNeckoChild::SendHTMLDNSPrefetch. r=jdm

This commit is contained in:
Jason Duell
2015-12-23 20:00:54 -05:00
parent d743918eb2
commit 09e835b8b0

View File

@@ -140,8 +140,11 @@ nsHTMLDNSPrefetch::Prefetch(const nsAString &hostname, uint16_t flags)
// considers empty strings to be valid hostnames // considers empty strings to be valid hostnames
if (!hostname.IsEmpty() && if (!hostname.IsEmpty() &&
net_IsValidHostName(NS_ConvertUTF16toUTF8(hostname))) { net_IsValidHostName(NS_ConvertUTF16toUTF8(hostname))) {
// during shutdown gNeckoChild might be null
if (gNeckoChild) {
gNeckoChild->SendHTMLDNSPrefetch(nsAutoString(hostname), flags); gNeckoChild->SendHTMLDNSPrefetch(nsAutoString(hostname), flags);
} }
}
return NS_OK; return NS_OK;
} }
@@ -197,9 +200,12 @@ nsHTMLDNSPrefetch::CancelPrefetch(const nsAString &hostname,
// considers empty strings to be valid hostnames // considers empty strings to be valid hostnames
if (!hostname.IsEmpty() && if (!hostname.IsEmpty() &&
net_IsValidHostName(NS_ConvertUTF16toUTF8(hostname))) { net_IsValidHostName(NS_ConvertUTF16toUTF8(hostname))) {
// during shutdown gNeckoChild might be null
if (gNeckoChild) {
gNeckoChild->SendCancelHTMLDNSPrefetch(nsString(hostname), flags, gNeckoChild->SendCancelHTMLDNSPrefetch(nsString(hostname), flags,
aReason); aReason);
} }
}
return NS_OK; return NS_OK;
} }
@@ -326,8 +332,11 @@ nsHTMLDNSPrefetch::nsDeferrals::SubmitQueue()
if (!hostName.IsEmpty() && NS_SUCCEEDED(rv) && !isLocalResource) { if (!hostName.IsEmpty() && NS_SUCCEEDED(rv) && !isLocalResource) {
if (IsNeckoChild()) { if (IsNeckoChild()) {
// during shutdown gNeckoChild might be null
if (gNeckoChild) {
gNeckoChild->SendHTMLDNSPrefetch(NS_ConvertUTF8toUTF16(hostName), gNeckoChild->SendHTMLDNSPrefetch(NS_ConvertUTF8toUTF16(hostName),
mEntries[mTail].mFlags); mEntries[mTail].mFlags);
}
} else { } else {
nsCOMPtr<nsICancelable> tmpOutstanding; nsCOMPtr<nsICancelable> tmpOutstanding;