1999-09-30 05:53:31 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1999-09-30 05:53:31 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
1999-09-30 05:53:31 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-09-30 05:53:31 +04:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:40:37 +03:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-09-30 05:53:31 +04:00
|
|
|
*/
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIModule.h"
|
|
|
|
#include "nsIGenericFactory.h"
|
|
|
|
#include "nsIComponentManager.h"
|
|
|
|
#include "nsIServiceManager.h"
|
2000-06-02 04:23:56 +04:00
|
|
|
#include "nsICategoryManager.h"
|
1999-09-30 05:53:31 +04:00
|
|
|
#include "nsIOService.h"
|
|
|
|
#include "nsNetModuleMgr.h"
|
|
|
|
#include "nsFileTransportService.h"
|
|
|
|
#include "nsSocketTransportService.h"
|
|
|
|
#include "nsSocketProviderService.h"
|
|
|
|
#include "nscore.h"
|
2000-02-03 06:44:22 +03:00
|
|
|
#include "nsStdURLParser.h"
|
|
|
|
#include "nsAuthURLParser.h"
|
|
|
|
#include "nsNoAuthURLParser.h"
|
1999-09-30 05:53:31 +04:00
|
|
|
#include "nsStdURL.h"
|
|
|
|
#include "nsSimpleURI.h"
|
|
|
|
#include "nsDnsService.h"
|
|
|
|
#include "nsLoadGroup.h"
|
|
|
|
#include "nsInputStreamChannel.h"
|
2000-02-03 02:04:47 +03:00
|
|
|
#include "nsStreamLoader.h"
|
2000-09-15 23:27:05 +04:00
|
|
|
#include "nsDownloader.h"
|
1999-11-30 07:50:42 +03:00
|
|
|
#include "nsAsyncStreamListener.h"
|
2001-01-24 01:10:34 +03:00
|
|
|
//#include "nsSyncStreamListener.h"
|
2000-01-25 00:28:28 +03:00
|
|
|
#include "nsFileStreams.h"
|
2000-02-04 10:31:43 +03:00
|
|
|
#include "nsBufferedStreams.h"
|
2000-02-16 00:58:59 +03:00
|
|
|
#include "nsProtocolProxyService.h"
|
2000-07-01 14:25:25 +04:00
|
|
|
#include "nsSOCKSSocketProvider.h"
|
2001-07-25 04:28:28 +04:00
|
|
|
#include "nsSOCKS4SocketProvider.h"
|
1999-09-30 05:53:31 +04:00
|
|
|
|
2001-01-24 01:10:34 +03:00
|
|
|
#include "nsNetCID.h"
|
|
|
|
|
2000-05-06 13:15:56 +04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "nsStreamConverterService.h"
|
2001-06-26 02:11:43 +04:00
|
|
|
#if defined(XP_MAC)
|
|
|
|
#include "nsAppleFileDecoder.h"
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppleFileDecoder)
|
|
|
|
#endif
|
2000-05-06 13:15:56 +04:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "nsMIMEService.h"
|
|
|
|
#include "nsXMLMIMEDataSource.h"
|
|
|
|
#include "nsMIMEInfoImpl.h"
|
|
|
|
|
2001-01-24 01:10:34 +03:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMIMEInfoImpl)
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2001-04-10 10:01:08 +04:00
|
|
|
#include "nsRequestObserverProxy.h"
|
2001-01-24 01:10:34 +03:00
|
|
|
#include "nsStreamListenerProxy.h"
|
|
|
|
#include "nsStreamProviderProxy.h"
|
|
|
|
#include "nsSimpleStreamListener.h"
|
|
|
|
#include "nsSimpleStreamProvider.h"
|
|
|
|
|
2001-04-10 10:01:08 +04:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsRequestObserverProxy)
|
2001-01-24 01:10:34 +03:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsStreamListenerProxy)
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsStreamProviderProxy)
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSimpleStreamListener)
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSimpleStreamProvider)
|
2000-05-06 13:15:56 +04:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2001-03-08 03:58:06 +03:00
|
|
|
#include "nsStreamListenerTee.h"
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsStreamListenerTee)
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2001-03-03 05:11:19 +03:00
|
|
|
#include "nsStorageTransport.h"
|
|
|
|
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsStorageTransport)
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2001-05-12 01:04:09 +04:00
|
|
|
#include "nsHttpHandler.h"
|
|
|
|
//NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHttpHandler, Init)
|
|
|
|
|
|
|
|
#include "nsHttpBasicAuth.h"
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpBasicAuth)
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2001-06-22 02:02:47 +04:00
|
|
|
|
|
|
|
static NS_METHOD
|
|
|
|
RegisterBuiltInURLParsers(nsIComponentManager *aCompMgr,
|
|
|
|
nsIFile *aPath,
|
|
|
|
const char *registryLocation,
|
|
|
|
const char *componentType,
|
|
|
|
const nsModuleComponentInfo *info)
|
|
|
|
{
|
|
|
|
nsresult rv;
|
|
|
|
nsCOMPtr<nsICategoryManager> catman =
|
|
|
|
do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
|
|
|
|
if (NS_FAILED(rv)) return rv;
|
|
|
|
|
|
|
|
nsXPIDLCString previous;
|
|
|
|
|
|
|
|
catman->AddCategoryEntry(NS_IURLPARSER_KEY,
|
|
|
|
"file",
|
|
|
|
NS_NOAUTHORITYURLPARSER_CONTRACT_ID,
|
|
|
|
PR_TRUE,
|
|
|
|
PR_TRUE,
|
|
|
|
getter_Copies(previous));
|
|
|
|
|
|
|
|
catman->AddCategoryEntry(NS_IURLPARSER_KEY,
|
|
|
|
"ftp",
|
|
|
|
NS_AUTHORITYURLPARSER_CONTRACT_ID,
|
|
|
|
PR_TRUE,
|
|
|
|
PR_TRUE,
|
|
|
|
getter_Copies(previous));
|
|
|
|
|
|
|
|
catman->AddCategoryEntry(NS_IURLPARSER_KEY,
|
|
|
|
"http",
|
|
|
|
NS_AUTHORITYURLPARSER_CONTRACT_ID,
|
|
|
|
PR_TRUE,
|
|
|
|
PR_TRUE,
|
|
|
|
getter_Copies(previous));
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static NS_METHOD
|
|
|
|
UnregisterBuiltInURLParsers(nsIComponentManager *aCompMgr,
|
|
|
|
nsIFile *aPath,
|
|
|
|
const char *registryLocation,
|
|
|
|
const nsModuleComponentInfo *info)
|
|
|
|
{
|
|
|
|
nsresult rv;
|
|
|
|
nsCOMPtr<nsICategoryManager> catman =
|
|
|
|
do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
|
|
|
|
if (NS_FAILED(rv)) return rv;
|
|
|
|
|
|
|
|
catman->DeleteCategoryEntry(NS_IURLPARSER_KEY, "file", PR_TRUE);
|
|
|
|
catman->DeleteCategoryEntry(NS_IURLPARSER_KEY, "ftp", PR_TRUE);
|
|
|
|
catman->DeleteCategoryEntry(NS_IURLPARSER_KEY, "http", PR_TRUE);
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-12 01:04:09 +04:00
|
|
|
#if 0
|
2000-05-06 13:15:56 +04:00
|
|
|
#include "nsIHTTPProtocolHandler.h"
|
|
|
|
#include "nsHTTPHandler.h"
|
|
|
|
#include "nsHTTPSHandler.h"
|
2000-06-02 04:23:56 +04:00
|
|
|
#include "nsBasicAuth.h"
|
2000-05-06 13:15:56 +04:00
|
|
|
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHTTPHandler, Init);
|
2001-03-13 05:01:07 +03:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHTTPSHandler, Init);
|
2000-05-06 13:15:56 +04:00
|
|
|
|
|
|
|
#define NS_HTTPS_HANDLER_FACTORY_CID { 0xd2771480, 0xcac4, 0x11d3, { 0x8c, 0xaf, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } }
|
|
|
|
|
2000-06-02 04:23:56 +04:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBasicAuth);
|
|
|
|
#define NS_BASICAUTH_CID { 0xd5c9bc48, 0x1dd1, 0x11b2, { 0x9a, 0x0b, 0xf7, 0x3f, 0x59, 0x53, 0x19, 0xae } }
|
2000-09-14 03:57:52 +04:00
|
|
|
#define NS_BASICAUTH_CONTRACTID "@mozilla.org/network/http-basic-auth;1"
|
2000-06-02 04:23:56 +04:00
|
|
|
|
|
|
|
/* XXX this should all be data-driven, via NS_IMPL_GETMODULE_WITH_CATEGORIES */
|
2000-06-02 04:50:16 +04:00
|
|
|
static NS_METHOD
|
2000-06-02 04:23:56 +04:00
|
|
|
RegisterBasicAuth(nsIComponentManager *aCompMgr, nsIFile *aPath,
|
2001-03-12 23:43:02 +03:00
|
|
|
const char *registryLocation, const char *componentType,
|
|
|
|
const nsModuleComponentInfo *info)
|
2000-06-02 04:23:56 +04:00
|
|
|
{
|
|
|
|
nsresult rv;
|
|
|
|
nsCOMPtr<nsICategoryManager> catman =
|
2000-09-14 03:57:52 +04:00
|
|
|
do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
|
2000-06-02 04:23:56 +04:00
|
|
|
if (NS_FAILED(rv)) return rv;
|
|
|
|
nsXPIDLCString previous;
|
2000-09-14 03:57:52 +04:00
|
|
|
return catman->AddCategoryEntry("http-auth", "basic", NS_BASICAUTH_CONTRACTID,
|
2000-06-02 04:23:56 +04:00
|
|
|
PR_TRUE, PR_TRUE, getter_Copies(previous));
|
|
|
|
}
|
|
|
|
|
2000-06-02 04:50:16 +04:00
|
|
|
static NS_METHOD
|
2000-06-02 04:23:56 +04:00
|
|
|
UnregisterBasicAuth(nsIComponentManager *aCompMgr, nsIFile *aPath,
|
2001-03-12 23:43:02 +03:00
|
|
|
const char *registryLocation,
|
|
|
|
const nsModuleComponentInfo *info)
|
2000-06-02 04:23:56 +04:00
|
|
|
{
|
|
|
|
nsresult rv;
|
|
|
|
nsCOMPtr<nsICategoryManager> catman =
|
2000-09-14 03:57:52 +04:00
|
|
|
do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
|
2000-06-02 04:23:56 +04:00
|
|
|
if (NS_FAILED(rv)) return rv;
|
|
|
|
nsXPIDLCString basicAuth;
|
2000-06-28 01:06:41 +04:00
|
|
|
rv = catman->GetCategoryEntry("http-auth", "basic",
|
2000-06-02 04:23:56 +04:00
|
|
|
getter_Copies(basicAuth));
|
|
|
|
if (NS_FAILED(rv)) return rv;
|
2000-07-01 14:25:25 +04:00
|
|
|
|
2000-06-02 04:23:56 +04:00
|
|
|
// only unregister if we're the current Basic-auth handler
|
2000-09-14 03:57:52 +04:00
|
|
|
if (!strcmp(basicAuth, NS_BASICAUTH_CONTRACTID))
|
2001-06-06 01:25:57 +04:00
|
|
|
return catman->DeleteCategoryEntry("http-auth", "basic", PR_TRUE);
|
2000-06-02 04:23:56 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2001-05-12 01:04:09 +04:00
|
|
|
#endif
|
|
|
|
|
2000-05-06 13:15:56 +04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "nsFileChannel.h"
|
|
|
|
#include "nsFileProtocolHandler.h"
|
|
|
|
#include "nsDataHandler.h"
|
|
|
|
#include "nsJARProtocolHandler.h"
|
|
|
|
#include "nsResProtocolHandler.h"
|
|
|
|
|
|
|
|
#include "nsAboutProtocolHandler.h"
|
|
|
|
#include "nsAboutBlank.h"
|
|
|
|
#include "nsAboutBloat.h"
|
2000-09-20 02:33:55 +04:00
|
|
|
#include "nsAboutCache.h"
|
2001-09-01 10:01:25 +04:00
|
|
|
#include "nsAboutConfig.h"
|
2001-04-18 07:09:32 +04:00
|
|
|
#include "nsAboutRedirector.h"
|
2000-05-06 13:15:56 +04:00
|
|
|
#include "nsKeywordProtocolHandler.h"
|
|
|
|
|
2001-03-14 01:44:34 +03:00
|
|
|
#include "nsAboutCacheEntry.h"
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAboutCacheEntry)
|
|
|
|
|
2000-05-06 13:15:56 +04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "nsFTPDirListingConv.h"
|
2001-03-14 05:51:01 +03:00
|
|
|
#include "nsGopherDirListingConv.h"
|
2000-05-06 13:15:56 +04:00
|
|
|
#include "nsMultiMixedConv.h"
|
|
|
|
#include "nsHTTPChunkConv.h"
|
|
|
|
#include "nsHTTPCompressConv.h"
|
|
|
|
#include "mozTXTToHTMLConv.h"
|
|
|
|
#include "nsUnknownDecoder.h"
|
|
|
|
#include "nsTXTToHTMLConv.h"
|
2001-03-06 05:14:42 +03:00
|
|
|
#include "nsIndexedToHTML.h"
|
2001-06-28 05:09:51 +04:00
|
|
|
#ifndef XP_MAC
|
|
|
|
#include "nsBinHexDecoder.h"
|
|
|
|
#endif
|
2001-03-08 03:41:53 +03:00
|
|
|
|
2000-05-06 13:15:56 +04:00
|
|
|
nsresult NS_NewFTPDirListingConv(nsFTPDirListingConv** result);
|
2001-03-14 05:51:01 +03:00
|
|
|
nsresult NS_NewGopherDirListingConv(nsGopherDirListingConv** result);
|
2000-05-06 13:15:56 +04:00
|
|
|
nsresult NS_NewMultiMixedConv (nsMultiMixedConv** result);
|
|
|
|
nsresult MOZ_NewTXTToHTMLConv (mozTXTToHTMLConv** result);
|
|
|
|
nsresult NS_NewHTTPChunkConv (nsHTTPChunkConv ** result);
|
|
|
|
nsresult NS_NewHTTPCompressConv (nsHTTPCompressConv ** result);
|
|
|
|
nsresult NS_NewNSTXTToHTMLConv(nsTXTToHTMLConv** result);
|
2001-03-08 03:41:53 +03:00
|
|
|
nsresult NS_NewStreamConv(nsStreamConverterService **aStreamConv);
|
|
|
|
|
|
|
|
#define FTP_UNIX_TO_INDEX "?from=text/ftp-dir-unix&to=application/http-index-format"
|
|
|
|
#define FTP_NT_TO_INDEX "?from=text/ftp-dir-nt&to=application/http-index-format"
|
2001-03-14 05:51:01 +03:00
|
|
|
#define GOPHER_TO_INDEX "?from=text/gopher-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=*/*"
|
2001-03-08 03:41:53 +03:00
|
|
|
#define UNKNOWN_CONTENT "?from=application/x-unknown-content-type&to=*/*"
|
|
|
|
#define CHUNKED_TO_UNCHUNKED "?from=chunked&to=unchunked"
|
|
|
|
#define UNCHUNKED_TO_CHUNKED "?from=unchunked&to=chunked"
|
|
|
|
#define GZIP_TO_UNCOMPRESSED "?from=gzip&to=uncompressed"
|
|
|
|
#define XGZIP_TO_UNCOMPRESSED "?from=x-gzip&to=uncompressed"
|
|
|
|
#define COMPRESS_TO_UNCOMPRESSED "?from=compress&to=uncompressed"
|
|
|
|
#define XCOMPRESS_TO_UNCOMPRESSED "?from=x-compress&to=uncompressed"
|
|
|
|
#define DEFLATE_TO_UNCOMPRESSED "?from=deflate&to=uncompressed"
|
|
|
|
#define PLAIN_TO_HTML "?from=text/plain&to=text/html"
|
|
|
|
|
2001-06-28 05:09:51 +04:00
|
|
|
#ifndef XP_MAC
|
|
|
|
#define BINHEX_TO_WILD "?from=application/mac-binhex40&to=*/*"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef XP_MAC
|
|
|
|
static PRUint32 g_StreamConverterCount = 16;
|
|
|
|
#else
|
2001-03-14 05:51:01 +03:00
|
|
|
static PRUint32 g_StreamConverterCount = 15;
|
2001-06-28 05:09:51 +04:00
|
|
|
#endif
|
2001-03-08 03:41:53 +03:00
|
|
|
|
|
|
|
static char *g_StreamConverterArray[] = {
|
|
|
|
FTP_UNIX_TO_INDEX,
|
|
|
|
FTP_NT_TO_INDEX,
|
2001-03-14 05:51:01 +03:00
|
|
|
GOPHER_TO_INDEX,
|
2001-03-08 03:41:53 +03:00
|
|
|
INDEX_TO_HTML,
|
|
|
|
MULTI_MIXED_X,
|
|
|
|
MULTI_MIXED,
|
2001-05-19 02:20:11 +04:00
|
|
|
MULTI_BYTERANGES,
|
2001-03-08 03:41:53 +03:00
|
|
|
UNKNOWN_CONTENT,
|
|
|
|
CHUNKED_TO_UNCHUNKED,
|
|
|
|
UNCHUNKED_TO_CHUNKED,
|
|
|
|
GZIP_TO_UNCOMPRESSED,
|
|
|
|
XGZIP_TO_UNCOMPRESSED,
|
|
|
|
COMPRESS_TO_UNCOMPRESSED,
|
|
|
|
XCOMPRESS_TO_UNCOMPRESSED,
|
|
|
|
DEFLATE_TO_UNCOMPRESSED,
|
2001-06-28 05:09:51 +04:00
|
|
|
#ifndef XP_MAC
|
|
|
|
BINHEX_TO_WILD,
|
|
|
|
#endif
|
2001-03-08 03:41:53 +03:00
|
|
|
PLAIN_TO_HTML
|
|
|
|
};
|
|
|
|
|
|
|
|
// each stream converter must add its from/to key to the category manager
|
|
|
|
// in RegisterStreamConverters(). This provides a string representation
|
|
|
|
// of each registered converter, rooted in the NS_ISTREAMCONVERTER_KEY
|
|
|
|
// category. These keys are then (when the stream converter service
|
|
|
|
// needs to chain converters together) enumerated and parsed to build
|
|
|
|
// a graph of converters for potential chaining.
|
|
|
|
static NS_METHOD
|
|
|
|
RegisterStreamConverters(nsIComponentManager *aCompMgr, nsIFile *aPath,
|
2001-03-12 23:43:02 +03:00
|
|
|
const char *registryLocation,
|
|
|
|
const char *componentType,
|
|
|
|
const nsModuleComponentInfo *info) {
|
2001-03-08 03:41:53 +03:00
|
|
|
nsresult rv;
|
|
|
|
nsCOMPtr<nsICategoryManager> catmgr =
|
|
|
|
do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
|
|
|
|
if (NS_FAILED(rv)) return rv;
|
|
|
|
nsXPIDLCString previous;
|
|
|
|
|
|
|
|
PRUint32 count = 0;
|
|
|
|
while (count < g_StreamConverterCount) {
|
|
|
|
(void) catmgr->AddCategoryEntry(NS_ISTREAMCONVERTER_KEY, g_StreamConverterArray[count],
|
|
|
|
"", PR_TRUE, PR_TRUE, getter_Copies(previous));
|
|
|
|
if (NS_FAILED(rv)) NS_ASSERTION(0, "adding a cat entry failed");
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
// same as RegisterStreamConverters except the reverse.
|
|
|
|
static NS_METHOD
|
|
|
|
UnregisterStreamConverters(nsIComponentManager *aCompMgr, nsIFile *aPath,
|
2001-03-12 23:43:02 +03:00
|
|
|
const char *registryLocation,
|
|
|
|
const nsModuleComponentInfo *info) {
|
2001-03-08 03:41:53 +03:00
|
|
|
nsresult rv;
|
|
|
|
nsCOMPtr<nsICategoryManager> catmgr =
|
|
|
|
do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
|
|
|
|
if (NS_FAILED(rv)) return rv;
|
|
|
|
|
|
|
|
|
|
|
|
PRUint32 count = 0;
|
|
|
|
while (count < g_StreamConverterCount) {
|
2001-06-06 01:25:57 +04:00
|
|
|
rv = catmgr->DeleteCategoryEntry(NS_ISTREAMCONVERTER_KEY,
|
|
|
|
g_StreamConverterArray[count],
|
|
|
|
PR_TRUE);
|
2001-03-08 03:41:53 +03:00
|
|
|
if (NS_FAILED(rv)) return rv;
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
return rv;
|
|
|
|
}
|
2001-06-28 05:09:51 +04:00
|
|
|
#ifndef XP_MAC
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBinHexDecoder);
|
|
|
|
#endif
|
2001-03-08 03:41:53 +03:00
|
|
|
|
|
|
|
static NS_IMETHODIMP
|
|
|
|
CreateNewStreamConvServiceFactory(nsISupports* aOuter, REFNSIID aIID, void **aResult)
|
|
|
|
{
|
|
|
|
if (!aResult) {
|
|
|
|
return NS_ERROR_INVALID_POINTER;
|
|
|
|
}
|
|
|
|
if (aOuter) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
|
|
|
}
|
|
|
|
nsStreamConverterService* inst = nsnull;
|
|
|
|
nsresult rv = NS_NewStreamConv(&inst);
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
rv = inst->QueryInterface(aIID, aResult);
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
}
|
|
|
|
NS_RELEASE(inst); /* get rid of extra refcnt */
|
|
|
|
return rv;
|
|
|
|
}
|
2000-05-06 13:15:56 +04:00
|
|
|
|
|
|
|
static NS_IMETHODIMP
|
|
|
|
CreateNewFTPDirListingConv(nsISupports* aOuter, REFNSIID aIID, void **aResult)
|
|
|
|
{
|
|
|
|
if (!aResult) {
|
|
|
|
return NS_ERROR_INVALID_POINTER;
|
|
|
|
}
|
|
|
|
if (aOuter) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
|
|
|
}
|
|
|
|
nsFTPDirListingConv* inst = nsnull;
|
|
|
|
nsresult rv = NS_NewFTPDirListingConv(&inst);
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
rv = inst->QueryInterface(aIID, aResult);
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
}
|
|
|
|
NS_RELEASE(inst); /* get rid of extra refcnt */
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2001-03-14 05:51:01 +03:00
|
|
|
static NS_IMETHODIMP
|
|
|
|
CreateNewGopherDirListingConv(nsISupports* aOuter, REFNSIID aIID, void **aResult)
|
|
|
|
{
|
|
|
|
if (!aResult) {
|
|
|
|
return NS_ERROR_INVALID_POINTER;
|
|
|
|
}
|
|
|
|
if (aOuter) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
|
|
|
}
|
|
|
|
nsGopherDirListingConv* inst = nsnull;
|
|
|
|
nsresult rv = NS_NewGopherDirListingConv(&inst);
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
rv = inst->QueryInterface(aIID, aResult);
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
}
|
|
|
|
NS_RELEASE(inst); /* get rid of extra refcnt */
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2000-05-06 13:15:56 +04:00
|
|
|
static NS_IMETHODIMP
|
|
|
|
CreateNewMultiMixedConvFactory(nsISupports* aOuter, REFNSIID aIID, void **aResult)
|
|
|
|
{
|
|
|
|
if (!aResult) {
|
|
|
|
return NS_ERROR_INVALID_POINTER;
|
|
|
|
}
|
|
|
|
if (aOuter) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
|
|
|
}
|
|
|
|
nsMultiMixedConv* inst = nsnull;
|
|
|
|
nsresult rv = NS_NewMultiMixedConv(&inst);
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
rv = inst->QueryInterface(aIID, aResult);
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
}
|
|
|
|
NS_RELEASE(inst); /* get rid of extra refcnt */
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
static NS_IMETHODIMP
|
|
|
|
CreateNewTXTToHTMLConvFactory(nsISupports* aOuter, REFNSIID aIID, void **aResult)
|
|
|
|
{
|
|
|
|
if (!aResult) {
|
|
|
|
return NS_ERROR_INVALID_POINTER;
|
|
|
|
}
|
|
|
|
if (aOuter) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
|
|
|
}
|
|
|
|
mozTXTToHTMLConv* inst = nsnull;
|
|
|
|
nsresult rv = MOZ_NewTXTToHTMLConv(&inst);
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
rv = inst->QueryInterface(aIID, aResult);
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
}
|
|
|
|
NS_RELEASE(inst); /* get rid of extra refcnt */
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
static NS_IMETHODIMP
|
|
|
|
CreateNewHTTPChunkConvFactory (nsISupports* aOuter, REFNSIID aIID, void **aResult)
|
|
|
|
{
|
|
|
|
if (!aResult) {
|
|
|
|
return NS_ERROR_INVALID_POINTER;
|
|
|
|
}
|
|
|
|
if (aOuter) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
|
|
|
}
|
|
|
|
nsHTTPChunkConv* inst = nsnull;
|
|
|
|
nsresult rv = NS_NewHTTPChunkConv (&inst);
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
rv = inst->QueryInterface(aIID, aResult);
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
}
|
|
|
|
NS_RELEASE(inst); /* get rid of extra refcnt */
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
static NS_IMETHODIMP
|
|
|
|
CreateNewHTTPCompressConvFactory (nsISupports* aOuter, REFNSIID aIID, void **aResult)
|
|
|
|
{
|
|
|
|
if (!aResult) {
|
|
|
|
return NS_ERROR_INVALID_POINTER;
|
|
|
|
}
|
|
|
|
if (aOuter) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
|
|
|
}
|
|
|
|
nsHTTPCompressConv* inst = nsnull;
|
|
|
|
nsresult rv = NS_NewHTTPCompressConv (&inst);
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
rv = inst->QueryInterface(aIID, aResult);
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
*aResult = nsnull;
|
|
|
|
}
|
|
|
|
NS_RELEASE(inst); /* get rid of extra refcnt */
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
static NS_IMETHODIMP
|
|
|
|
CreateNewUnknownDecoderFactory(nsISupports *aOuter, REFNSIID aIID, void **aResult)
|
|
|
|
{
|
|
|
|
nsresult rv;
|
|
|
|
|
|
|
|
if (!aResult) {
|
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
|
|
|
*aResult = nsnull;
|
|
|
|
|
|
|
|
if (aOuter) {
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsUnknownDecoder *inst;
|
|
|
|
|
|
|
|
inst = new nsUnknownDecoder();
|
|
|
|
if (!inst) {
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
NS_ADDREF(inst);
|
|
|
|
rv = inst->QueryInterface(aIID, aResult);
|
|
|
|
NS_RELEASE(inst);
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
static NS_IMETHODIMP
|
|
|
|
CreateNewNSTXTToHTMLConvFactory(nsISupports *aOuter, REFNSIID aIID, void **aResult)
|
|
|
|
{
|
|
|
|
nsresult rv;
|
|
|
|
|
|
|
|
if (!aResult) {
|
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
|
|
|
*aResult = nsnull;
|
|
|
|
|
|
|
|
if (aOuter) {
|
|
|
|
return NS_ERROR_NO_AGGREGATION;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsTXTToHTMLConv *inst;
|
|
|
|
|
|
|
|
inst = new nsTXTToHTMLConv();
|
|
|
|
if (!inst) return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
|
|
|
|
NS_ADDREF(inst);
|
|
|
|
rv = inst->Init();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
delete inst;
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
rv = inst->QueryInterface(aIID, aResult);
|
|
|
|
NS_RELEASE(inst);
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
1999-09-30 05:53:31 +04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Module implementation for the net library
|
|
|
|
|
2000-05-25 12:27:40 +04:00
|
|
|
// Necko module shutdown hook
|
|
|
|
static void PR_CALLBACK nsNeckoShutdown(nsIModule *neckoModule)
|
|
|
|
{
|
|
|
|
// Release the url parser that the stdurl is holding.
|
|
|
|
nsStdURL::ShutdownGlobalObjects();
|
|
|
|
}
|
|
|
|
|
1999-11-12 12:07:26 +03:00
|
|
|
static nsModuleComponentInfo gNetModuleInfo[] = {
|
2001-04-10 10:01:08 +04:00
|
|
|
{ NS_IOSERVICE_CLASSNAME,
|
1999-11-12 12:07:26 +03:00
|
|
|
NS_IOSERVICE_CID,
|
2001-04-10 10:01:08 +04:00
|
|
|
NS_IOSERVICE_CONTRACTID,
|
1999-11-12 12:07:26 +03:00
|
|
|
nsIOService::Create },
|
|
|
|
{ "File Transport Service",
|
|
|
|
NS_FILETRANSPORTSERVICE_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
"@mozilla.org/network/file-transport-service;1",
|
1999-11-12 12:07:26 +03:00
|
|
|
nsFileTransportService::Create },
|
|
|
|
{ "Socket Transport Service",
|
|
|
|
NS_SOCKETTRANSPORTSERVICE_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
"@mozilla.org/network/socket-transport-service;1",
|
1999-11-12 12:07:26 +03:00
|
|
|
nsSocketTransportService::Create },
|
|
|
|
{ "Socket Provider Service",
|
|
|
|
NS_SOCKETPROVIDERSERVICE_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
"@mozilla.org/network/socket-provider-service;1",
|
1999-11-12 12:07:26 +03:00
|
|
|
nsSocketProviderService::Create },
|
|
|
|
{ "DNS Service",
|
|
|
|
NS_DNSSERVICE_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
"@mozilla.org/network/dns-service;1",
|
1999-11-12 12:07:26 +03:00
|
|
|
nsDNSService::Create },
|
2001-04-10 10:01:08 +04:00
|
|
|
{ NS_STANDARDURL_CLASSNAME,
|
1999-11-12 12:07:26 +03:00
|
|
|
NS_STANDARDURL_CID,
|
2001-04-10 10:01:08 +04:00
|
|
|
NS_STANDARDURL_CONTRACTID,
|
1999-11-12 12:07:26 +03:00
|
|
|
nsStdURL::Create },
|
2001-04-10 10:01:08 +04:00
|
|
|
{ NS_SIMPLEURI_CLASSNAME,
|
1999-11-12 12:07:26 +03:00
|
|
|
NS_SIMPLEURI_CID,
|
2001-04-10 10:01:08 +04:00
|
|
|
NS_SIMPLEURI_CONTRACTID,
|
1999-11-12 12:07:26 +03:00
|
|
|
nsSimpleURI::Create },
|
|
|
|
{ "External Module Manager",
|
|
|
|
NS_NETMODULEMGR_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
"@mozilla.org/network/net-extern-mod;1",
|
1999-11-12 12:07:26 +03:00
|
|
|
nsNetModuleMgr::Create },
|
2000-04-13 13:20:50 +04:00
|
|
|
{ NS_FILEIO_CLASSNAME,
|
|
|
|
NS_FILEIO_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_FILEIO_CONTRACTID,
|
2000-04-13 13:20:50 +04:00
|
|
|
nsFileIO::Create },
|
|
|
|
{ NS_INPUTSTREAMIO_CLASSNAME,
|
|
|
|
NS_INPUTSTREAMIO_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_INPUTSTREAMIO_CONTRACTID,
|
2000-04-13 13:20:50 +04:00
|
|
|
nsInputStreamIO::Create },
|
|
|
|
{ NS_STREAMIOCHANNEL_CLASSNAME,
|
|
|
|
NS_STREAMIOCHANNEL_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_STREAMIOCHANNEL_CONTRACTID,
|
2000-04-13 13:20:50 +04:00
|
|
|
nsStreamIOChannel::Create },
|
1999-11-12 12:07:26 +03:00
|
|
|
{ "Unichar Stream Loader",
|
2000-02-03 02:04:47 +03:00
|
|
|
NS_STREAMLOADER_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
"@mozilla.org/network/stream-loader;1",
|
2000-02-03 02:04:47 +03:00
|
|
|
nsStreamLoader::Create },
|
2001-04-17 14:47:22 +04:00
|
|
|
{ NS_DOWNLOADER_CLASSNAME,
|
2000-09-15 23:27:05 +04:00
|
|
|
NS_DOWNLOADER_CID,
|
2001-04-17 14:47:22 +04:00
|
|
|
NS_DOWNLOADER_CONTRACTID,
|
2000-09-15 23:27:05 +04:00
|
|
|
nsDownloader::Create },
|
2001-04-10 10:01:08 +04:00
|
|
|
{ NS_REQUESTOBSERVERPROXY_CLASSNAME,
|
|
|
|
NS_REQUESTOBSERVERPROXY_CID,
|
|
|
|
NS_REQUESTOBSERVERPROXY_CONTRACTID,
|
|
|
|
nsRequestObserverProxyConstructor },
|
2001-01-24 01:10:34 +03:00
|
|
|
{ NS_STREAMLISTENERPROXY_CLASSNAME,
|
|
|
|
NS_STREAMLISTENERPROXY_CID,
|
|
|
|
NS_STREAMLISTENERPROXY_CONTRACTID,
|
|
|
|
nsStreamListenerProxyConstructor },
|
|
|
|
{ NS_STREAMPROVIDERPROXY_CLASSNAME,
|
|
|
|
NS_STREAMPROVIDERPROXY_CID,
|
|
|
|
NS_STREAMPROVIDERPROXY_CONTRACTID,
|
|
|
|
nsStreamProviderProxyConstructor },
|
|
|
|
{ NS_SIMPLESTREAMLISTENER_CLASSNAME,
|
|
|
|
NS_SIMPLESTREAMLISTENER_CID,
|
|
|
|
NS_SIMPLESTREAMLISTENER_CONTRACTID,
|
|
|
|
nsSimpleStreamListenerConstructor },
|
|
|
|
{ NS_SIMPLESTREAMPROVIDER_CLASSNAME,
|
|
|
|
NS_SIMPLESTREAMPROVIDER_CID,
|
|
|
|
NS_SIMPLESTREAMPROVIDER_CONTRACTID,
|
|
|
|
nsSimpleStreamProviderConstructor },
|
2001-03-08 03:58:06 +03:00
|
|
|
{ NS_ASYNCSTREAMLISTENER_CLASSNAME,
|
1999-11-12 12:07:26 +03:00
|
|
|
NS_ASYNCSTREAMLISTENER_CID,
|
2001-03-08 03:58:06 +03:00
|
|
|
NS_ASYNCSTREAMLISTENER_CONTRACTID,
|
1999-11-12 12:07:26 +03:00
|
|
|
nsAsyncStreamListener::Create },
|
2001-03-08 03:58:06 +03:00
|
|
|
{ NS_STREAMLISTENERTEE_CLASSNAME,
|
|
|
|
NS_STREAMLISTENERTEE_CID,
|
|
|
|
NS_STREAMLISTENERTEE_CONTRACTID,
|
|
|
|
nsStreamListenerTeeConstructor },
|
2001-03-03 05:11:19 +03:00
|
|
|
{ NS_STORAGETRANSPORT_CLASSNAME,
|
|
|
|
NS_STORAGETRANSPORT_CID,
|
|
|
|
NS_STORAGETRANSPORT_CONTRACTID,
|
|
|
|
nsStorageTransportConstructor },
|
2001-04-10 10:01:08 +04:00
|
|
|
{ NS_LOADGROUP_CLASSNAME,
|
1999-11-12 12:07:26 +03:00
|
|
|
NS_LOADGROUP_CID,
|
2001-04-10 10:01:08 +04:00
|
|
|
NS_LOADGROUP_CONTRACTID,
|
2000-01-25 00:28:28 +03:00
|
|
|
nsLoadGroup::Create },
|
2000-03-29 07:58:50 +04:00
|
|
|
{ NS_LOCALFILEINPUTSTREAM_CLASSNAME,
|
|
|
|
NS_LOCALFILEINPUTSTREAM_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_LOCALFILEINPUTSTREAM_CONTRACTID,
|
2000-01-25 00:28:28 +03:00
|
|
|
nsFileInputStream::Create },
|
2000-03-29 07:58:50 +04:00
|
|
|
{ NS_LOCALFILEOUTPUTSTREAM_CLASSNAME,
|
|
|
|
NS_LOCALFILEOUTPUTSTREAM_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_LOCALFILEOUTPUTSTREAM_CONTRACTID,
|
2000-02-03 06:44:22 +03:00
|
|
|
nsFileOutputStream::Create },
|
2001-06-22 02:02:47 +04:00
|
|
|
|
|
|
|
// The register functions for the build in
|
|
|
|
// parsers just need to be called once.
|
2000-02-03 06:44:22 +03:00
|
|
|
{ "StdURLParser",
|
|
|
|
NS_STANDARDURLPARSER_CID,
|
2001-06-22 02:02:47 +04:00
|
|
|
NS_STANDARDURLPARSER_CONTRACT_ID,
|
|
|
|
nsStdURLParser::Create,
|
|
|
|
RegisterBuiltInURLParsers,
|
|
|
|
UnregisterBuiltInURLParsers
|
|
|
|
},
|
2000-02-03 06:44:22 +03:00
|
|
|
{ "AuthURLParser",
|
|
|
|
NS_AUTHORITYURLPARSER_CID,
|
2001-06-22 02:02:47 +04:00
|
|
|
NS_AUTHORITYURLPARSER_CONTRACT_ID,
|
2000-02-03 06:44:22 +03:00
|
|
|
nsAuthURLParser::Create },
|
|
|
|
{ "NoAuthURLParser",
|
|
|
|
NS_NOAUTHORITYURLPARSER_CID,
|
2001-06-22 02:02:47 +04:00
|
|
|
NS_NOAUTHORITYURLPARSER_CONTRACT_ID,
|
2000-02-03 06:44:22 +03:00
|
|
|
nsNoAuthURLParser::Create },
|
2001-06-22 02:02:47 +04:00
|
|
|
|
2000-02-04 10:31:43 +03:00
|
|
|
{ NS_BUFFEREDINPUTSTREAM_CLASSNAME,
|
|
|
|
NS_BUFFEREDINPUTSTREAM_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_BUFFEREDINPUTSTREAM_CONTRACTID,
|
2000-02-04 10:31:43 +03:00
|
|
|
nsBufferedInputStream::Create },
|
|
|
|
{ NS_BUFFEREDOUTPUTSTREAM_CLASSNAME,
|
|
|
|
NS_BUFFEREDOUTPUTSTREAM_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_BUFFEREDOUTPUTSTREAM_CONTRACTID,
|
2000-02-16 00:58:59 +03:00
|
|
|
nsBufferedOutputStream::Create },
|
|
|
|
{ "Protocol Proxy Service",
|
|
|
|
NS_PROTOCOLPROXYSERVICE_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
"@mozilla.org/network/protocol-proxy-service;1",
|
2000-05-06 13:15:56 +04:00
|
|
|
nsProtocolProxyService::Create },
|
|
|
|
|
|
|
|
// from netwerk/streamconv:
|
2001-03-08 03:41:53 +03:00
|
|
|
|
|
|
|
// this converter is "always" part of a build.
|
|
|
|
// HACK-ALERT, register *all* converters
|
|
|
|
// in this converters component manager
|
|
|
|
// registration. just piggy backing here until
|
|
|
|
// you can add registration functions to
|
|
|
|
// the generic module macro.
|
2000-05-06 13:15:56 +04:00
|
|
|
{ "Stream Converter Service",
|
|
|
|
NS_STREAMCONVERTERSERVICE_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
"@mozilla.org/streamConverters;1",
|
2001-03-08 03:41:53 +03:00
|
|
|
CreateNewStreamConvServiceFactory,
|
|
|
|
RegisterStreamConverters, // registers *all* converters
|
|
|
|
UnregisterStreamConverters // unregisters *all* converters
|
|
|
|
},
|
2001-06-26 02:11:43 +04:00
|
|
|
|
|
|
|
#if defined(XP_MAC)
|
|
|
|
{ NS_APPLEFILEDECODER_CLASSNAME,
|
|
|
|
NS_APPLEFILEDECODER_CID,
|
|
|
|
NS_IAPPLEFILEDECODER_CONTRACTID,
|
|
|
|
nsAppleFileDecoderConstructor
|
|
|
|
},
|
|
|
|
#endif
|
2000-05-06 13:15:56 +04:00
|
|
|
|
|
|
|
// from netwerk/streamconv/converters:
|
|
|
|
{ "FTPDirListingConverter",
|
2001-03-08 03:41:53 +03:00
|
|
|
NS_FTPDIRLISTINGCONVERTER_CID,
|
|
|
|
NS_ISTREAMCONVERTER_KEY FTP_UNIX_TO_INDEX,
|
2000-05-06 13:15:56 +04:00
|
|
|
CreateNewFTPDirListingConv
|
|
|
|
},
|
|
|
|
|
|
|
|
{ "FTPDirListingConverter",
|
|
|
|
NS_FTPDIRLISTINGCONVERTER_CID,
|
2001-03-08 03:41:53 +03:00
|
|
|
NS_ISTREAMCONVERTER_KEY FTP_NT_TO_INDEX,
|
2000-05-06 13:15:56 +04:00
|
|
|
CreateNewFTPDirListingConv
|
|
|
|
},
|
2001-03-06 05:14:42 +03:00
|
|
|
|
2001-03-14 05:51:01 +03:00
|
|
|
{ "GopherDirListingConverter",
|
|
|
|
NS_GOPHERDIRLISTINGCONVERTER_CID,
|
|
|
|
NS_ISTREAMCONVERTER_KEY GOPHER_TO_INDEX,
|
|
|
|
CreateNewGopherDirListingConv
|
|
|
|
},
|
|
|
|
|
2001-03-06 05:14:42 +03:00
|
|
|
{ "Indexed to HTML Converter",
|
|
|
|
NS_NSINDEXEDTOHTMLCONVERTER_CID,
|
2001-03-08 03:41:53 +03:00
|
|
|
NS_ISTREAMCONVERTER_KEY INDEX_TO_HTML,
|
2001-03-06 05:14:42 +03:00
|
|
|
nsIndexedToHTML::Create
|
|
|
|
},
|
2000-05-06 13:15:56 +04:00
|
|
|
|
|
|
|
{ "MultiMixedConverter",
|
|
|
|
NS_MULTIMIXEDCONVERTER_CID,
|
2001-03-08 03:41:53 +03:00
|
|
|
NS_ISTREAMCONVERTER_KEY MULTI_MIXED_X,
|
2000-05-06 13:15:56 +04:00
|
|
|
CreateNewMultiMixedConvFactory
|
|
|
|
},
|
|
|
|
|
2001-05-19 02:20:11 +04:00
|
|
|
{ "MultiMixedByteRange",
|
|
|
|
NS_MULTIMIXEDCONVERTER_CID,
|
|
|
|
NS_ISTREAMCONVERTER_KEY MULTI_BYTERANGES,
|
|
|
|
CreateNewMultiMixedConvFactory
|
|
|
|
},
|
|
|
|
|
2000-05-06 13:15:56 +04:00
|
|
|
{ "MultiMixedConverter2",
|
|
|
|
NS_MULTIMIXEDCONVERTER_CID,
|
2001-03-08 03:41:53 +03:00
|
|
|
NS_ISTREAMCONVERTER_KEY MULTI_MIXED,
|
2000-05-06 13:15:56 +04:00
|
|
|
CreateNewMultiMixedConvFactory
|
|
|
|
},
|
|
|
|
{ "Unknown Content-Type Decoder",
|
|
|
|
NS_UNKNOWNDECODER_CID,
|
2001-03-08 03:41:53 +03:00
|
|
|
NS_ISTREAMCONVERTER_KEY UNKNOWN_CONTENT,
|
2000-05-06 13:15:56 +04:00
|
|
|
CreateNewUnknownDecoderFactory
|
|
|
|
},
|
|
|
|
|
|
|
|
{ "HttpChunkConverter",
|
|
|
|
NS_HTTPCHUNKCONVERTER_CID,
|
2001-03-08 03:41:53 +03:00
|
|
|
NS_ISTREAMCONVERTER_KEY CHUNKED_TO_UNCHUNKED,
|
2000-05-06 13:15:56 +04:00
|
|
|
CreateNewHTTPChunkConvFactory
|
|
|
|
},
|
|
|
|
|
|
|
|
{ "HttpChunkConverter",
|
|
|
|
NS_HTTPCHUNKCONVERTER_CID,
|
2001-03-08 03:41:53 +03:00
|
|
|
NS_ISTREAMCONVERTER_KEY UNCHUNKED_TO_CHUNKED,
|
2000-05-06 13:15:56 +04:00
|
|
|
CreateNewHTTPChunkConvFactory
|
|
|
|
},
|
|
|
|
|
|
|
|
{ "HttpCompressConverter",
|
|
|
|
NS_HTTPCOMPRESSCONVERTER_CID,
|
2001-03-08 03:41:53 +03:00
|
|
|
NS_ISTREAMCONVERTER_KEY GZIP_TO_UNCOMPRESSED,
|
2000-05-06 13:15:56 +04:00
|
|
|
CreateNewHTTPCompressConvFactory
|
|
|
|
},
|
|
|
|
|
|
|
|
{ "HttpCompressConverter",
|
|
|
|
NS_HTTPCOMPRESSCONVERTER_CID,
|
2001-03-08 03:41:53 +03:00
|
|
|
NS_ISTREAMCONVERTER_KEY XGZIP_TO_UNCOMPRESSED,
|
2000-05-06 13:15:56 +04:00
|
|
|
CreateNewHTTPCompressConvFactory
|
|
|
|
},
|
|
|
|
{ "HttpCompressConverter",
|
|
|
|
NS_HTTPCOMPRESSCONVERTER_CID,
|
2001-03-08 03:41:53 +03:00
|
|
|
NS_ISTREAMCONVERTER_KEY COMPRESS_TO_UNCOMPRESSED,
|
2000-05-06 13:15:56 +04:00
|
|
|
CreateNewHTTPCompressConvFactory
|
|
|
|
},
|
|
|
|
{ "HttpCompressConverter",
|
|
|
|
NS_HTTPCOMPRESSCONVERTER_CID,
|
2001-03-08 03:41:53 +03:00
|
|
|
NS_ISTREAMCONVERTER_KEY XCOMPRESS_TO_UNCOMPRESSED,
|
2000-05-06 13:15:56 +04:00
|
|
|
CreateNewHTTPCompressConvFactory
|
|
|
|
},
|
|
|
|
{ "HttpCompressConverter",
|
|
|
|
NS_HTTPCOMPRESSCONVERTER_CID,
|
2001-03-08 03:41:53 +03:00
|
|
|
NS_ISTREAMCONVERTER_KEY DEFLATE_TO_UNCOMPRESSED,
|
2000-05-06 13:15:56 +04:00
|
|
|
CreateNewHTTPCompressConvFactory
|
|
|
|
},
|
|
|
|
{ "NSTXTToHTMLConverter",
|
|
|
|
NS_NSTXTTOHTMLCONVERTER_CID,
|
2001-03-08 03:41:53 +03:00
|
|
|
NS_ISTREAMCONVERTER_KEY PLAIN_TO_HTML,
|
2000-05-06 13:15:56 +04:00
|
|
|
CreateNewNSTXTToHTMLConvFactory
|
2001-06-28 05:09:51 +04:00
|
|
|
},
|
|
|
|
#ifndef XP_MAC
|
|
|
|
{ "nsBinHexConverter", NS_BINHEXDECODER_CID,
|
|
|
|
NS_ISTREAMCONVERTER_KEY BINHEX_TO_WILD,
|
|
|
|
nsBinHexDecoderConstructor
|
|
|
|
},
|
|
|
|
#endif
|
2000-05-06 13:15:56 +04:00
|
|
|
// This is not a real stream converter, it's just
|
|
|
|
// registering it's cid factory here.
|
|
|
|
{ "HACK-TXTToHTMLConverter",
|
|
|
|
MOZITXTTOHTMLCONV_CID,
|
|
|
|
NS_ISTREAMCONVERTER_KEY,
|
|
|
|
CreateNewTXTToHTMLConvFactory
|
|
|
|
},
|
2001-04-17 14:47:22 +04:00
|
|
|
#if defined(OLD_CACHE)
|
2000-05-06 13:15:56 +04:00
|
|
|
// from netwerk/cache:
|
2000-09-14 03:57:52 +04:00
|
|
|
{ "Memory Cache", NS_MEM_CACHE_FACTORY_CID, NS_NETWORK_MEMORY_CACHE_CONTRACTID, nsMemCacheConstructor },
|
|
|
|
{ "File Cache", NS_NETDISKCACHE_CID, NS_NETWORK_FILE_CACHE_CONTRACTID, nsNetDiskCacheConstructor },
|
|
|
|
{ "Cache Manager",NS_CACHE_MANAGER_CID, NS_NETWORK_CACHE_MANAGER_CONTRACTID,nsCacheManagerConstructor },
|
2001-04-17 14:47:22 +04:00
|
|
|
#endif
|
2000-05-06 13:15:56 +04:00
|
|
|
// from netwerk/mime:
|
|
|
|
{ "The MIME mapping service",
|
|
|
|
NS_MIMESERVICE_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
"@mozilla.org/mimeold;1",
|
2000-05-06 13:15:56 +04:00
|
|
|
nsMIMEService::Create
|
|
|
|
},
|
|
|
|
{ "xml mime datasource",
|
|
|
|
NS_XMLMIMEDATASOURCE_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_XMLMIMEDATASOURCE_CONTRACTID,
|
2000-05-06 13:15:56 +04:00
|
|
|
nsXMLMIMEDataSource::Create
|
|
|
|
},
|
|
|
|
{ "xml mime INFO",
|
|
|
|
NS_MIMEINFO_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_MIMEINFO_CONTRACTID,
|
2000-05-06 13:15:56 +04:00
|
|
|
nsMIMEInfoImplConstructor
|
|
|
|
},
|
|
|
|
|
|
|
|
// from netwerk/protocol/file:
|
|
|
|
{ "File Protocol Handler",
|
|
|
|
NS_FILEPROTOCOLHANDLER_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "file",
|
2000-05-06 13:15:56 +04:00
|
|
|
nsFileProtocolHandler::Create
|
|
|
|
},
|
|
|
|
{ NS_LOCALFILECHANNEL_CLASSNAME,
|
|
|
|
NS_LOCALFILECHANNEL_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_LOCALFILECHANNEL_CONTRACTID,
|
2000-05-06 13:15:56 +04:00
|
|
|
nsFileChannel::Create
|
|
|
|
},
|
|
|
|
|
2001-05-12 01:04:09 +04:00
|
|
|
#if 0
|
2000-05-06 13:15:56 +04:00
|
|
|
// from netwerk/protocol/http:
|
|
|
|
{ "HTTP Handler",
|
|
|
|
NS_IHTTPHANDLER_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http",
|
2000-05-06 13:15:56 +04:00
|
|
|
nsHTTPHandlerConstructor },
|
|
|
|
{ "HTTPS Handler",
|
|
|
|
NS_HTTPS_HANDLER_FACTORY_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "https",
|
2001-03-13 05:01:07 +03:00
|
|
|
nsHTTPSHandlerConstructor },
|
2000-06-02 04:23:56 +04:00
|
|
|
{ "Basic Auth Encoder",
|
|
|
|
NS_BASICAUTH_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_BASICAUTH_CONTRACTID,
|
2000-06-02 04:23:56 +04:00
|
|
|
nsBasicAuthConstructor,
|
|
|
|
RegisterBasicAuth,
|
|
|
|
UnregisterBasicAuth
|
|
|
|
},
|
2001-05-12 01:04:09 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
{ "HTTP Handler",
|
|
|
|
NS_HTTPPROTOCOLHANDLER_CID,
|
|
|
|
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http",
|
|
|
|
nsHttpHandler::Create },
|
|
|
|
|
|
|
|
{ "HTTPS Handler",
|
|
|
|
NS_HTTPPROTOCOLHANDLER_CID,
|
|
|
|
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "https",
|
|
|
|
nsHttpHandler::Create },
|
|
|
|
|
|
|
|
{ "HTTP Basic Auth Encoder",
|
|
|
|
NS_HTTPBASICAUTH_CID,
|
|
|
|
NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX "basic",
|
|
|
|
nsHttpBasicAuthConstructor },
|
2000-05-06 13:15:56 +04:00
|
|
|
|
|
|
|
// from netwerk/protocol/data:
|
|
|
|
{ "Data Protocol Handler",
|
|
|
|
NS_DATAHANDLER_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "data",
|
2000-05-06 13:15:56 +04:00
|
|
|
nsDataHandler::Create},
|
|
|
|
|
|
|
|
// from netwerk/protocol/jar:
|
|
|
|
{ "JAR Protocol Handler",
|
|
|
|
NS_JARPROTOCOLHANDLER_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "jar",
|
2000-05-06 13:15:56 +04:00
|
|
|
nsJARProtocolHandler::Create
|
|
|
|
},
|
|
|
|
|
|
|
|
// from netwerk/protocol/res:
|
|
|
|
{ "The Resource Protocol Handler",
|
|
|
|
NS_RESPROTOCOLHANDLER_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "resource",
|
2000-05-06 13:15:56 +04:00
|
|
|
nsResProtocolHandler::Create
|
|
|
|
},
|
|
|
|
|
|
|
|
// from netwerk/protocol/about:
|
|
|
|
{ "About Protocol Handler",
|
|
|
|
NS_ABOUTPROTOCOLHANDLER_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "about",
|
2000-05-06 13:15:56 +04:00
|
|
|
nsAboutProtocolHandler::Create
|
|
|
|
},
|
|
|
|
{ "about:blank",
|
|
|
|
NS_ABOUT_BLANK_MODULE_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_ABOUT_MODULE_CONTRACTID_PREFIX "blank",
|
2000-05-06 13:15:56 +04:00
|
|
|
nsAboutBlank::Create
|
|
|
|
},
|
|
|
|
{ "about:bloat",
|
|
|
|
NS_ABOUT_BLOAT_MODULE_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_ABOUT_MODULE_CONTRACTID_PREFIX "bloat",
|
2000-05-06 13:15:56 +04:00
|
|
|
nsAboutBloat::Create
|
|
|
|
},
|
2001-09-01 10:01:25 +04:00
|
|
|
{ "about:config",
|
|
|
|
NS_ABOUT_CONFIG_MODULE_CID,
|
|
|
|
NS_ABOUT_MODULE_CONTRACTID_PREFIX "config",
|
|
|
|
nsAboutConfig::Create
|
|
|
|
},
|
2000-05-06 13:15:56 +04:00
|
|
|
{ "about:credits",
|
2001-04-18 07:09:32 +04:00
|
|
|
NS_ABOUT_REDIRECTOR_MODULE_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_ABOUT_MODULE_CONTRACTID_PREFIX "credits",
|
2001-04-18 07:09:32 +04:00
|
|
|
nsAboutRedirector::Create
|
2000-05-06 13:15:56 +04:00
|
|
|
},
|
2000-09-22 13:05:57 +04:00
|
|
|
{ "about:plugins",
|
2001-04-18 07:09:32 +04:00
|
|
|
NS_ABOUT_REDIRECTOR_MODULE_CID,
|
2000-09-22 13:05:57 +04:00
|
|
|
NS_ABOUT_MODULE_CONTRACTID_PREFIX "plugins",
|
2001-04-18 07:09:32 +04:00
|
|
|
nsAboutRedirector::Create
|
2000-09-22 13:05:57 +04:00
|
|
|
},
|
2000-05-06 13:15:56 +04:00
|
|
|
{ "about:mozilla",
|
2001-04-18 07:09:32 +04:00
|
|
|
NS_ABOUT_REDIRECTOR_MODULE_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_ABOUT_MODULE_CONTRACTID_PREFIX "mozilla",
|
2001-04-18 07:09:32 +04:00
|
|
|
nsAboutRedirector::Create
|
2000-05-06 13:15:56 +04:00
|
|
|
},
|
2000-09-20 02:33:55 +04:00
|
|
|
{ "about:cache",
|
|
|
|
NS_ABOUT_CACHE_MODULE_CID,
|
|
|
|
NS_ABOUT_MODULE_CONTRACTID_PREFIX "cache",
|
|
|
|
nsAboutCache::Create
|
|
|
|
},
|
2001-03-14 01:44:34 +03:00
|
|
|
{ "about:cache-entry",
|
|
|
|
NS_ABOUT_CACHE_ENTRY_MODULE_CID,
|
|
|
|
NS_ABOUT_MODULE_CONTRACTID_PREFIX "cache-entry",
|
|
|
|
nsAboutCacheEntryConstructor
|
|
|
|
},
|
2000-05-06 13:15:56 +04:00
|
|
|
// from netwerk/protocol/keyword:
|
|
|
|
{ "The Keyword Protocol Handler",
|
|
|
|
NS_KEYWORDPROTOCOLHANDLER_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "keyword",
|
2000-05-06 13:15:56 +04:00
|
|
|
nsKeywordProtocolHandler::Create
|
2000-07-01 14:25:25 +04:00
|
|
|
},
|
|
|
|
|
|
|
|
{ NS_ISOCKSSOCKETPROVIDER_CLASSNAME,
|
|
|
|
NS_SOCKSSOCKETPROVIDER_CID,
|
2000-09-14 03:57:52 +04:00
|
|
|
NS_ISOCKSSOCKETPROVIDER_CONTRACTID,
|
2000-07-01 14:25:25 +04:00
|
|
|
nsSOCKSSocketProvider::Create
|
2001-07-25 04:28:28 +04:00
|
|
|
},
|
|
|
|
|
|
|
|
{ NS_ISOCKS4SOCKETPROVIDER_CLASSNAME,
|
|
|
|
NS_SOCKS4SOCKETPROVIDER_CID,
|
|
|
|
NS_ISOCKS4SOCKETPROVIDER_CONTRACTID,
|
|
|
|
nsSOCKS4SocketProvider::Create
|
2000-05-06 13:15:56 +04:00
|
|
|
}
|
|
|
|
|
2001-07-25 04:28:28 +04:00
|
|
|
|
1999-09-30 05:53:31 +04:00
|
|
|
};
|
|
|
|
|
2001-05-05 09:33:37 +04:00
|
|
|
NS_IMPL_NSGETMODULE_WITH_DTOR(necko_core_and_primary_protocols, gNetModuleInfo,
|
2000-05-25 12:27:40 +04:00
|
|
|
nsNeckoShutdown)
|