nsNetModule.cpp 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "necko-config.h"
  6. #define ALLOW_LATE_HTTPLOG_H_INCLUDE 1
  7. #include "base/basictypes.h"
  8. #include "nsCOMPtr.h"
  9. #include "nsIClassInfoImpl.h"
  10. #include "mozilla/ModuleUtils.h"
  11. #include "nsIComponentManager.h"
  12. #include "nsIServiceManager.h"
  13. #include "nsICategoryManager.h"
  14. #include "nsSocketProviderService.h"
  15. #include "nscore.h"
  16. #include "nsSimpleURI.h"
  17. #include "nsSimpleNestedURI.h"
  18. #include "nsLoadGroup.h"
  19. #include "nsStreamLoader.h"
  20. #include "nsIncrementalStreamLoader.h"
  21. #include "nsUnicharStreamLoader.h"
  22. #include "nsFileStreams.h"
  23. #include "nsBufferedStreams.h"
  24. #include "nsMIMEInputStream.h"
  25. #include "nsSOCKSSocketProvider.h"
  26. #include "nsCacheService.h"
  27. #include "nsDiskCacheDeviceSQL.h"
  28. #include "nsApplicationCache.h"
  29. #include "nsApplicationCacheService.h"
  30. #include "nsMimeTypes.h"
  31. #include "nsDNSPrefetch.h"
  32. #include "nsAboutProtocolHandler.h"
  33. #include "nsXULAppAPI.h"
  34. #include "nsCategoryCache.h"
  35. #include "nsIContentSniffer.h"
  36. #include "Predictor.h"
  37. #include "nsIThreadPool.h"
  38. #include "mozilla/net/NeckoChild.h"
  39. #include "nsNetCID.h"
  40. #ifndef XP_MACOSX
  41. #define BUILD_BINHEX_DECODER 1
  42. #endif
  43. #if defined(XP_MACOSX) || defined(XP_WIN) || defined(XP_LINUX)
  44. #define BUILD_NETWORK_INFO_SERVICE 1
  45. #endif
  46. typedef nsCategoryCache<nsIContentSniffer> ContentSnifferCache;
  47. ContentSnifferCache* gNetSniffers = nullptr;
  48. ContentSnifferCache* gDataSniffers = nullptr;
  49. ///////////////////////////////////////////////////////////////////////////////
  50. #include "nsIOService.h"
  51. typedef mozilla::net::nsIOService nsIOService;
  52. NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIOService, nsIOService::GetInstance)
  53. #include "nsDNSService2.h"
  54. NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIDNSService,
  55. nsDNSService::GetXPCOMSingleton)
  56. #include "nsProtocolProxyService.h"
  57. typedef mozilla::net::nsProtocolProxyService nsProtocolProxyService;
  58. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsProtocolProxyService, Init)
  59. #include "nsStreamTransportService.h"
  60. typedef mozilla::net::nsStreamTransportService nsStreamTransportService;
  61. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStreamTransportService, Init)
  62. #include "nsSocketTransportService2.h"
  63. typedef mozilla::net::nsSocketTransportService nsSocketTransportService;
  64. #undef LOG
  65. #undef LOG_ENABLED
  66. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSocketTransportService, Init)
  67. #include "nsServerSocket.h"
  68. typedef mozilla::net::nsServerSocket nsServerSocket;
  69. NS_GENERIC_FACTORY_CONSTRUCTOR(nsServerSocket)
  70. #include "TLSServerSocket.h"
  71. typedef mozilla::net::TLSServerSocket TLSServerSocket;
  72. NS_GENERIC_FACTORY_CONSTRUCTOR(TLSServerSocket)
  73. #include "nsUDPSocket.h"
  74. typedef mozilla::net::nsUDPSocket nsUDPSocket;
  75. NS_GENERIC_FACTORY_CONSTRUCTOR(nsUDPSocket)
  76. #include "nsUDPSocketProvider.h"
  77. NS_GENERIC_FACTORY_CONSTRUCTOR(nsUDPSocketProvider)
  78. #include "nsAsyncStreamCopier.h"
  79. NS_GENERIC_FACTORY_CONSTRUCTOR(nsAsyncStreamCopier)
  80. #include "nsInputStreamPump.h"
  81. NS_GENERIC_FACTORY_CONSTRUCTOR(nsInputStreamPump)
  82. #include "nsInputStreamChannel.h"
  83. typedef mozilla::net::nsInputStreamChannel nsInputStreamChannel;
  84. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsInputStreamChannel, Init)
  85. #include "nsDownloader.h"
  86. NS_GENERIC_FACTORY_CONSTRUCTOR(nsDownloader)
  87. #include "BackgroundFileSaver.h"
  88. namespace mozilla {
  89. namespace net {
  90. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(BackgroundFileSaverOutputStream, Init)
  91. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(BackgroundFileSaverStreamListener, Init)
  92. } // namespace net
  93. } // namespace mozilla
  94. #include "nsSyncStreamListener.h"
  95. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSyncStreamListener, Init)
  96. NS_GENERIC_FACTORY_CONSTRUCTOR(nsAtomicFileOutputStream)
  97. NS_GENERIC_FACTORY_CONSTRUCTOR(nsSafeFileOutputStream)
  98. NS_GENERIC_FACTORY_CONSTRUCTOR(nsFileStream)
  99. typedef mozilla::net::nsLoadGroup nsLoadGroup;
  100. NS_GENERIC_AGGREGATED_CONSTRUCTOR_INIT(nsLoadGroup, Init)
  101. #include "ArrayBufferInputStream.h"
  102. NS_GENERIC_FACTORY_CONSTRUCTOR(ArrayBufferInputStream)
  103. #include "nsEffectiveTLDService.h"
  104. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsEffectiveTLDService, Init)
  105. #include "nsSerializationHelper.h"
  106. NS_GENERIC_FACTORY_CONSTRUCTOR(nsSerializationHelper)
  107. #include "RedirectChannelRegistrar.h"
  108. typedef mozilla::net::RedirectChannelRegistrar RedirectChannelRegistrar;
  109. NS_GENERIC_FACTORY_CONSTRUCTOR(RedirectChannelRegistrar)
  110. #include "CacheStorageService.h"
  111. typedef mozilla::net::CacheStorageService CacheStorageService;
  112. NS_GENERIC_FACTORY_CONSTRUCTOR(CacheStorageService)
  113. #include "LoadContextInfo.h"
  114. typedef mozilla::net::LoadContextInfoFactory LoadContextInfoFactory;
  115. NS_GENERIC_FACTORY_CONSTRUCTOR(LoadContextInfoFactory)
  116. ///////////////////////////////////////////////////////////////////////////////
  117. #include "mozilla/net/CaptivePortalService.h"
  118. namespace mozilla {
  119. namespace net {
  120. NS_GENERIC_FACTORY_CONSTRUCTOR(CaptivePortalService)
  121. } // namespace net
  122. } // namespace mozilla
  123. #include "RequestContextService.h"
  124. typedef mozilla::net::RequestContextService RequestContextService;
  125. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(RequestContextService, Init)
  126. ///////////////////////////////////////////////////////////////////////////////
  127. extern nsresult
  128. net_NewIncrementalDownload(nsISupports *, const nsIID &, void **);
  129. #define NS_INCREMENTALDOWNLOAD_CID \
  130. { /* a62af1ba-79b3-4896-8aaf-b148bfce4280 */ \
  131. 0xa62af1ba, \
  132. 0x79b3, \
  133. 0x4896, \
  134. {0x8a, 0xaf, 0xb1, 0x48, 0xbf, 0xce, 0x42, 0x80} \
  135. }
  136. ///////////////////////////////////////////////////////////////////////////////
  137. #include "nsMIMEHeaderParamImpl.h"
  138. NS_GENERIC_FACTORY_CONSTRUCTOR(nsMIMEHeaderParamImpl)
  139. ///////////////////////////////////////////////////////////////////////////////
  140. #include "nsRequestObserverProxy.h"
  141. #include "nsSimpleStreamListener.h"
  142. #include "nsDirIndexParser.h"
  143. #include "nsDirIndex.h"
  144. typedef mozilla::net::nsRequestObserverProxy nsRequestObserverProxy;
  145. NS_GENERIC_FACTORY_CONSTRUCTOR(nsRequestObserverProxy)
  146. typedef mozilla::net::nsSimpleStreamListener nsSimpleStreamListener;
  147. NS_GENERIC_FACTORY_CONSTRUCTOR(nsSimpleStreamListener)
  148. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsDirIndexParser, Init)
  149. NS_GENERIC_FACTORY_CONSTRUCTOR(nsDirIndex)
  150. ///////////////////////////////////////////////////////////////////////////////
  151. #include "nsStreamListenerTee.h"
  152. typedef mozilla::net::nsStreamListenerTee nsStreamListenerTee;
  153. NS_GENERIC_FACTORY_CONSTRUCTOR(nsStreamListenerTee)
  154. ///////////////////////////////////////////////////////////////////////////////
  155. #ifdef NECKO_COOKIES
  156. #include "nsCookieService.h"
  157. NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsICookieService,
  158. nsCookieService::GetXPCOMSingleton)
  159. #endif
  160. ///////////////////////////////////////////////////////////////////////////////
  161. #ifdef NECKO_WIFI
  162. #include "nsWifiMonitor.h"
  163. #undef LOG
  164. #undef LOG_ENABLED
  165. NS_GENERIC_FACTORY_CONSTRUCTOR(nsWifiMonitor)
  166. #endif
  167. ///////////////////////////////////////////////////////////////////////////////
  168. // protocols
  169. ///////////////////////////////////////////////////////////////////////////////
  170. // about:blank is mandatory
  171. #include "nsAboutProtocolHandler.h"
  172. #include "nsAboutBlank.h"
  173. typedef mozilla::net::nsAboutProtocolHandler nsAboutProtocolHandler;
  174. typedef mozilla::net::nsSafeAboutProtocolHandler nsSafeAboutProtocolHandler;
  175. typedef mozilla::net::nsNestedAboutURI nsNestedAboutURI;
  176. NS_GENERIC_FACTORY_CONSTRUCTOR(nsAboutProtocolHandler)
  177. NS_GENERIC_FACTORY_CONSTRUCTOR(nsSafeAboutProtocolHandler)
  178. NS_GENERIC_FACTORY_CONSTRUCTOR(nsNestedAboutURI)
  179. #ifdef NECKO_PROTOCOL_about
  180. // about
  181. #include "nsAboutCache.h"
  182. #include "nsAboutCacheEntry.h"
  183. NS_GENERIC_FACTORY_CONSTRUCTOR(nsAboutCacheEntry)
  184. #endif
  185. NS_GENERIC_FACTORY_CONSTRUCTOR(nsApplicationCacheService)
  186. NS_GENERIC_FACTORY_CONSTRUCTOR(nsApplicationCacheNamespace)
  187. NS_GENERIC_FACTORY_CONSTRUCTOR(nsApplicationCache)
  188. #ifdef NECKO_PROTOCOL_file
  189. // file
  190. #include "nsFileProtocolHandler.h"
  191. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsFileProtocolHandler, Init)
  192. #endif
  193. #ifdef NECKO_PROTOCOL_ftp
  194. // ftp
  195. #include "nsFtpProtocolHandler.h"
  196. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsFtpProtocolHandler, Init)
  197. #endif
  198. #ifdef NECKO_PROTOCOL_http
  199. // http/https
  200. #include "nsHttpHandler.h"
  201. #include "Http2Compression.h"
  202. #undef LOG
  203. #undef LOG_ENABLED
  204. #include "nsHttpAuthManager.h"
  205. #include "nsHttpChannelAuthProvider.h"
  206. #include "nsHttpBasicAuth.h"
  207. #include "nsHttpDigestAuth.h"
  208. #include "nsHttpNTLMAuth.h"
  209. #include "nsHttpActivityDistributor.h"
  210. #include "ThrottleQueue.h"
  211. #undef LOG
  212. #undef LOG_ENABLED
  213. namespace mozilla {
  214. namespace net {
  215. NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpNTLMAuth)
  216. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHttpHandler, Init)
  217. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHttpsHandler, Init)
  218. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHttpAuthManager, Init)
  219. NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpChannelAuthProvider)
  220. NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpActivityDistributor)
  221. NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpBasicAuth)
  222. NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpDigestAuth)
  223. NS_GENERIC_FACTORY_CONSTRUCTOR(ThrottleQueue)
  224. } // namespace net
  225. } // namespace mozilla
  226. #endif // !NECKO_PROTOCOL_http
  227. #include "mozilla/net/Dashboard.h"
  228. namespace mozilla {
  229. namespace net {
  230. NS_GENERIC_FACTORY_CONSTRUCTOR(Dashboard)
  231. } // namespace net
  232. } // namespace mozilla
  233. #ifdef XP_WIN
  234. #include "../socket/nsNamedPipeService.h"
  235. namespace mozilla {
  236. namespace net {
  237. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(NamedPipeService, Init)
  238. } // namespace net
  239. } // namespace mozilla
  240. #endif
  241. #ifdef NECKO_PROTOCOL_res
  242. // resource
  243. #include "nsResProtocolHandler.h"
  244. #include "ExtensionProtocolHandler.h"
  245. #include "SubstitutingProtocolHandler.h"
  246. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsResProtocolHandler, Init)
  247. namespace mozilla {
  248. NS_GENERIC_FACTORY_CONSTRUCTOR(ExtensionProtocolHandler)
  249. NS_GENERIC_FACTORY_CONSTRUCTOR(SubstitutingURL)
  250. } // namespace mozilla
  251. #endif
  252. #ifdef NECKO_PROTOCOL_device
  253. #include "nsDeviceProtocolHandler.h"
  254. typedef mozilla::net::nsDeviceProtocolHandler nsDeviceProtocolHandler;
  255. NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceProtocolHandler)
  256. #endif
  257. #ifdef NECKO_PROTOCOL_viewsource
  258. #include "nsViewSourceHandler.h"
  259. typedef mozilla::net::nsViewSourceHandler nsViewSourceHandler;
  260. NS_GENERIC_FACTORY_CONSTRUCTOR(nsViewSourceHandler)
  261. #endif
  262. #ifdef NECKO_PROTOCOL_data
  263. #include "nsDataHandler.h"
  264. #endif
  265. #ifdef NECKO_PROTOCOL_wyciwyg
  266. #include "nsWyciwygProtocolHandler.h"
  267. NS_GENERIC_FACTORY_CONSTRUCTOR(nsWyciwygProtocolHandler)
  268. #endif
  269. #ifdef NECKO_PROTOCOL_websocket
  270. #include "WebSocketChannel.h"
  271. #include "WebSocketChannelChild.h"
  272. namespace mozilla {
  273. namespace net {
  274. static BaseWebSocketChannel*
  275. WebSocketChannelConstructor(bool aSecure)
  276. {
  277. if (IsNeckoChild()) {
  278. return new WebSocketChannelChild(aSecure);
  279. }
  280. if (aSecure) {
  281. return new WebSocketSSLChannel;
  282. } else {
  283. return new WebSocketChannel;
  284. }
  285. }
  286. #define WEB_SOCKET_HANDLER_CONSTRUCTOR(type, secure) \
  287. static nsresult \
  288. type##Constructor(nsISupports *aOuter, REFNSIID aIID, \
  289. void **aResult) \
  290. { \
  291. nsresult rv; \
  292. \
  293. BaseWebSocketChannel * inst; \
  294. \
  295. *aResult = nullptr; \
  296. if (nullptr != aOuter) { \
  297. rv = NS_ERROR_NO_AGGREGATION; \
  298. return rv; \
  299. } \
  300. inst = WebSocketChannelConstructor(secure); \
  301. NS_ADDREF(inst); \
  302. rv = inst->QueryInterface(aIID, aResult); \
  303. NS_RELEASE(inst); \
  304. return rv; \
  305. }
  306. WEB_SOCKET_HANDLER_CONSTRUCTOR(WebSocketChannel, false)
  307. WEB_SOCKET_HANDLER_CONSTRUCTOR(WebSocketSSLChannel, true)
  308. #undef WEB_SOCKET_HANDLER_CONSTRUCTOR
  309. } // namespace net
  310. } // namespace mozilla
  311. #endif
  312. #ifdef NECKO_PROTOCOL_rtsp
  313. #include "RtspHandler.h"
  314. namespace mozilla {
  315. namespace net {
  316. NS_GENERIC_FACTORY_CONSTRUCTOR(RtspHandler)
  317. } // namespace mozilla::net
  318. } // namespace mozilla
  319. #endif
  320. ///////////////////////////////////////////////////////////////////////////////
  321. #include "nsURLParsers.h"
  322. NS_GENERIC_FACTORY_CONSTRUCTOR(nsNoAuthURLParser)
  323. NS_GENERIC_FACTORY_CONSTRUCTOR(nsAuthURLParser)
  324. NS_GENERIC_FACTORY_CONSTRUCTOR(nsStdURLParser)
  325. #include "nsStandardURL.h"
  326. typedef mozilla::net::nsStandardURL nsStandardURL;
  327. NS_GENERIC_FACTORY_CONSTRUCTOR(nsStandardURL)
  328. typedef mozilla::net::nsSimpleURI nsSimpleURI;
  329. NS_GENERIC_FACTORY_CONSTRUCTOR(nsSimpleURI)
  330. typedef mozilla::net::nsSimpleNestedURI nsSimpleNestedURI;
  331. NS_GENERIC_FACTORY_CONSTRUCTOR(nsSimpleNestedURI)
  332. ///////////////////////////////////////////////////////////////////////////////
  333. #include "nsIDNService.h"
  334. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsIDNService, Init)
  335. ///////////////////////////////////////////////////////////////////////////////
  336. #if defined(XP_WIN)
  337. #include "nsNotifyAddrListener.h"
  338. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNotifyAddrListener, Init)
  339. #elif defined(MOZ_WIDGET_COCOA)
  340. #include "nsNetworkLinkService.h"
  341. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNetworkLinkService, Init)
  342. #elif defined(XP_LINUX)
  343. #include "nsNotifyAddrListener_Linux.h"
  344. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNotifyAddrListener, Init)
  345. #endif
  346. ///////////////////////////////////////////////////////////////////////////////
  347. #ifdef NECKO_PROTOCOL_ftp
  348. #include "nsFTPDirListingConv.h"
  349. nsresult NS_NewFTPDirListingConv(nsFTPDirListingConv** result);
  350. #endif
  351. #include "nsStreamConverterService.h"
  352. #include "nsMultiMixedConv.h"
  353. #include "nsHTTPCompressConv.h"
  354. #include "mozTXTToHTMLConv.h"
  355. #include "nsUnknownDecoder.h"
  356. #include "nsTXTToHTMLConv.h"
  357. namespace mozilla {
  358. namespace net {
  359. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsTXTToHTMLConv, Init)
  360. } // namespace net
  361. } // namespace mozilla
  362. ///////////////////////////////////////////////////////////////////////////////
  363. #ifdef BUILD_NETWORK_INFO_SERVICE
  364. #include "nsNetworkInfoService.h"
  365. typedef mozilla::net::nsNetworkInfoService nsNetworkInfoService;
  366. NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNetworkInfoService, Init)
  367. #endif // BUILD_NETWORK_INFO_SERVICE
  368. #include "nsIndexedToHTML.h"
  369. #ifdef BUILD_BINHEX_DECODER
  370. #include "nsBinHexDecoder.h"
  371. #endif
  372. nsresult NS_NewMultiMixedConv (nsMultiMixedConv** result);
  373. nsresult MOZ_NewTXTToHTMLConv (mozTXTToHTMLConv** result);
  374. nsresult NS_NewHTTPCompressConv (mozilla::net::nsHTTPCompressConv ** result);
  375. nsresult NS_NewStreamConv(nsStreamConverterService **aStreamConv);
  376. #define FTP_TO_INDEX "?from=text/ftp-dir&to=application/http-index-format"
  377. #define INDEX_TO_HTML "?from=application/http-index-format&to=text/html"
  378. #define MULTI_MIXED_X "?from=multipart/x-mixed-replace&to=*/*"
  379. #define MULTI_MIXED "?from=multipart/mixed&to=*/*"
  380. #define MULTI_BYTERANGES "?from=multipart/byteranges&to=*/*"
  381. #define UNKNOWN_CONTENT "?from=" UNKNOWN_CONTENT_TYPE "&to=*/*"
  382. #define GZIP_TO_UNCOMPRESSED "?from=gzip&to=uncompressed"
  383. #define XGZIP_TO_UNCOMPRESSED "?from=x-gzip&to=uncompressed"
  384. #define BROTLI_TO_UNCOMPRESSED "?from=br&to=uncompressed"
  385. #define COMPRESS_TO_UNCOMPRESSED "?from=compress&to=uncompressed"
  386. #define XCOMPRESS_TO_UNCOMPRESSED "?from=x-compress&to=uncompressed"
  387. #define DEFLATE_TO_UNCOMPRESSED "?from=deflate&to=uncompressed"
  388. #define PLAIN_TO_HTML "?from=text/plain&to=text/html"
  389. #ifdef BUILD_BINHEX_DECODER
  390. #define BINHEX_TO_WILD "?from=application/mac-binhex40&to=*/*"
  391. #endif
  392. static const mozilla::Module::CategoryEntry kNeckoCategories[] = {
  393. { NS_ISTREAMCONVERTER_KEY, FTP_TO_INDEX, "" },
  394. { NS_ISTREAMCONVERTER_KEY, INDEX_TO_HTML, "" },
  395. { NS_ISTREAMCONVERTER_KEY, MULTI_MIXED_X, "" },
  396. { NS_ISTREAMCONVERTER_KEY, MULTI_MIXED, "" },
  397. { NS_ISTREAMCONVERTER_KEY, MULTI_BYTERANGES, "" },
  398. { NS_ISTREAMCONVERTER_KEY, UNKNOWN_CONTENT, "" },
  399. { NS_ISTREAMCONVERTER_KEY, GZIP_TO_UNCOMPRESSED, "" },
  400. { NS_ISTREAMCONVERTER_KEY, XGZIP_TO_UNCOMPRESSED, "" },
  401. { NS_ISTREAMCONVERTER_KEY, BROTLI_TO_UNCOMPRESSED, "" },
  402. { NS_ISTREAMCONVERTER_KEY, COMPRESS_TO_UNCOMPRESSED, "" },
  403. { NS_ISTREAMCONVERTER_KEY, XCOMPRESS_TO_UNCOMPRESSED, "" },
  404. { NS_ISTREAMCONVERTER_KEY, DEFLATE_TO_UNCOMPRESSED, "" },
  405. #ifdef BUILD_BINHEX_DECODER
  406. { NS_ISTREAMCONVERTER_KEY, BINHEX_TO_WILD, "" },
  407. #endif
  408. { NS_ISTREAMCONVERTER_KEY, PLAIN_TO_HTML, "" },
  409. NS_BINARYDETECTOR_CATEGORYENTRY,
  410. { nullptr }
  411. };
  412. #ifdef BUILD_BINHEX_DECODER
  413. typedef mozilla::net::nsBinHexDecoder nsBinHexDecoder;
  414. NS_GENERIC_FACTORY_CONSTRUCTOR(nsBinHexDecoder)
  415. #endif
  416. static nsresult
  417. CreateNewStreamConvServiceFactory(nsISupports* aOuter, REFNSIID aIID, void **aResult)
  418. {
  419. if (!aResult) {
  420. return NS_ERROR_INVALID_POINTER;
  421. }
  422. if (aOuter) {
  423. *aResult = nullptr;
  424. return NS_ERROR_NO_AGGREGATION;
  425. }
  426. nsStreamConverterService* inst = nullptr;
  427. nsresult rv = NS_NewStreamConv(&inst);
  428. if (NS_FAILED(rv)) {
  429. *aResult = nullptr;
  430. return rv;
  431. }
  432. rv = inst->QueryInterface(aIID, aResult);
  433. if (NS_FAILED(rv)) {
  434. *aResult = nullptr;
  435. }
  436. NS_RELEASE(inst); /* get rid of extra refcnt */
  437. return rv;
  438. }
  439. #ifdef NECKO_PROTOCOL_ftp
  440. static nsresult
  441. CreateNewFTPDirListingConv(nsISupports* aOuter, REFNSIID aIID, void **aResult)
  442. {
  443. if (!aResult) {
  444. return NS_ERROR_INVALID_POINTER;
  445. }
  446. if (aOuter) {
  447. *aResult = nullptr;
  448. return NS_ERROR_NO_AGGREGATION;
  449. }
  450. nsFTPDirListingConv* inst = nullptr;
  451. nsresult rv = NS_NewFTPDirListingConv(&inst);
  452. if (NS_FAILED(rv)) {
  453. *aResult = nullptr;
  454. return rv;
  455. }
  456. rv = inst->QueryInterface(aIID, aResult);
  457. if (NS_FAILED(rv)) {
  458. *aResult = nullptr;
  459. }
  460. NS_RELEASE(inst); /* get rid of extra refcnt */
  461. return rv;
  462. }
  463. #endif
  464. static nsresult
  465. CreateNewMultiMixedConvFactory(nsISupports* aOuter, REFNSIID aIID, void **aResult)
  466. {
  467. if (!aResult) {
  468. return NS_ERROR_INVALID_POINTER;
  469. }
  470. if (aOuter) {
  471. *aResult = nullptr;
  472. return NS_ERROR_NO_AGGREGATION;
  473. }
  474. nsMultiMixedConv* inst = nullptr;
  475. nsresult rv = NS_NewMultiMixedConv(&inst);
  476. if (NS_FAILED(rv)) {
  477. *aResult = nullptr;
  478. return rv;
  479. }
  480. rv = inst->QueryInterface(aIID, aResult);
  481. if (NS_FAILED(rv)) {
  482. *aResult = nullptr;
  483. }
  484. NS_RELEASE(inst); /* get rid of extra refcnt */
  485. return rv;
  486. }
  487. static nsresult
  488. CreateNewTXTToHTMLConvFactory(nsISupports* aOuter, REFNSIID aIID, void **aResult)
  489. {
  490. if (!aResult) {
  491. return NS_ERROR_INVALID_POINTER;
  492. }
  493. if (aOuter) {
  494. *aResult = nullptr;
  495. return NS_ERROR_NO_AGGREGATION;
  496. }
  497. mozTXTToHTMLConv* inst = nullptr;
  498. nsresult rv = MOZ_NewTXTToHTMLConv(&inst);
  499. if (NS_FAILED(rv)) {
  500. *aResult = nullptr;
  501. return rv;
  502. }
  503. rv = inst->QueryInterface(aIID, aResult);
  504. if (NS_FAILED(rv)) {
  505. *aResult = nullptr;
  506. }
  507. NS_RELEASE(inst); /* get rid of extra refcnt */
  508. return rv;
  509. }
  510. static nsresult
  511. CreateNewHTTPCompressConvFactory (nsISupports* aOuter, REFNSIID aIID, void **aResult)
  512. {
  513. if (!aResult) {
  514. return NS_ERROR_INVALID_POINTER;
  515. }
  516. if (aOuter) {
  517. *aResult = nullptr;
  518. return NS_ERROR_NO_AGGREGATION;
  519. }
  520. mozilla::net::nsHTTPCompressConv* inst = nullptr;
  521. nsresult rv = NS_NewHTTPCompressConv (&inst);
  522. if (NS_FAILED(rv)) {
  523. *aResult = nullptr;
  524. return rv;
  525. }
  526. rv = inst->QueryInterface(aIID, aResult);
  527. if (NS_FAILED(rv)) {
  528. *aResult = nullptr;
  529. }
  530. NS_RELEASE(inst); /* get rid of extra refcnt */
  531. return rv;
  532. }
  533. static nsresult
  534. CreateNewUnknownDecoderFactory(nsISupports *aOuter, REFNSIID aIID, void **aResult)
  535. {
  536. nsresult rv;
  537. if (!aResult) {
  538. return NS_ERROR_NULL_POINTER;
  539. }
  540. *aResult = nullptr;
  541. if (aOuter) {
  542. return NS_ERROR_NO_AGGREGATION;
  543. }
  544. nsUnknownDecoder *inst;
  545. inst = new nsUnknownDecoder();
  546. if (!inst) {
  547. return NS_ERROR_OUT_OF_MEMORY;
  548. }
  549. NS_ADDREF(inst);
  550. rv = inst->QueryInterface(aIID, aResult);
  551. NS_RELEASE(inst);
  552. return rv;
  553. }
  554. static nsresult
  555. CreateNewBinaryDetectorFactory(nsISupports *aOuter, REFNSIID aIID, void **aResult)
  556. {
  557. nsresult rv;
  558. if (!aResult) {
  559. return NS_ERROR_NULL_POINTER;
  560. }
  561. *aResult = nullptr;
  562. if (aOuter) {
  563. return NS_ERROR_NO_AGGREGATION;
  564. }
  565. auto* inst = new nsBinaryDetector();
  566. if (!inst) {
  567. return NS_ERROR_OUT_OF_MEMORY;
  568. }
  569. NS_ADDREF(inst);
  570. rv = inst->QueryInterface(aIID, aResult);
  571. NS_RELEASE(inst);
  572. return rv;
  573. }
  574. ///////////////////////////////////////////////////////////////////////////////
  575. // Module implementation for the net library
  576. // Net module startup hook
  577. static nsresult nsNetStartup()
  578. {
  579. return NS_OK;
  580. }
  581. // Net module shutdown hook
  582. static void nsNetShutdown()
  583. {
  584. // Release the url parser that the stdurl is holding.
  585. nsStandardURL::ShutdownGlobalObjects();
  586. // Release global state used by the URL helper module.
  587. net_ShutdownURLHelper();
  588. #ifdef XP_MACOSX
  589. net_ShutdownURLHelperOSX();
  590. #endif
  591. // Release DNS service reference.
  592. nsDNSPrefetch::Shutdown();
  593. #ifdef NECKO_PROTOCOL_websocket
  594. // Release the Websocket Admission Manager
  595. mozilla::net::WebSocketChannel::Shutdown();
  596. #endif // NECKO_PROTOCOL_websocket
  597. #ifdef NECKO_PROTOCOL_http
  598. mozilla::net::Http2CompressionCleanup();
  599. #endif // NECKO_PROTOCOL_http
  600. delete gNetSniffers;
  601. gNetSniffers = nullptr;
  602. delete gDataSniffers;
  603. gDataSniffers = nullptr;
  604. }
  605. NS_DEFINE_NAMED_CID(NS_IOSERVICE_CID);
  606. NS_DEFINE_NAMED_CID(NS_STREAMTRANSPORTSERVICE_CID);
  607. NS_DEFINE_NAMED_CID(NS_SOCKETTRANSPORTSERVICE_CID);
  608. NS_DEFINE_NAMED_CID(NS_SERVERSOCKET_CID);
  609. NS_DEFINE_NAMED_CID(NS_TLSSERVERSOCKET_CID);
  610. NS_DEFINE_NAMED_CID(NS_UDPSOCKET_CID);
  611. NS_DEFINE_NAMED_CID(NS_SOCKETPROVIDERSERVICE_CID);
  612. NS_DEFINE_NAMED_CID(NS_DNSSERVICE_CID);
  613. NS_DEFINE_NAMED_CID(NS_IDNSERVICE_CID);
  614. NS_DEFINE_NAMED_CID(NS_EFFECTIVETLDSERVICE_CID);
  615. NS_DEFINE_NAMED_CID(NS_SIMPLEURI_CID);
  616. NS_DEFINE_NAMED_CID(NS_SIMPLENESTEDURI_CID);
  617. NS_DEFINE_NAMED_CID(NS_ASYNCSTREAMCOPIER_CID);
  618. NS_DEFINE_NAMED_CID(NS_INPUTSTREAMPUMP_CID);
  619. NS_DEFINE_NAMED_CID(NS_INPUTSTREAMCHANNEL_CID);
  620. NS_DEFINE_NAMED_CID(NS_STREAMLOADER_CID);
  621. NS_DEFINE_NAMED_CID(NS_INCREMENTALSTREAMLOADER_CID);
  622. NS_DEFINE_NAMED_CID(NS_UNICHARSTREAMLOADER_CID);
  623. NS_DEFINE_NAMED_CID(NS_DOWNLOADER_CID);
  624. NS_DEFINE_NAMED_CID(NS_BACKGROUNDFILESAVEROUTPUTSTREAM_CID);
  625. NS_DEFINE_NAMED_CID(NS_BACKGROUNDFILESAVERSTREAMLISTENER_CID);
  626. NS_DEFINE_NAMED_CID(NS_SYNCSTREAMLISTENER_CID);
  627. NS_DEFINE_NAMED_CID(NS_REQUESTOBSERVERPROXY_CID);
  628. NS_DEFINE_NAMED_CID(NS_SIMPLESTREAMLISTENER_CID);
  629. NS_DEFINE_NAMED_CID(NS_STREAMLISTENERTEE_CID);
  630. NS_DEFINE_NAMED_CID(NS_LOADGROUP_CID);
  631. NS_DEFINE_NAMED_CID(NS_LOCALFILEINPUTSTREAM_CID);
  632. NS_DEFINE_NAMED_CID(NS_LOCALFILEOUTPUTSTREAM_CID);
  633. NS_DEFINE_NAMED_CID(NS_PARTIALLOCALFILEINPUTSTREAM_CID);
  634. NS_DEFINE_NAMED_CID(NS_ATOMICLOCALFILEOUTPUTSTREAM_CID);
  635. NS_DEFINE_NAMED_CID(NS_SAFELOCALFILEOUTPUTSTREAM_CID);
  636. NS_DEFINE_NAMED_CID(NS_LOCALFILESTREAM_CID);
  637. NS_DEFINE_NAMED_CID(NS_INCREMENTALDOWNLOAD_CID);
  638. NS_DEFINE_NAMED_CID(NS_STDURLPARSER_CID);
  639. NS_DEFINE_NAMED_CID(NS_NOAUTHURLPARSER_CID);
  640. NS_DEFINE_NAMED_CID(NS_AUTHURLPARSER_CID);
  641. NS_DEFINE_NAMED_CID(NS_STANDARDURL_CID);
  642. NS_DEFINE_NAMED_CID(NS_ARRAYBUFFERINPUTSTREAM_CID);
  643. NS_DEFINE_NAMED_CID(NS_BUFFEREDINPUTSTREAM_CID);
  644. NS_DEFINE_NAMED_CID(NS_BUFFEREDOUTPUTSTREAM_CID);
  645. NS_DEFINE_NAMED_CID(NS_MIMEINPUTSTREAM_CID);
  646. NS_DEFINE_NAMED_CID(NS_PROTOCOLPROXYSERVICE_CID);
  647. NS_DEFINE_NAMED_CID(NS_STREAMCONVERTERSERVICE_CID);
  648. #if defined(XP_WIN)
  649. NS_DEFINE_NAMED_CID(NS_NAMEDPIPESERVICE_CID);
  650. #endif
  651. NS_DEFINE_NAMED_CID(NS_DASHBOARD_CID);
  652. #ifdef NECKO_PROTOCOL_ftp
  653. NS_DEFINE_NAMED_CID(NS_FTPDIRLISTINGCONVERTER_CID);
  654. #endif
  655. NS_DEFINE_NAMED_CID(NS_NSINDEXEDTOHTMLCONVERTER_CID);
  656. NS_DEFINE_NAMED_CID(NS_DIRINDEXPARSER_CID);
  657. NS_DEFINE_NAMED_CID(NS_MULTIMIXEDCONVERTER_CID);
  658. NS_DEFINE_NAMED_CID(NS_UNKNOWNDECODER_CID);
  659. NS_DEFINE_NAMED_CID(NS_BINARYDETECTOR_CID);
  660. NS_DEFINE_NAMED_CID(NS_HTTPCOMPRESSCONVERTER_CID);
  661. NS_DEFINE_NAMED_CID(NS_NSTXTTOHTMLCONVERTER_CID);
  662. #ifdef BUILD_BINHEX_DECODER
  663. NS_DEFINE_NAMED_CID(NS_BINHEXDECODER_CID);
  664. #endif
  665. NS_DEFINE_NAMED_CID(MOZITXTTOHTMLCONV_CID);
  666. NS_DEFINE_NAMED_CID(NS_DIRINDEX_CID);
  667. NS_DEFINE_NAMED_CID(NS_MIMEHEADERPARAM_CID);
  668. #ifdef NECKO_PROTOCOL_file
  669. NS_DEFINE_NAMED_CID(NS_FILEPROTOCOLHANDLER_CID);
  670. #endif
  671. #ifdef NECKO_PROTOCOL_http
  672. NS_DEFINE_NAMED_CID(NS_HTTPPROTOCOLHANDLER_CID);
  673. NS_DEFINE_NAMED_CID(NS_HTTPSPROTOCOLHANDLER_CID);
  674. NS_DEFINE_NAMED_CID(NS_HTTPBASICAUTH_CID);
  675. NS_DEFINE_NAMED_CID(NS_HTTPDIGESTAUTH_CID);
  676. NS_DEFINE_NAMED_CID(NS_HTTPNTLMAUTH_CID);
  677. NS_DEFINE_NAMED_CID(NS_HTTPAUTHMANAGER_CID);
  678. NS_DEFINE_NAMED_CID(NS_HTTPCHANNELAUTHPROVIDER_CID);
  679. NS_DEFINE_NAMED_CID(NS_HTTPACTIVITYDISTRIBUTOR_CID);
  680. NS_DEFINE_NAMED_CID(NS_THROTTLEQUEUE_CID);
  681. #endif // !NECKO_PROTOCOL_http
  682. #ifdef NECKO_PROTOCOL_ftp
  683. NS_DEFINE_NAMED_CID(NS_FTPPROTOCOLHANDLER_CID);
  684. #endif
  685. #ifdef NECKO_PROTOCOL_res
  686. NS_DEFINE_NAMED_CID(NS_RESPROTOCOLHANDLER_CID);
  687. NS_DEFINE_NAMED_CID(NS_EXTENSIONPROTOCOLHANDLER_CID);
  688. NS_DEFINE_NAMED_CID(NS_SUBSTITUTINGURL_CID);
  689. #endif
  690. NS_DEFINE_NAMED_CID(NS_ABOUTPROTOCOLHANDLER_CID);
  691. NS_DEFINE_NAMED_CID(NS_SAFEABOUTPROTOCOLHANDLER_CID);
  692. NS_DEFINE_NAMED_CID(NS_ABOUT_BLANK_MODULE_CID);
  693. NS_DEFINE_NAMED_CID(NS_NESTEDABOUTURI_CID);
  694. #ifdef NECKO_PROTOCOL_about
  695. NS_DEFINE_NAMED_CID(NS_ABOUT_CACHE_MODULE_CID);
  696. NS_DEFINE_NAMED_CID(NS_ABOUT_CACHE_ENTRY_MODULE_CID);
  697. #endif
  698. NS_DEFINE_NAMED_CID(NS_SOCKSSOCKETPROVIDER_CID);
  699. NS_DEFINE_NAMED_CID(NS_SOCKS4SOCKETPROVIDER_CID);
  700. NS_DEFINE_NAMED_CID(NS_UDPSOCKETPROVIDER_CID);
  701. NS_DEFINE_NAMED_CID(NS_CACHESERVICE_CID);
  702. NS_DEFINE_NAMED_CID(NS_APPLICATIONCACHESERVICE_CID);
  703. NS_DEFINE_NAMED_CID(NS_APPLICATIONCACHENAMESPACE_CID);
  704. NS_DEFINE_NAMED_CID(NS_APPLICATIONCACHE_CID);
  705. #ifdef NECKO_COOKIES
  706. NS_DEFINE_NAMED_CID(NS_COOKIEMANAGER_CID);
  707. NS_DEFINE_NAMED_CID(NS_COOKIESERVICE_CID);
  708. #endif
  709. #ifdef NECKO_WIFI
  710. NS_DEFINE_NAMED_CID(NS_WIFI_MONITOR_COMPONENT_CID);
  711. #endif
  712. #ifdef NECKO_PROTOCOL_data
  713. NS_DEFINE_NAMED_CID(NS_DATAPROTOCOLHANDLER_CID);
  714. #endif
  715. #ifdef NECKO_PROTOCOL_device
  716. NS_DEFINE_NAMED_CID(NS_DEVICEPROTOCOLHANDLER_CID);
  717. #endif
  718. #ifdef NECKO_PROTOCOL_viewsource
  719. NS_DEFINE_NAMED_CID(NS_VIEWSOURCEHANDLER_CID);
  720. #endif
  721. #ifdef NECKO_PROTOCOL_wyciwyg
  722. NS_DEFINE_NAMED_CID(NS_WYCIWYGPROTOCOLHANDLER_CID);
  723. #endif
  724. #ifdef NECKO_PROTOCOL_websocket
  725. NS_DEFINE_NAMED_CID(NS_WEBSOCKETPROTOCOLHANDLER_CID);
  726. NS_DEFINE_NAMED_CID(NS_WEBSOCKETSSLPROTOCOLHANDLER_CID);
  727. #endif
  728. #ifdef NECKO_PROTOCOL_rtsp
  729. NS_DEFINE_NAMED_CID(NS_RTSPPROTOCOLHANDLER_CID);
  730. #endif
  731. #if defined(XP_WIN)
  732. NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
  733. #elif defined(MOZ_WIDGET_COCOA)
  734. NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
  735. #elif defined(XP_LINUX)
  736. NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
  737. #endif
  738. NS_DEFINE_NAMED_CID(NS_SERIALIZATION_HELPER_CID);
  739. NS_DEFINE_NAMED_CID(NS_REDIRECTCHANNELREGISTRAR_CID);
  740. NS_DEFINE_NAMED_CID(NS_CACHE_STORAGE_SERVICE_CID);
  741. NS_DEFINE_NAMED_CID(NS_NSILOADCONTEXTINFOFACTORY_CID);
  742. NS_DEFINE_NAMED_CID(NS_NETWORKPREDICTOR_CID);
  743. NS_DEFINE_NAMED_CID(NS_CAPTIVEPORTAL_CID);
  744. NS_DEFINE_NAMED_CID(NS_REQUESTCONTEXTSERVICE_CID);
  745. #ifdef BUILD_NETWORK_INFO_SERVICE
  746. NS_DEFINE_NAMED_CID(NETWORKINFOSERVICE_CID);
  747. #endif // BUILD_NETWORK_INFO_SERVICE
  748. static const mozilla::Module::CIDEntry kNeckoCIDs[] = {
  749. { &kNS_IOSERVICE_CID, false, nullptr, nsIOServiceConstructor },
  750. { &kNS_STREAMTRANSPORTSERVICE_CID, false, nullptr, nsStreamTransportServiceConstructor },
  751. { &kNS_SOCKETTRANSPORTSERVICE_CID, false, nullptr, nsSocketTransportServiceConstructor },
  752. { &kNS_SERVERSOCKET_CID, false, nullptr, nsServerSocketConstructor },
  753. { &kNS_TLSSERVERSOCKET_CID, false, nullptr, TLSServerSocketConstructor },
  754. { &kNS_UDPSOCKET_CID, false, nullptr, nsUDPSocketConstructor },
  755. { &kNS_SOCKETPROVIDERSERVICE_CID, false, nullptr, nsSocketProviderService::Create },
  756. { &kNS_DNSSERVICE_CID, false, nullptr, nsIDNSServiceConstructor },
  757. { &kNS_IDNSERVICE_CID, false, nullptr, nsIDNServiceConstructor },
  758. { &kNS_EFFECTIVETLDSERVICE_CID, false, nullptr, nsEffectiveTLDServiceConstructor },
  759. { &kNS_SIMPLEURI_CID, false, nullptr, nsSimpleURIConstructor },
  760. { &kNS_SIMPLENESTEDURI_CID, false, nullptr, nsSimpleNestedURIConstructor },
  761. { &kNS_ASYNCSTREAMCOPIER_CID, false, nullptr, nsAsyncStreamCopierConstructor },
  762. { &kNS_INPUTSTREAMPUMP_CID, false, nullptr, nsInputStreamPumpConstructor },
  763. { &kNS_INPUTSTREAMCHANNEL_CID, false, nullptr, nsInputStreamChannelConstructor },
  764. { &kNS_STREAMLOADER_CID, false, nullptr, mozilla::net::nsStreamLoader::Create },
  765. { &kNS_INCREMENTALSTREAMLOADER_CID, false, nullptr, nsIncrementalStreamLoader::Create },
  766. { &kNS_UNICHARSTREAMLOADER_CID, false, nullptr, nsUnicharStreamLoader::Create },
  767. { &kNS_DOWNLOADER_CID, false, nullptr, nsDownloaderConstructor },
  768. { &kNS_BACKGROUNDFILESAVEROUTPUTSTREAM_CID, false, nullptr,
  769. mozilla::net::BackgroundFileSaverOutputStreamConstructor },
  770. { &kNS_BACKGROUNDFILESAVERSTREAMLISTENER_CID, false, nullptr,
  771. mozilla::net::BackgroundFileSaverStreamListenerConstructor },
  772. { &kNS_SYNCSTREAMLISTENER_CID, false, nullptr, nsSyncStreamListenerConstructor },
  773. { &kNS_REQUESTOBSERVERPROXY_CID, false, nullptr, nsRequestObserverProxyConstructor },
  774. { &kNS_SIMPLESTREAMLISTENER_CID, false, nullptr, nsSimpleStreamListenerConstructor },
  775. { &kNS_STREAMLISTENERTEE_CID, false, nullptr, nsStreamListenerTeeConstructor },
  776. { &kNS_LOADGROUP_CID, false, nullptr, nsLoadGroupConstructor },
  777. { &kNS_LOCALFILEINPUTSTREAM_CID, false, nullptr, nsFileInputStream::Create },
  778. { &kNS_LOCALFILEOUTPUTSTREAM_CID, false, nullptr, nsFileOutputStream::Create },
  779. { &kNS_PARTIALLOCALFILEINPUTSTREAM_CID, false, nullptr, nsPartialFileInputStream::Create },
  780. { &kNS_ATOMICLOCALFILEOUTPUTSTREAM_CID, false, nullptr, nsAtomicFileOutputStreamConstructor },
  781. { &kNS_SAFELOCALFILEOUTPUTSTREAM_CID, false, nullptr, nsSafeFileOutputStreamConstructor },
  782. { &kNS_LOCALFILESTREAM_CID, false, nullptr, nsFileStreamConstructor },
  783. { &kNS_INCREMENTALDOWNLOAD_CID, false, nullptr, net_NewIncrementalDownload },
  784. { &kNS_STDURLPARSER_CID, false, nullptr, nsStdURLParserConstructor },
  785. { &kNS_NOAUTHURLPARSER_CID, false, nullptr, nsNoAuthURLParserConstructor },
  786. { &kNS_AUTHURLPARSER_CID, false, nullptr, nsAuthURLParserConstructor },
  787. { &kNS_STANDARDURL_CID, false, nullptr, nsStandardURLConstructor },
  788. { &kNS_ARRAYBUFFERINPUTSTREAM_CID, false, nullptr, ArrayBufferInputStreamConstructor },
  789. { &kNS_BUFFEREDINPUTSTREAM_CID, false, nullptr, nsBufferedInputStream::Create },
  790. { &kNS_BUFFEREDOUTPUTSTREAM_CID, false, nullptr, nsBufferedOutputStream::Create },
  791. { &kNS_MIMEINPUTSTREAM_CID, false, nullptr, nsMIMEInputStreamConstructor },
  792. { &kNS_PROTOCOLPROXYSERVICE_CID, true, nullptr, nsProtocolProxyServiceConstructor },
  793. { &kNS_STREAMCONVERTERSERVICE_CID, false, nullptr, CreateNewStreamConvServiceFactory },
  794. #if defined (XP_WIN)
  795. { &kNS_NAMEDPIPESERVICE_CID, false, NULL, mozilla::net::NamedPipeServiceConstructor },
  796. #endif
  797. { &kNS_DASHBOARD_CID, false, nullptr, mozilla::net::DashboardConstructor },
  798. #ifdef NECKO_PROTOCOL_ftp
  799. { &kNS_FTPDIRLISTINGCONVERTER_CID, false, nullptr, CreateNewFTPDirListingConv },
  800. #endif
  801. { &kNS_NSINDEXEDTOHTMLCONVERTER_CID, false, nullptr, nsIndexedToHTML::Create },
  802. { &kNS_DIRINDEXPARSER_CID, false, nullptr, nsDirIndexParserConstructor },
  803. { &kNS_MULTIMIXEDCONVERTER_CID, false, nullptr, CreateNewMultiMixedConvFactory },
  804. { &kNS_UNKNOWNDECODER_CID, false, nullptr, CreateNewUnknownDecoderFactory },
  805. { &kNS_BINARYDETECTOR_CID, false, nullptr, CreateNewBinaryDetectorFactory },
  806. { &kNS_HTTPCOMPRESSCONVERTER_CID, false, nullptr, CreateNewHTTPCompressConvFactory },
  807. { &kNS_NSTXTTOHTMLCONVERTER_CID, false, nullptr, mozilla::net::nsTXTToHTMLConvConstructor },
  808. #ifdef BUILD_BINHEX_DECODER
  809. { &kNS_BINHEXDECODER_CID, false, nullptr, nsBinHexDecoderConstructor },
  810. #endif
  811. { &kMOZITXTTOHTMLCONV_CID, false, nullptr, CreateNewTXTToHTMLConvFactory },
  812. { &kNS_DIRINDEX_CID, false, nullptr, nsDirIndexConstructor },
  813. { &kNS_MIMEHEADERPARAM_CID, false, nullptr, nsMIMEHeaderParamImplConstructor },
  814. #ifdef NECKO_PROTOCOL_file
  815. { &kNS_FILEPROTOCOLHANDLER_CID, false, nullptr, nsFileProtocolHandlerConstructor },
  816. #endif
  817. #ifdef NECKO_PROTOCOL_http
  818. { &kNS_HTTPPROTOCOLHANDLER_CID, false, nullptr, mozilla::net::nsHttpHandlerConstructor },
  819. { &kNS_HTTPSPROTOCOLHANDLER_CID, false, nullptr, mozilla::net::nsHttpsHandlerConstructor },
  820. { &kNS_HTTPBASICAUTH_CID, false, nullptr, mozilla::net::nsHttpBasicAuthConstructor },
  821. { &kNS_HTTPDIGESTAUTH_CID, false, nullptr, mozilla::net::nsHttpDigestAuthConstructor },
  822. { &kNS_HTTPNTLMAUTH_CID, false, nullptr, mozilla::net::nsHttpNTLMAuthConstructor },
  823. { &kNS_HTTPAUTHMANAGER_CID, false, nullptr, mozilla::net::nsHttpAuthManagerConstructor },
  824. { &kNS_HTTPCHANNELAUTHPROVIDER_CID, false, nullptr, mozilla::net::nsHttpChannelAuthProviderConstructor },
  825. { &kNS_HTTPACTIVITYDISTRIBUTOR_CID, false, nullptr, mozilla::net::nsHttpActivityDistributorConstructor },
  826. { &kNS_THROTTLEQUEUE_CID, false, nullptr, mozilla::net::ThrottleQueueConstructor },
  827. #endif // !NECKO_PROTOCOL_http
  828. #ifdef NECKO_PROTOCOL_ftp
  829. { &kNS_FTPPROTOCOLHANDLER_CID, false, nullptr, nsFtpProtocolHandlerConstructor },
  830. #endif
  831. #ifdef NECKO_PROTOCOL_res
  832. { &kNS_RESPROTOCOLHANDLER_CID, false, nullptr, nsResProtocolHandlerConstructor },
  833. { &kNS_EXTENSIONPROTOCOLHANDLER_CID, false, nullptr, mozilla::ExtensionProtocolHandlerConstructor },
  834. { &kNS_SUBSTITUTINGURL_CID, false, nullptr, mozilla::SubstitutingURLConstructor },
  835. #endif
  836. { &kNS_ABOUTPROTOCOLHANDLER_CID, false, nullptr, nsAboutProtocolHandlerConstructor },
  837. { &kNS_SAFEABOUTPROTOCOLHANDLER_CID, false, nullptr, nsSafeAboutProtocolHandlerConstructor },
  838. { &kNS_ABOUT_BLANK_MODULE_CID, false, nullptr, nsAboutBlank::Create },
  839. { &kNS_NESTEDABOUTURI_CID, false, nullptr, nsNestedAboutURIConstructor },
  840. #ifdef NECKO_PROTOCOL_about
  841. { &kNS_ABOUT_CACHE_MODULE_CID, false, nullptr, nsAboutCache::Create },
  842. { &kNS_ABOUT_CACHE_ENTRY_MODULE_CID, false, nullptr, nsAboutCacheEntryConstructor },
  843. #endif
  844. { &kNS_SOCKSSOCKETPROVIDER_CID, false, nullptr, nsSOCKSSocketProvider::CreateV5 },
  845. { &kNS_SOCKS4SOCKETPROVIDER_CID, false, nullptr, nsSOCKSSocketProvider::CreateV4 },
  846. { &kNS_UDPSOCKETPROVIDER_CID, false, nullptr, nsUDPSocketProviderConstructor },
  847. { &kNS_CACHESERVICE_CID, false, nullptr, nsCacheService::Create },
  848. { &kNS_APPLICATIONCACHESERVICE_CID, false, nullptr, nsApplicationCacheServiceConstructor },
  849. { &kNS_APPLICATIONCACHENAMESPACE_CID, false, nullptr, nsApplicationCacheNamespaceConstructor },
  850. { &kNS_APPLICATIONCACHE_CID, false, nullptr, nsApplicationCacheConstructor },
  851. #ifdef NECKO_COOKIES
  852. { &kNS_COOKIEMANAGER_CID, false, nullptr, nsICookieServiceConstructor },
  853. { &kNS_COOKIESERVICE_CID, false, nullptr, nsICookieServiceConstructor },
  854. #endif
  855. #ifdef NECKO_WIFI
  856. { &kNS_WIFI_MONITOR_COMPONENT_CID, false, nullptr, nsWifiMonitorConstructor },
  857. #endif
  858. #ifdef NECKO_PROTOCOL_data
  859. { &kNS_DATAPROTOCOLHANDLER_CID, false, nullptr, nsDataHandler::Create },
  860. #endif
  861. #ifdef NECKO_PROTOCOL_device
  862. { &kNS_DEVICEPROTOCOLHANDLER_CID, false, nullptr, nsDeviceProtocolHandlerConstructor},
  863. #endif
  864. #ifdef NECKO_PROTOCOL_viewsource
  865. { &kNS_VIEWSOURCEHANDLER_CID, false, nullptr, nsViewSourceHandlerConstructor },
  866. #endif
  867. #ifdef NECKO_PROTOCOL_wyciwyg
  868. { &kNS_WYCIWYGPROTOCOLHANDLER_CID, false, nullptr, nsWyciwygProtocolHandlerConstructor },
  869. #endif
  870. #ifdef NECKO_PROTOCOL_websocket
  871. { &kNS_WEBSOCKETPROTOCOLHANDLER_CID, false, nullptr,
  872. mozilla::net::WebSocketChannelConstructor },
  873. { &kNS_WEBSOCKETSSLPROTOCOLHANDLER_CID, false, nullptr,
  874. mozilla::net::WebSocketSSLChannelConstructor },
  875. #endif
  876. #ifdef NECKO_PROTOCOL_rtsp
  877. { &kNS_RTSPPROTOCOLHANDLER_CID, false, nullptr, mozilla::net::RtspHandlerConstructor },
  878. #endif
  879. #if defined(XP_WIN)
  880. { &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsNotifyAddrListenerConstructor },
  881. #elif defined(MOZ_WIDGET_COCOA)
  882. { &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsNetworkLinkServiceConstructor },
  883. #elif defined(XP_LINUX)
  884. { &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsNotifyAddrListenerConstructor },
  885. #endif
  886. { &kNS_SERIALIZATION_HELPER_CID, false, nullptr, nsSerializationHelperConstructor },
  887. { &kNS_REDIRECTCHANNELREGISTRAR_CID, false, nullptr, RedirectChannelRegistrarConstructor },
  888. { &kNS_CACHE_STORAGE_SERVICE_CID, false, nullptr, CacheStorageServiceConstructor },
  889. { &kNS_NSILOADCONTEXTINFOFACTORY_CID, false, nullptr, LoadContextInfoFactoryConstructor },
  890. { &kNS_NETWORKPREDICTOR_CID, false, nullptr, mozilla::net::Predictor::Create },
  891. { &kNS_CAPTIVEPORTAL_CID, false, nullptr, mozilla::net::CaptivePortalServiceConstructor },
  892. { &kNS_REQUESTCONTEXTSERVICE_CID, false, nullptr, RequestContextServiceConstructor },
  893. #ifdef BUILD_NETWORK_INFO_SERVICE
  894. { &kNETWORKINFOSERVICE_CID, false, nullptr, nsNetworkInfoServiceConstructor },
  895. #endif
  896. { nullptr }
  897. };
  898. static const mozilla::Module::ContractIDEntry kNeckoContracts[] = {
  899. { NS_IOSERVICE_CONTRACTID, &kNS_IOSERVICE_CID },
  900. { NS_NETUTIL_CONTRACTID, &kNS_IOSERVICE_CID },
  901. { NS_STREAMTRANSPORTSERVICE_CONTRACTID, &kNS_STREAMTRANSPORTSERVICE_CID },
  902. { NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &kNS_SOCKETTRANSPORTSERVICE_CID },
  903. { NS_SERVERSOCKET_CONTRACTID, &kNS_SERVERSOCKET_CID },
  904. { NS_TLSSERVERSOCKET_CONTRACTID, &kNS_TLSSERVERSOCKET_CID },
  905. { NS_UDPSOCKET_CONTRACTID, &kNS_UDPSOCKET_CID },
  906. { NS_SOCKETPROVIDERSERVICE_CONTRACTID, &kNS_SOCKETPROVIDERSERVICE_CID },
  907. { NS_DNSSERVICE_CONTRACTID, &kNS_DNSSERVICE_CID },
  908. { NS_IDNSERVICE_CONTRACTID, &kNS_IDNSERVICE_CID },
  909. { NS_EFFECTIVETLDSERVICE_CONTRACTID, &kNS_EFFECTIVETLDSERVICE_CID },
  910. { NS_SIMPLEURI_CONTRACTID, &kNS_SIMPLEURI_CID },
  911. { NS_ASYNCSTREAMCOPIER_CONTRACTID, &kNS_ASYNCSTREAMCOPIER_CID },
  912. { NS_INPUTSTREAMPUMP_CONTRACTID, &kNS_INPUTSTREAMPUMP_CID },
  913. { NS_INPUTSTREAMCHANNEL_CONTRACTID, &kNS_INPUTSTREAMCHANNEL_CID },
  914. { NS_STREAMLOADER_CONTRACTID, &kNS_STREAMLOADER_CID },
  915. { NS_INCREMENTALSTREAMLOADER_CONTRACTID, &kNS_INCREMENTALSTREAMLOADER_CID },
  916. { NS_UNICHARSTREAMLOADER_CONTRACTID, &kNS_UNICHARSTREAMLOADER_CID },
  917. { NS_DOWNLOADER_CONTRACTID, &kNS_DOWNLOADER_CID },
  918. { NS_BACKGROUNDFILESAVEROUTPUTSTREAM_CONTRACTID, &kNS_BACKGROUNDFILESAVEROUTPUTSTREAM_CID },
  919. { NS_BACKGROUNDFILESAVERSTREAMLISTENER_CONTRACTID, &kNS_BACKGROUNDFILESAVERSTREAMLISTENER_CID },
  920. { NS_SYNCSTREAMLISTENER_CONTRACTID, &kNS_SYNCSTREAMLISTENER_CID },
  921. { NS_REQUESTOBSERVERPROXY_CONTRACTID, &kNS_REQUESTOBSERVERPROXY_CID },
  922. { NS_SIMPLESTREAMLISTENER_CONTRACTID, &kNS_SIMPLESTREAMLISTENER_CID },
  923. { NS_STREAMLISTENERTEE_CONTRACTID, &kNS_STREAMLISTENERTEE_CID },
  924. { NS_LOADGROUP_CONTRACTID, &kNS_LOADGROUP_CID },
  925. { NS_LOCALFILEINPUTSTREAM_CONTRACTID, &kNS_LOCALFILEINPUTSTREAM_CID },
  926. { NS_LOCALFILEOUTPUTSTREAM_CONTRACTID, &kNS_LOCALFILEOUTPUTSTREAM_CID },
  927. { NS_PARTIALLOCALFILEINPUTSTREAM_CONTRACTID, &kNS_PARTIALLOCALFILEINPUTSTREAM_CID },
  928. { NS_ATOMICLOCALFILEOUTPUTSTREAM_CONTRACTID, &kNS_ATOMICLOCALFILEOUTPUTSTREAM_CID },
  929. { NS_SAFELOCALFILEOUTPUTSTREAM_CONTRACTID, &kNS_SAFELOCALFILEOUTPUTSTREAM_CID },
  930. { NS_LOCALFILESTREAM_CONTRACTID, &kNS_LOCALFILESTREAM_CID },
  931. { NS_INCREMENTALDOWNLOAD_CONTRACTID, &kNS_INCREMENTALDOWNLOAD_CID },
  932. { NS_STDURLPARSER_CONTRACTID, &kNS_STDURLPARSER_CID },
  933. { NS_NOAUTHURLPARSER_CONTRACTID, &kNS_NOAUTHURLPARSER_CID },
  934. { NS_AUTHURLPARSER_CONTRACTID, &kNS_AUTHURLPARSER_CID },
  935. { NS_STANDARDURL_CONTRACTID, &kNS_STANDARDURL_CID },
  936. { NS_ARRAYBUFFERINPUTSTREAM_CONTRACTID, &kNS_ARRAYBUFFERINPUTSTREAM_CID },
  937. { NS_BUFFEREDINPUTSTREAM_CONTRACTID, &kNS_BUFFEREDINPUTSTREAM_CID },
  938. { NS_BUFFEREDOUTPUTSTREAM_CONTRACTID, &kNS_BUFFEREDOUTPUTSTREAM_CID },
  939. { NS_MIMEINPUTSTREAM_CONTRACTID, &kNS_MIMEINPUTSTREAM_CID },
  940. { NS_PROTOCOLPROXYSERVICE_CONTRACTID, &kNS_PROTOCOLPROXYSERVICE_CID },
  941. { NS_STREAMCONVERTERSERVICE_CONTRACTID, &kNS_STREAMCONVERTERSERVICE_CID },
  942. #if defined(XP_WIN)
  943. { NS_NAMEDPIPESERVICE_CONTRACTID, &kNS_NAMEDPIPESERVICE_CID },
  944. #endif
  945. { NS_DASHBOARD_CONTRACTID, &kNS_DASHBOARD_CID },
  946. #ifdef NECKO_PROTOCOL_ftp
  947. { NS_ISTREAMCONVERTER_KEY FTP_TO_INDEX, &kNS_FTPDIRLISTINGCONVERTER_CID },
  948. #endif
  949. { NS_ISTREAMCONVERTER_KEY INDEX_TO_HTML, &kNS_NSINDEXEDTOHTMLCONVERTER_CID },
  950. { NS_DIRINDEXPARSER_CONTRACTID, &kNS_DIRINDEXPARSER_CID },
  951. { NS_ISTREAMCONVERTER_KEY MULTI_MIXED_X, &kNS_MULTIMIXEDCONVERTER_CID },
  952. { NS_ISTREAMCONVERTER_KEY MULTI_BYTERANGES, &kNS_MULTIMIXEDCONVERTER_CID },
  953. { NS_ISTREAMCONVERTER_KEY MULTI_MIXED, &kNS_MULTIMIXEDCONVERTER_CID },
  954. { NS_ISTREAMCONVERTER_KEY UNKNOWN_CONTENT, &kNS_UNKNOWNDECODER_CID },
  955. { NS_GENERIC_CONTENT_SNIFFER, &kNS_UNKNOWNDECODER_CID },
  956. { NS_BINARYDETECTOR_CONTRACTID, &kNS_BINARYDETECTOR_CID },
  957. { NS_ISTREAMCONVERTER_KEY GZIP_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
  958. { NS_ISTREAMCONVERTER_KEY XGZIP_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
  959. { NS_ISTREAMCONVERTER_KEY BROTLI_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
  960. { NS_ISTREAMCONVERTER_KEY COMPRESS_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
  961. { NS_ISTREAMCONVERTER_KEY XCOMPRESS_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
  962. { NS_ISTREAMCONVERTER_KEY DEFLATE_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
  963. { NS_ISTREAMCONVERTER_KEY PLAIN_TO_HTML, &kNS_NSTXTTOHTMLCONVERTER_CID },
  964. #ifdef BUILD_BINHEX_DECODER
  965. { NS_ISTREAMCONVERTER_KEY BINHEX_TO_WILD, &kNS_BINHEXDECODER_CID },
  966. #endif
  967. { MOZ_TXTTOHTMLCONV_CONTRACTID, &kMOZITXTTOHTMLCONV_CID },
  968. { "@mozilla.org/dirIndex;1", &kNS_DIRINDEX_CID },
  969. { NS_MIMEHEADERPARAM_CONTRACTID, &kNS_MIMEHEADERPARAM_CID },
  970. #ifdef NECKO_PROTOCOL_file
  971. { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "file", &kNS_FILEPROTOCOLHANDLER_CID },
  972. #endif
  973. #ifdef NECKO_PROTOCOL_http
  974. { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &kNS_HTTPPROTOCOLHANDLER_CID },
  975. { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "https", &kNS_HTTPSPROTOCOLHANDLER_CID },
  976. { NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX "basic", &kNS_HTTPBASICAUTH_CID },
  977. { NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX "digest", &kNS_HTTPDIGESTAUTH_CID },
  978. { NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX "ntlm", &kNS_HTTPNTLMAUTH_CID },
  979. { NS_HTTPAUTHMANAGER_CONTRACTID, &kNS_HTTPAUTHMANAGER_CID },
  980. { NS_HTTPCHANNELAUTHPROVIDER_CONTRACTID, &kNS_HTTPCHANNELAUTHPROVIDER_CID },
  981. { NS_HTTPACTIVITYDISTRIBUTOR_CONTRACTID, &kNS_HTTPACTIVITYDISTRIBUTOR_CID },
  982. { NS_THROTTLEQUEUE_CONTRACTID, &kNS_THROTTLEQUEUE_CID },
  983. #endif // !NECKO_PROTOCOL_http
  984. #ifdef NECKO_PROTOCOL_ftp
  985. { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "ftp", &kNS_FTPPROTOCOLHANDLER_CID },
  986. #endif
  987. #ifdef NECKO_PROTOCOL_res
  988. { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "resource", &kNS_RESPROTOCOLHANDLER_CID },
  989. { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "moz-extension", &kNS_EXTENSIONPROTOCOLHANDLER_CID },
  990. #endif
  991. { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "about", &kNS_ABOUTPROTOCOLHANDLER_CID },
  992. { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "moz-safe-about", &kNS_SAFEABOUTPROTOCOLHANDLER_CID },
  993. { NS_ABOUT_MODULE_CONTRACTID_PREFIX "blank", &kNS_ABOUT_BLANK_MODULE_CID },
  994. #ifdef NECKO_PROTOCOL_about
  995. { NS_ABOUT_MODULE_CONTRACTID_PREFIX "cache", &kNS_ABOUT_CACHE_MODULE_CID },
  996. { NS_ABOUT_MODULE_CONTRACTID_PREFIX "cache-entry", &kNS_ABOUT_CACHE_ENTRY_MODULE_CID },
  997. #endif
  998. { NS_NETWORK_SOCKET_CONTRACTID_PREFIX "socks", &kNS_SOCKSSOCKETPROVIDER_CID },
  999. { NS_NETWORK_SOCKET_CONTRACTID_PREFIX "socks4", &kNS_SOCKS4SOCKETPROVIDER_CID },
  1000. { NS_NETWORK_SOCKET_CONTRACTID_PREFIX "udp", &kNS_UDPSOCKETPROVIDER_CID },
  1001. { NS_CACHESERVICE_CONTRACTID, &kNS_CACHESERVICE_CID },
  1002. { NS_APPLICATIONCACHESERVICE_CONTRACTID, &kNS_APPLICATIONCACHESERVICE_CID },
  1003. { NS_APPLICATIONCACHENAMESPACE_CONTRACTID, &kNS_APPLICATIONCACHENAMESPACE_CID },
  1004. { NS_APPLICATIONCACHE_CONTRACTID, &kNS_APPLICATIONCACHE_CID },
  1005. #ifdef NECKO_COOKIES
  1006. { NS_COOKIEMANAGER_CONTRACTID, &kNS_COOKIEMANAGER_CID },
  1007. { NS_COOKIESERVICE_CONTRACTID, &kNS_COOKIESERVICE_CID },
  1008. #endif
  1009. #ifdef NECKO_WIFI
  1010. { NS_WIFI_MONITOR_CONTRACTID, &kNS_WIFI_MONITOR_COMPONENT_CID },
  1011. #endif
  1012. #ifdef NECKO_PROTOCOL_data
  1013. { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "data", &kNS_DATAPROTOCOLHANDLER_CID },
  1014. #endif
  1015. #ifdef NECKO_PROTOCOL_device
  1016. { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "moz-device", &kNS_DEVICEPROTOCOLHANDLER_CID },
  1017. #endif
  1018. #ifdef NECKO_PROTOCOL_viewsource
  1019. { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "view-source", &kNS_VIEWSOURCEHANDLER_CID },
  1020. #endif
  1021. #ifdef NECKO_PROTOCOL_wyciwyg
  1022. { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "wyciwyg", &kNS_WYCIWYGPROTOCOLHANDLER_CID },
  1023. #endif
  1024. #ifdef NECKO_PROTOCOL_websocket
  1025. { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "ws", &kNS_WEBSOCKETPROTOCOLHANDLER_CID },
  1026. { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "wss", &kNS_WEBSOCKETSSLPROTOCOLHANDLER_CID },
  1027. #endif
  1028. #ifdef NECKO_PROTOCOL_rtsp
  1029. { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "rtsp", &kNS_RTSPPROTOCOLHANDLER_CID },
  1030. #endif
  1031. #if defined(XP_WIN)
  1032. { NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
  1033. #elif defined(MOZ_WIDGET_COCOA)
  1034. { NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
  1035. #elif defined(XP_LINUX)
  1036. { NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
  1037. #endif
  1038. { NS_SERIALIZATION_HELPER_CONTRACTID, &kNS_SERIALIZATION_HELPER_CID },
  1039. { NS_REDIRECTCHANNELREGISTRAR_CONTRACTID, &kNS_REDIRECTCHANNELREGISTRAR_CID },
  1040. { NS_CACHE_STORAGE_SERVICE_CONTRACTID, &kNS_CACHE_STORAGE_SERVICE_CID },
  1041. { NS_CACHE_STORAGE_SERVICE_CONTRACTID2, &kNS_CACHE_STORAGE_SERVICE_CID },
  1042. { NS_NSILOADCONTEXTINFOFACTORY_CONTRACTID, &kNS_NSILOADCONTEXTINFOFACTORY_CID },
  1043. { NS_NETWORKPREDICTOR_CONTRACTID, &kNS_NETWORKPREDICTOR_CID },
  1044. { NS_CAPTIVEPORTAL_CONTRACTID, &kNS_CAPTIVEPORTAL_CID },
  1045. { NS_REQUESTCONTEXTSERVICE_CONTRACTID, &kNS_REQUESTCONTEXTSERVICE_CID },
  1046. #ifdef BUILD_NETWORK_INFO_SERVICE
  1047. { NETWORKINFOSERVICE_CONTRACT_ID, &kNETWORKINFOSERVICE_CID },
  1048. #endif
  1049. { nullptr }
  1050. };
  1051. static const mozilla::Module kNeckoModule = {
  1052. mozilla::Module::kVersion,
  1053. kNeckoCIDs,
  1054. kNeckoContracts,
  1055. kNeckoCategories,
  1056. nullptr,
  1057. nsNetStartup,
  1058. nsNetShutdown
  1059. };
  1060. NSMODULE_DEFN(necko) = &kNeckoModule;