From b980528eaa0f9b0361727660874d3a601d89af1a Mon Sep 17 00:00:00 2001 From: Christoph Kerschbaumer Date: Sun, 21 Sep 2014 09:44:27 -0700 Subject: [PATCH] Bug 1038756: Callsites creating a channel in /rdf/ (r=bsmedberg) --- rdf/base/nsRDFXMLDataSource.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/rdf/base/nsRDFXMLDataSource.cpp b/rdf/base/nsRDFXMLDataSource.cpp index b2a5700265e..d91eccab94f 100644 --- a/rdf/base/nsRDFXMLDataSource.cpp +++ b/rdf/base/nsRDFXMLDataSource.cpp @@ -94,6 +94,8 @@ #include "nsIChannelEventSink.h" #include "nsIAsyncVerifyRedirectCallback.h" #include "nsNetUtil.h" +#include "nsIContentPolicy.h" +#include "nsContentUtils.h" #include "rdfIDataSource.h" @@ -483,7 +485,12 @@ RDFXMLDataSourceImpl::BlockingParse(nsIURI* aURL, nsIStreamListener* aConsumer) nsCOMPtr request; // Null LoadGroup ? - rv = NS_NewChannel(getter_AddRefs(channel), aURL, nullptr); + rv = NS_NewChannel(getter_AddRefs(channel), + aURL, + nsContentUtils::GetSystemPrincipal(), + nsILoadInfo::SEC_NORMAL, + nsIContentPolicy::TYPE_OTHER); + if (NS_FAILED(rv)) return rv; nsCOMPtr in; rv = channel->Open(getter_AddRefs(in)); @@ -948,7 +955,15 @@ RDFXMLDataSourceImpl::Refresh(bool aBlocking) } else { // Null LoadGroup ? - rv = NS_OpenURI(this, nullptr, mURL, nullptr, nullptr, this); + rv = NS_OpenURI(this, + nullptr, // aContext + mURL, + nsContentUtils::GetSystemPrincipal(), + nsILoadInfo::SEC_NORMAL, + nsIContentPolicy::TYPE_OTHER, + nullptr, // aLoadGroup + this); // aCallbacks + if (NS_FAILED(rv)) return rv; // So we don't try to issue two asynchronous loads at once.