mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1063197 - Callsites of NS_NewInputStreamChannel in /content/base (r=jst)
This commit is contained in:
parent
3ee3159b25
commit
554d4eeea3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user