зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1063197 - Callsites of NS_NewInputStreamChannel in /content/base (r=jst)
This commit is contained in:
Родитель
3636869e7d
Коммит
fdc7306ea1
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче