зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1773770: Part 5 - Migrate necko category entries to static registration. r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D149433
This commit is contained in:
Родитель
36eea502fb
Коммит
3d617d9036
|
@ -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}',
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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__ */
|
||||
|
|
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче