netwerk/build/nsNetModule.cpp

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

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

mercurial