Bug 1601712 - Avoid notifying callback directly from InputStreamShim::AsyncWait() r=dragana

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Michal Novotny 2020-01-08 10:15:48 +00:00
Родитель bc2f4a9ed9
Коммит 4fe21c14b2
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -1765,10 +1765,10 @@ class CheckAvailData final : public Runnable {
}
MOZ_MUST_USE nsresult Dispatch() {
if (OnSocketThread()) {
return Run();
}
// Dispatch the event even if we're on socket thread to avoid closing and
// destructing Http2Session in case this call is comming from
// Http2Session::ReadSegments() and the callback closes the transaction in
// OnInputStreamRead().
nsCOMPtr<nsIEventTarget> sts =
do_GetService("@mozilla.org/network/socket-transport-service;1");
return sts->Dispatch(this, nsIEventTarget::DISPATCH_NORMAL);