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:38:33 +0100
changeset 488103 97f24ea0ae94621b027d83a152de7680cb82a885
parent 487063 24931c1b6d9e5c0b1e496a2428f2012428715956
child 546637 e99c66db72e1d9c1cd2b116e6085c8dc7fbf4ec1
push id46422
push uservalentin.gosu@gmail.com
push dateWed, 22 Feb 2017 15:39: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