Bug 1341343 - Don't send AltDataOutputStreamConstructor IPC message if mIPCOpen is false r=mayhemer draft
authorValentin Gosu <valentin.gosu@gmail.com>
Wed, 22 Feb 2017 16:32:44 +0100
changeset 488102 36fbf9cc13e7543c51b6d5e370c8a442da00b12f
parent 487090 fdfe6c2812f7fbf31aa3acc74b9ed1e3e4fe3fec
child 546636 a460325811dd28bc1d381ed4585458397d52439e
push id46421
push uservalentin.gosu@gmail.com
push dateWed, 22 Feb 2017 15:33:14 +0000
reviewersmayhemer
bugs1341343
milestone54.0a1
Bug 1341343 - Don't send AltDataOutputStreamConstructor IPC message if mIPCOpen is false r=mayhemer MozReview-Commit-ID: 2cVpB2HOgSG
netwerk/protocol/http/HttpChannelChild.cpp
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -2423,16 +2423,21 @@ HttpChannelChild::GetAlternativeDataType
   aType = mAvailableCachedAltDataType;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HttpChannelChild::OpenAlternativeOutputStream(const nsACString & aType, nsIOutputStream * *_retval)
 {
   MOZ_ASSERT(NS_IsMainThread(), "Main thread only");
+
+  if (!mIPCOpen) {
+    return NS_ERROR_NOT_AVAILABLE;
+  }
+
   RefPtr<AltDataOutputStreamChild> stream =
     static_cast<AltDataOutputStreamChild*>(gNeckoChild->SendPAltDataOutputStreamConstructor(nsCString(aType), this));
   stream.forget(_retval);
   return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // HttpChannelChild::nsIResumableChannel