зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset ec9fb39f7133 (bug 1354349) for bustage
This commit is contained in:
Родитель
1c4a806242
Коммит
7ba1b88f0b
|
@ -2956,7 +2956,6 @@ public:
|
|||
NS_IMETHOD SetLoadGroup(nsILoadGroup*) NO_IMPL
|
||||
NS_IMETHOD SetLoadFlags(nsLoadFlags) NO_IMPL
|
||||
NS_IMETHOD GetLoadFlags(nsLoadFlags*) NO_IMPL
|
||||
NS_IMETHOD GetIsDocument(bool *) NO_IMPL
|
||||
NS_IMETHOD GetOriginalURI(nsIURI**) NO_IMPL
|
||||
NS_IMETHOD SetOriginalURI(nsIURI*) NO_IMPL
|
||||
NS_IMETHOD GetURI(nsIURI** aUri) override
|
||||
|
|
|
@ -442,12 +442,6 @@ nsresult nsJSChannel::Init(nsIURI* aURI, nsILoadInfo* aLoadInfo)
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsJSChannel::GetIsDocument(bool *aIsDocument)
|
||||
{
|
||||
return NS_GetIsDocumentChannel(this, aIsDocument);
|
||||
}
|
||||
|
||||
//
|
||||
// nsISupports implementation...
|
||||
//
|
||||
|
|
|
@ -486,12 +486,6 @@ nsJARChannel::SetLoadFlags(nsLoadFlags aLoadFlags)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsJARChannel::GetIsDocument(bool *aIsDocument)
|
||||
{
|
||||
return NS_GetIsDocumentChannel(this, aIsDocument);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsJARChannel::GetLoadGroup(nsILoadGroup **aLoadGroup)
|
||||
{
|
||||
|
|
|
@ -503,12 +503,6 @@ nsBaseChannel::GetLoadInfo(nsILoadInfo** aLoadInfo)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBaseChannel::GetIsDocument(bool *aIsDocument)
|
||||
{
|
||||
return NS_GetIsDocumentChannel(this, aIsDocument);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBaseChannel::GetNotificationCallbacks(nsIInterfaceRequestor **aCallbacks)
|
||||
{
|
||||
|
|
|
@ -208,9 +208,6 @@ interface nsIChannel : nsIRequest
|
|||
/**
|
||||
* Set (e.g., by the docshell) to indicate whether or not the channel
|
||||
* corresponds to a document URI.
|
||||
* While setting this flag is sufficient to mark a channel as a document
|
||||
* load, _checking_ whether the channel is a document load requires the use
|
||||
* of the new channel.isDocument
|
||||
*/
|
||||
const unsigned long LOAD_DOCUMENT_URI = 1 << 16;
|
||||
|
||||
|
@ -347,26 +344,7 @@ interface nsIChannel : nsIRequest
|
|||
*/
|
||||
attribute nsILoadInfo loadInfo;
|
||||
|
||||
/**
|
||||
* Returns true if the channel is used to create a document.
|
||||
* It returns true if the loadFlags have LOAD_DOCUMENT_URI set, or if
|
||||
* LOAD_HTML_OBJECT_DATA is set and the channel has the appropriate
|
||||
* MIME type.
|
||||
* Note: May have the wrong value if called before OnStartRequest as we
|
||||
* don't know the MIME type yet.
|
||||
*/
|
||||
readonly attribute bool isDocument;
|
||||
|
||||
%{ C++
|
||||
inline bool IsDocument()
|
||||
{
|
||||
bool isDocument = false;
|
||||
if (NS_SUCCEEDED(GetIsDocument(&isDocument)) && isDocument) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
inline already_AddRefed<nsILoadInfo> GetLoadInfo()
|
||||
{
|
||||
nsCOMPtr<nsILoadInfo> result;
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include "nsIMIMEHeaderParam.h"
|
||||
#include "nsIMutable.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsIObjectLoadingContent.h"
|
||||
#include "nsIOfflineCacheUpdate.h"
|
||||
#include "nsIPersistentProperties2.h"
|
||||
#include "nsIPrivateBrowsingChannel.h"
|
||||
|
@ -358,45 +357,6 @@ NS_NewChannel(nsIChannel **outChannel,
|
|||
aIoService);
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_GetIsDocumentChannel(nsIChannel * aChannel, bool *aIsDocument)
|
||||
{
|
||||
// Check if this channel is going to be used to create a document. If it has
|
||||
// LOAD_DOCUMENT_URI set it is trivially creating a document. If
|
||||
// LOAD_HTML_OBJECT_DATA is set it may or may not be used to create a
|
||||
// document, depending on its MIME type.
|
||||
|
||||
*aIsDocument = false;
|
||||
if (!aChannel || !aIsDocument) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsLoadFlags loadFlags;
|
||||
nsresult rv = aChannel->GetLoadFlags(&loadFlags);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
if (loadFlags & nsIChannel::LOAD_DOCUMENT_URI) {
|
||||
*aIsDocument = true;
|
||||
return NS_OK;
|
||||
}
|
||||
if (!(loadFlags & nsIRequest::LOAD_HTML_OBJECT_DATA)) {
|
||||
*aIsDocument = false;
|
||||
return NS_OK;
|
||||
}
|
||||
nsAutoCString mimeType;
|
||||
rv = aChannel->GetContentType(mimeType);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
if (nsContentUtils::HtmlObjectContentTypeForMIMEType(mimeType, nullptr) ==
|
||||
nsIObjectLoadingContent::TYPE_DOCUMENT) {
|
||||
*aIsDocument = true;
|
||||
return NS_OK;
|
||||
}
|
||||
*aIsDocument = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_MakeAbsoluteURI(nsACString &result,
|
||||
const nsACString &spec,
|
||||
|
|
|
@ -190,8 +190,6 @@ NS_NewChannel(nsIChannel **outChannel,
|
|||
nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL,
|
||||
nsIIOService *aIoService = nullptr);
|
||||
|
||||
nsresult NS_GetIsDocumentChannel(nsIChannel * aChannel, bool *aIsDocument);
|
||||
|
||||
nsresult NS_MakeAbsoluteURI(nsACString &result,
|
||||
const nsACString &spec,
|
||||
nsIURI *baseURI);
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
NS_IMETHOD GetContentDispositionHeader(nsACString & aContentDispositionHeader) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetContentDispositionHeader(aContentDispositionHeader); } \
|
||||
NS_IMETHOD GetLoadInfo(nsILoadInfo * *aLoadInfo) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLoadInfo(aLoadInfo); } \
|
||||
NS_IMETHOD SetLoadInfo(nsILoadInfo *aLoadInfo) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetLoadInfo(aLoadInfo); } \
|
||||
NS_IMETHOD GetIsDocument(bool *aIsDocument) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsDocument(aIsDocument); }; \
|
||||
|
||||
class nsAboutCache final : public nsIAboutModule
|
||||
{
|
||||
|
|
|
@ -535,12 +535,6 @@ HttpBaseChannel::GetLoadInfo(nsILoadInfo **aLoadInfo)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HttpBaseChannel::GetIsDocument(bool *aIsDocument)
|
||||
{
|
||||
return NS_GetIsDocumentChannel(this, aIsDocument);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HttpBaseChannel::GetNotificationCallbacks(nsIInterfaceRequestor **aCallbacks)
|
||||
{
|
||||
|
|
|
@ -135,7 +135,6 @@ public:
|
|||
NS_IMETHOD SetOwner(nsISupports *aOwner) override;
|
||||
NS_IMETHOD GetLoadInfo(nsILoadInfo **aLoadInfo) override;
|
||||
NS_IMETHOD SetLoadInfo(nsILoadInfo *aLoadInfo) override;
|
||||
NS_IMETHOD GetIsDocument(bool *aIsDocument) override;
|
||||
NS_IMETHOD GetNotificationCallbacks(nsIInterfaceRequestor **aCallbacks) override;
|
||||
NS_IMETHOD SetNotificationCallbacks(nsIInterfaceRequestor *aCallbacks) override;
|
||||
NS_IMETHOD GetContentType(nsACString& aContentType) override;
|
||||
|
|
|
@ -539,12 +539,6 @@ NullHttpChannel::SetLoadFlags(nsLoadFlags aLoadFlags)
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NullHttpChannel::GetIsDocument(bool *aIsDocument)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// NullHttpChannel::nsITimedChannel
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -286,7 +286,7 @@ interface nsIHttpChannel : nsIChannel
|
|||
|
||||
/** Indicates whether channel should be treated as the main one for the
|
||||
* current document. If manually set to true, will always remain true. Otherwise,
|
||||
* will be true if LOAD_DOCUMENT_URI is set in the channel's loadflags.
|
||||
* will be true iff LOAD_DOCUMENT_URI is set in the channel's loadflags.
|
||||
*/
|
||||
[must_use] attribute boolean isMainDocumentChannel;
|
||||
|
||||
|
|
|
@ -573,14 +573,6 @@ nsViewSourceChannel::SetLoadInfo(nsILoadInfo* aLoadInfo)
|
|||
return mChannel->SetLoadInfo(aLoadInfo);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsViewSourceChannel::GetIsDocument(bool *aIsDocument)
|
||||
{
|
||||
NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE);
|
||||
|
||||
return mChannel->GetIsDocument(aIsDocument);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsViewSourceChannel::GetNotificationCallbacks(nsIInterfaceRequestor* *aNotificationCallbacks)
|
||||
{
|
||||
|
|
|
@ -493,12 +493,6 @@ WyciwygChannelChild::SetLoadInfo(nsILoadInfo* aLoadInfo)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
WyciwygChannelChild::GetIsDocument(bool *aIsDocument)
|
||||
{
|
||||
return NS_GetIsDocumentChannel(this, aIsDocument);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
WyciwygChannelChild::GetNotificationCallbacks(nsIInterfaceRequestor * *aCallbacks)
|
||||
{
|
||||
|
|
|
@ -166,12 +166,6 @@ nsWyciwygChannel::GetLoadFlags(uint32_t * aLoadFlags)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWyciwygChannel::GetIsDocument(bool *aIsDocument)
|
||||
{
|
||||
return NS_GetIsDocumentChannel(this, aIsDocument);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsIChannel methods:
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -227,12 +227,6 @@ nsPartChannel::SetLoadFlags(nsLoadFlags aLoadFlags)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPartChannel::GetIsDocument(bool *aIsDocument)
|
||||
{
|
||||
return NS_GetIsDocumentChannel(this, aIsDocument);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPartChannel::GetLoadGroup(nsILoadGroup* *aLoadGroup)
|
||||
{
|
||||
|
|
|
@ -350,12 +350,6 @@ ExternalHelperAppParent::SetLoadFlags(nsLoadFlags aLoadFlags)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ExternalHelperAppParent::GetIsDocument(bool *aIsDocument)
|
||||
{
|
||||
return NS_GetIsDocumentChannel(this, aIsDocument);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ExternalHelperAppParent::GetLoadGroup(nsILoadGroup* *aLoadGroup)
|
||||
{
|
||||
|
|
|
@ -245,11 +245,6 @@ NS_IMETHODIMP nsExtProtocolChannel::SetLoadFlags(nsLoadFlags aLoadFlags)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsExtProtocolChannel::GetIsDocument(bool *aIsDocument)
|
||||
{
|
||||
return NS_GetIsDocumentChannel(this, aIsDocument);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsExtProtocolChannel::GetContentType(nsACString &aContentType)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
|
Загрузка…
Ссылка в новой задаче