mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
Bug 1469430 - Remove unused nsDocShell::LoadStream; r=Nika
MozReview-Commit-ID: BbTMuZXKzsJ --HG-- extra : rebase_source : 3d7533d6d46064c3b9a5ae2a492d4cc83df7e989
This commit is contained in:
parent
e33ff43117
commit
19e1f63d3f
@ -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)
|
||||
{
|
||||
|
@ -91,31 +91,6 @@ interface nsIDocShell : nsIDocShellTreeItem
|
||||
in unsigned long aLoadFlags,
|
||||
in boolean firstParty);
|
||||
|
||||
/**
|
||||
* Loads a given stream. This will give priority to loading the requested
|
||||
* stream in the object implementing this interface. If it can't be loaded
|
||||
* here however, the URL dispatched will go through its normal process of
|
||||
* content loading.
|
||||
*
|
||||
* @param aStream - The input stream that provides access to the data
|
||||
* to be loaded. This must be a blocking, threadsafe
|
||||
* stream implementation.
|
||||
* @param aURI - The URI representing the stream, or null.
|
||||
* @param aContentType - The type (MIME) of data being loaded (empty if unknown).
|
||||
* @param aContentCharset - The charset of the data being loaded (empty if unknown).
|
||||
* @param aLoadInfo - This is the extended load info for this load. This
|
||||
* most often will be null, but if you need to do
|
||||
* additional setup for this load you can get a
|
||||
* loadInfo object by calling createLoadInfo. Once
|
||||
* you have this object you can set the needed
|
||||
* properties on it and then pass it to loadStream.
|
||||
*/
|
||||
[noscript]void loadStream(in nsIInputStream aStream,
|
||||
in nsIURI aURI,
|
||||
in ACString aContentType,
|
||||
in ACString aContentCharset,
|
||||
in nsIDocShellLoadInfo aLoadInfo);
|
||||
|
||||
const long INTERNAL_LOAD_FLAGS_NONE = 0x0;
|
||||
const long INTERNAL_LOAD_FLAGS_INHERIT_PRINCIPAL = 0x1;
|
||||
const long INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER = 0x2;
|
||||
|
Loading…
Reference in New Issue
Block a user