Bug 1063197 - Callsites of NS_NewInputStreamChannel in /content/base (r=jst)

This commit is contained in:
Christoph Kerschbaumer 2014-10-16 11:14:42 -07:00
Родитель 3636869e7d
Коммит fdc7306ea1
2 изменённых файлов: 12 добавлений и 17 удалений

Просмотреть файл

@ -238,18 +238,15 @@ DOMParser::ParseFromStream(nsIInputStream *stream,
// Create a fake channel
nsCOMPtr<nsIChannel> parserChannel;
NS_NewInputStreamChannel(getter_AddRefs(parserChannel), mDocumentURI, nullptr,
nsDependentCString(contentType), nullptr);
NS_NewInputStreamChannel(getter_AddRefs(parserChannel),
mDocumentURI,
nullptr, // aStream
mOriginalPrincipal,
nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL,
nsIContentPolicy::TYPE_OTHER,
nsDependentCString(contentType));
NS_ENSURE_STATE(parserChannel);
// More principal-faking here
nsCOMPtr<nsILoadInfo> loadInfo =
new LoadInfo(mOriginalPrincipal,
nullptr,
nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL,
nsIContentPolicy::TYPE_OTHER);
parserChannel->SetLoadInfo(loadInfo);
if (charset) {
parserChannel->SetContentCharset(nsDependentCString(charset));
}

Просмотреть файл

@ -519,7 +519,11 @@ nsHostObjectProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
nsCOMPtr<nsIChannel> channel;
rv = NS_NewInputStreamChannel(getter_AddRefs(channel),
uri,
stream);
stream,
info->mPrincipal,
nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL,
nsIContentPolicy::TYPE_OTHER);
NS_ENSURE_SUCCESS(rv, rv);
nsString type;
@ -537,12 +541,6 @@ nsHostObjectProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
return error.ErrorCode();
}
nsCOMPtr<nsILoadInfo> loadInfo =
new mozilla::LoadInfo(info->mPrincipal,
nullptr,
nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL,
nsIContentPolicy::TYPE_OTHER);
channel->SetLoadInfo(loadInfo);
channel->SetOriginalURI(uri);
channel->SetContentType(NS_ConvertUTF16toUTF8(type));
channel->SetContentLength(size);