Bug 1488306 - Remove the XPCOM component registration for nsUnknwonDecoder; r=valentin

Differential Revision: https://phabricator.services.mozilla.com/D4897
This commit is contained in:
Ehsan Akhgari 2018-09-03 21:49:18 -04:00
parent abcd838ffb
commit d7274895ea
4 changed files with 6 additions and 14 deletions

View File

@ -9,7 +9,7 @@
#include "nsURLHelper.h"
#include "nsNetCID.h"
#include "nsMimeTypes.h"
#include "nsIContentSniffer.h"
#include "nsUnknownDecoder.h"
#include "nsIScriptSecurityManager.h"
#include "nsMimeTypes.h"
#include "nsIHttpChannel.h"
@ -824,10 +824,7 @@ CallUnknownTypeSniffer(void *aClosure, const uint8_t *aData, uint32_t aCount)
{
nsIChannel *chan = static_cast<nsIChannel*>(aClosure);
nsCOMPtr<nsIContentSniffer> sniffer =
do_CreateInstance(NS_GENERIC_CONTENT_SNIFFER);
if (!sniffer)
return;
RefPtr<nsUnknownDecoder> sniffer = new nsUnknownDecoder();
nsAutoCString detected;
nsresult rv = sniffer->GetMIMETypeFromContent(chan, aData, aCount, detected);

View File

@ -952,14 +952,6 @@
{0xa1, 0x6c, 0x00, 0x50, 0x04, 0x1c, 0xaf, 0x44} \
}
/**
* General-purpose content sniffer component. Use with CreateInstance.
*
* Implements nsIContentSniffer
*/
#define NS_GENERIC_CONTENT_SNIFFER \
"@mozilla.org/network/content-sniffer;1"
/**
* Detector that can act as either an nsIStreamConverter or an
* nsIContentSniffer to decide whether text/plain data is "really" text/plain

View File

@ -948,7 +948,6 @@ static const mozilla::Module::ContractIDEntry kNeckoContracts[] = {
{ NS_ISTREAMCONVERTER_KEY MULTI_BYTERANGES, &kNS_MULTIMIXEDCONVERTER_CID },
{ NS_ISTREAMCONVERTER_KEY MULTI_MIXED, &kNS_MULTIMIXEDCONVERTER_CID },
{ NS_ISTREAMCONVERTER_KEY UNKNOWN_CONTENT, &kNS_UNKNOWNDECODER_CID },
{ NS_GENERIC_CONTENT_SNIFFER, &kNS_UNKNOWNDECODER_CID },
{ NS_BINARYDETECTOR_CONTRACTID, &kNS_BINARYDETECTOR_CID },
{ NS_ISTREAMCONVERTER_KEY GZIP_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
{ NS_ISTREAMCONVERTER_KEY XGZIP_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },

View File

@ -8,6 +8,10 @@ XPIDL_SOURCES += [
'nsICompressConvStats.idl'
]
EXPORTS += [
'nsUnknownDecoder.h',
]
XPIDL_MODULE = 'necko_http'
UNIFIED_SOURCES += [