diff --git a/netwerk/build/components.conf b/netwerk/build/components.conf index 57b6ca3698ed..d5b651a54644 100644 --- a/netwerk/build/components.conf +++ b/netwerk/build/components.conf @@ -11,6 +11,22 @@ Headers = [ InitFunc = 'nsNetStartup' UnloadFunc = 'nsNetShutdown' +Categories = { + '@mozilla.org/streamconv;1': { + '?from=application/http-index-format&to=text/html': ('', ProcessSelector.ALLOW_IN_SOCKET_PROCESS), + '?from=multipart/x-mixed-replace&to=*/*': ('', ProcessSelector.ALLOW_IN_SOCKET_PROCESS), + '?from=multipart/mixed&to=*/*': ('', ProcessSelector.ALLOW_IN_SOCKET_PROCESS), + '?from=multipart/byteranges&to=*/*': ('', ProcessSelector.ALLOW_IN_SOCKET_PROCESS), + '?from=application/x-unknown-content-type&to=*/*': ('', ProcessSelector.ALLOW_IN_SOCKET_PROCESS), + '?from=gzip&to=uncompressed': ('', ProcessSelector.ALLOW_IN_SOCKET_PROCESS), + '?from=x-gzip&to=uncompressed': ('', ProcessSelector.ALLOW_IN_SOCKET_PROCESS), + '?from=br&to=uncompressed': ('', ProcessSelector.ALLOW_IN_SOCKET_PROCESS), + '?from=compress&to=uncompressed': ('', ProcessSelector.ALLOW_IN_SOCKET_PROCESS), + '?from=x-compress&to=uncompressed': ('', ProcessSelector.ALLOW_IN_SOCKET_PROCESS), + '?from=deflate&to=uncompressed': ('', ProcessSelector.ALLOW_IN_SOCKET_PROCESS), + }, +} + Classes = [ { 'cid': '{3014dde6-aa1c-41db-87d0-48764a3710f6}', @@ -69,6 +85,7 @@ Classes = [ 'cid': '{a2027ec6-ba0d-4c72-805d-148233f5f33c}', 'contract_ids': ['@mozilla.org/network/binary-detector;1'], 'legacy_constructor': 'CreateNewBinaryDetectorFactory', + 'categories': {'net-content-sniffers': 'Binary Detector'} }, { 'cid': '{9226888e-da08-11d3-8cda-0060b0fc14a3}', diff --git a/netwerk/build/nsNetModule.cpp b/netwerk/build/nsNetModule.cpp index 13a872a59700..72cd6c74cc49 100644 --- a/netwerk/build/nsNetModule.cpp +++ b/netwerk/build/nsNetModule.cpp @@ -119,33 +119,6 @@ nsresult MOZ_NewTXTToHTMLConv(mozTXTToHTMLConv** result); nsresult NS_NewHTTPCompressConv(mozilla::net::nsHTTPCompressConv** result); nsresult NS_NewStreamConv(nsStreamConverterService** aStreamConv); -#define INDEX_TO_HTML "?from=application/http-index-format&to=text/html" -#define MULTI_MIXED_X "?from=multipart/x-mixed-replace&to=*/*" -#define MULTI_MIXED "?from=multipart/mixed&to=*/*" -#define MULTI_BYTERANGES "?from=multipart/byteranges&to=*/*" -#define UNKNOWN_CONTENT "?from=" UNKNOWN_CONTENT_TYPE "&to=*/*" -#define GZIP_TO_UNCOMPRESSED "?from=gzip&to=uncompressed" -#define XGZIP_TO_UNCOMPRESSED "?from=x-gzip&to=uncompressed" -#define BROTLI_TO_UNCOMPRESSED "?from=br&to=uncompressed" -#define COMPRESS_TO_UNCOMPRESSED "?from=compress&to=uncompressed" -#define XCOMPRESS_TO_UNCOMPRESSED "?from=x-compress&to=uncompressed" -#define DEFLATE_TO_UNCOMPRESSED "?from=deflate&to=uncompressed" - -static const mozilla::Module::CategoryEntry kNeckoCategories[] = { - {NS_ISTREAMCONVERTER_KEY, INDEX_TO_HTML, ""}, - {NS_ISTREAMCONVERTER_KEY, MULTI_MIXED_X, ""}, - {NS_ISTREAMCONVERTER_KEY, MULTI_MIXED, ""}, - {NS_ISTREAMCONVERTER_KEY, MULTI_BYTERANGES, ""}, - {NS_ISTREAMCONVERTER_KEY, UNKNOWN_CONTENT, ""}, - {NS_ISTREAMCONVERTER_KEY, GZIP_TO_UNCOMPRESSED, ""}, - {NS_ISTREAMCONVERTER_KEY, XGZIP_TO_UNCOMPRESSED, ""}, - {NS_ISTREAMCONVERTER_KEY, BROTLI_TO_UNCOMPRESSED, ""}, - {NS_ISTREAMCONVERTER_KEY, COMPRESS_TO_UNCOMPRESSED, ""}, - {NS_ISTREAMCONVERTER_KEY, XCOMPRESS_TO_UNCOMPRESSED, ""}, - {NS_ISTREAMCONVERTER_KEY, DEFLATE_TO_UNCOMPRESSED, ""}, - NS_BINARYDETECTOR_CATEGORYENTRY, - {nullptr}}; - nsresult CreateNewStreamConvServiceFactory(REFNSIID aIID, void** aResult) { if (!aResult) { return NS_ERROR_INVALID_POINTER; @@ -279,13 +252,3 @@ void nsNetShutdown() { delete gNetAndORBSniffers; gNetAndORBSniffers = nullptr; } - -extern const mozilla::Module kNeckoModule = { - mozilla::Module::kVersion, - nullptr, - nullptr, - kNeckoCategories, - nullptr, - nullptr, - nullptr, - mozilla::Module::ALLOW_IN_SOCKET_PROCESS}; diff --git a/netwerk/streamconv/converters/nsUnknownDecoder.h b/netwerk/streamconv/converters/nsUnknownDecoder.h index d21304337fc8..0df9df93ad37 100644 --- a/netwerk/streamconv/converters/nsUnknownDecoder.h +++ b/netwerk/streamconv/converters/nsUnknownDecoder.h @@ -149,10 +149,4 @@ class nsBinaryDetector : public nsUnknownDecoder { virtual void DetermineContentType(nsIRequest* aRequest) override; }; -#define NS_BINARYDETECTOR_CATEGORYENTRY \ - { \ - NS_CONTENT_SNIFFER_CATEGORY, "Binary Detector", \ - NS_BINARYDETECTOR_CONTRACTID \ - } - #endif /* nsUnknownDecoder_h__ */ diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp index abfd54d4dde4..b76c62d0149e 100644 --- a/xpcom/components/nsComponentManager.cpp +++ b/xpcom/components/nsComponentManager.cpp @@ -271,7 +271,6 @@ nsComponentManagerImpl::nsComponentManagerImpl() mLock("nsComponentManagerImpl.mLock"), mStatus(NOT_INITIALIZED) {} -extern const mozilla::Module kNeckoModule; extern const mozilla::Module kPowerManagerModule; extern const mozilla::Module kContentProcessWidgetModule; #if defined(MOZ_WIDGET_COCOA) || defined(MOZ_WIDGET_UIKIT) @@ -361,7 +360,6 @@ nsresult nsComponentManagerImpl::Init() { nsCategoryManager::GetSingleton()->SuppressNotifications(true); - RegisterModule(&kNeckoModule); RegisterModule(&kPowerManagerModule); RegisterModule(&kContentProcessWidgetModule); #if defined(MOZ_WIDGET_COCOA) || defined(MOZ_WIDGET_UIKIT)