Bug 1478124: Part 8d - Update netwerk module to use a static component manifest. r=mayhemer
authorKris Maglione <maglione.k@gmail.com>
Sun, 16 Dec 2018 18:36:32 -0800
changeset 456007 4a36400ab63cbc7ff3758c1a6fc1d1a209d9d131
parent 456006 1b7d8d7be13d4befd087089938a9bec464c9e3e8
child 456008 c4df3fabb4e639156559b1d7bae31ba83a620f17
push id35466
push usershindli@mozilla.com
push dateWed, 30 Jan 2019 04:11:39 +0000
treeherdermozilla-central@0c6d81e2d4fa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1478124
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1478124: Part 8d - Update netwerk module to use a static component manifest. r=mayhemer Differential Revision: https://phabricator.services.mozilla.com/D15042
netwerk/base/moz.build
netwerk/base/nsUDPSocket.h
netwerk/build/components.conf
netwerk/build/moz.build
netwerk/build/nsNetModule.cpp
netwerk/build/nsNetModule.h
netwerk/protocol/res/ExtensionProtocolHandler.cpp
netwerk/protocol/res/SubstitutingProtocolHandler.cpp
netwerk/protocol/res/SubstitutingProtocolHandler.h
netwerk/protocol/res/SubstitutingURL.h
netwerk/protocol/res/moz.build
netwerk/protocol/res/nsResProtocolHandler.h
--- a/netwerk/base/moz.build
+++ b/netwerk/base/moz.build
@@ -143,16 +143,17 @@ EXPORTS += [
     'nsFileStreams.h',
     'nsInputStreamPump.h',
     'nsMIMEInputStream.h',
     'nsNetUtil.h',
     'nsReadLine.h',
     'nsSerializationHelper.h',
     'nsSimpleNestedURI.h',
     'nsSimpleURI.h',
+    'nsStandardURL.h',
     'nsStreamListenerWrapper.h',
     'nsURIHashKey.h',
     'nsURLHelper.h',
     'nsURLParsers.h',
     'SimpleChannel.h',
 ]
 
 EXPORTS.mozilla += [
--- a/netwerk/base/nsUDPSocket.h
+++ b/netwerk/base/nsUDPSocket.h
@@ -3,16 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsUDPSocket_h__
 #define nsUDPSocket_h__
 
 #include "nsIUDPSocket.h"
 #include "mozilla/Mutex.h"
+#include "mozilla/net/DNS.h"
 #include "nsIOutputStream.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 
 //-----------------------------------------------------------------------------
 
 namespace mozilla {
 namespace net {
new file mode 100644
--- /dev/null
+++ b/netwerk/build/components.conf
@@ -0,0 +1,622 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+Headers = [
+    '/netwerk/build/nsNetModule.h'
+]
+
+InitFunc = 'nsNetStartup'
+UnloadFunc = 'nsNetShutdown'
+
+Classes = [
+    {
+        'cid': '{3014dde6-aa1c-41db-87d0-48764a3710f6}',
+        'contract_ids': ['@mozilla.org/io/arraybuffer-input-stream;1'],
+        'type': 'ArrayBufferInputStream',
+        'headers': ['/netwerk/base/ArrayBufferInputStream.h'],
+    },
+    {
+        'cid': '{62d4b190-3642-4450-b019-d1c1fba56025}',
+        'contract_ids': ['@mozilla.org/load-context-info-factory;1'],
+        'type': 'mozilla::net::LoadContextInfoFactory',
+        'headers': ['mozilla/LoadContextInfo.h'],
+    },
+    {
+        'cid': '{ea70b098-5014-4e21-aee1-75e6b2c4b8e0}',
+        'contract_ids': [
+            '@mozilla.org/netwerk/cache-storage-service;1',
+            '@mozilla.org/network/cache-storage-service;1',
+        ],
+        'singleton': True,
+        'type': 'mozilla::net::CacheStorageService',
+        'headers': ['CacheStorageService.h'],
+    },
+    {
+        'cid': '{02bf7a2a-39d8-4a23-a50c-2cbb085ab7a5}',
+        'contract_ids': ['@mozilla.org/network/application-cache-service;1'],
+        'singleton': True,
+        'type': 'nsApplicationCacheService',
+        'headers': ['nsApplicationCacheService.h'],
+    },
+    {
+        'cid': '{e746a8b1-c97a-4fc5-baa4-66607521bd08}',
+        'contract_ids': ['@mozilla.org/network/async-stream-copier;1'],
+        'type': 'nsAsyncStreamCopier',
+        'headers': ['/netwerk/base/nsAsyncStreamCopier.h'],
+    },
+    {
+        'cid': '{6eae857e-4ba9-11e3-9b39-b4036188709b}',
+        'contract_ids': ['@mozilla.org/network/atomic-file-output-stream;1'],
+        'type': 'nsAtomicFileOutputStream',
+        'headers': ['nsFileStreams.h'],
+    },
+    {
+        'cid': '{62147d1e-ef6a-40e8-aaf8-d039f5caaa81}',
+        'contract_ids': ['@mozilla.org/network/background-file-saver;1?mode=outputstream'],
+        'type': 'mozilla::net::BackgroundFileSaverOutputStream',
+        'headers': ['/netwerk/base/BackgroundFileSaver.h'],
+        'init_method': 'Init',
+    },
+    {
+        'cid': '{208de7fc-a781-4031-bbae-cc0de539f61a}',
+        'contract_ids': ['@mozilla.org/network/background-file-saver;1?mode=streamlistener'],
+        'type': 'mozilla::net::BackgroundFileSaverStreamListener',
+        'headers': ['/netwerk/base/BackgroundFileSaver.h'],
+        'init_method': 'Init',
+    },
+    {
+        'cid': '{a2027ec6-ba0d-4c72-805d-148233f5f33c}',
+        'contract_ids': ['@mozilla.org/network/binary-detector;1'],
+        'legacy_constructor': 'CreateNewBinaryDetectorFactory',
+    },
+    {
+        'cid': '{9226888e-da08-11d3-8cda-0060b0fc14a3}',
+        'contract_ids': ['@mozilla.org/network/buffered-input-stream;1'],
+        'legacy_constructor': 'nsBufferedInputStream::Create',
+        'headers': ['/netwerk/base/nsBufferedStreams.h'],
+    },
+    {
+        'cid': '{9868b4ce-da08-11d3-8cda-0060b0fc14a3}',
+        'contract_ids': ['@mozilla.org/network/buffered-output-stream;1'],
+        'legacy_constructor': 'nsBufferedOutputStream::Create',
+        'headers': ['/netwerk/base/nsBufferedStreams.h'],
+    },
+    {
+        'cid': '{6c84aec9-29a5-4264-8fbc-bee8f922ea67}',
+        'contract_ids': ['@mozilla.org/network/cache-service;1'],
+        'legacy_constructor': 'nsCacheServiceConstructor',
+    },
+    {
+        'cid': '{bdbe0555-fc3d-4f7b-9205-c309ceb2d641}',
+        'contract_ids': ['@mozilla.org/network/captive-portal-service;1'],
+        'singleton': True,
+        'type': 'nsICaptivePortalService',
+        'constructor': 'mozilla::net::CaptivePortalService::GetSingleton',
+        'headers': ['mozilla/net/CaptivePortalService.h'],
+    },
+    {
+        'cid': '{c79eb3c6-091a-45a6-8544-5a8d1ab79537}',
+        'contract_ids': ['@mozilla.org/network/dashboard;1'],
+        'type': 'mozilla::net::Dashboard',
+        'headers': ['mozilla/net/Dashboard.h'],
+    },
+    {
+        'cid': '{b0ff4572-dae4-4bef-a092-83c1b88f6be9}',
+        'contract_ids': ['@mozilla.org/network/dns-service;1'],
+        'singleton': True,
+        'type': 'nsIDNSService',
+        'constructor': 'nsDNSService::GetXPCOMSingleton',
+        'headers': ['/netwerk/dns/nsDNSService2.h'],
+        'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
+    },
+    {
+        'cid': '{510a86bb-6019-4ed1-bb4f-965cffd23ece}',
+        'contract_ids': ['@mozilla.org/network/downloader;1'],
+        'type': 'nsDownloader',
+        'headers': ['/netwerk/base/nsDownloader.h'],
+    },
+    {
+        'cid': '{cb9abbae-66b6-4609-8594-5c4ff300888e}',
+        'contract_ids': ['@mozilla.org/network/effective-tld-service;1'],
+        'singleton': True,
+        'type': 'nsEffectiveTLDService',
+        'headers': ['/netwerk/dns/nsEffectiveTLDService.h'],
+        'init_method': 'Init',
+    },
+    {
+        'cid': '{be9a53ae-c7e9-11d3-8cda-0060b0fc14a3}',
+        'contract_ids': ['@mozilla.org/network/file-input-stream;1'],
+        'legacy_constructor': 'nsFileInputStream::Create',
+        'headers': ['nsFileStreams.h'],
+    },
+    {
+        'cid': '{c272fee0-c7e9-11d3-8cda-0060b0fc14a3}',
+        'contract_ids': ['@mozilla.org/network/file-output-stream;1'],
+        'legacy_constructor': 'nsFileOutputStream::Create',
+        'headers': ['nsFileStreams.h'],
+    },
+    {
+        'cid': '{15629ada-a41c-4a09-961f-6553cd60b1a2}',
+        'contract_ids': ['@mozilla.org/network/http-activity-distributor;1'],
+        'type': 'mozilla::net::nsHttpActivityDistributor',
+        'headers': ['/netwerk/protocol/http/nsHttpActivityDistributor.h'],
+    },
+    {
+        'cid': '{36b63ef3-e0fa-4c49-9fd4-e065e85568f4}',
+        'contract_ids': ['@mozilla.org/network/http-auth-manager;1'],
+        'type': 'mozilla::net::nsHttpAuthManager',
+        'headers': ['/netwerk/protocol/http/nsHttpAuthManager.h'],
+        'init_method': 'Init',
+    },
+    {
+        'cid': '{62b778a6-bce3-456b-8c31-2865fbb68c91}',
+        'contract_ids': ['@mozilla.org/network/idn-service;1'],
+        'type': 'nsIDNService',
+        'headers': ['/netwerk/dns/nsIDNService.h'],
+        'init_method': 'Init',
+        'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
+    },
+    {
+        'cid': '{a62af1ba-79b3-4896-8aaf-b148bfce4280}',
+        'contract_ids': ['@mozilla.org/network/incremental-download;1'],
+        'legacy_constructor': 'net_NewIncrementalDownload',
+    },
+    {
+        'cid': '{5d6352a3-b9c3-4fa3-87aa-b2a3c6e5a501}',
+        'contract_ids': ['@mozilla.org/network/incremental-stream-loader;1'],
+        'legacy_constructor': 'nsIncrementalStreamLoader::Create',
+        'headers': ['/netwerk/base/nsIncrementalStreamLoader.h'],
+    },
+    {
+        'cid': '{6ddb050c-0d04-11d4-986e-00c04fa0cf4a}',
+        'contract_ids': ['@mozilla.org/network/input-stream-channel;1'],
+        'type': 'mozilla::net::nsInputStreamChannel',
+        'headers': ['/netwerk/base/nsInputStreamChannel.h'],
+        'init_method': 'Init',
+    },
+    {
+        'cid': '{ccd0e960-7947-4635-b70e-4c661b63d675}',
+        'contract_ids': ['@mozilla.org/network/input-stream-pump;1'],
+        'type': 'nsInputStreamPump',
+        'headers': ['nsInputStreamPump.h'],
+    },
+    {
+        'cid': '{9ac9e770-18bc-11d3-9337-00104ba0fd40}',
+        'contract_ids': [
+            '@mozilla.org/network/io-service;1',
+            '@mozilla.org/network/util;1',
+        ],
+        'singleton': True,
+        'type': 'mozilla::net::nsIOService',
+        'headers': ['/netwerk/base/nsIOService.h'],
+        'constructor': 'mozilla::net::nsIOService::GetInstance',
+        'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
+    },
+    {
+        'cid': '{e1c61582-2a84-11d3-8cce-0060b0fc14a3}',
+        'contract_ids': ['@mozilla.org/network/load-group;1'],
+        'legacy_constructor': 'nsLoadGroupConstructor',
+    },
+    {
+        'cid': '{1f4dbcf7-245c-4c8c-943d-8a1da0495e8a}',
+        'contract_ids': ['@mozilla.org/network/mime-hdrparam;1'],
+        'type': 'nsMIMEHeaderParamImpl',
+        'headers': ['/netwerk/mime/nsMIMEHeaderParamImpl.h'],
+    },
+    {
+        'cid': '{58a1c31c-1dd2-11b2-a3f6-d36949d48268}',
+        'contract_ids': ['@mozilla.org/network/mime-input-stream;1'],
+        'legacy_constructor': 'nsMIMEInputStreamConstructor',
+        'headers': ['nsMIMEInputStream.h'],
+    },
+    {
+        'cid': '{2693457e-3ba5-4455-991f-5350946adb12}',
+        'contract_ids': ['@mozilla.org/network/network-connectivity-service;1'],
+        'singleton': True,
+        'type': 'nsINetworkConnectivityService',
+        'constructor': 'mozilla::net::NetworkConnectivityService::GetSingleton',
+        'headers': ['mozilla/net/NetworkConnectivityService.h'],
+    },
+    {
+        'cid': '{969adfdf-7221-4419-aecf-05f8faf00c9b}',
+        'contract_ids': ['@mozilla.org/network/predictor;1'],
+        'singleton': True,
+        'legacy_constructor': 'mozilla::net::Predictor::Create',
+        'headers': ['mozilla/net/Predictor.h'],
+    },
+    {
+        'cid': '{e9b301c0-e0e4-11d3-a1a8-0050041caf44}',
+        'contract_ids': ['@mozilla.org/network/protocol-proxy-service;1'],
+        'singleton': True,
+        'type': 'mozilla::net::nsProtocolProxyService',
+        'headers': ['/netwerk/base/nsProtocolProxyService.h'],
+        'init_method': 'Init',
+    },
+    {
+        'cid': '{3decd6c8-30ef-11d3-8cd0-0060b0fc14a3}',
+        'contract_ids': ['@mozilla.org/network/protocol/about;1?what=blank'],
+        'legacy_constructor': 'nsAboutBlank::Create',
+        'headers': ['/netwerk/protocol/about/nsAboutBlank.h'],
+    },
+    {
+        'cid': '{9158c470-86e4-11d4-9be2-00e09872a416}',
+        'contract_ids': ['@mozilla.org/network/protocol/about;1?what=cache'],
+        'legacy_constructor': 'nsAboutCache::Create',
+        'headers': ['/netwerk/protocol/about/nsAboutCache.h'],
+    },
+    {
+        'cid': '{7fa5237d-b0eb-438f-9e50-ca0166e63788}',
+        'contract_ids': ['@mozilla.org/network/protocol/about;1?what=cache-entry'],
+        'type': 'nsAboutCacheEntry',
+        'headers': ['/netwerk/protocol/about/nsAboutCacheEntry.h'],
+    },
+    {
+        'cid': '{9e3b6c90-2f75-11d3-8cd0-0060b0fc14a3}',
+        'contract_ids': ['@mozilla.org/network/protocol;1?name=about'],
+        'singleton': True,
+        'type': 'mozilla::net::nsAboutProtocolHandler',
+        'headers': ['/netwerk/protocol/about/nsAboutProtocolHandler.h'],
+    },
+    {
+        'cid': '{b6ed3030-6183-11d3-a178-0050041caf44}',
+        'contract_ids': ['@mozilla.org/network/protocol;1?name=data'],
+        'singleton': True,
+        'legacy_constructor': 'nsDataHandler::Create',
+        'headers': ['/netwerk/protocol/data/nsDataHandler.h'],
+    },
+    {
+        'cid': '{fbc81170-1f69-11d3-9344-00104ba0fd40}',
+        'contract_ids': ['@mozilla.org/network/protocol;1?name=file'],
+        'singleton': True,
+        'type': 'nsFileProtocolHandler',
+        'headers': ['mozilla/net/nsFileProtocolHandler.h'],
+        'init_method': 'Init',
+    },
+    {
+        'cid': '{25029490-f132-11d2-9588-00805f369f95}',
+        'contract_ids': ['@mozilla.org/network/protocol;1?name=ftp'],
+        'singleton': True,
+        'type': 'nsFtpProtocolHandler',
+        'headers': ['/netwerk/protocol/ftp/nsFtpProtocolHandler.h'],
+        'init_method': 'Init',
+    },
+    {
+        'cid': '{4f47e42e-4d23-4dd3-bfda-eb29255e9ea3}',
+        'contract_ids': ['@mozilla.org/network/protocol;1?name=http'],
+        'singleton': True,
+        'type': 'mozilla::net::nsHttpHandler',
+    },
+    {
+        'cid': '{dccbe7e4-7750-466b-a557-5ea36c8ff24e}',
+        'contract_ids': ['@mozilla.org/network/protocol;1?name=https'],
+        'singleton': True,
+        'type': 'mozilla::net::nsHttpsHandler',
+    },
+    {
+        'cid': '{aea16cd0-f020-4138-b068-0716c4a15b5a}',
+        'contract_ids': ['@mozilla.org/network/protocol;1?name=moz-extension'],
+        'singleton': True,
+        'type': 'mozilla::net::ExtensionProtocolHandler',
+        'headers': ['mozilla/net/ExtensionProtocolHandler.h'],
+        'constructor': 'mozilla::net::ExtensionProtocolHandler::GetSingleton',
+    },
+    {
+        'cid': '{1423e739-782c-4081-b5d8-fe6fba68c0ef}',
+        'contract_ids': ['@mozilla.org/network/protocol;1?name=moz-safe-about'],
+        'singleton': True,
+        'type': 'mozilla::net::nsSafeAboutProtocolHandler',
+        'headers': ['/netwerk/protocol/about/nsAboutProtocolHandler.h'],
+    },
+    {
+        'cid': '{e64f152a-9f07-11d3-8cda-0060b0fc14a3}',
+        'contract_ids': ['@mozilla.org/network/protocol;1?name=resource'],
+        'singleton': True,
+        'type': 'nsResProtocolHandler',
+        'headers': ['/netwerk/protocol/res/nsResProtocolHandler.h'],
+        'init_method': 'Init',
+    },
+    {
+        'cid': '{9c7ec5d1-23f9-11d5-aea8-8fcc0793e97f}',
+        'contract_ids': ['@mozilla.org/network/protocol;1?name=view-source'],
+        'singleton': True,
+        'type': 'mozilla::net::nsViewSourceHandler',
+        'headers': ['/netwerk/protocol/viewsource/nsViewSourceHandler.h'],
+    },
+    {
+        'cid': '{dc01db59-a513-4c90-824b-085cce06c0aa}',
+        'contract_ids': ['@mozilla.org/network/protocol;1?name=ws'],
+        'singleton': True,
+        'legacy_constructor': 'mozilla::net::WebSocketChannelConstructor',
+    },
+    {
+        'cid': '{dc01dbbb-a5bb-4cbb-82bb-085cce06c0bb}',
+        'contract_ids': ['@mozilla.org/network/protocol;1?name=wss'],
+        'singleton': True,
+        'legacy_constructor': 'mozilla::net::WebSocketSSLChannelConstructor',
+    },
+    {
+        'cid': '{e7509b46-2eb2-410a-9d7c-c3ce73284d01}',
+        'contract_ids': ['@mozilla.org/network/protocol;1?name=wyciwyg'],
+        'singleton': True,
+        'type': 'nsWyciwygProtocolHandler',
+        'headers': ['/netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.h'],
+    },
+    {
+        'cid': '{a181af0d-68b8-4308-94db-d4f859058215}',
+        'contract_ids': ['@mozilla.org/network/safe-file-output-stream;1'],
+        'type': 'nsAtomicFileOutputStream',
+        'headers': ['nsFileStreams.h'],
+    },
+    {
+        'cid': '{d6ef593d-a429-4b14-a887-d9e2f765d9ed}',
+        'contract_ids': ['@mozilla.org/network/serialization-helper;1'],
+        'type': 'nsSerializationHelper',
+        'headers': ['nsSerializationHelper.h'],
+    },
+    {
+        'cid': '{2ec62893-3b35-48fa-ab1d-5e68a9f45f08}',
+        'contract_ids': ['@mozilla.org/network/server-socket;1'],
+        'type': 'mozilla::net::nsServerSocket',
+        'headers': ['/netwerk/base/nsServerSocket.h'],
+    },
+    {
+        'cid': '{fb8cbf4e-4701-4ba1-b1d6-5388e041fb67}',
+        'contract_ids': ['@mozilla.org/network/simple-stream-listener;1'],
+        'type': 'mozilla::net::nsSimpleStreamListener',
+        'headers': ['/netwerk/base/nsSimpleStreamListener.h'],
+    },
+    {
+        'cid': '{2be14592-28d4-4a83-8fe9-08e778849f6e}',
+        'contract_ids': ['@mozilla.org/network/simple-uri-mutator;1'],
+        'type': 'mozilla::net::nsSimpleURI::Mutator',
+        'headers': ['nsSimpleURI.h'],
+        'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
+    },
+    {
+        'cid': '{ad56b25f-e6bb-4db3-9f7b-5b7db33fd2b1}',
+        'contract_ids': ['@mozilla.org/network/socket-transport-service;1'],
+        'singleton': True,
+        'type': 'mozilla::net::nsSocketTransportService',
+        'headers': ['/netwerk/base/nsSocketTransportService2.h'],
+        'init_method': 'Init',
+        'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
+    },
+    {
+        'cid': '{ce7d7da0-fb28-44a3-8c7b-000c165918f4}',
+        'contract_ids': ['@mozilla.org/network/standard-url-mutator;1'],
+        'type': 'mozilla::net::nsStandardURL::Mutator',
+        'headers': ['/netwerk/base/nsStandardURL.h'],
+        'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
+    },
+    {
+        'cid': '{831f8f13-7aa8-485f-b02e-77c881cc5773}',
+        'contract_ids': ['@mozilla.org/network/stream-listener-tee;1'],
+        'type': 'mozilla::net::nsStreamListenerTee',
+        'headers': ['/netwerk/base/nsStreamListenerTee.h'],
+    },
+    {
+        'cid': '{5ba6d920-d4e9-11d3-a1a5-0050041caf44}',
+        'contract_ids': ['@mozilla.org/network/stream-loader;1'],
+        'legacy_constructor': 'mozilla::net::nsStreamLoader::Create',
+        'headers': ['/netwerk/base/nsStreamLoader.h'],
+    },
+    {
+        'cid': '{0885d4f8-f7b8-4cda-902e-94ba38bc256e}',
+        'contract_ids': ['@mozilla.org/network/stream-transport-service;1'],
+        'type': 'mozilla::net::nsStreamTransportService',
+        'headers': ['/netwerk/base/nsStreamTransportService.h'],
+        'init_method': 'Init',
+    },
+    {
+        'cid': '{4c39159c-cd90-4dd3-97a7-06af5e6d84c4}',
+        'contract_ids': ['@mozilla.org/network/throttlequeue;1'],
+        'type': 'mozilla::net::ThrottleQueue',
+        'headers': ['/netwerk/base/ThrottleQueue.h'],
+    },
+    {
+        'cid': '{1813cbb4-c98e-4622-8c7d-839167f3f272}',
+        'contract_ids': ['@mozilla.org/network/tls-server-socket;1'],
+        'type': 'mozilla::net::TLSServerSocket',
+        'headers': ['/netwerk/base/TLSServerSocket.h'],
+    },
+    {
+        'cid': '{c9f74572-7b8e-4fec-bb4a-03c0d3021bd6}',
+        'contract_ids': ['@mozilla.org/network/udp-socket;1'],
+        'type': 'mozilla::net::nsUDPSocket',
+        'headers': ['/netwerk/base/nsUDPSocket.h'],
+    },
+    {
+        'cid': '{ff41913b-546a-4bff-9201-dc9b2c032eba}',
+        'contract_ids': ['@mozilla.org/network/url-parser;1?auth=maybe'],
+        'type': 'nsStdURLParser',
+        'headers': ['nsURLParsers.h'],
+        'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
+    },
+    {
+        'cid': '{78804a84-8173-42b6-bb94-789f0816a810}',
+        'contract_ids': ['@mozilla.org/network/url-parser;1?auth=no'],
+        'type': 'nsNoAuthURLParser',
+        'headers': ['nsURLParsers.h'],
+        'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
+    },
+    {
+        'cid': '{275d800e-3f60-4896-adb7-d7f390ce0e42}',
+        'contract_ids': ['@mozilla.org/network/url-parser;1?auth=yes'],
+        'type': 'nsAuthURLParser',
+        'headers': ['nsURLParsers.h'],
+        'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
+    },
+    {
+        'cid': '{892ffeb0-3f80-11d3-a16c-0050041caf44}',
+        'contract_ids': ['@mozilla.org/streamConverters;1'],
+        'legacy_constructor': 'CreateNewStreamConvServiceFactory',
+    },
+    {
+        'cid': '{cf0f71fd-fafd-4e2b-9fdc-134d972e16e2}',
+        'contract_ids': ['@mozilla.org/streamconv;1?from=application/http-index-format&to=text/html'],
+        'legacy_constructor': 'nsIndexedToHTML::Create',
+        'headers': ['/netwerk/streamconv/converters/nsIndexedToHTML.h'],
+    },
+    {
+        'cid': '{7d7008a0-c49a-11d3-9b22-0080c7cb1080}',
+        'contract_ids': ['@mozilla.org/streamconv;1?from=application/x-unknown-content-type&to=*/*'],
+        'legacy_constructor': 'CreateNewUnknownDecoderFactory',
+    },
+    {
+        'cid': '{66230b2b-17fa-4bd3-abf4-07986151022d}',
+        'contract_ids': [
+            '@mozilla.org/streamconv;1?from=br&to=uncompressed',
+            '@mozilla.org/streamconv;1?from=compress&to=uncompressed',
+            '@mozilla.org/streamconv;1?from=deflate&to=uncompressed',
+            '@mozilla.org/streamconv;1?from=gzip&to=uncompressed',
+            '@mozilla.org/streamconv;1?from=x-compress&to=uncompressed',
+            '@mozilla.org/streamconv;1?from=x-gzip&to=uncompressed',
+        ],
+        'legacy_constructor': 'CreateNewHTTPCompressConvFactory',
+    },
+    {
+        'cid': '{7584ce90-5b25-11d3-a175-0050041caf44}',
+        'contract_ids': [
+            '@mozilla.org/streamconv;1?from=multipart/byteranges&to=*/*',
+            '@mozilla.org/streamconv;1?from=multipart/mixed&to=*/*',
+            '@mozilla.org/streamconv;1?from=multipart/x-mixed-replace&to=*/*',
+        ],
+        'legacy_constructor': 'CreateNewMultiMixedConvFactory',
+    },
+    {
+        'cid': '{14c0e880-623e-11d3-a178-0050041caf44}',
+        'contract_ids': ['@mozilla.org/streamconv;1?from=text/ftp-dir&to=application/http-index-format'],
+        'legacy_constructor': 'CreateNewFTPDirListingConv',
+    },
+    {
+        'cid': '{77c0e42a-1dd2-11b2-8ebf-edc6606f2f4b}',
+        'contract_ids': ['@mozilla.org/txttohtmlconv;1'],
+        'legacy_constructor': 'CreateNewTXTToHTMLConvFactory',
+    },
+    {
+        'cid': '{2f277c00-0eaf-4ddb-b936-41326ba48aae}',
+        'contract_ids': [],
+        'type': 'mozilla::net::nsNestedAboutURI::Mutator',
+        'headers': ['/netwerk/protocol/about/nsAboutProtocolHandler.h'],
+    },
+    {
+        'cid': '{56388dad-287b-4240-a785-85c394012503}',
+        'contract_ids': [],
+        'type': 'mozilla::net::nsSimpleNestedURI::Mutator',
+        'headers': ['nsSimpleNestedURI.h'],
+    },
+    {
+        'cid': '{9c4e9d49-ce64-4ca3-acef-3075c5e5aba7}',
+        'contract_ids': [],
+        'type': 'mozilla::net::nsSimpleNestedURI::Mutator',
+        'headers': ['nsSimpleNestedURI.h'],
+    },
+    {
+        'cid': '{b0054ef3-b096-483d-8242-4ee36b7b2115}',
+        'contract_ids': [],
+        'type': 'mozilla::net::nsNestedAboutURI::Mutator',
+        'headers': ['/netwerk/protocol/about/nsAboutProtocolHandler.h'],
+    },
+    {
+        'cid': '{b3cfeb91-332a-46c9-ad97-93ff39841494}',
+        'contract_ids': [],
+        'type': 'mozilla::net::SubstitutingURL::Mutator',
+        'headers': ['mozilla/net/SubstitutingURL.h'],
+    },
+    {
+        'cid': '{de9472d0-8034-11d3-9399-00104ba0fd40}',
+        'contract_ids': [],
+        'type': 'mozilla::net::nsStandardURL::Mutator',
+        'headers': ['/netwerk/base/nsStandardURL.h'],
+        'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
+    },
+    {
+        'cid': '{dea9657c-18cf-4984-bde9-ccef5d8ab473}',
+        'contract_ids': [],
+        'type': 'mozilla::net::SubstitutingURL::Mutator',
+        'headers': ['mozilla/net/SubstitutingURL.h'],
+    },
+    {
+        'cid': '{e0da1d70-2f7b-11d3-8cd0-0060b0fc14a3}',
+        'contract_ids': [],
+        'type': 'mozilla::net::nsSimpleURI::Mutator',
+        'headers': ['nsSimpleURI.h'],
+        'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
+    },
+]
+
+if defined('NECKO_COOKIES'):
+    Classes += [
+        {
+            'cid': '{c375fa80-150f-11d6-a618-0010a401eb10}',
+            'contract_ids': [
+                '@mozilla.org/cookieService;1',
+                '@mozilla.org/cookiemanager;1',
+            ],
+            'singleton': True,
+            'type': 'nsICookieService',
+            'constructor': 'nsCookieService::GetXPCOMSingleton',
+            'headers': ['/netwerk/cookie/nsCookieService.h'],
+        },
+    ]
+
+if defined('NECKO_WIFI'):
+    Classes += [
+        {
+            'cid': '{3ff8fb9f-ee63-48df-89f0-dace0242fd82}',
+            'contract_ids': ['@mozilla.org/wifi/monitor;1'],
+            'singleton': True,
+            'type': 'nsWifiMonitor',
+            'headers': ['/netwerk/wifi/nsWifiMonitor.h'],
+        },
+    ]
+
+if buildconfig.substs['OS_ARCH'] in ('WINNT', 'Darwin', 'Linux'):
+    Classes += [
+        {
+            'cid': '{296d0900-f8ef-4df0-9c35-db5862abc58d}',
+            'contract_ids': ['@mozilla.org/network-info-service;1'],
+            'type': 'mozilla::net::nsNetworkInfoService',
+            'headers': ['/netwerk/base/nsNetworkInfoService.h'],
+            'init_method': 'Init',
+        },
+    ]
+
+
+toolkit = buildconfig.substs['MOZ_WIDGET_TOOLKIT']
+link_service = None
+if toolkit == 'windows':
+    link_service = {
+        'type': 'nsNotifyAddrListener',
+        'headers': ['/netwerk/system/win32/nsNotifyAddrListener.h'],
+        'init_method': 'Init',
+    }
+elif toolkit == 'cocoa':
+    link_service = {
+        'type': 'nsNetworkLinkService',
+        'headers': ['/netwerk/system/mac/nsNetworkLinkService.h'],
+        'init_method': 'Init',
+    }
+elif toolkit == 'android':
+    link_service = {
+        'type': 'nsAndroidNetworkLinkService',
+        'headers': ['/netwerk/system/android/nsAndroidNetworkLinkService.h'],
+    }
+elif buildconfig.substs['OS_ARCH'] == 'Linux':
+    link_service = {
+        'type': 'nsNotifyAddrListener',
+        'headers': ['/netwerk/system/linux/nsNotifyAddrListener_Linux.h'],
+        'init_method': 'Init',
+    }
+
+if link_service:
+    Classes += [
+        dict({
+            'cid': '{75a500a2-0030-40f7-86f8-63f225b940ae}',
+            'contract_ids': ['@mozilla.org/network/network-link-service;1'],
+            'singleton': True,
+        }, **link_service)
+    ]
--- a/netwerk/build/moz.build
+++ b/netwerk/build/moz.build
@@ -7,16 +7,20 @@
 EXPORTS += [
     'nsNetCID.h',
 ]
 
 SOURCES += [
     'nsNetModule.cpp',
 ]
 
+XPCOM_MANIFESTS += [
+    'components.conf',
+]
+
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/extensions/auth',
     '/netwerk/base',
     '/netwerk/cache',
@@ -36,42 +40,13 @@ LOCAL_INCLUDES += [
     '/netwerk/streamconv/converters',
 ]
 
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     LOCAL_INCLUDES += [
         '/netwerk/protocol/gio',
     ]
 
-if CONFIG['OS_ARCH'] == 'WINNT':
-    LOCAL_INCLUDES += [
-        '/netwerk/system/win32',
-    ]
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
-    LOCAL_INCLUDES += [
-        '/netwerk/system/mac',
-    ]
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
-    LOCAL_INCLUDES += [
-        '/netwerk/system/android',
-    ]
-
-elif CONFIG['OS_ARCH'] == 'Linux':
-    LOCAL_INCLUDES += [
-        '/netwerk/system/linux',
-    ]
-
-if CONFIG['NECKO_COOKIES']:
-    LOCAL_INCLUDES += [
-        '/netwerk/cookie',
-    ]
-
-if CONFIG['NECKO_WIFI']:
-    LOCAL_INCLUDES += [
-        '/netwerk/wifi',
-    ]
 
 LOCAL_INCLUDES += [
     '!/netwerk/dns',
     '/modules/brotli/dec',
 ]
--- a/netwerk/build/nsNetModule.cpp
+++ b/netwerk/build/nsNetModule.cpp
@@ -6,377 +6,142 @@
 
 #include "necko-config.h"
 
 #define ALLOW_LATE_HTTPLOG_H_INCLUDE 1
 #include "base/basictypes.h"
 
 #include "nsCOMPtr.h"
 #include "nsIClassInfoImpl.h"
+#include "mozilla/Components.h"
 #include "mozilla/ModuleUtils.h"
 #include "nsIComponentManager.h"
 #include "nsIServiceManager.h"
 #include "nsICategoryManager.h"
 #include "nscore.h"
 #include "nsSimpleURI.h"
-#include "nsSimpleNestedURI.h"
 #include "nsLoadGroup.h"
-#include "nsStreamLoader.h"
-#include "nsIncrementalStreamLoader.h"
-#include "nsFileStreams.h"
-#include "nsBufferedStreams.h"
-#include "nsMIMEInputStream.h"
-#include "nsSOCKSSocketProvider.h"
-#include "nsCacheService.h"
-#include "nsDiskCacheDeviceSQL.h"
-#include "nsApplicationCacheService.h"
 #include "nsMimeTypes.h"
 #include "nsDNSPrefetch.h"
-#include "nsAboutProtocolHandler.h"
 #include "nsXULAppAPI.h"
 #include "nsCategoryCache.h"
 #include "nsIContentSniffer.h"
-#include "Predictor.h"
+#include "nsStandardURL.h"
 #include "nsIThreadPool.h"
 #include "mozilla/net/BackgroundChannelRegistrar.h"
 #include "mozilla/net/NeckoChild.h"
 #include "RedirectChannelRegistrar.h"
 #include "nsAuthGSSAPI.h"
 
 #include "nsNetCID.h"
 
 #if defined(XP_MACOSX) || defined(XP_WIN) || defined(XP_LINUX)
 #  define BUILD_NETWORK_INFO_SERVICE 1
 #endif
 
+using namespace mozilla;
+
 typedef nsCategoryCache<nsIContentSniffer> ContentSnifferCache;
 ContentSnifferCache* gNetSniffers = nullptr;
 ContentSnifferCache* gDataSniffers = nullptr;
 
-///////////////////////////////////////////////////////////////////////////////
-
-#include "nsIOService.h"
-typedef mozilla::net::nsIOService nsIOService;
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIOService, nsIOService::GetInstance)
-
-#include "nsDNSService2.h"
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIDNSService,
-                                         nsDNSService::GetXPCOMSingleton)
-
-#include "nsProtocolProxyService.h"
-typedef mozilla::net::nsProtocolProxyService nsProtocolProxyService;
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsProtocolProxyService, Init)
-
-#include "nsStreamTransportService.h"
-typedef mozilla::net::nsStreamTransportService nsStreamTransportService;
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStreamTransportService, Init)
-
-#include "nsSocketTransportService2.h"
-typedef mozilla::net::nsSocketTransportService nsSocketTransportService;
-#undef LOG
-#undef LOG_ENABLED
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSocketTransportService, Init)
-
-#include "nsServerSocket.h"
-typedef mozilla::net::nsServerSocket nsServerSocket;
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsServerSocket)
-
-#include "TLSServerSocket.h"
-typedef mozilla::net::TLSServerSocket TLSServerSocket;
-NS_GENERIC_FACTORY_CONSTRUCTOR(TLSServerSocket)
-
-#include "nsUDPSocket.h"
-typedef mozilla::net::nsUDPSocket nsUDPSocket;
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsUDPSocket)
-
-#include "nsAsyncStreamCopier.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsAsyncStreamCopier)
-
-#include "nsInputStreamPump.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsInputStreamPump)
-
-#include "nsInputStreamChannel.h"
-typedef mozilla::net::nsInputStreamChannel nsInputStreamChannel;
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsInputStreamChannel, Init)
-
-#include "nsDownloader.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsDownloader)
-
-#include "BackgroundFileSaver.h"
-namespace mozilla {
-namespace net {
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(BackgroundFileSaverOutputStream, Init)
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(BackgroundFileSaverStreamListener, Init)
-}  // namespace net
-}  // namespace mozilla
-
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsAtomicFileOutputStream)
-
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsSafeFileOutputStream)
-
+#define static
 typedef mozilla::net::nsLoadGroup nsLoadGroup;
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsLoadGroup, Init)
-
-#include "ArrayBufferInputStream.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR(ArrayBufferInputStream)
-
-#include "nsEffectiveTLDService.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsEffectiveTLDService, Init)
-
-#include "nsSerializationHelper.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsSerializationHelper)
-
-#include "CacheStorageService.h"
-typedef mozilla::net::CacheStorageService CacheStorageService;
-NS_GENERIC_FACTORY_CONSTRUCTOR(CacheStorageService)
-
-#include "LoadContextInfo.h"
-typedef mozilla::net::LoadContextInfoFactory LoadContextInfoFactory;
-NS_GENERIC_FACTORY_CONSTRUCTOR(LoadContextInfoFactory)
-
-///////////////////////////////////////////////////////////////////////////////
-
-#include "mozilla/net/CaptivePortalService.h"
-namespace mozilla {
-namespace net {
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsICaptivePortalService,
-                                         CaptivePortalService::GetSingleton)
-}  // namespace net
-}  // namespace mozilla
-
-#include "mozilla/net/NetworkConnectivityService.h"
-namespace mozilla {
-namespace net {
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(
-    nsINetworkConnectivityService, NetworkConnectivityService::GetSingleton)
-}  // namespace net
-}  // namespace mozilla
-
-///////////////////////////////////////////////////////////////////////////////
-
-extern nsresult net_NewIncrementalDownload(nsISupports*, const nsIID&, void**);
-
-#define NS_INCREMENTALDOWNLOAD_CID                   \
-  { /* a62af1ba-79b3-4896-8aaf-b148bfce4280 */       \
-    0xa62af1ba, 0x79b3, 0x4896, {                    \
-      0x8a, 0xaf, 0xb1, 0x48, 0xbf, 0xce, 0x42, 0x80 \
-    }                                                \
-  }
-
-///////////////////////////////////////////////////////////////////////////////
-
-#include "nsMIMEHeaderParamImpl.h"
-
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsMIMEHeaderParamImpl)
-///////////////////////////////////////////////////////////////////////////////
-
-#include "nsSimpleStreamListener.h"
-
-typedef mozilla::net::nsSimpleStreamListener nsSimpleStreamListener;
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsSimpleStreamListener)
-
-///////////////////////////////////////////////////////////////////////////////
-
-#include "nsStreamListenerTee.h"
-typedef mozilla::net::nsStreamListenerTee nsStreamListenerTee;
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsStreamListenerTee)
-
-///////////////////////////////////////////////////////////////////////////////
-
-#ifdef NECKO_COOKIES
-#  include "nsCookieService.h"
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsICookieService,
-                                         nsCookieService::GetXPCOMSingleton)
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-#ifdef NECKO_WIFI
-
-#  include "nsWifiMonitor.h"
-#  undef LOG
-#  undef LOG_ENABLED
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsWifiMonitor)
-
-#endif
+#undef static
 
 ///////////////////////////////////////////////////////////////////////////////
 // protocols
 ///////////////////////////////////////////////////////////////////////////////
 
-// about:blank is mandatory
-#include "nsAboutProtocolHandler.h"
-#include "nsAboutBlank.h"
-typedef mozilla::net::nsAboutProtocolHandler nsAboutProtocolHandler;
-typedef mozilla::net::nsSafeAboutProtocolHandler nsSafeAboutProtocolHandler;
-typedef mozilla::net::nsNestedAboutURI::Mutator nsNestedAboutURIMutator;
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsAboutProtocolHandler)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsSafeAboutProtocolHandler)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsNestedAboutURIMutator)
-
-// about
-#include "nsAboutCache.h"
-#include "nsAboutCacheEntry.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsAboutCacheEntry)
-
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsApplicationCacheService)
-
-// file
-#include "nsFileProtocolHandler.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsFileProtocolHandler, Init)
-
-// ftp
-#include "nsFtpProtocolHandler.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsFtpProtocolHandler, Init)
-
 // http/https
 #include "nsHttpHandler.h"
 #include "Http2Compression.h"
 #undef LOG
 #undef LOG_ENABLED
 #include "nsHttpAuthManager.h"
 #include "nsHttpActivityDistributor.h"
 #include "ThrottleQueue.h"
 #undef LOG
 #undef LOG_ENABLED
-namespace mozilla {
-namespace net {
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsHttpHandler,
-                                         nsHttpHandler::GetInstance)
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHttpsHandler, Init)
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHttpAuthManager, Init)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpActivityDistributor)
-NS_GENERIC_FACTORY_CONSTRUCTOR(ThrottleQueue)
-}  // namespace net
-}  // namespace mozilla
 
-#include "mozilla/net/Dashboard.h"
-namespace mozilla {
-namespace net {
-NS_GENERIC_FACTORY_CONSTRUCTOR(Dashboard)
-}  // namespace net
-}  // namespace mozilla
+NS_IMPL_COMPONENT_FACTORY(net::nsHttpHandler) {
+  return net::nsHttpHandler::GetInstance().downcast<nsIHttpProtocolHandler>();
+}
+
+NS_IMPL_COMPONENT_FACTORY(net::nsHttpsHandler) {
+  auto handler = MakeRefPtr<net::nsHttpsHandler>();
 
-// resource
-#include "nsResProtocolHandler.h"
-#include "ExtensionProtocolHandler.h"
-#include "SubstitutingProtocolHandler.h"
-typedef mozilla::net::ExtensionProtocolHandler ExtensionProtocolHandler;
-typedef mozilla::net::SubstitutingURL::Mutator SubstitutingURLMutator;
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsResProtocolHandler, Init)
+  if (NS_FAILED(handler->Init())) {
+    return nullptr;
+  }
+  return handler.forget().downcast<nsIHttpProtocolHandler>();
+}
+
 
-namespace mozilla {
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ExtensionProtocolHandler,
-                                         ExtensionProtocolHandler::GetSingleton)
-NS_GENERIC_FACTORY_CONSTRUCTOR(SubstitutingURLMutator)
-}  // namespace mozilla
+#include "nsCacheService.h"
 
-#include "nsViewSourceHandler.h"
-typedef mozilla::net::nsViewSourceHandler nsViewSourceHandler;
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsViewSourceHandler)
-
-#include "nsDataHandler.h"
-
-#include "nsWyciwygProtocolHandler.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsWyciwygProtocolHandler)
+nsresult nsCacheServiceConstructor(nsISupports* aOuter, const nsIID& aIID,
+                                   void** aResult) {
+  return nsCacheService::Create(aOuter, aIID, aResult);
+}
 
 #include "WebSocketChannel.h"
 #include "WebSocketChannelChild.h"
 namespace mozilla {
 namespace net {
 static BaseWebSocketChannel* WebSocketChannelConstructor(bool aSecure) {
   if (IsNeckoChild()) {
     return new WebSocketChannelChild(aSecure);
   }
 
   if (aSecure) {
     return new WebSocketSSLChannel;
   }
   return new WebSocketChannel;
 }
 
-#define WEB_SOCKET_HANDLER_CONSTRUCTOR(type, secure)                    \
-  static nsresult type##Constructor(nsISupports* aOuter, REFNSIID aIID, \
-                                    void** aResult) {                   \
-    nsresult rv;                                                        \
-                                                                        \
-    BaseWebSocketChannel* inst;                                         \
-                                                                        \
-    *aResult = nullptr;                                                 \
-    if (nullptr != aOuter) {                                            \
-      rv = NS_ERROR_NO_AGGREGATION;                                     \
-      return rv;                                                        \
-    }                                                                   \
-    inst = WebSocketChannelConstructor(secure);                         \
-    NS_ADDREF(inst);                                                    \
-    rv = inst->QueryInterface(aIID, aResult);                           \
-    NS_RELEASE(inst);                                                   \
-    return rv;                                                          \
+#define WEB_SOCKET_HANDLER_CONSTRUCTOR(type, secure)             \
+  nsresult type##Constructor(nsISupports* aOuter, REFNSIID aIID, \
+                             void** aResult) {                   \
+    nsresult rv;                                                 \
+                                                                 \
+    BaseWebSocketChannel* inst;                                  \
+                                                                 \
+    *aResult = nullptr;                                          \
+    if (nullptr != aOuter) {                                     \
+      rv = NS_ERROR_NO_AGGREGATION;                              \
+      return rv;                                                 \
+    }                                                            \
+    inst = WebSocketChannelConstructor(secure);                  \
+    NS_ADDREF(inst);                                             \
+    rv = inst->QueryInterface(aIID, aResult);                    \
+    NS_RELEASE(inst);                                            \
+    return rv;                                                   \
   }
 
 WEB_SOCKET_HANDLER_CONSTRUCTOR(WebSocketChannel, false)
 WEB_SOCKET_HANDLER_CONSTRUCTOR(WebSocketSSLChannel, true)
 #undef WEB_SOCKET_HANDLER_CONSTRUCTOR
 }  // namespace net
 }  // namespace mozilla
 
 ///////////////////////////////////////////////////////////////////////////////
 
-#include "nsURLParsers.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsNoAuthURLParser)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsAuthURLParser)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsStdURLParser)
-
-#include "nsStandardURL.h"
-typedef mozilla::net::nsStandardURL::Mutator nsStandardURLMutator;
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsStandardURLMutator)
-typedef mozilla::net::nsSimpleURI::Mutator nsSimpleURIMutator;
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsSimpleURIMutator)
-
-typedef mozilla::net::nsSimpleNestedURI::Mutator nsSimpleNestedURIMutator;
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsSimpleNestedURIMutator)
-
-///////////////////////////////////////////////////////////////////////////////
-
-#include "nsIDNService.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsIDNService, Init)
-
-///////////////////////////////////////////////////////////////////////////////
-#if defined(XP_WIN)
-#  include "nsNotifyAddrListener.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNotifyAddrListener, Init)
-#elif defined(MOZ_WIDGET_COCOA)
-#  include "nsNetworkLinkService.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNetworkLinkService, Init)
-#elif defined(MOZ_WIDGET_ANDROID)
-#  include "nsAndroidNetworkLinkService.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsAndroidNetworkLinkService)
-#elif defined(XP_LINUX)
-#  include "nsNotifyAddrListener_Linux.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNotifyAddrListener, Init)
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-
 #include "nsFTPDirListingConv.h"
 nsresult NS_NewFTPDirListingConv(nsFTPDirListingConv** result);
 
 #include "nsStreamConverterService.h"
 #include "nsMultiMixedConv.h"
 #include "nsHTTPCompressConv.h"
 #include "mozTXTToHTMLConv.h"
 #include "nsUnknownDecoder.h"
 
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef BUILD_NETWORK_INFO_SERVICE
-#  include "nsNetworkInfoService.h"
-typedef mozilla::net::nsNetworkInfoService nsNetworkInfoService;
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNetworkInfoService, Init)
-#endif  // BUILD_NETWORK_INFO_SERVICE
-
 #include "nsIndexedToHTML.h"
 
 nsresult NS_NewMultiMixedConv(nsMultiMixedConv** result);
 nsresult MOZ_NewTXTToHTMLConv(mozTXTToHTMLConv** result);
 nsresult NS_NewHTTPCompressConv(mozilla::net::nsHTTPCompressConv** result);
 nsresult NS_NewStreamConv(nsStreamConverterService** aStreamConv);
 
 #define FTP_TO_INDEX "?from=text/ftp-dir&to=application/http-index-format"
@@ -403,19 +168,18 @@ static const mozilla::Module::CategoryEn
     {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}};
 
-static nsresult CreateNewStreamConvServiceFactory(nsISupports* aOuter,
-                                                  REFNSIID aIID,
-                                                  void** aResult) {
+nsresult CreateNewStreamConvServiceFactory(nsISupports* aOuter, REFNSIID aIID,
+                                           void** aResult) {
   if (!aResult) {
     return NS_ERROR_INVALID_POINTER;
   }
   if (aOuter) {
     *aResult = nullptr;
     return NS_ERROR_NO_AGGREGATION;
   }
   nsStreamConverterService* inst = nullptr;
@@ -427,18 +191,18 @@ static nsresult CreateNewStreamConvServi
   rv = inst->QueryInterface(aIID, aResult);
   if (NS_FAILED(rv)) {
     *aResult = nullptr;
   }
   NS_RELEASE(inst); /* get rid of extra refcnt */
   return rv;
 }
 
-static nsresult CreateNewFTPDirListingConv(nsISupports* aOuter, REFNSIID aIID,
-                                           void** aResult) {
+nsresult CreateNewFTPDirListingConv(nsISupports* aOuter, REFNSIID aIID,
+                                    void** aResult) {
   if (!aResult) {
     return NS_ERROR_INVALID_POINTER;
   }
   if (aOuter) {
     *aResult = nullptr;
     return NS_ERROR_NO_AGGREGATION;
   }
   nsFTPDirListingConv* inst = nullptr;
@@ -450,18 +214,18 @@ static nsresult CreateNewFTPDirListingCo
   rv = inst->QueryInterface(aIID, aResult);
   if (NS_FAILED(rv)) {
     *aResult = nullptr;
   }
   NS_RELEASE(inst); /* get rid of extra refcnt */
   return rv;
 }
 
-static nsresult CreateNewMultiMixedConvFactory(nsISupports* aOuter,
-                                               REFNSIID aIID, void** aResult) {
+nsresult CreateNewMultiMixedConvFactory(nsISupports* aOuter, REFNSIID aIID,
+                                        void** aResult) {
   if (!aResult) {
     return NS_ERROR_INVALID_POINTER;
   }
   if (aOuter) {
     *aResult = nullptr;
     return NS_ERROR_NO_AGGREGATION;
   }
   nsMultiMixedConv* inst = nullptr;
@@ -473,18 +237,18 @@ static nsresult CreateNewMultiMixedConvF
   rv = inst->QueryInterface(aIID, aResult);
   if (NS_FAILED(rv)) {
     *aResult = nullptr;
   }
   NS_RELEASE(inst); /* get rid of extra refcnt */
   return rv;
 }
 
-static nsresult CreateNewTXTToHTMLConvFactory(nsISupports* aOuter,
-                                              REFNSIID aIID, void** aResult) {
+nsresult CreateNewTXTToHTMLConvFactory(nsISupports* aOuter, REFNSIID aIID,
+                                       void** aResult) {
   if (!aResult) {
     return NS_ERROR_INVALID_POINTER;
   }
   if (aOuter) {
     *aResult = nullptr;
     return NS_ERROR_NO_AGGREGATION;
   }
   mozTXTToHTMLConv* inst = nullptr;
@@ -496,19 +260,18 @@ static nsresult CreateNewTXTToHTMLConvFa
   rv = inst->QueryInterface(aIID, aResult);
   if (NS_FAILED(rv)) {
     *aResult = nullptr;
   }
   NS_RELEASE(inst); /* get rid of extra refcnt */
   return rv;
 }
 
-static nsresult CreateNewHTTPCompressConvFactory(nsISupports* aOuter,
-                                                 REFNSIID aIID,
-                                                 void** aResult) {
+nsresult CreateNewHTTPCompressConvFactory(nsISupports* aOuter, REFNSIID aIID,
+                                          void** aResult) {
   if (!aResult) {
     return NS_ERROR_INVALID_POINTER;
   }
   if (aOuter) {
     *aResult = nullptr;
     return NS_ERROR_NO_AGGREGATION;
   }
   mozilla::net::nsHTTPCompressConv* inst = nullptr;
@@ -520,18 +283,18 @@ static nsresult CreateNewHTTPCompressCon
   rv = inst->QueryInterface(aIID, aResult);
   if (NS_FAILED(rv)) {
     *aResult = nullptr;
   }
   NS_RELEASE(inst); /* get rid of extra refcnt */
   return rv;
 }
 
-static nsresult CreateNewUnknownDecoderFactory(nsISupports* aOuter,
-                                               REFNSIID aIID, void** aResult) {
+nsresult CreateNewUnknownDecoderFactory(nsISupports* aOuter, REFNSIID aIID,
+                                        void** aResult) {
   nsresult rv;
 
   if (!aResult) {
     return NS_ERROR_NULL_POINTER;
   }
   *aResult = nullptr;
 
   if (aOuter) {
@@ -546,18 +309,18 @@ static nsresult CreateNewUnknownDecoderF
   }
   NS_ADDREF(inst);
   rv = inst->QueryInterface(aIID, aResult);
   NS_RELEASE(inst);
 
   return rv;
 }
 
-static nsresult CreateNewBinaryDetectorFactory(nsISupports* aOuter,
-                                               REFNSIID aIID, void** aResult) {
+nsresult CreateNewBinaryDetectorFactory(nsISupports* aOuter, REFNSIID aIID,
+                                        void** aResult) {
   nsresult rv;
 
   if (!aResult) {
     return NS_ERROR_NULL_POINTER;
   }
   *aResult = nullptr;
 
   if (aOuter) {
@@ -574,23 +337,23 @@ static nsresult CreateNewBinaryDetectorF
 
   return rv;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 // Module implementation for the net library
 
 // Net module startup hook
-static nsresult nsNetStartup() {
+nsresult nsNetStartup() {
   mozilla::net::nsStandardURL::InitGlobalObjects();
   return NS_OK;
 }
 
 // Net module shutdown hook
-static void nsNetShutdown() {
+void nsNetShutdown() {
   // Release the url parser that the stdurl is holding.
   mozilla::net::nsStandardURL::ShutdownGlobalObjects();
 
   // Release global state used by the URL helper module.
   net_ShutdownURLHelper();
 #ifdef XP_MACOSX
   net_ShutdownURLHelperOSX();
 #endif
@@ -610,334 +373,18 @@ static void nsNetShutdown() {
   nsAuthGSSAPI::Shutdown();
 
   delete gNetSniffers;
   gNetSniffers = nullptr;
   delete gDataSniffers;
   gDataSniffers = nullptr;
 }
 
-NS_DEFINE_NAMED_CID(NS_IOSERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_STREAMTRANSPORTSERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_SOCKETTRANSPORTSERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_SERVERSOCKET_CID);
-NS_DEFINE_NAMED_CID(NS_TLSSERVERSOCKET_CID);
-NS_DEFINE_NAMED_CID(NS_UDPSOCKET_CID);
-NS_DEFINE_NAMED_CID(NS_DNSSERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_IDNSERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_EFFECTIVETLDSERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_SIMPLEURI_CID);
-NS_DEFINE_NAMED_CID(NS_SIMPLEURIMUTATOR_CID);
-NS_DEFINE_NAMED_CID(NS_SIMPLENESTEDURI_CID);
-NS_DEFINE_NAMED_CID(NS_SIMPLENESTEDURIMUTATOR_CID);
-NS_DEFINE_NAMED_CID(NS_ASYNCSTREAMCOPIER_CID);
-NS_DEFINE_NAMED_CID(NS_INPUTSTREAMPUMP_CID);
-NS_DEFINE_NAMED_CID(NS_INPUTSTREAMCHANNEL_CID);
-NS_DEFINE_NAMED_CID(NS_STREAMLOADER_CID);
-NS_DEFINE_NAMED_CID(NS_INCREMENTALSTREAMLOADER_CID);
-NS_DEFINE_NAMED_CID(NS_DOWNLOADER_CID);
-NS_DEFINE_NAMED_CID(NS_BACKGROUNDFILESAVEROUTPUTSTREAM_CID);
-NS_DEFINE_NAMED_CID(NS_BACKGROUNDFILESAVERSTREAMLISTENER_CID);
-NS_DEFINE_NAMED_CID(NS_SIMPLESTREAMLISTENER_CID);
-NS_DEFINE_NAMED_CID(NS_STREAMLISTENERTEE_CID);
-NS_DEFINE_NAMED_CID(NS_LOADGROUP_CID);
-NS_DEFINE_NAMED_CID(NS_LOCALFILEINPUTSTREAM_CID);
-NS_DEFINE_NAMED_CID(NS_LOCALFILEOUTPUTSTREAM_CID);
-NS_DEFINE_NAMED_CID(NS_ATOMICLOCALFILEOUTPUTSTREAM_CID);
-NS_DEFINE_NAMED_CID(NS_SAFELOCALFILEOUTPUTSTREAM_CID);
-NS_DEFINE_NAMED_CID(NS_INCREMENTALDOWNLOAD_CID);
-NS_DEFINE_NAMED_CID(NS_STDURLPARSER_CID);
-NS_DEFINE_NAMED_CID(NS_NOAUTHURLPARSER_CID);
-NS_DEFINE_NAMED_CID(NS_AUTHURLPARSER_CID);
-NS_DEFINE_NAMED_CID(NS_STANDARDURL_CID);
-NS_DEFINE_NAMED_CID(NS_STANDARDURLMUTATOR_CID);
-NS_DEFINE_NAMED_CID(NS_ARRAYBUFFERINPUTSTREAM_CID);
-NS_DEFINE_NAMED_CID(NS_BUFFEREDINPUTSTREAM_CID);
-NS_DEFINE_NAMED_CID(NS_BUFFEREDOUTPUTSTREAM_CID);
-NS_DEFINE_NAMED_CID(NS_MIMEINPUTSTREAM_CID);
-NS_DEFINE_NAMED_CID(NS_PROTOCOLPROXYSERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_STREAMCONVERTERSERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_DASHBOARD_CID);
-NS_DEFINE_NAMED_CID(NS_FTPDIRLISTINGCONVERTER_CID);
-NS_DEFINE_NAMED_CID(NS_NSINDEXEDTOHTMLCONVERTER_CID);
-NS_DEFINE_NAMED_CID(NS_MULTIMIXEDCONVERTER_CID);
-NS_DEFINE_NAMED_CID(NS_UNKNOWNDECODER_CID);
-NS_DEFINE_NAMED_CID(NS_BINARYDETECTOR_CID);
-NS_DEFINE_NAMED_CID(NS_HTTPCOMPRESSCONVERTER_CID);
-NS_DEFINE_NAMED_CID(MOZITXTTOHTMLCONV_CID);
-NS_DEFINE_NAMED_CID(NS_MIMEHEADERPARAM_CID);
-NS_DEFINE_NAMED_CID(NS_FILEPROTOCOLHANDLER_CID);
-NS_DEFINE_NAMED_CID(NS_HTTPPROTOCOLHANDLER_CID);
-NS_DEFINE_NAMED_CID(NS_HTTPSPROTOCOLHANDLER_CID);
-NS_DEFINE_NAMED_CID(NS_HTTPAUTHMANAGER_CID);
-NS_DEFINE_NAMED_CID(NS_HTTPACTIVITYDISTRIBUTOR_CID);
-NS_DEFINE_NAMED_CID(NS_THROTTLEQUEUE_CID);
-NS_DEFINE_NAMED_CID(NS_FTPPROTOCOLHANDLER_CID);
-NS_DEFINE_NAMED_CID(NS_RESPROTOCOLHANDLER_CID);
-NS_DEFINE_NAMED_CID(NS_EXTENSIONPROTOCOLHANDLER_CID);
-NS_DEFINE_NAMED_CID(NS_SUBSTITUTINGURL_CID);
-NS_DEFINE_NAMED_CID(NS_SUBSTITUTINGURLMUTATOR_CID);
-NS_DEFINE_NAMED_CID(NS_ABOUTPROTOCOLHANDLER_CID);
-NS_DEFINE_NAMED_CID(NS_SAFEABOUTPROTOCOLHANDLER_CID);
-NS_DEFINE_NAMED_CID(NS_ABOUT_BLANK_MODULE_CID);
-NS_DEFINE_NAMED_CID(NS_NESTEDABOUTURI_CID);
-NS_DEFINE_NAMED_CID(NS_NESTEDABOUTURIMUTATOR_CID);
-NS_DEFINE_NAMED_CID(NS_ABOUT_CACHE_MODULE_CID);
-NS_DEFINE_NAMED_CID(NS_ABOUT_CACHE_ENTRY_MODULE_CID);
-NS_DEFINE_NAMED_CID(NS_CACHESERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_APPLICATIONCACHESERVICE_CID);
-#ifdef NECKO_COOKIES
-NS_DEFINE_NAMED_CID(NS_COOKIEMANAGER_CID);
-NS_DEFINE_NAMED_CID(NS_COOKIESERVICE_CID);
-#endif
-#ifdef NECKO_WIFI
-NS_DEFINE_NAMED_CID(NS_WIFI_MONITOR_COMPONENT_CID);
-#endif
-NS_DEFINE_NAMED_CID(NS_DATAPROTOCOLHANDLER_CID);
-NS_DEFINE_NAMED_CID(NS_VIEWSOURCEHANDLER_CID);
-NS_DEFINE_NAMED_CID(NS_WYCIWYGPROTOCOLHANDLER_CID);
-NS_DEFINE_NAMED_CID(NS_WEBSOCKETPROTOCOLHANDLER_CID);
-NS_DEFINE_NAMED_CID(NS_WEBSOCKETSSLPROTOCOLHANDLER_CID);
-#if defined(XP_WIN)
-NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
-#elif defined(MOZ_WIDGET_COCOA)
-NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
-#elif defined(MOZ_WIDGET_ANDROID)
-NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
-#elif defined(XP_LINUX)
-NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
-#endif
-NS_DEFINE_NAMED_CID(NS_SERIALIZATION_HELPER_CID);
-NS_DEFINE_NAMED_CID(NS_CACHE_STORAGE_SERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_NSILOADCONTEXTINFOFACTORY_CID);
-NS_DEFINE_NAMED_CID(NS_NETWORKPREDICTOR_CID);
-NS_DEFINE_NAMED_CID(NS_CAPTIVEPORTAL_CID);
-NS_DEFINE_NAMED_CID(NS_NETWORKCONNECTIVITYSERVICE_CID);
-#ifdef BUILD_NETWORK_INFO_SERVICE
-NS_DEFINE_NAMED_CID(NETWORKINFOSERVICE_CID);
-#endif  // BUILD_NETWORK_INFO_SERVICE
-
-static const mozilla::Module::CIDEntry kNeckoCIDs[] = {
-    // clang-format off
-    { &kNS_IOSERVICE_CID, false, nullptr, nsIOServiceConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { &kNS_STREAMTRANSPORTSERVICE_CID, false, nullptr, nsStreamTransportServiceConstructor },
-    { &kNS_SOCKETTRANSPORTSERVICE_CID, false, nullptr, nsSocketTransportServiceConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { &kNS_SERVERSOCKET_CID, false, nullptr, nsServerSocketConstructor },
-    { &kNS_TLSSERVERSOCKET_CID, false, nullptr, TLSServerSocketConstructor },
-    { &kNS_UDPSOCKET_CID, false, nullptr, nsUDPSocketConstructor },
-    { &kNS_DNSSERVICE_CID, false, nullptr, nsIDNSServiceConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { &kNS_IDNSERVICE_CID, false, nullptr, nsIDNServiceConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { &kNS_EFFECTIVETLDSERVICE_CID, false, nullptr, nsEffectiveTLDServiceConstructor },
-    { &kNS_SIMPLEURI_CID, false, nullptr, nsSimpleURIMutatorConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS }, // do_CreateInstance returns mutator
-    { &kNS_SIMPLEURIMUTATOR_CID, false, nullptr, nsSimpleURIMutatorConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { &kNS_SIMPLENESTEDURI_CID, false, nullptr, nsSimpleNestedURIMutatorConstructor }, // do_CreateInstance returns mutator
-    { &kNS_SIMPLENESTEDURIMUTATOR_CID, false, nullptr, nsSimpleNestedURIMutatorConstructor },
-    { &kNS_ASYNCSTREAMCOPIER_CID, false, nullptr, nsAsyncStreamCopierConstructor },
-    { &kNS_INPUTSTREAMPUMP_CID, false, nullptr, nsInputStreamPumpConstructor },
-    { &kNS_INPUTSTREAMCHANNEL_CID, false, nullptr, nsInputStreamChannelConstructor },
-    { &kNS_STREAMLOADER_CID, false, nullptr, mozilla::net::nsStreamLoader::Create },
-    { &kNS_INCREMENTALSTREAMLOADER_CID, false, nullptr, nsIncrementalStreamLoader::Create },
-    { &kNS_DOWNLOADER_CID, false, nullptr, nsDownloaderConstructor },
-    { &kNS_BACKGROUNDFILESAVEROUTPUTSTREAM_CID, false, nullptr,
-      mozilla::net::BackgroundFileSaverOutputStreamConstructor },
-    { &kNS_BACKGROUNDFILESAVERSTREAMLISTENER_CID, false, nullptr,
-      mozilla::net::BackgroundFileSaverStreamListenerConstructor },
-    { &kNS_SIMPLESTREAMLISTENER_CID, false, nullptr, nsSimpleStreamListenerConstructor },
-    { &kNS_STREAMLISTENERTEE_CID, false, nullptr, nsStreamListenerTeeConstructor },
-    { &kNS_LOADGROUP_CID, false, nullptr, nsLoadGroupConstructor },
-    { &kNS_LOCALFILEINPUTSTREAM_CID, false, nullptr, nsFileInputStream::Create },
-    { &kNS_LOCALFILEOUTPUTSTREAM_CID, false, nullptr, nsFileOutputStream::Create },
-    { &kNS_ATOMICLOCALFILEOUTPUTSTREAM_CID, false, nullptr, nsAtomicFileOutputStreamConstructor },
-    { &kNS_SAFELOCALFILEOUTPUTSTREAM_CID, false, nullptr, nsSafeFileOutputStreamConstructor },
-    { &kNS_INCREMENTALDOWNLOAD_CID, false, nullptr, net_NewIncrementalDownload },
-    { &kNS_STDURLPARSER_CID, false, nullptr, nsStdURLParserConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { &kNS_NOAUTHURLPARSER_CID, false, nullptr, nsNoAuthURLParserConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { &kNS_AUTHURLPARSER_CID, false, nullptr, nsAuthURLParserConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { &kNS_STANDARDURL_CID, false, nullptr, nsStandardURLMutatorConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS }, // do_CreateInstance returns mutator
-    { &kNS_STANDARDURLMUTATOR_CID, false, nullptr, nsStandardURLMutatorConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { &kNS_ARRAYBUFFERINPUTSTREAM_CID, false, nullptr, ArrayBufferInputStreamConstructor },
-    { &kNS_BUFFEREDINPUTSTREAM_CID, false, nullptr, nsBufferedInputStream::Create },
-    { &kNS_BUFFEREDOUTPUTSTREAM_CID, false, nullptr, nsBufferedOutputStream::Create },
-    { &kNS_MIMEINPUTSTREAM_CID, false, nullptr, nsMIMEInputStreamConstructor },
-    { &kNS_PROTOCOLPROXYSERVICE_CID, true, nullptr, nsProtocolProxyServiceConstructor },
-    { &kNS_STREAMCONVERTERSERVICE_CID, false, nullptr, CreateNewStreamConvServiceFactory },
-    { &kNS_DASHBOARD_CID, false, nullptr, mozilla::net::DashboardConstructor },
-    { &kNS_FTPDIRLISTINGCONVERTER_CID, false, nullptr, CreateNewFTPDirListingConv },
-    { &kNS_NSINDEXEDTOHTMLCONVERTER_CID, false, nullptr, nsIndexedToHTML::Create },
-    { &kNS_MULTIMIXEDCONVERTER_CID, false, nullptr, CreateNewMultiMixedConvFactory },
-    { &kNS_UNKNOWNDECODER_CID, false, nullptr, CreateNewUnknownDecoderFactory },
-    { &kNS_BINARYDETECTOR_CID, false, nullptr, CreateNewBinaryDetectorFactory },
-    { &kNS_HTTPCOMPRESSCONVERTER_CID, false, nullptr, CreateNewHTTPCompressConvFactory },
-    { &kMOZITXTTOHTMLCONV_CID, false, nullptr, CreateNewTXTToHTMLConvFactory },
-    { &kNS_MIMEHEADERPARAM_CID, false, nullptr, nsMIMEHeaderParamImplConstructor },
-    { &kNS_FILEPROTOCOLHANDLER_CID, false, nullptr, nsFileProtocolHandlerConstructor },
-    { &kNS_HTTPPROTOCOLHANDLER_CID, false, nullptr, mozilla::net::nsHttpHandlerConstructor },
-    { &kNS_HTTPSPROTOCOLHANDLER_CID, false, nullptr, mozilla::net::nsHttpsHandlerConstructor },
-    { &kNS_HTTPAUTHMANAGER_CID, false, nullptr, mozilla::net::nsHttpAuthManagerConstructor },
-    { &kNS_HTTPACTIVITYDISTRIBUTOR_CID, false, nullptr, mozilla::net::nsHttpActivityDistributorConstructor },
-    { &kNS_THROTTLEQUEUE_CID, false, nullptr, mozilla::net::ThrottleQueueConstructor },
-    { &kNS_FTPPROTOCOLHANDLER_CID, false, nullptr, nsFtpProtocolHandlerConstructor },
-    { &kNS_RESPROTOCOLHANDLER_CID, false, nullptr, nsResProtocolHandlerConstructor },
-    { &kNS_EXTENSIONPROTOCOLHANDLER_CID, false, nullptr, mozilla::ExtensionProtocolHandlerConstructor },
-    { &kNS_SUBSTITUTINGURL_CID, false, nullptr, mozilla::SubstitutingURLMutatorConstructor }, // do_CreateInstance returns mutator
-    { &kNS_SUBSTITUTINGURLMUTATOR_CID, false, nullptr, mozilla::SubstitutingURLMutatorConstructor },
-    { &kNS_ABOUTPROTOCOLHANDLER_CID, false, nullptr, nsAboutProtocolHandlerConstructor },
-    { &kNS_SAFEABOUTPROTOCOLHANDLER_CID, false, nullptr, nsSafeAboutProtocolHandlerConstructor },
-    { &kNS_ABOUT_BLANK_MODULE_CID, false, nullptr, nsAboutBlank::Create },
-    { &kNS_NESTEDABOUTURI_CID, false, nullptr, nsNestedAboutURIMutatorConstructor }, // do_CreateInstance returns mutator
-    { &kNS_NESTEDABOUTURIMUTATOR_CID, false, nullptr, nsNestedAboutURIMutatorConstructor },
-    { &kNS_ABOUT_CACHE_MODULE_CID, false, nullptr, nsAboutCache::Create },
-    { &kNS_ABOUT_CACHE_ENTRY_MODULE_CID, false, nullptr, nsAboutCacheEntryConstructor },
-    { &kNS_CACHESERVICE_CID, false, nullptr, nsCacheService::Create },
-    { &kNS_APPLICATIONCACHESERVICE_CID, false, nullptr, nsApplicationCacheServiceConstructor },
-#ifdef NECKO_COOKIES
-    { &kNS_COOKIEMANAGER_CID, false, nullptr, nsICookieServiceConstructor },
-    { &kNS_COOKIESERVICE_CID, false, nullptr, nsICookieServiceConstructor },
-#endif
-#ifdef NECKO_WIFI
-    { &kNS_WIFI_MONITOR_COMPONENT_CID, false, nullptr, nsWifiMonitorConstructor },
-#endif
-    { &kNS_DATAPROTOCOLHANDLER_CID, false, nullptr, nsDataHandler::Create },
-    { &kNS_VIEWSOURCEHANDLER_CID, false, nullptr, nsViewSourceHandlerConstructor },
-    { &kNS_WYCIWYGPROTOCOLHANDLER_CID, false, nullptr, nsWyciwygProtocolHandlerConstructor },
-    { &kNS_WEBSOCKETPROTOCOLHANDLER_CID, false, nullptr,
-      mozilla::net::WebSocketChannelConstructor },
-    { &kNS_WEBSOCKETSSLPROTOCOLHANDLER_CID, false, nullptr,
-      mozilla::net::WebSocketSSLChannelConstructor },
-#if defined(XP_WIN)
-    { &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsNotifyAddrListenerConstructor },
-#elif defined(MOZ_WIDGET_COCOA)
-    { &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsNetworkLinkServiceConstructor },
-#elif defined(MOZ_WIDGET_ANDROID)
-    { &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsAndroidNetworkLinkServiceConstructor },
-#elif defined(XP_LINUX)
-    { &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsNotifyAddrListenerConstructor },
-#endif
-    { &kNS_SERIALIZATION_HELPER_CID, false, nullptr, nsSerializationHelperConstructor },
-    { &kNS_CACHE_STORAGE_SERVICE_CID, false, nullptr, CacheStorageServiceConstructor },
-    { &kNS_NSILOADCONTEXTINFOFACTORY_CID, false, nullptr, LoadContextInfoFactoryConstructor },
-    { &kNS_NETWORKPREDICTOR_CID, false, nullptr, mozilla::net::Predictor::Create },
-    { &kNS_CAPTIVEPORTAL_CID, false, nullptr, mozilla::net::nsICaptivePortalServiceConstructor },
-    { &kNS_NETWORKCONNECTIVITYSERVICE_CID, false, nullptr, mozilla::net::nsINetworkConnectivityServiceConstructor },
-#ifdef BUILD_NETWORK_INFO_SERVICE
-    { &kNETWORKINFOSERVICE_CID, false, nullptr, nsNetworkInfoServiceConstructor },
-#endif
-    { nullptr }
-    // clang-format on
-};
-
-static const mozilla::Module::ContractIDEntry kNeckoContracts[] = {
-    // clang-format off
-    { NS_IOSERVICE_CONTRACTID, &kNS_IOSERVICE_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { NS_NETUTIL_CONTRACTID, &kNS_IOSERVICE_CID },
-    { NS_STREAMTRANSPORTSERVICE_CONTRACTID, &kNS_STREAMTRANSPORTSERVICE_CID },
-    { NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &kNS_SOCKETTRANSPORTSERVICE_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { NS_SERVERSOCKET_CONTRACTID, &kNS_SERVERSOCKET_CID },
-    { NS_TLSSERVERSOCKET_CONTRACTID, &kNS_TLSSERVERSOCKET_CID },
-    { NS_UDPSOCKET_CONTRACTID, &kNS_UDPSOCKET_CID },
-    { NS_DNSSERVICE_CONTRACTID, &kNS_DNSSERVICE_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { NS_IDNSERVICE_CONTRACTID, &kNS_IDNSERVICE_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { NS_EFFECTIVETLDSERVICE_CONTRACTID, &kNS_EFFECTIVETLDSERVICE_CID },
-    { NS_SIMPLEURIMUTATOR_CONTRACTID, &kNS_SIMPLEURIMUTATOR_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { NS_ASYNCSTREAMCOPIER_CONTRACTID, &kNS_ASYNCSTREAMCOPIER_CID },
-    { NS_INPUTSTREAMPUMP_CONTRACTID, &kNS_INPUTSTREAMPUMP_CID },
-    { NS_INPUTSTREAMCHANNEL_CONTRACTID, &kNS_INPUTSTREAMCHANNEL_CID },
-    { NS_STREAMLOADER_CONTRACTID, &kNS_STREAMLOADER_CID },
-    { NS_INCREMENTALSTREAMLOADER_CONTRACTID, &kNS_INCREMENTALSTREAMLOADER_CID },
-    { NS_DOWNLOADER_CONTRACTID, &kNS_DOWNLOADER_CID },
-    { NS_BACKGROUNDFILESAVEROUTPUTSTREAM_CONTRACTID, &kNS_BACKGROUNDFILESAVEROUTPUTSTREAM_CID },
-    { NS_BACKGROUNDFILESAVERSTREAMLISTENER_CONTRACTID, &kNS_BACKGROUNDFILESAVERSTREAMLISTENER_CID },
-    { NS_SIMPLESTREAMLISTENER_CONTRACTID, &kNS_SIMPLESTREAMLISTENER_CID },
-    { NS_STREAMLISTENERTEE_CONTRACTID, &kNS_STREAMLISTENERTEE_CID },
-    { NS_LOADGROUP_CONTRACTID, &kNS_LOADGROUP_CID },
-    { NS_LOCALFILEINPUTSTREAM_CONTRACTID, &kNS_LOCALFILEINPUTSTREAM_CID },
-    { NS_LOCALFILEOUTPUTSTREAM_CONTRACTID, &kNS_LOCALFILEOUTPUTSTREAM_CID },
-    { NS_ATOMICLOCALFILEOUTPUTSTREAM_CONTRACTID, &kNS_ATOMICLOCALFILEOUTPUTSTREAM_CID },
-    { NS_SAFELOCALFILEOUTPUTSTREAM_CONTRACTID, &kNS_SAFELOCALFILEOUTPUTSTREAM_CID },
-    { NS_INCREMENTALDOWNLOAD_CONTRACTID, &kNS_INCREMENTALDOWNLOAD_CID },
-    { NS_STDURLPARSER_CONTRACTID, &kNS_STDURLPARSER_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { NS_NOAUTHURLPARSER_CONTRACTID, &kNS_NOAUTHURLPARSER_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { NS_AUTHURLPARSER_CONTRACTID, &kNS_AUTHURLPARSER_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { NS_STANDARDURLMUTATOR_CONTRACTID, &kNS_STANDARDURLMUTATOR_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
-    { NS_ARRAYBUFFERINPUTSTREAM_CONTRACTID, &kNS_ARRAYBUFFERINPUTSTREAM_CID },
-    { NS_BUFFEREDINPUTSTREAM_CONTRACTID, &kNS_BUFFEREDINPUTSTREAM_CID },
-    { NS_BUFFEREDOUTPUTSTREAM_CONTRACTID, &kNS_BUFFEREDOUTPUTSTREAM_CID },
-    { NS_MIMEINPUTSTREAM_CONTRACTID, &kNS_MIMEINPUTSTREAM_CID },
-    { NS_PROTOCOLPROXYSERVICE_CONTRACTID, &kNS_PROTOCOLPROXYSERVICE_CID },
-    { NS_STREAMCONVERTERSERVICE_CONTRACTID, &kNS_STREAMCONVERTERSERVICE_CID },
-    { NS_DASHBOARD_CONTRACTID, &kNS_DASHBOARD_CID },
-    { NS_ISTREAMCONVERTER_KEY FTP_TO_INDEX, &kNS_FTPDIRLISTINGCONVERTER_CID },
-    { NS_ISTREAMCONVERTER_KEY INDEX_TO_HTML, &kNS_NSINDEXEDTOHTMLCONVERTER_CID },
-    { NS_ISTREAMCONVERTER_KEY MULTI_MIXED_X, &kNS_MULTIMIXEDCONVERTER_CID },
-    { 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_BINARYDETECTOR_CONTRACTID, &kNS_BINARYDETECTOR_CID },
-    { NS_ISTREAMCONVERTER_KEY GZIP_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
-    { NS_ISTREAMCONVERTER_KEY XGZIP_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
-    { NS_ISTREAMCONVERTER_KEY BROTLI_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
-    { NS_ISTREAMCONVERTER_KEY COMPRESS_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
-    { NS_ISTREAMCONVERTER_KEY XCOMPRESS_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
-    { NS_ISTREAMCONVERTER_KEY DEFLATE_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
-    { MOZ_TXTTOHTMLCONV_CONTRACTID, &kMOZITXTTOHTMLCONV_CID },
-    { NS_MIMEHEADERPARAM_CONTRACTID, &kNS_MIMEHEADERPARAM_CID },
-    { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "file", &kNS_FILEPROTOCOLHANDLER_CID },
-    { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &kNS_HTTPPROTOCOLHANDLER_CID },
-    { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "https", &kNS_HTTPSPROTOCOLHANDLER_CID },
-    { NS_HTTPAUTHMANAGER_CONTRACTID, &kNS_HTTPAUTHMANAGER_CID },
-    { NS_HTTPACTIVITYDISTRIBUTOR_CONTRACTID, &kNS_HTTPACTIVITYDISTRIBUTOR_CID },
-    { NS_THROTTLEQUEUE_CONTRACTID, &kNS_THROTTLEQUEUE_CID },
-    { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "ftp", &kNS_FTPPROTOCOLHANDLER_CID },
-    { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "resource", &kNS_RESPROTOCOLHANDLER_CID },
-    { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "moz-extension", &kNS_EXTENSIONPROTOCOLHANDLER_CID },
-    { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "about", &kNS_ABOUTPROTOCOLHANDLER_CID },
-    { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "moz-safe-about", &kNS_SAFEABOUTPROTOCOLHANDLER_CID },
-    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "blank", &kNS_ABOUT_BLANK_MODULE_CID },
-    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "cache", &kNS_ABOUT_CACHE_MODULE_CID },
-    { NS_ABOUT_MODULE_CONTRACTID_PREFIX "cache-entry", &kNS_ABOUT_CACHE_ENTRY_MODULE_CID },
-    { NS_CACHESERVICE_CONTRACTID, &kNS_CACHESERVICE_CID },
-    { NS_APPLICATIONCACHESERVICE_CONTRACTID, &kNS_APPLICATIONCACHESERVICE_CID },
-#ifdef NECKO_COOKIES
-    { NS_COOKIEMANAGER_CONTRACTID, &kNS_COOKIEMANAGER_CID },
-    { NS_COOKIESERVICE_CONTRACTID, &kNS_COOKIESERVICE_CID },
-#endif
-#ifdef NECKO_WIFI
-    { NS_WIFI_MONITOR_CONTRACTID, &kNS_WIFI_MONITOR_COMPONENT_CID },
-#endif
-    { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "data", &kNS_DATAPROTOCOLHANDLER_CID },
-    { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "view-source", &kNS_VIEWSOURCEHANDLER_CID },
-    { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "wyciwyg", &kNS_WYCIWYGPROTOCOLHANDLER_CID },
-    { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "ws", &kNS_WEBSOCKETPROTOCOLHANDLER_CID },
-    { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "wss", &kNS_WEBSOCKETSSLPROTOCOLHANDLER_CID },
-#if defined(XP_WIN)
-    { NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
-#elif defined(MOZ_WIDGET_COCOA)
-    { NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
-#elif defined(MOZ_WIDGET_ANDROID)
-    { NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
-#elif defined(XP_LINUX)
-    { NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
-#endif
-    { NS_SERIALIZATION_HELPER_CONTRACTID, &kNS_SERIALIZATION_HELPER_CID },
-    { NS_CACHE_STORAGE_SERVICE_CONTRACTID, &kNS_CACHE_STORAGE_SERVICE_CID },
-    { NS_CACHE_STORAGE_SERVICE_CONTRACTID2, &kNS_CACHE_STORAGE_SERVICE_CID },
-    { NS_NSILOADCONTEXTINFOFACTORY_CONTRACTID, &kNS_NSILOADCONTEXTINFOFACTORY_CID },
-    { NS_NETWORKPREDICTOR_CONTRACTID, &kNS_NETWORKPREDICTOR_CID },
-    { NS_CAPTIVEPORTAL_CONTRACTID, &kNS_CAPTIVEPORTAL_CID },
-    { NS_NETWORKCONNECTIVITYSERVICE_CONTRACTID, &kNS_NETWORKCONNECTIVITYSERVICE_CID },
-#ifdef BUILD_NETWORK_INFO_SERVICE
-    { NETWORKINFOSERVICE_CONTRACT_ID, &kNETWORKINFOSERVICE_CID },
-#endif
-    { nullptr }
-    // clang-format on
-};
-
-static const mozilla::Module kNeckoModule = {
-    mozilla::Module::kVersion,
-    kNeckoCIDs,
-    kNeckoContracts,
-    kNeckoCategories,
-    nullptr,
-    nsNetStartup,
-    nsNetShutdown,
-    mozilla::Module::ALLOW_IN_SOCKET_PROCESS};
+static const mozilla::Module kNeckoModule = {mozilla::Module::kVersion,
+                                             nullptr,
+                                             nullptr,
+                                             kNeckoCategories,
+                                             nullptr,
+                                             nullptr,
+                                             nullptr,
+                                             mozilla::Module::ALLOW_IN_SOCKET_PROCESS};
 
 NSMODULE_DEFN(necko) = &kNeckoModule;
new file mode 100644
--- /dev/null
+++ b/netwerk/build/nsNetModule.h
@@ -0,0 +1,47 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef nsNetModule_h
+#define nsNetModule_h
+
+#include "nsID.h"
+
+class nsISupports;
+
+nsresult nsNetStartup();
+void nsNetShutdown();
+
+nsresult CreateNewStreamConvServiceFactory(nsISupports* aOuter,
+                                           const nsIID& aIID, void** aResult);
+nsresult CreateNewFTPDirListingConv(nsISupports* aOuter, const nsIID& aIID,
+                                    void** aResult);
+nsresult CreateNewMultiMixedConvFactory(nsISupports* aOuter, const nsIID& aIID,
+                                        void** aResult);
+nsresult CreateNewTXTToHTMLConvFactory(nsISupports* aOuter, const nsIID& aIID,
+                                       void** aResult);
+nsresult CreateNewHTTPCompressConvFactory(nsISupports* aOuter,
+                                          const nsIID& aIID, void** aResult);
+nsresult CreateNewUnknownDecoderFactory(nsISupports* aOuter, const nsIID& aIID,
+                                        void** aResult);
+nsresult CreateNewBinaryDetectorFactory(nsISupports* aOuter, const nsIID& aIID,
+                                        void** aResult);
+nsresult nsLoadGroupConstructor(nsISupports* aOuter, const nsIID& aIID,
+                                void** aResult);
+
+nsresult nsCacheServiceConstructor(nsISupports* aOuter, const nsIID& aIID,
+                                   void** aResult);
+
+extern nsresult net_NewIncrementalDownload(nsISupports*, const nsIID&, void**);
+
+namespace mozilla {
+namespace net {
+nsresult WebSocketChannelConstructor(nsISupports* aOuter, const nsIID& aIID,
+                                     void** aResult);
+nsresult WebSocketSSLChannelConstructor(nsISupports* aOuter, const nsIID& aIID,
+                                        void** aResult);
+}
+}
+
+#endif
--- a/netwerk/protocol/res/ExtensionProtocolHandler.cpp
+++ b/netwerk/protocol/res/ExtensionProtocolHandler.cpp
@@ -34,16 +34,17 @@
 #include "nsIInputStreamPump.h"
 #include "nsIJARURI.h"
 #include "nsIStreamListener.h"
 #include "nsIThread.h"
 #include "nsIInputStream.h"
 #include "nsIOutputStream.h"
 #include "nsIStreamConverterService.h"
 #include "nsNetUtil.h"
+#include "nsURLHelper.h"
 #include "prio.h"
 #include "SimpleChannel.h"
 
 #if defined(XP_WIN)
 #  include "nsILocalFileWin.h"
 #  include "WinUtils.h"
 #endif
 
--- a/netwerk/protocol/res/SubstitutingProtocolHandler.cpp
+++ b/netwerk/protocol/res/SubstitutingProtocolHandler.cpp
@@ -4,16 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/chrome/RegistryMessageUtils.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/Unused.h"
 
 #include "SubstitutingProtocolHandler.h"
+#include "SubstitutingURL.h"
 #include "nsIChannel.h"
 #include "nsIIOService.h"
 #include "nsIFile.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsReadableUtils.h"
 #include "nsURLHelper.h"
 #include "nsEscape.h"
--- a/netwerk/protocol/res/SubstitutingProtocolHandler.h
+++ b/netwerk/protocol/res/SubstitutingProtocolHandler.h
@@ -4,20 +4,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef SubstitutingProtocolHandler_h___
 #define SubstitutingProtocolHandler_h___
 
 #include "nsISubstitutingProtocolHandler.h"
 
-#include "nsIOService.h"
 #include "nsISubstitutionObserver.h"
 #include "nsDataHashtable.h"
-#include "nsStandardURL.h"
 #include "mozilla/chrome/RegistryMessageUtils.h"
 #include "mozilla/Maybe.h"
 
 class nsIIOService;
 
 namespace mozilla {
 namespace net {
 
@@ -112,55 +110,12 @@ class SubstitutingProtocolHandler {
   // substituting URIs only map to other URIs of the same type, or to
   // file:// and jar:// URIs.
   //
   // Enforcing this for ye olde resource:// URIs could carry compat risks, so
   // we just try to enforce it on new protocols going forward.
   bool mEnforceFileOrJar;
 };
 
-// SubstitutingURL : overrides nsStandardURL::GetFile to provide nsIFile
-// resolution
-class SubstitutingURL : public nsStandardURL {
- public:
-  virtual nsStandardURL* StartClone() override;
-  virtual MOZ_MUST_USE nsresult EnsureFile() override;
-  NS_IMETHOD GetClassIDNoAlloc(nsCID* aCID) override;
-
- private:
-  explicit SubstitutingURL() : nsStandardURL(true) {}
-  explicit SubstitutingURL(bool aSupportsFileURL) : nsStandardURL(true) {
-    MOZ_ASSERT(aSupportsFileURL);
-  }
-  virtual nsresult Clone(nsIURI** aURI) override {
-    return nsStandardURL::Clone(aURI);
-  }
-
- public:
-  class Mutator : public TemplatedMutator<SubstitutingURL> {
-    NS_DECL_ISUPPORTS
-   public:
-    explicit Mutator() = default;
-
-   private:
-    virtual ~Mutator() = default;
-
-    SubstitutingURL* Create() override { return new SubstitutingURL(); }
-  };
-
-  NS_IMETHOD Mutate(nsIURIMutator** aMutator) override {
-    RefPtr<SubstitutingURL::Mutator> mutator = new SubstitutingURL::Mutator();
-    nsresult rv = mutator->InitFromURI(this);
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
-    mutator.forget(aMutator);
-    return NS_OK;
-  }
-
-  friend BaseURIMutator<SubstitutingURL>;
-  friend TemplatedMutator<SubstitutingURL>;
-};
-
 }  // namespace net
 }  // namespace mozilla
 
 #endif /* SubstitutingProtocolHandler_h___ */
copy from netwerk/protocol/res/SubstitutingProtocolHandler.h
copy to netwerk/protocol/res/SubstitutingURL.h
--- a/netwerk/protocol/res/SubstitutingProtocolHandler.h
+++ b/netwerk/protocol/res/SubstitutingURL.h
@@ -1,127 +1,24 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef SubstitutingProtocolHandler_h___
-#define SubstitutingProtocolHandler_h___
-
-#include "nsISubstitutingProtocolHandler.h"
+#ifndef SubstitutingURL_h
+#define SubstitutingURL_h
 
-#include "nsIOService.h"
-#include "nsISubstitutionObserver.h"
-#include "nsDataHashtable.h"
 #include "nsStandardURL.h"
-#include "mozilla/chrome/RegistryMessageUtils.h"
-#include "mozilla/Maybe.h"
 
 class nsIIOService;
 
 namespace mozilla {
 namespace net {
 
-//
-// Base class for resource://-like substitution protocols.
-//
-// If you add a new protocol, make sure to change nsChromeRegistryChrome
-// to properly invoke CollectSubstitutions at the right time.
-class SubstitutingProtocolHandler {
- public:
-  SubstitutingProtocolHandler(const char* aScheme, uint32_t aFlags,
-                              bool aEnforceFileOrJar = true);
-  explicit SubstitutingProtocolHandler(const char* aScheme);
-
-  NS_INLINE_DECL_REFCOUNTING(SubstitutingProtocolHandler);
-  NS_DECL_NON_VIRTUAL_NSIPROTOCOLHANDLER;
-  NS_DECL_NON_VIRTUAL_NSISUBSTITUTINGPROTOCOLHANDLER;
-
-  bool HasSubstitution(const nsACString& aRoot) const {
-    return mSubstitutions.Get(aRoot, nullptr);
-  }
-
-  MOZ_MUST_USE nsresult
-  CollectSubstitutions(InfallibleTArray<SubstitutionMapping>& aResources);
-
- protected:
-  virtual ~SubstitutingProtocolHandler() = default;
-  void ConstructInternal();
-
-  MOZ_MUST_USE nsresult SendSubstitution(const nsACString& aRoot,
-                                         nsIURI* aBaseURI, uint32_t aFlags);
-
-  nsresult GetSubstitutionFlags(const nsACString& root, uint32_t* flags);
-
-  // Override this in the subclass to try additional lookups after checking
-  // mSubstitutions.
-  virtual MOZ_MUST_USE nsresult GetSubstitutionInternal(const nsACString& aRoot,
-                                                        nsIURI** aResult,
-                                                        uint32_t* aFlags) {
-    *aResult = nullptr;
-    *aFlags = 0;
-    return NS_ERROR_NOT_AVAILABLE;
-  }
-
-  // Override this in the subclass to check for special case when resolving URIs
-  // _before_ checking substitutions.
-  virtual MOZ_MUST_USE bool ResolveSpecialCases(const nsACString& aHost,
-                                                const nsACString& aPath,
-                                                const nsACString& aPathname,
-                                                nsACString& aResult) {
-    return false;
-  }
-
-  // Override this in the subclass to check for special case when opening
-  // channels.
-  virtual MOZ_MUST_USE nsresult SubstituteChannel(nsIURI* uri,
-                                                  nsILoadInfo* aLoadInfo,
-                                                  nsIChannel** result) {
-    return NS_OK;
-  }
-
-  nsIIOService* IOService() { return mIOService; }
-
- private:
-  struct SubstitutionEntry {
-    SubstitutionEntry() : flags(0) {}
-
-    ~SubstitutionEntry() = default;
-
-    nsCOMPtr<nsIURI> baseURI;
-    uint32_t flags;
-  };
-
-  // Notifies all observers that a new substitution from |aRoot| to
-  // |aBaseURI| has been set/installed for this protocol handler.
-  void NotifyObservers(const nsACString& aRoot, nsIURI* aBaseURI);
-
-  nsCString mScheme;
-  Maybe<uint32_t> mFlags;
-  nsDataHashtable<nsCStringHashKey, SubstitutionEntry> mSubstitutions;
-  nsCOMPtr<nsIIOService> mIOService;
-
-  // The list of observers added with AddObserver that will be
-  // notified when substitutions are set or unset.
-  nsTArray<nsCOMPtr<nsISubstitutionObserver>> mObservers;
-
-  // In general, we expect the principal of a document loaded from a
-  // substituting URI to be a codebase principal for that URI (rather than
-  // a principal for whatever is underneath). However, this only works if
-  // the protocol handler for the underlying URI doesn't set an explicit
-  // owner (which chrome:// does, for example). So we want to require that
-  // substituting URIs only map to other URIs of the same type, or to
-  // file:// and jar:// URIs.
-  //
-  // Enforcing this for ye olde resource:// URIs could carry compat risks, so
-  // we just try to enforce it on new protocols going forward.
-  bool mEnforceFileOrJar;
-};
-
 // SubstitutingURL : overrides nsStandardURL::GetFile to provide nsIFile
 // resolution
 class SubstitutingURL : public nsStandardURL {
  public:
   virtual nsStandardURL* StartClone() override;
   virtual MOZ_MUST_USE nsresult EnsureFile() override;
   NS_IMETHOD GetClassIDNoAlloc(nsCID* aCID) override;
 
@@ -158,9 +55,9 @@ class SubstitutingURL : public nsStandar
 
   friend BaseURIMutator<SubstitutingURL>;
   friend TemplatedMutator<SubstitutingURL>;
 };
 
 }  // namespace net
 }  // namespace mozilla
 
-#endif /* SubstitutingProtocolHandler_h___ */
+#endif /* SubstitutingURL_h */
--- a/netwerk/protocol/res/moz.build
+++ b/netwerk/protocol/res/moz.build
@@ -10,16 +10,17 @@ XPIDL_SOURCES += [
     'nsISubstitutionObserver.idl',
 ]
 
 XPIDL_MODULE = 'necko_res'
 
 EXPORTS.mozilla.net += [
     'ExtensionProtocolHandler.h',
     'SubstitutingProtocolHandler.h',
+    'SubstitutingURL.h',
 ]
 
 UNIFIED_SOURCES += [
     'ExtensionProtocolHandler.cpp',
     'nsResProtocolHandler.cpp',
     'SubstitutingProtocolHandler.cpp',
 ]
 
--- a/netwerk/protocol/res/nsResProtocolHandler.h
+++ b/netwerk/protocol/res/nsResProtocolHandler.h
@@ -6,17 +6,16 @@
 #ifndef nsResProtocolHandler_h___
 #define nsResProtocolHandler_h___
 
 #include "SubstitutingProtocolHandler.h"
 
 #include "nsIResProtocolHandler.h"
 #include "nsInterfaceHashtable.h"
 #include "nsWeakReference.h"
-#include "nsStandardURL.h"
 
 class nsISubstitutionObserver;
 
 struct SubstitutionMapping;
 class nsResProtocolHandler final
     : public nsIResProtocolHandler,
       public mozilla::net::SubstitutingProtocolHandler,
       public nsSupportsWeakReference {