Bug 1440771 - Part 4: Use nsCOMPtr<nsIInputStream> directly in PNecko, r=baku

MozReview-Commit-ID: COnMiadbCjn
This commit is contained in:
Nika Layzell
2018-02-23 15:29:54 -05:00
parent 8acd371fa2
commit a3011f7e14
3 changed files with 5 additions and 12 deletions

View File

@@ -239,12 +239,8 @@ ExtensionStreamGetter::GetAsync(nsIStreamListener* aListener,
gNeckoChild->SendGetExtensionStream(uri)->Then(
mMainThreadEventTarget,
__func__,
[self] (const OptionalIPCStream& stream) {
nsCOMPtr<nsIInputStream> inputStream;
if (stream.type() == OptionalIPCStream::OptionalIPCStream::TIPCStream) {
inputStream = ipc::DeserializeIPCStream(stream);
}
self->OnStream(inputStream.forget());
[self] (const nsCOMPtr<nsIInputStream>& stream) {
self->OnStream(do_AddRef(stream));
},
[self] (const mozilla::ipc::ResponseRejectReason) {
self->OnStream(nullptr);