зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1333106. Stop leaking in the prefetch service if the prefetch is blocked by security checks. r=mcmanus
This commit is contained in:
Родитель
5e4160791e
Коммит
b7cf5b83fd
|
@ -5755,6 +5755,7 @@ nsHttpChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *context)
|
|||
|
||||
if (!gHttpHandler->Active()) {
|
||||
LOG((" after HTTP shutdown..."));
|
||||
ReleaseListeners();
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
|
@ -5833,7 +5834,10 @@ nsHttpChannel::AsyncOpen2(nsIStreamListener *aListener)
|
|||
{
|
||||
nsCOMPtr<nsIStreamListener> listener = aListener;
|
||||
nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
ReleaseListeners();
|
||||
return rv;
|
||||
}
|
||||
return AsyncOpen(listener, nullptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -156,7 +156,13 @@ nsPrefetchNode::OpenChannel()
|
|||
false);
|
||||
}
|
||||
|
||||
return mChannel->AsyncOpen2(this);
|
||||
rv = mChannel->AsyncOpen2(this);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
// Drop the ref to the channel, because we don't want to end up with
|
||||
// cycles through it.
|
||||
mChannel = nullptr;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
Загрузка…
Ссылка в новой задаче