Bug 1063197 - Callsites of NS_NewInputStreamChannel in /parser/ (r=bz)
authorChristoph Kerschbaumer <mozilla@christophkerschbaumer.com>
Thu, 16 Oct 2014 11:17:07 -0700
changeset 210810 547202c856b4fe2893b637603a217af8449eec78
parent 210809 89f80a2a643180165cf84c3f8ae14dcd7bdd87fa
child 210811 3de863f08848a5dce83576e01ddc323005d4d17a
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbz
bugs1063197
milestone36.0a1
Bug 1063197 - Callsites of NS_NewInputStreamChannel in /parser/ (r=bz)
parser/xml/nsSAXXMLReader.cpp
--- a/parser/xml/nsSAXXMLReader.cpp
+++ b/parser/xml/nsSAXXMLReader.cpp
@@ -1,16 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIInputStream.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
+#include "nsNullPrincipal.h"
 #include "nsIParser.h"
 #include "nsParserCIID.h"
 #include "nsStreamUtils.h"
 #include "nsStringStream.h"
 #include "nsIScriptError.h"
 #include "nsSAXAttributes.h"
 #include "nsSAXLocator.h"
 #include "nsSAXXMLReader.h"
@@ -490,19 +491,28 @@ nsSAXXMLReader::ParseFromStream(nsIInput
                                    aStream, 4096);
     NS_ENSURE_SUCCESS(rv, rv);
     aStream = bufferedStream;
   }
  
   rv = EnsureBaseURI();
   NS_ENSURE_SUCCESS(rv, rv);
 
+  nsCOMPtr<nsIPrincipal> nullPrincipal =
+    do_CreateInstance("@mozilla.org/nullprincipal;1", &rv);
+  NS_ENSURE_SUCCESS(rv, rv);
+
   nsCOMPtr<nsIChannel> parserChannel;
-  rv = NS_NewInputStreamChannel(getter_AddRefs(parserChannel), mBaseURI,
-                                aStream, nsDependentCString(aContentType));
+  rv = NS_NewInputStreamChannel(getter_AddRefs(parserChannel),
+                                mBaseURI,
+                                aStream,
+                                nullPrincipal,
+                                nsILoadInfo::SEC_NORMAL,
+                                nsIContentPolicy::TYPE_OTHER,
+                                nsDependentCString(aContentType));
   if (!parserChannel || NS_FAILED(rv))
     return NS_ERROR_FAILURE;
 
   if (aCharset)
     parserChannel->SetContentCharset(nsDependentCString(aCharset));
 
   rv = InitParser(nullptr, parserChannel);
   NS_ENSURE_SUCCESS(rv, rv);