Bug 1119005 - No need to branch on NewChannelinternal callsites anymore - netUtil.h changes (r=sicking,sworkman)
authorChristoph Kerschbaumer <mozilla@christophkerschbaumer.com>
Thu, 19 Feb 2015 11:47:18 -0800
changeset 229937 9d623faf8c8b065dc0c18256e51a23daf75e8321
parent 229936 3615c8ae27ad4ea47ccae77a74c5145cc5bd7265
child 229938 2144c24dfa0169e3c3e44e22a2f13d6f9e92323b
push id55844
push usermozilla@christophkerschbaumer.com
push dateFri, 20 Feb 2015 00:55:10 +0000
treeherdermozilla-inbound@2144c24dfa01 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking, sworkman
bugs1119005
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1119005 - No need to branch on NewChannelinternal callsites anymore - netUtil.h changes (r=sicking,sworkman)
netwerk/base/nsNetUtil.h
--- a/netwerk/base/nsNetUtil.h
+++ b/netwerk/base/nsNetUtil.h
@@ -591,17 +591,16 @@ NS_GetRealPort(nsIURI* aURI)
 inline nsresult /* NS_NewInputStreamChannelWithLoadInfo */
 NS_NewInputStreamChannelInternal(nsIChannel**        outChannel,
                                  nsIURI*             aUri,
                                  nsIInputStream*     aStream,
                                  const nsACString&   aContentType,
                                  const nsACString&   aContentCharset,
                                  nsILoadInfo*        aLoadInfo)
 {
-  MOZ_ASSERT(aLoadInfo, "can not create channel without a loadinfo");
   nsresult rv;
   nsCOMPtr<nsIInputStreamChannel> isc =
     do_CreateInstance(NS_INPUTSTREAMCHANNEL_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = isc->SetURI(aUri);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = isc->SetContentStream(aStream);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -618,17 +617,17 @@ NS_NewInputStreamChannelInternal(nsIChan
     rv = channel->SetContentCharset(aContentCharset);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   channel->SetLoadInfo(aLoadInfo);
 
   // If we're sandboxed, make sure to clear any owner the channel
   // might already have.
-  if (aLoadInfo->GetLoadingSandboxed()) {
+  if (aLoadInfo && aLoadInfo->GetLoadingSandboxed()) {
     channel->SetOwner(nullptr);
   }
 
   channel.forget(outChannel);
   return NS_OK;
 }
 
 inline nsresult