Bug 1469430 - Remove unused nsDocShell::LoadStream; r=Nika
MozReview-Commit-ID: BbTMuZXKzsJ
This commit is contained in:
@@ -1027,72 +1027,6 @@ nsDocShell::LoadURI(nsIURI* aURI,
|
||||
nullptr); // No nsIRequest
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::LoadStream(nsIInputStream* aStream, nsIURI* aURI,
|
||||
const nsACString& aContentType,
|
||||
const nsACString& aContentCharset,
|
||||
nsIDocShellLoadInfo* aLoadInfo)
|
||||
{
|
||||
NS_ENSURE_ARG(aStream);
|
||||
|
||||
mAllowKeywordFixup = false;
|
||||
|
||||
// if the caller doesn't pass in a URI we need to create a dummy URI. necko
|
||||
// currently requires a URI in various places during the load. Some consumers
|
||||
// do as well.
|
||||
nsCOMPtr<nsIURI> uri = aURI;
|
||||
if (!uri) {
|
||||
// HACK ALERT
|
||||
nsresult rv = NS_OK;
|
||||
// Make sure that the URI spec "looks" like a protocol and path...
|
||||
// For now, just use a bogus protocol called "internal"
|
||||
rv = NS_MutateURI(NS_SIMPLEURIMUTATOR_CONTRACTID)
|
||||
.SetSpec(NS_LITERAL_CSTRING("internal:load-stream"))
|
||||
.Finalize(uri);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t loadType = LOAD_NORMAL;
|
||||
nsCOMPtr<nsIPrincipal> triggeringPrincipal;
|
||||
if (aLoadInfo) {
|
||||
nsDocShellInfoLoadType lt = nsIDocShellLoadInfo::loadNormal;
|
||||
(void)aLoadInfo->GetLoadType(<);
|
||||
// Get the appropriate LoadType from nsIDocShellLoadInfo type
|
||||
loadType = ConvertDocShellInfoLoadTypeToLoadType(lt);
|
||||
aLoadInfo->GetTriggeringPrincipal(getter_AddRefs(triggeringPrincipal));
|
||||
}
|
||||
|
||||
NS_ENSURE_SUCCESS(Stop(nsIWebNavigation::STOP_NETWORK), NS_ERROR_FAILURE);
|
||||
|
||||
mLoadType = loadType;
|
||||
|
||||
if (!triggeringPrincipal) {
|
||||
triggeringPrincipal = nsContentUtils::GetSystemPrincipal();
|
||||
}
|
||||
|
||||
// build up a channel for this stream.
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
nsCOMPtr<nsIInputStream> stream = aStream;
|
||||
nsresult rv = NS_NewInputStreamChannel(getter_AddRefs(channel),
|
||||
uri,
|
||||
stream.forget(),
|
||||
triggeringPrincipal,
|
||||
nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
|
||||
nsIContentPolicy::TYPE_OTHER,
|
||||
aContentType,
|
||||
aContentCharset);
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIURILoader> uriLoader(do_GetService(NS_URI_LOADER_CONTRACTID));
|
||||
NS_ENSURE_TRUE(uriLoader, NS_ERROR_FAILURE);
|
||||
|
||||
NS_ENSURE_SUCCESS(DoChannelLoad(channel, uriLoader, false),
|
||||
NS_ERROR_FAILURE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::CreateLoadInfo(nsIDocShellLoadInfo** aLoadInfo)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user