Bug 1038756: Callsites creating a channel in /rdf/ (r=bsmedberg)

This commit is contained in:
Christoph Kerschbaumer 2014-09-21 09:44:27 -07:00
parent 6d214a9775
commit b980528eaa

View File

@ -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<nsIRequest> 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<nsIInputStream> 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.