Bug 1556987 - Invalid assertion in nsHttpChannel::OnPush, r=dragana

NS_HTTP_ONPUSH_LISTENER capability is set in nsHttpChannel::SetupTransaction when notification callbacks implement nsIHttpPushListener, but nsHttpChannel::OnPush event is initiated on socket thread in Http2PushedStream::TryOnPush and the channel can be closed and listeners released before nsHttpChannel::OnPush is called on the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D33776

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Michal Novotny 2019-06-06 06:35:50 +00:00
parent 66a7ddb52a
commit 8e84b11096

View File

@ -9276,13 +9276,12 @@ nsresult nsHttpChannel::OnPush(const nsACString& url,
NS_GET_IID(nsIHttpPushListener),
getter_AddRefs(pushListener));
MOZ_ASSERT(pushListener);
if (!pushListener) {
LOG(
("nsHttpChannel::OnPush [this=%p] notification callbacks do not "
"implement nsIHttpPushListener\n",
this));
return NS_ERROR_UNEXPECTED;
return NS_ERROR_NOT_AVAILABLE;
}
nsCOMPtr<nsIURI> pushResource;