Bug 1343743 - Part5: Label PAltDataOutputStreamChild, r=mayhemer

Use neckoTarget in HttpChannelChild to label PAltDataOutputStreamChild actor.
This commit is contained in:
Kershaw Chang 2017-06-12 00:24:00 +02:00
Родитель d17d3c6887
Коммит f903c2a340
2 изменённых файлов: 17 добавлений и 5 удалений

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

@ -119,9 +119,9 @@ NeckoChild::AllocPAltDataOutputStreamChild(
const nsCString& type,
PHttpChannelChild* channel)
{
AltDataOutputStreamChild* stream = new AltDataOutputStreamChild();
stream->AddIPDLReference();
return stream;
// We don't allocate here: see HttpChannelChild::OpenAlternativeOutputStream()
NS_NOTREACHED("AllocPAltDataOutputStreamChild should not be called");
return nullptr;
}
bool

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

@ -2715,8 +2715,20 @@ HttpChannelChild::OpenAlternativeOutputStream(const nsACString & aType, nsIOutpu
return NS_ERROR_NOT_AVAILABLE;
}
RefPtr<AltDataOutputStreamChild> stream =
static_cast<AltDataOutputStreamChild*>(gNeckoChild->SendPAltDataOutputStreamConstructor(nsCString(aType), this));
nsCOMPtr<nsIEventTarget> neckoTarget = GetNeckoTarget();
MOZ_ASSERT(neckoTarget);
RefPtr<AltDataOutputStreamChild> stream = new AltDataOutputStreamChild();
stream->AddIPDLReference();
gNeckoChild->SetEventTargetForActor(stream, neckoTarget);
if (!gNeckoChild->SendPAltDataOutputStreamConstructor(stream,
nsCString(aType),
this)) {
return NS_ERROR_FAILURE;
}
stream.forget(_retval);
return NS_OK;
}