From 7ba1b88f0b4e78b1ba622f288ad90bd9654c21b9 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Tue, 18 Apr 2017 08:52:14 +0200 Subject: [PATCH] Backed out changeset ec9fb39f7133 (bug 1354349) for bustage --- dom/ipc/TabParent.cpp | 1 - dom/jsurl/nsJSProtocolHandler.cpp | 6 --- modules/libjar/nsJARChannel.cpp | 6 --- netwerk/base/nsBaseChannel.cpp | 6 --- netwerk/base/nsIChannel.idl | 22 ---------- netwerk/base/nsNetUtil.cpp | 40 ------------------- netwerk/base/nsNetUtil.h | 2 - netwerk/protocol/about/nsAboutCache.h | 1 - netwerk/protocol/http/HttpBaseChannel.cpp | 6 --- netwerk/protocol/http/HttpBaseChannel.h | 1 - netwerk/protocol/http/NullHttpChannel.cpp | 6 --- netwerk/protocol/http/nsIHttpChannel.idl | 2 +- .../viewsource/nsViewSourceChannel.cpp | 8 ---- .../protocol/wyciwyg/WyciwygChannelChild.cpp | 6 --- netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp | 6 --- .../converters/nsMultiMixedConv.cpp | 6 --- .../exthandler/ExternalHelperAppParent.cpp | 6 --- .../exthandler/nsExternalProtocolHandler.cpp | 5 --- 18 files changed, 1 insertion(+), 135 deletions(-) diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index 168ee5561912..b2bd8f152d1d 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -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 diff --git a/dom/jsurl/nsJSProtocolHandler.cpp b/dom/jsurl/nsJSProtocolHandler.cpp index 1e53e93e2775..0c1b5d9599fc 100644 --- a/dom/jsurl/nsJSProtocolHandler.cpp +++ b/dom/jsurl/nsJSProtocolHandler.cpp @@ -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... // diff --git a/modules/libjar/nsJARChannel.cpp b/modules/libjar/nsJARChannel.cpp index 85383dc16cf9..7e69cb341046 100644 --- a/modules/libjar/nsJARChannel.cpp +++ b/modules/libjar/nsJARChannel.cpp @@ -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) { diff --git a/netwerk/base/nsBaseChannel.cpp b/netwerk/base/nsBaseChannel.cpp index f45a1e3b6848..42173b49d14b 100644 --- a/netwerk/base/nsBaseChannel.cpp +++ b/netwerk/base/nsBaseChannel.cpp @@ -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) { diff --git a/netwerk/base/nsIChannel.idl b/netwerk/base/nsIChannel.idl index 2be8e88c3736..743e942920d2 100644 --- a/netwerk/base/nsIChannel.idl +++ b/netwerk/base/nsIChannel.idl @@ -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 GetLoadInfo() { nsCOMPtr result; diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp index 52a0595cd955..ddc13df268e2 100644 --- a/netwerk/base/nsNetUtil.cpp +++ b/netwerk/base/nsNetUtil.cpp @@ -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, diff --git a/netwerk/base/nsNetUtil.h b/netwerk/base/nsNetUtil.h index 72cfc37e5a4f..be99db82f174 100644 --- a/netwerk/base/nsNetUtil.h +++ b/netwerk/base/nsNetUtil.h @@ -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); diff --git a/netwerk/protocol/about/nsAboutCache.h b/netwerk/protocol/about/nsAboutCache.h index 488d2c8ea820..c2d1af85054b 100644 --- a/netwerk/protocol/about/nsAboutCache.h +++ b/netwerk/protocol/about/nsAboutCache.h @@ -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 { diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 0742df96a633..a5e53dd2ba47 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -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) { diff --git a/netwerk/protocol/http/HttpBaseChannel.h b/netwerk/protocol/http/HttpBaseChannel.h index f11aa43ed9b9..591c08496ea8 100644 --- a/netwerk/protocol/http/HttpBaseChannel.h +++ b/netwerk/protocol/http/HttpBaseChannel.h @@ -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; diff --git a/netwerk/protocol/http/NullHttpChannel.cpp b/netwerk/protocol/http/NullHttpChannel.cpp index 59da1a36b2ea..12fdb7b29347 100644 --- a/netwerk/protocol/http/NullHttpChannel.cpp +++ b/netwerk/protocol/http/NullHttpChannel.cpp @@ -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 //----------------------------------------------------------------------------- diff --git a/netwerk/protocol/http/nsIHttpChannel.idl b/netwerk/protocol/http/nsIHttpChannel.idl index e9bf4d2f8892..c3ad1330078f 100644 --- a/netwerk/protocol/http/nsIHttpChannel.idl +++ b/netwerk/protocol/http/nsIHttpChannel.idl @@ -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; diff --git a/netwerk/protocol/viewsource/nsViewSourceChannel.cpp b/netwerk/protocol/viewsource/nsViewSourceChannel.cpp index 2100225fc3c7..ddf81e2b95dc 100644 --- a/netwerk/protocol/viewsource/nsViewSourceChannel.cpp +++ b/netwerk/protocol/viewsource/nsViewSourceChannel.cpp @@ -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) { diff --git a/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp b/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp index 32ffaef2c42a..28ccbdf89c75 100644 --- a/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp +++ b/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp @@ -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) { diff --git a/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp b/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp index d2f20b80a29e..bc341a1530c7 100644 --- a/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp +++ b/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp @@ -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: /////////////////////////////////////////////////////////////////////////////// diff --git a/netwerk/streamconv/converters/nsMultiMixedConv.cpp b/netwerk/streamconv/converters/nsMultiMixedConv.cpp index d0f62d919e26..e4e4b5c6f913 100644 --- a/netwerk/streamconv/converters/nsMultiMixedConv.cpp +++ b/netwerk/streamconv/converters/nsMultiMixedConv.cpp @@ -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) { diff --git a/uriloader/exthandler/ExternalHelperAppParent.cpp b/uriloader/exthandler/ExternalHelperAppParent.cpp index 5bd84d70e50b..9ca7a6d88fa0 100644 --- a/uriloader/exthandler/ExternalHelperAppParent.cpp +++ b/uriloader/exthandler/ExternalHelperAppParent.cpp @@ -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) { diff --git a/uriloader/exthandler/nsExternalProtocolHandler.cpp b/uriloader/exthandler/nsExternalProtocolHandler.cpp index 2ab27c37d90f..3b264c2c69fd 100644 --- a/uriloader/exthandler/nsExternalProtocolHandler.cpp +++ b/uriloader/exthandler/nsExternalProtocolHandler.cpp @@ -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;