2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2018-11-30 18:39:55 +03:00
|
|
|
/* vim: set sw=2 ts=8 et tw=80 : */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-10-03 04:40:10 +04:00
|
|
|
|
2003-04-23 07:47:43 +04:00
|
|
|
#include "necko-config.h"
|
|
|
|
|
2013-06-22 20:01:06 +04:00
|
|
|
#define ALLOW_LATE_HTTPLOG_H_INCLUDE 1
|
2009-10-22 03:01:16 +04:00
|
|
|
#include "base/basictypes.h"
|
|
|
|
|
1999-09-30 05:53:31 +04:00
|
|
|
#include "nsCOMPtr.h"
|
2006-03-30 21:31:15 +04:00
|
|
|
#include "nsIClassInfoImpl.h"
|
2018-12-17 05:36:32 +03:00
|
|
|
#include "mozilla/Components.h"
|
2010-06-10 22:11:40 +04:00
|
|
|
#include "mozilla/ModuleUtils.h"
|
1999-09-30 05:53:31 +04:00
|
|
|
#include "nscore.h"
|
|
|
|
#include "nsSimpleURI.h"
|
|
|
|
#include "nsLoadGroup.h"
|
2004-01-08 06:56:02 +03:00
|
|
|
#include "nsMimeTypes.h"
|
2008-11-08 02:00:26 +03:00
|
|
|
#include "nsDNSPrefetch.h"
|
2011-05-04 17:36:23 +04:00
|
|
|
#include "nsXULAppAPI.h"
|
2012-11-21 04:19:53 +04:00
|
|
|
#include "nsCategoryCache.h"
|
|
|
|
#include "nsIContentSniffer.h"
|
2018-12-17 05:36:32 +03:00
|
|
|
#include "nsStandardURL.h"
|
2018-09-26 03:27:32 +03:00
|
|
|
#include "mozilla/net/BackgroundChannelRegistrar.h"
|
2013-06-22 20:01:06 +04:00
|
|
|
#include "mozilla/net/NeckoChild.h"
|
2018-08-22 07:37:28 +03:00
|
|
|
#include "RedirectChannelRegistrar.h"
|
2018-11-01 13:39:58 +03:00
|
|
|
#include "nsAuthGSSAPI.h"
|
1999-09-30 05:53:31 +04:00
|
|
|
|
2001-01-24 01:10:34 +03:00
|
|
|
#include "nsNetCID.h"
|
|
|
|
|
2016-06-02 23:42:36 +03:00
|
|
|
#if defined(XP_MACOSX) || defined(XP_WIN) || defined(XP_LINUX)
|
2016-06-01 23:16:40 +03:00
|
|
|
# define BUILD_NETWORK_INFO_SERVICE 1
|
|
|
|
#endif
|
|
|
|
|
2018-12-17 05:36:32 +03:00
|
|
|
using namespace mozilla;
|
|
|
|
|
2012-11-21 04:19:53 +04:00
|
|
|
typedef nsCategoryCache<nsIContentSniffer> ContentSnifferCache;
|
2014-06-02 16:08:21 +04:00
|
|
|
ContentSnifferCache* gNetSniffers = nullptr;
|
|
|
|
ContentSnifferCache* gDataSniffers = nullptr;
|
2012-11-21 04:19:53 +04:00
|
|
|
|
2018-12-17 05:36:32 +03:00
|
|
|
#define static
|
2016-05-19 05:02:57 +03:00
|
|
|
typedef mozilla::net::nsLoadGroup nsLoadGroup;
|
2018-12-19 18:08:28 +03:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsLoadGroup, Init)
|
2018-12-17 05:36:32 +03:00
|
|
|
#undef static
|
2009-03-17 03:30:58 +03:00
|
|
|
|
2001-03-08 03:58:06 +03:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2003-04-23 07:47:43 +04:00
|
|
|
// protocols
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// http/https
|
2001-05-12 01:04:09 +04:00
|
|
|
#include "nsHttpHandler.h"
|
2015-05-27 10:49:00 +03:00
|
|
|
#include "Http2Compression.h"
|
2009-08-21 02:55:07 +04:00
|
|
|
#undef LOG
|
|
|
|
#undef LOG_ENABLED
|
2003-03-27 22:31:53 +03:00
|
|
|
#include "nsHttpAuthManager.h"
|
2009-09-02 00:55:50 +04:00
|
|
|
#include "nsHttpActivityDistributor.h"
|
2016-02-24 00:26:45 +03:00
|
|
|
#include "ThrottleQueue.h"
|
2003-01-18 05:15:14 +03:00
|
|
|
#undef LOG
|
2003-04-11 05:19:07 +04:00
|
|
|
#undef LOG_ENABLED
|
2009-09-02 00:55:50 +04:00
|
|
|
|
2018-12-17 05:36:32 +03:00
|
|
|
NS_IMPL_COMPONENT_FACTORY(net::nsHttpHandler) {
|
|
|
|
return net::nsHttpHandler::GetInstance().downcast<nsIHttpProtocolHandler>();
|
|
|
|
}
|
2012-12-10 18:13:55 +04:00
|
|
|
|
2018-12-17 05:36:32 +03:00
|
|
|
NS_IMPL_COMPONENT_FACTORY(net::nsHttpsHandler) {
|
|
|
|
auto handler = MakeRefPtr<net::nsHttpsHandler>();
|
2015-07-17 01:50:07 +03:00
|
|
|
|
2018-12-17 05:36:32 +03:00
|
|
|
if (NS_FAILED(handler->Init())) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
return handler.forget().downcast<nsIHttpProtocolHandler>();
|
|
|
|
}
|
2001-09-20 05:32:16 +04:00
|
|
|
|
2018-12-17 05:36:32 +03:00
|
|
|
#include "nsCacheService.h"
|
2005-11-12 21:17:19 +03:00
|
|
|
|
2018-12-17 05:36:32 +03:00
|
|
|
nsresult nsCacheServiceConstructor(nsISupports* aOuter, const nsIID& aIID,
|
|
|
|
void** aResult) {
|
|
|
|
return nsCacheService::Create(aOuter, aIID, aResult);
|
|
|
|
}
|
2010-10-11 15:35:10 +04:00
|
|
|
|
2011-07-05 08:18:33 +04:00
|
|
|
#include "WebSocketChannel.h"
|
2011-05-04 17:36:23 +04:00
|
|
|
#include "WebSocketChannelChild.h"
|
2020-01-18 16:48:34 +03:00
|
|
|
namespace mozilla::net {
|
2011-07-05 08:18:33 +04:00
|
|
|
static BaseWebSocketChannel* WebSocketChannelConstructor(bool aSecure) {
|
2011-05-04 17:36:23 +04:00
|
|
|
if (IsNeckoChild()) {
|
|
|
|
return new WebSocketChannelChild(aSecure);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (aSecure) {
|
2011-07-05 08:18:33 +04:00
|
|
|
return new WebSocketSSLChannel;
|
2011-05-04 17:36:23 +04:00
|
|
|
}
|
2017-02-09 13:21:38 +03:00
|
|
|
return new WebSocketChannel;
|
2011-05-04 17:36:23 +04:00
|
|
|
}
|
|
|
|
|
2018-12-17 05:36:32 +03:00
|
|
|
#define WEB_SOCKET_HANDLER_CONSTRUCTOR(type, secure) \
|
|
|
|
nsresult type##Constructor(nsISupports* aOuter, REFNSIID aIID, \
|
|
|
|
void** aResult) { \
|
|
|
|
nsresult rv; \
|
|
|
|
\
|
2019-03-05 21:43:02 +03:00
|
|
|
RefPtr<BaseWebSocketChannel> inst; \
|
2018-12-17 05:36:32 +03:00
|
|
|
\
|
|
|
|
*aResult = nullptr; \
|
|
|
|
if (nullptr != aOuter) { \
|
|
|
|
rv = NS_ERROR_NO_AGGREGATION; \
|
|
|
|
return rv; \
|
|
|
|
} \
|
|
|
|
inst = WebSocketChannelConstructor(secure); \
|
2019-03-05 21:43:02 +03:00
|
|
|
return inst->QueryInterface(aIID, aResult); \
|
2011-05-04 17:36:23 +04:00
|
|
|
}
|
|
|
|
|
2011-07-05 08:18:33 +04:00
|
|
|
WEB_SOCKET_HANDLER_CONSTRUCTOR(WebSocketChannel, false)
|
|
|
|
WEB_SOCKET_HANDLER_CONSTRUCTOR(WebSocketSSLChannel, true)
|
2011-05-04 17:36:23 +04:00
|
|
|
#undef WEB_SOCKET_HANDLER_CONSTRUCTOR
|
2020-01-18 16:48:34 +03:00
|
|
|
} // namespace mozilla::net
|
2013-09-23 14:12:11 +04:00
|
|
|
|
2001-09-20 05:32:16 +04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2000-05-06 13:15:56 +04:00
|
|
|
#include "nsFTPDirListingConv.h"
|
2003-07-12 02:13:30 +04:00
|
|
|
nsresult NS_NewFTPDirListingConv(nsFTPDirListingConv** result);
|
|
|
|
|
2013-10-11 11:32:47 +04:00
|
|
|
#include "nsStreamConverterService.h"
|
2000-05-06 13:15:56 +04:00
|
|
|
#include "nsMultiMixedConv.h"
|
|
|
|
#include "nsHTTPCompressConv.h"
|
|
|
|
#include "mozTXTToHTMLConv.h"
|
|
|
|
#include "nsUnknownDecoder.h"
|
2014-07-08 22:50:14 +04:00
|
|
|
|
2016-06-01 23:16:40 +03:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2001-03-06 05:14:42 +03:00
|
|
|
#include "nsIndexedToHTML.h"
|
2001-03-08 03:41:53 +03:00
|
|
|
|
2000-05-06 13:15:56 +04:00
|
|
|
nsresult NS_NewMultiMixedConv(nsMultiMixedConv** result);
|
|
|
|
nsresult MOZ_NewTXTToHTMLConv(mozTXTToHTMLConv** result);
|
2015-09-19 04:24:28 +03:00
|
|
|
nsresult NS_NewHTTPCompressConv(mozilla::net::nsHTTPCompressConv** result);
|
2001-03-08 03:41:53 +03:00
|
|
|
nsresult NS_NewStreamConv(nsStreamConverterService** aStreamConv);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2002-08-29 07:13:18 +04:00
|
|
|
#define FTP_TO_INDEX "?from=text/ftp-dir&to=application/http-index-format"
|
2001-03-08 03:41:53 +03:00
|
|
|
#define INDEX_TO_HTML "?from=application/http-index-format&to=text/html"
|
|
|
|
#define MULTI_MIXED_X "?from=multipart/x-mixed-replace&to=*/*"
|
|
|
|
#define MULTI_MIXED "?from=multipart/mixed&to=*/*"
|
2001-05-19 02:20:11 +04:00
|
|
|
#define MULTI_BYTERANGES "?from=multipart/byteranges&to=*/*"
|
2004-01-08 06:56:02 +03:00
|
|
|
#define UNKNOWN_CONTENT "?from=" UNKNOWN_CONTENT_TYPE "&to=*/*"
|
2001-03-08 03:41:53 +03:00
|
|
|
#define GZIP_TO_UNCOMPRESSED "?from=gzip&to=uncompressed"
|
|
|
|
#define XGZIP_TO_UNCOMPRESSED "?from=x-gzip&to=uncompressed"
|
2015-10-06 18:03:50 +03:00
|
|
|
#define BROTLI_TO_UNCOMPRESSED "?from=br&to=uncompressed"
|
2001-03-08 03:41:53 +03:00
|
|
|
#define COMPRESS_TO_UNCOMPRESSED "?from=compress&to=uncompressed"
|
|
|
|
#define XCOMPRESS_TO_UNCOMPRESSED "?from=x-compress&to=uncompressed"
|
|
|
|
#define DEFLATE_TO_UNCOMPRESSED "?from=deflate&to=uncompressed"
|
|
|
|
|
2010-06-10 22:11:40 +04:00
|
|
|
static const mozilla::Module::CategoryEntry kNeckoCategories[] = {
|
|
|
|
{NS_ISTREAMCONVERTER_KEY, FTP_TO_INDEX, ""},
|
|
|
|
{NS_ISTREAMCONVERTER_KEY, INDEX_TO_HTML, ""},
|
|
|
|
{NS_ISTREAMCONVERTER_KEY, MULTI_MIXED_X, ""},
|
|
|
|
{NS_ISTREAMCONVERTER_KEY, MULTI_MIXED, ""},
|
|
|
|
{NS_ISTREAMCONVERTER_KEY, MULTI_BYTERANGES, ""},
|
|
|
|
{NS_ISTREAMCONVERTER_KEY, UNKNOWN_CONTENT, ""},
|
|
|
|
{NS_ISTREAMCONVERTER_KEY, GZIP_TO_UNCOMPRESSED, ""},
|
|
|
|
{NS_ISTREAMCONVERTER_KEY, XGZIP_TO_UNCOMPRESSED, ""},
|
2015-09-22 19:55:23 +03:00
|
|
|
{NS_ISTREAMCONVERTER_KEY, BROTLI_TO_UNCOMPRESSED, ""},
|
2010-06-10 22:11:40 +04:00
|
|
|
{NS_ISTREAMCONVERTER_KEY, COMPRESS_TO_UNCOMPRESSED, ""},
|
|
|
|
{NS_ISTREAMCONVERTER_KEY, XCOMPRESS_TO_UNCOMPRESSED, ""},
|
|
|
|
{NS_ISTREAMCONVERTER_KEY, DEFLATE_TO_UNCOMPRESSED, ""},
|
|
|
|
NS_BINARYDETECTOR_CATEGORYENTRY,
|
2013-09-19 23:28:26 +04:00
|
|
|
{nullptr}};
|
2001-03-08 03:41:53 +03:00
|
|
|
|
2018-12-17 05:36:32 +03:00
|
|
|
nsresult CreateNewStreamConvServiceFactory(nsISupports* aOuter, REFNSIID aIID,
|
|
|
|
void** aResult) {
|
2017-07-06 15:00:35 +03:00
|
|
|
if (!aResult) {
|
|
|
|
return NS_ERROR_INVALID_POINTER;
|
|
|
|
}
|
|
|
|
if (aOuter) {
|
|
|
|
*aResult = nullptr;
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
2001-03-08 03:41:53 +03:00
|
|
|
}
|
2019-03-05 21:43:02 +03:00
|
|
|
RefPtr<nsStreamConverterService> inst;
|
|
|
|
nsresult rv = NS_NewStreamConv(getter_AddRefs(inst));
|
2017-07-06 15:00:35 +03:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nullptr;
|
|
|
|
return rv;
|
2018-11-30 13:46:48 +03:00
|
|
|
}
|
2001-03-08 03:41:53 +03:00
|
|
|
rv = inst->QueryInterface(aIID, aResult);
|
2017-07-06 15:00:35 +03:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nullptr;
|
2018-11-30 13:46:48 +03:00
|
|
|
}
|
2017-07-06 15:00:35 +03:00
|
|
|
return rv;
|
2001-03-08 03:41:53 +03:00
|
|
|
}
|
2000-05-06 13:15:56 +04:00
|
|
|
|
2018-12-17 05:36:32 +03:00
|
|
|
nsresult CreateNewFTPDirListingConv(nsISupports* aOuter, REFNSIID aIID,
|
|
|
|
void** aResult) {
|
2017-07-06 15:00:35 +03:00
|
|
|
if (!aResult) {
|
|
|
|
return NS_ERROR_INVALID_POINTER;
|
|
|
|
}
|
|
|
|
if (aOuter) {
|
|
|
|
*aResult = nullptr;
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
2000-05-06 13:15:56 +04:00
|
|
|
}
|
2019-03-05 21:43:02 +03:00
|
|
|
RefPtr<nsFTPDirListingConv> inst;
|
|
|
|
nsresult rv = NS_NewFTPDirListingConv(getter_AddRefs(inst));
|
2017-07-06 15:00:35 +03:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nullptr;
|
|
|
|
return rv;
|
2018-11-30 13:46:48 +03:00
|
|
|
}
|
2000-05-06 13:15:56 +04:00
|
|
|
rv = inst->QueryInterface(aIID, aResult);
|
2017-07-06 15:00:35 +03:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nullptr;
|
2018-11-30 13:46:48 +03:00
|
|
|
}
|
2017-07-06 15:00:35 +03:00
|
|
|
return rv;
|
2000-05-06 13:15:56 +04:00
|
|
|
}
|
|
|
|
|
2018-12-17 05:36:32 +03:00
|
|
|
nsresult CreateNewMultiMixedConvFactory(nsISupports* aOuter, REFNSIID aIID,
|
|
|
|
void** aResult) {
|
2017-07-06 15:00:35 +03:00
|
|
|
if (!aResult) {
|
|
|
|
return NS_ERROR_INVALID_POINTER;
|
|
|
|
}
|
|
|
|
if (aOuter) {
|
|
|
|
*aResult = nullptr;
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
2000-05-06 13:15:56 +04:00
|
|
|
}
|
2019-03-05 21:43:02 +03:00
|
|
|
RefPtr<nsMultiMixedConv> inst;
|
|
|
|
nsresult rv = NS_NewMultiMixedConv(getter_AddRefs(inst));
|
2017-07-06 15:00:35 +03:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nullptr;
|
|
|
|
return rv;
|
2018-11-30 13:46:48 +03:00
|
|
|
}
|
2000-05-06 13:15:56 +04:00
|
|
|
rv = inst->QueryInterface(aIID, aResult);
|
2017-07-06 15:00:35 +03:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nullptr;
|
2018-11-30 13:46:48 +03:00
|
|
|
}
|
2017-07-06 15:00:35 +03:00
|
|
|
return rv;
|
2000-05-06 13:15:56 +04:00
|
|
|
}
|
|
|
|
|
2018-12-17 05:36:32 +03:00
|
|
|
nsresult CreateNewTXTToHTMLConvFactory(nsISupports* aOuter, REFNSIID aIID,
|
|
|
|
void** aResult) {
|
2017-07-06 15:00:35 +03:00
|
|
|
if (!aResult) {
|
|
|
|
return NS_ERROR_INVALID_POINTER;
|
|
|
|
}
|
|
|
|
if (aOuter) {
|
|
|
|
*aResult = nullptr;
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
2000-05-06 13:15:56 +04:00
|
|
|
}
|
2019-03-05 21:43:02 +03:00
|
|
|
RefPtr<mozTXTToHTMLConv> inst;
|
|
|
|
nsresult rv = MOZ_NewTXTToHTMLConv(getter_AddRefs(inst));
|
2017-07-06 15:00:35 +03:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nullptr;
|
|
|
|
return rv;
|
2018-11-30 13:46:48 +03:00
|
|
|
}
|
2000-05-06 13:15:56 +04:00
|
|
|
rv = inst->QueryInterface(aIID, aResult);
|
2017-07-06 15:00:35 +03:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nullptr;
|
2018-11-30 13:46:48 +03:00
|
|
|
}
|
2017-07-06 15:00:35 +03:00
|
|
|
return rv;
|
2000-05-06 13:15:56 +04:00
|
|
|
}
|
|
|
|
|
2018-12-17 05:36:32 +03:00
|
|
|
nsresult CreateNewHTTPCompressConvFactory(nsISupports* aOuter, REFNSIID aIID,
|
|
|
|
void** aResult) {
|
2017-07-06 15:00:35 +03:00
|
|
|
if (!aResult) {
|
|
|
|
return NS_ERROR_INVALID_POINTER;
|
|
|
|
}
|
|
|
|
if (aOuter) {
|
|
|
|
*aResult = nullptr;
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
2000-05-06 13:15:56 +04:00
|
|
|
}
|
2019-03-05 21:43:02 +03:00
|
|
|
RefPtr<mozilla::net::nsHTTPCompressConv> inst;
|
|
|
|
nsresult rv = NS_NewHTTPCompressConv(getter_AddRefs(inst));
|
2017-07-06 15:00:35 +03:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nullptr;
|
|
|
|
return rv;
|
2018-11-30 13:46:48 +03:00
|
|
|
}
|
2000-05-06 13:15:56 +04:00
|
|
|
rv = inst->QueryInterface(aIID, aResult);
|
2017-07-06 15:00:35 +03:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nullptr;
|
2018-11-30 13:46:48 +03:00
|
|
|
}
|
2017-07-06 15:00:35 +03:00
|
|
|
return rv;
|
2000-05-06 13:15:56 +04:00
|
|
|
}
|
|
|
|
|
2018-12-17 05:36:32 +03:00
|
|
|
nsresult CreateNewUnknownDecoderFactory(nsISupports* aOuter, REFNSIID aIID,
|
|
|
|
void** aResult) {
|
2000-05-06 13:15:56 +04:00
|
|
|
if (!aResult) {
|
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
2012-07-30 18:20:58 +04:00
|
|
|
*aResult = nullptr;
|
2000-05-06 13:15:56 +04:00
|
|
|
|
|
|
|
if (aOuter) {
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
|
|
|
}
|
|
|
|
|
2019-03-05 21:43:02 +03:00
|
|
|
RefPtr<nsUnknownDecoder> inst = new nsUnknownDecoder();
|
|
|
|
return inst->QueryInterface(aIID, aResult);
|
2000-05-06 13:15:56 +04:00
|
|
|
}
|
|
|
|
|
2018-12-17 05:36:32 +03:00
|
|
|
nsresult CreateNewBinaryDetectorFactory(nsISupports* aOuter, REFNSIID aIID,
|
|
|
|
void** aResult) {
|
2004-01-08 06:56:02 +03:00
|
|
|
if (!aResult) {
|
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
2012-07-30 18:20:58 +04:00
|
|
|
*aResult = nullptr;
|
2004-01-08 06:56:02 +03:00
|
|
|
|
|
|
|
if (aOuter) {
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
|
|
|
}
|
|
|
|
|
2019-03-05 21:43:02 +03:00
|
|
|
RefPtr<nsBinaryDetector> inst = new nsBinaryDetector();
|
|
|
|
return inst->QueryInterface(aIID, aResult);
|
2004-01-08 06:56:02 +03:00
|
|
|
}
|
|
|
|
|
1999-09-30 05:53:31 +04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Module implementation for the net library
|
|
|
|
|
2005-04-05 21:40:32 +04:00
|
|
|
// Net module startup hook
|
2018-12-17 05:36:32 +03:00
|
|
|
nsresult nsNetStartup() {
|
2018-03-22 04:59:32 +03:00
|
|
|
mozilla::net::nsStandardURL::InitGlobalObjects();
|
2014-10-16 06:11:45 +04:00
|
|
|
return NS_OK;
|
2005-04-05 21:40:32 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Net module shutdown hook
|
2018-12-17 05:36:32 +03:00
|
|
|
void nsNetShutdown() {
|
2000-05-25 12:27:40 +04:00
|
|
|
// Release the url parser that the stdurl is holding.
|
2018-03-19 22:22:32 +03:00
|
|
|
mozilla::net::nsStandardURL::ShutdownGlobalObjects();
|
2002-07-02 22:15:19 +04:00
|
|
|
|
2002-09-13 23:32:45 +04:00
|
|
|
// Release global state used by the URL helper module.
|
|
|
|
net_ShutdownURLHelper();
|
2007-10-03 02:26:53 +04:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
net_ShutdownURLHelperOSX();
|
|
|
|
#endif
|
2017-07-06 15:00:35 +03:00
|
|
|
|
2008-11-08 02:00:26 +03:00
|
|
|
// Release DNS service reference.
|
|
|
|
nsDNSPrefetch::Shutdown();
|
2011-05-22 05:27:52 +04:00
|
|
|
|
|
|
|
// Release the Websocket Admission Manager
|
2011-07-05 08:18:33 +04:00
|
|
|
mozilla::net::WebSocketChannel::Shutdown();
|
2012-11-21 04:19:53 +04:00
|
|
|
|
2015-05-27 10:49:00 +03:00
|
|
|
mozilla::net::Http2CompressionCleanup();
|
|
|
|
|
2018-08-22 07:37:28 +03:00
|
|
|
mozilla::net::RedirectChannelRegistrar::Shutdown();
|
|
|
|
|
2018-09-26 03:27:32 +03:00
|
|
|
mozilla::net::BackgroundChannelRegistrar::Shutdown();
|
|
|
|
|
2018-11-01 13:39:58 +03:00
|
|
|
nsAuthGSSAPI::Shutdown();
|
|
|
|
|
2012-11-21 04:19:53 +04:00
|
|
|
delete gNetSniffers;
|
|
|
|
gNetSniffers = nullptr;
|
|
|
|
delete gDataSniffers;
|
|
|
|
gDataSniffers = nullptr;
|
2000-05-25 12:27:40 +04:00
|
|
|
}
|
|
|
|
|
2019-04-05 05:30:56 +03:00
|
|
|
extern const mozilla::Module kNeckoModule = {
|
2018-12-17 05:36:32 +03:00
|
|
|
mozilla::Module::kVersion,
|
|
|
|
nullptr,
|
2019-02-04 22:10:18 +03:00
|
|
|
nullptr,
|
2018-12-17 05:36:32 +03:00
|
|
|
kNeckoCategories,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
nullptr,
|
|
|
|
mozilla::Module::ALLOW_IN_SOCKET_PROCESS};
|