Back to index

lightning-sunbird  0.9+nobinonly
nsNetModule.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #include "necko-config.h"
00039 
00040 #include "nsCOMPtr.h"
00041 #include "nsIModule.h"
00042 #include "nsIGenericFactory.h"
00043 #include "nsIComponentManager.h"
00044 #include "nsIServiceManager.h"
00045 #include "nsICategoryManager.h"
00046 #include "nsSocketProviderService.h"
00047 #include "nscore.h"
00048 #include "nsSimpleURI.h"
00049 #include "nsLoadGroup.h"
00050 #include "nsStreamLoader.h"
00051 #include "nsUnicharStreamLoader.h"
00052 #include "nsAsyncStreamListener.h"
00053 #include "nsFileStreams.h"
00054 #include "nsBufferedStreams.h"
00055 #include "nsMIMEInputStream.h"
00056 #include "nsSOCKSSocketProvider.h"
00057 #include "nsCacheService.h"
00058 #include "nsIOThreadPool.h"
00059 #include "nsMimeTypes.h"
00060 #include "nsNetStrings.h"
00061 
00062 #include "nsNetCID.h"
00063 
00064 #if defined(XP_MAC) || defined(XP_MACOSX)
00065 // Mac OS
00066 #define BUILD_APPLEFILE_DECODER 1
00067 #else
00068 // other platforms
00069 #define BUILD_BINHEX_DECODER 1
00070 #endif
00071 
00073 
00074 #include "nsIOService.h"
00075 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIOService, nsIOService::GetInstance)
00076 
00077 #include "nsDNSService2.h"
00078 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsDNSService, Init)
00079   
00080 #include "nsProtocolProxyService.h"
00081 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsProtocolProxyService, Init)
00082 
00083 #include "nsStreamTransportService.h"
00084 NS_GENERIC_FACTORY_CONSTRUCTOR(nsStreamTransportService)
00085 
00086 #include "nsSocketTransportService2.h"
00087 #undef LOG
00088 #undef LOG_ENABLED
00089 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSocketTransportService, Init)
00090 
00091 #include "nsServerSocket.h"
00092 NS_GENERIC_FACTORY_CONSTRUCTOR(nsServerSocket)
00093 
00094 #include "nsAsyncStreamCopier.h"
00095 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAsyncStreamCopier)
00096 
00097 #include "nsInputStreamPump.h"
00098 NS_GENERIC_FACTORY_CONSTRUCTOR(nsInputStreamPump)
00099 
00100 #include "nsInputStreamChannel.h"
00101 NS_GENERIC_FACTORY_CONSTRUCTOR(nsInputStreamChannel)
00102 
00103 #include "nsDownloader.h"
00104 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDownloader)
00105 
00106 #include "nsSyncStreamListener.h"
00107 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSyncStreamListener, Init)
00108 
00109 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSafeFileOutputStream)
00110 
00112 
00113 extern NS_METHOD
00114 net_NewIncrementalDownload(nsISupports *, const nsIID &, void **);
00115 
00116 #define NS_INCREMENTALDOWNLOAD_CLASSNAME \
00117     "nsIncrementalDownload"
00118 #define NS_INCREMENTALDOWNLOAD_CID \
00119 { /* a62af1ba-79b3-4896-8aaf-b148bfce4280 */         \
00120     0xa62af1ba,                                      \
00121     0x79b3,                                          \
00122     0x4896,                                          \
00123     {0x8a, 0xaf, 0xb1, 0x48, 0xbf, 0xce, 0x42, 0x80} \
00124 }
00125 
00127 
00128 #include "nsStreamConverterService.h"
00129 
00130 #ifdef BUILD_APPLEFILE_DECODER
00131 #include "nsAppleFileDecoder.h"
00132 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppleFileDecoder)
00133 #endif
00134 
00136 
00137 #include "nsMIMEHeaderParamImpl.h"
00138 
00139 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMIMEHeaderParamImpl)
00141 
00142 #include "nsRequestObserverProxy.h"
00143 #include "nsSimpleStreamListener.h"
00144 #include "nsDirIndexParser.h"
00145 #include "nsDirIndex.h"
00146 
00147 NS_GENERIC_FACTORY_CONSTRUCTOR(nsRequestObserverProxy)
00148 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSimpleStreamListener)
00149 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsDirIndexParser, Init)
00150 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDirIndex)
00151 
00153 
00154 #include "nsStreamListenerTee.h"
00155 NS_GENERIC_FACTORY_CONSTRUCTOR(nsStreamListenerTee)
00156 
00157 
00158 
00159 #ifdef NECKO_COOKIES
00160 #include "nsCookieService.h"
00161 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsCookieService, nsCookieService::GetSingleton)
00162 #endif
00163 
00165 // protocols
00167 
00168 // about:blank is mandatory
00169 #include "nsAboutProtocolHandler.h"
00170 #include "nsAboutBlank.h"
00171 
00172 #ifdef NECKO_PROTOCOL_about
00173 // about
00174 #include "nsAboutBloat.h"
00175 #include "nsAboutCache.h"
00176 #include "nsAboutRedirector.h"
00177 #include "nsAboutCacheEntry.h"
00178 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAboutCacheEntry)
00179 #endif
00180   
00181 #ifdef NECKO_PROTOCOL_file
00182 // file
00183 #include "nsFileProtocolHandler.h"
00184 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsFileProtocolHandler, Init)
00185 #endif
00186 
00187 #ifdef NECKO_PROTOCOL_ftp
00188 // ftp
00189 #include "nsFtpProtocolHandler.h"
00190 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsFtpProtocolHandler, Init)
00191 #endif
00192 
00193 #ifdef NECKO_PROTOCOL_http
00194 // http/https
00195 #include "nsHttpHandler.h"
00196 #include "nsHttpAuthManager.h"
00197 #include "nsHttpBasicAuth.h"
00198 #include "nsHttpDigestAuth.h"
00199 #include "nsHttpNTLMAuth.h"
00200 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpNTLMAuth)
00201 #undef LOG
00202 #undef LOG_ENABLED
00203 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHttpHandler, Init)
00204 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHttpsHandler, Init)
00205 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHttpAuthManager, Init)
00206 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpBasicAuth)
00207 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpDigestAuth)
00208 #endif // !NECKO_PROTOCOL_http
00209   
00210 #ifdef NECKO_PROTOCOL_res
00211 // resource
00212 #include "nsResProtocolHandler.h"
00213 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsResProtocolHandler, Init)
00214 NS_GENERIC_FACTORY_CONSTRUCTOR(nsResURL)
00215 #endif
00216 
00218 
00219 #include "nsURIChecker.h"
00220 NS_GENERIC_FACTORY_CONSTRUCTOR(nsURIChecker)
00221 
00222 
00223 
00224 #include "nsURLParsers.h"
00225 NS_GENERIC_FACTORY_CONSTRUCTOR(nsNoAuthURLParser)
00226 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAuthURLParser)
00227 NS_GENERIC_FACTORY_CONSTRUCTOR(nsStdURLParser)
00228 
00229 #include "nsStandardURL.h"
00230 NS_GENERIC_FACTORY_CONSTRUCTOR(nsStandardURL)
00231 
00232 
00233 
00234 #include "nsIDNService.h"
00235 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsIDNService, Init)
00236 
00237 
00238 
00239 #if defined(XP_WIN) && !defined(WINCE)
00240 #include "nsNotifyAddrListener.h"
00241 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNotifyAddrListener, Init)
00242 #endif
00243 
00245 
00246 #ifdef NECKO_PROTOCOL_ftp
00247 #include "nsFTPDirListingConv.h"
00248 nsresult NS_NewFTPDirListingConv(nsFTPDirListingConv** result);
00249 #endif
00250 
00251 #ifdef NECKO_PROTOCOL_gopher
00252 #include "nsGopherDirListingConv.h"
00253 nsresult NS_NewGopherDirListingConv(nsGopherDirListingConv** result);
00254 #endif
00255 
00256 #include "nsMultiMixedConv.h"
00257 #include "nsHTTPCompressConv.h"
00258 #include "mozTXTToHTMLConv.h"
00259 #include "nsUnknownDecoder.h"
00260 #include "nsTXTToHTMLConv.h"
00261 #include "nsIndexedToHTML.h"
00262 #ifdef BUILD_BINHEX_DECODER
00263 #include "nsBinHexDecoder.h"
00264 #endif
00265 
00266 nsresult NS_NewMultiMixedConv (nsMultiMixedConv** result);
00267 nsresult MOZ_NewTXTToHTMLConv (mozTXTToHTMLConv** result);
00268 nsresult NS_NewHTTPCompressConv  (nsHTTPCompressConv ** result);
00269 nsresult NS_NewNSTXTToHTMLConv(nsTXTToHTMLConv** result);
00270 nsresult NS_NewStreamConv(nsStreamConverterService **aStreamConv);
00271 
00272 #define FTP_TO_INDEX                 "?from=text/ftp-dir&to=application/http-index-format"
00273 #define GOPHER_TO_INDEX              "?from=text/gopher-dir&to=application/http-index-format"
00274 #define INDEX_TO_HTML                "?from=application/http-index-format&to=text/html"
00275 #define MULTI_MIXED_X                "?from=multipart/x-mixed-replace&to=*/*"
00276 #define MULTI_MIXED                  "?from=multipart/mixed&to=*/*"
00277 #define MULTI_BYTERANGES             "?from=multipart/byteranges&to=*/*"
00278 #define UNKNOWN_CONTENT              "?from=" UNKNOWN_CONTENT_TYPE "&to=*/*"
00279 #define MAYBE_TEXT                   "?from=" APPLICATION_MAYBE_TEXT "&to=*/*"
00280 #define GZIP_TO_UNCOMPRESSED         "?from=gzip&to=uncompressed"
00281 #define XGZIP_TO_UNCOMPRESSED        "?from=x-gzip&to=uncompressed"
00282 #define COMPRESS_TO_UNCOMPRESSED     "?from=compress&to=uncompressed"
00283 #define XCOMPRESS_TO_UNCOMPRESSED    "?from=x-compress&to=uncompressed"
00284 #define DEFLATE_TO_UNCOMPRESSED      "?from=deflate&to=uncompressed"
00285 #define PLAIN_TO_HTML                "?from=text/plain&to=text/html"
00286 
00287 #ifdef BUILD_BINHEX_DECODER
00288 #define BINHEX_TO_WILD               "?from=application/mac-binhex40&to=*/*"
00289 #endif
00290 
00291 static const char *const g_StreamConverterArray[] = {
00292         FTP_TO_INDEX,
00293         GOPHER_TO_INDEX,
00294         INDEX_TO_HTML,
00295         MULTI_MIXED_X,
00296         MULTI_MIXED,
00297         MULTI_BYTERANGES,
00298         UNKNOWN_CONTENT,
00299         MAYBE_TEXT,
00300         GZIP_TO_UNCOMPRESSED,
00301         XGZIP_TO_UNCOMPRESSED,
00302         COMPRESS_TO_UNCOMPRESSED,
00303         XCOMPRESS_TO_UNCOMPRESSED,
00304         DEFLATE_TO_UNCOMPRESSED,
00305 #ifdef BUILD_BINHEX_DECODER
00306         BINHEX_TO_WILD,
00307 #endif
00308         PLAIN_TO_HTML
00309     };
00310 
00311 static PRUint32 g_StreamConverterCount = sizeof(g_StreamConverterCount)/sizeof(const char*);
00312 
00313 // each stream converter must add its from/to key to the category manager
00314 // in RegisterStreamConverters(). This provides a string representation
00315 // of each registered converter, rooted in the NS_ISTREAMCONVERTER_KEY
00316 // category. These keys are then (when the stream converter service
00317 // needs to chain converters together) enumerated and parsed to build
00318 // a graph of converters for potential chaining.
00319 static NS_METHOD
00320 RegisterStreamConverters(nsIComponentManager *aCompMgr, nsIFile *aPath,
00321                          const char *registryLocation,
00322                          const char *componentType,
00323                          const nsModuleComponentInfo *info) {
00324     nsresult rv;
00325     nsCOMPtr<nsICategoryManager> catmgr =
00326         do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
00327     if (NS_FAILED(rv)) return rv;
00328     nsXPIDLCString previous;
00329 
00330     PRUint32 count = 0;
00331     while (count < g_StreamConverterCount) {
00332         (void) catmgr->AddCategoryEntry(NS_ISTREAMCONVERTER_KEY, g_StreamConverterArray[count],
00333                                       "", PR_TRUE, PR_TRUE, getter_Copies(previous));
00334         if (NS_FAILED(rv)) NS_ASSERTION(0, "adding a cat entry failed");
00335         count++;
00336     }
00337     
00338     return rv;
00339 }
00340 
00341 // same as RegisterStreamConverters except the reverse.
00342 static NS_METHOD
00343 UnregisterStreamConverters(nsIComponentManager *aCompMgr, nsIFile *aPath,
00344                            const char *registryLocation,
00345                            const nsModuleComponentInfo *info) {
00346     nsresult rv;
00347     nsCOMPtr<nsICategoryManager> catmgr =
00348         do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
00349     if (NS_FAILED(rv)) return rv;
00350 
00351 
00352     PRUint32 count = 0;
00353     while (count < g_StreamConverterCount) {
00354         rv = catmgr->DeleteCategoryEntry(NS_ISTREAMCONVERTER_KEY, 
00355                                          g_StreamConverterArray[count], 
00356                                          PR_TRUE);
00357         if (NS_FAILED(rv)) return rv;
00358         count++;
00359     }
00360     return rv;
00361 }
00362 
00363 #ifdef BUILD_BINHEX_DECODER
00364 NS_GENERIC_FACTORY_CONSTRUCTOR(nsBinHexDecoder)
00365 #endif
00366 
00367 static NS_IMETHODIMP                 
00368 CreateNewStreamConvServiceFactory(nsISupports* aOuter, REFNSIID aIID, void **aResult) 
00369 {
00370     if (!aResult) {                                                  
00371         return NS_ERROR_INVALID_POINTER;                             
00372     }
00373     if (aOuter) {                                                    
00374         *aResult = nsnull;                                           
00375         return NS_ERROR_NO_AGGREGATION;                              
00376     }   
00377     nsStreamConverterService* inst = nsnull;
00378     nsresult rv = NS_NewStreamConv(&inst);
00379     if (NS_FAILED(rv)) {                                             
00380         *aResult = nsnull;                                           
00381         return rv;                                                   
00382     } 
00383     rv = inst->QueryInterface(aIID, aResult);
00384     if (NS_FAILED(rv)) {                                             
00385         *aResult = nsnull;                                           
00386     }                                                                
00387     NS_RELEASE(inst);             /* get rid of extra refcnt */      
00388     return rv;              
00389 }
00390 
00391 #ifdef NECKO_PROTOCOL_ftp
00392 static NS_IMETHODIMP                 
00393 CreateNewFTPDirListingConv(nsISupports* aOuter, REFNSIID aIID, void **aResult) 
00394 {
00395     if (!aResult) {                                                  
00396         return NS_ERROR_INVALID_POINTER;                             
00397     }
00398     if (aOuter) {                                                    
00399         *aResult = nsnull;                                           
00400         return NS_ERROR_NO_AGGREGATION;                              
00401     }   
00402     nsFTPDirListingConv* inst = nsnull;
00403     nsresult rv = NS_NewFTPDirListingConv(&inst);
00404     if (NS_FAILED(rv)) {                                             
00405         *aResult = nsnull;                                           
00406         return rv;                                                   
00407     } 
00408     rv = inst->QueryInterface(aIID, aResult);
00409     if (NS_FAILED(rv)) {                                             
00410         *aResult = nsnull;                                           
00411     }                                                                
00412     NS_RELEASE(inst);             /* get rid of extra refcnt */      
00413     return rv;              
00414 }
00415 #endif
00416 
00417 #ifdef NECKO_PROTOCOL_gopher
00418 static NS_IMETHODIMP                 
00419 CreateNewGopherDirListingConv(nsISupports* aOuter, REFNSIID aIID, void **aResult) 
00420 {
00421     if (!aResult) {
00422         return NS_ERROR_INVALID_POINTER;
00423     }
00424     if (aOuter) {
00425         *aResult = nsnull;
00426         return NS_ERROR_NO_AGGREGATION;
00427     }
00428     nsGopherDirListingConv* inst = nsnull;
00429     nsresult rv = NS_NewGopherDirListingConv(&inst);
00430     if (NS_FAILED(rv)) {
00431         *aResult = nsnull;
00432         return rv;
00433     }
00434     rv = inst->QueryInterface(aIID, aResult);
00435     if (NS_FAILED(rv)) {
00436         *aResult = nsnull;
00437     }
00438     NS_RELEASE(inst);             /* get rid of extra refcnt */
00439     return rv;
00440 }
00441 #endif
00442 
00443 static NS_IMETHODIMP                 
00444 CreateNewMultiMixedConvFactory(nsISupports* aOuter, REFNSIID aIID, void **aResult) 
00445 {
00446     if (!aResult) {                                                  
00447         return NS_ERROR_INVALID_POINTER;                             
00448     }
00449     if (aOuter) {                                                    
00450         *aResult = nsnull;                                           
00451         return NS_ERROR_NO_AGGREGATION;                              
00452     }   
00453     nsMultiMixedConv* inst = nsnull;
00454     nsresult rv = NS_NewMultiMixedConv(&inst);
00455     if (NS_FAILED(rv)) {                                             
00456         *aResult = nsnull;                                           
00457         return rv;                                                   
00458     } 
00459     rv = inst->QueryInterface(aIID, aResult);
00460     if (NS_FAILED(rv)) {                                             
00461         *aResult = nsnull;                                           
00462     }                                                                
00463     NS_RELEASE(inst);             /* get rid of extra refcnt */      
00464     return rv;              
00465 }
00466 
00467 static NS_IMETHODIMP                 
00468 CreateNewTXTToHTMLConvFactory(nsISupports* aOuter, REFNSIID aIID, void **aResult) 
00469 {
00470     if (!aResult) {                                                  
00471         return NS_ERROR_INVALID_POINTER;                             
00472     }
00473     if (aOuter) {                                                    
00474         *aResult = nsnull;                                           
00475         return NS_ERROR_NO_AGGREGATION;                              
00476     }   
00477     mozTXTToHTMLConv* inst = nsnull;
00478     nsresult rv = MOZ_NewTXTToHTMLConv(&inst);
00479     if (NS_FAILED(rv)) {                                             
00480         *aResult = nsnull;                                           
00481         return rv;                                                   
00482     } 
00483     rv = inst->QueryInterface(aIID, aResult);
00484     if (NS_FAILED(rv)) {                                             
00485         *aResult = nsnull;                                           
00486     }                                                                
00487     NS_RELEASE(inst);             /* get rid of extra refcnt */      
00488     return rv;              
00489 }
00490 
00491 static NS_IMETHODIMP                 
00492 CreateNewHTTPCompressConvFactory (nsISupports* aOuter, REFNSIID aIID, void **aResult) 
00493 {
00494     if (!aResult) {                                                  
00495         return NS_ERROR_INVALID_POINTER;                             
00496     }
00497     if (aOuter) {                                                    
00498         *aResult = nsnull;                                           
00499         return NS_ERROR_NO_AGGREGATION;                              
00500     }   
00501     nsHTTPCompressConv* inst = nsnull;
00502     nsresult rv = NS_NewHTTPCompressConv (&inst);
00503     if (NS_FAILED(rv)) {                                             
00504         *aResult = nsnull;                                           
00505         return rv;                                                   
00506     } 
00507     rv = inst->QueryInterface(aIID, aResult);
00508     if (NS_FAILED(rv)) {                                             
00509         *aResult = nsnull;                                           
00510     }                                                                
00511     NS_RELEASE(inst);             /* get rid of extra refcnt */      
00512     return rv;              
00513 }
00514 
00515 static NS_IMETHODIMP
00516 CreateNewUnknownDecoderFactory(nsISupports *aOuter, REFNSIID aIID, void **aResult)
00517 {
00518   nsresult rv;
00519 
00520   if (!aResult) {
00521     return NS_ERROR_NULL_POINTER;
00522   }
00523   *aResult = nsnull;
00524 
00525   if (aOuter) {
00526     return NS_ERROR_NO_AGGREGATION;
00527   }
00528 
00529   nsUnknownDecoder *inst;
00530   
00531   inst = new nsUnknownDecoder();
00532   if (!inst) {
00533     return NS_ERROR_OUT_OF_MEMORY;
00534   }
00535   NS_ADDREF(inst);
00536   rv = inst->QueryInterface(aIID, aResult);
00537   NS_RELEASE(inst);
00538 
00539   return rv;
00540 }
00541 
00542 static NS_IMETHODIMP
00543 CreateNewBinaryDetectorFactory(nsISupports *aOuter, REFNSIID aIID, void **aResult)
00544 {
00545   nsresult rv;
00546 
00547   if (!aResult) {
00548     return NS_ERROR_NULL_POINTER;
00549   }
00550   *aResult = nsnull;
00551 
00552   if (aOuter) {
00553     return NS_ERROR_NO_AGGREGATION;
00554   }
00555 
00556   nsBinaryDetector* inst = new nsBinaryDetector();
00557   if (!inst) {
00558     return NS_ERROR_OUT_OF_MEMORY;
00559   }
00560   NS_ADDREF(inst);
00561   rv = inst->QueryInterface(aIID, aResult);
00562   NS_RELEASE(inst);
00563 
00564   return rv;
00565 }
00566 
00567 static NS_IMETHODIMP
00568 CreateNewNSTXTToHTMLConvFactory(nsISupports *aOuter, REFNSIID aIID, void **aResult)
00569 {
00570   nsresult rv;
00571 
00572   if (!aResult) {
00573     return NS_ERROR_NULL_POINTER;
00574   }
00575   *aResult = nsnull;
00576 
00577   if (aOuter) {
00578     return NS_ERROR_NO_AGGREGATION;
00579   }
00580 
00581   nsTXTToHTMLConv *inst;
00582   
00583   inst = new nsTXTToHTMLConv();
00584   if (!inst) return NS_ERROR_OUT_OF_MEMORY;
00585 
00586   NS_ADDREF(inst);
00587   rv = inst->Init();
00588   if (NS_FAILED(rv)) {
00589     delete inst;
00590     return rv;
00591   }
00592   rv = inst->QueryInterface(aIID, aResult);
00593   NS_RELEASE(inst);
00594 
00595   return rv;
00596 }
00597 
00599 // Module implementation for the net library
00600 
00601 // Net module startup hook
00602 PR_STATIC_CALLBACK(nsresult) nsNetStartup(nsIModule *neckoModule)
00603 {
00604     gNetStrings = new nsNetStrings();
00605     return gNetStrings ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
00606 }
00607 
00608 
00609 // Net module shutdown hook
00610 static void PR_CALLBACK nsNetShutdown(nsIModule *neckoModule)
00611 {
00612     // Release the url parser that the stdurl is holding.
00613     nsStandardURL::ShutdownGlobalObjects();
00614 
00615     // Release buffer cache
00616     NS_IF_RELEASE(nsIOService::gBufferCache);
00617 
00618     // Release global state used by the URL helper module.
00619     net_ShutdownURLHelper();
00620 
00621     // Release necko strings
00622     delete gNetStrings;
00623     gNetStrings = nsnull;
00624 }
00625 
00626 static const nsModuleComponentInfo gNetModuleInfo[] = {
00627     { NS_IOSERVICE_CLASSNAME,
00628       NS_IOSERVICE_CID,
00629       NS_IOSERVICE_CONTRACTID,
00630       nsIOServiceConstructor },
00631     { NS_IOSERVICE_CLASSNAME,
00632       NS_IOSERVICE_CID,
00633       NS_NETUTIL_CONTRACTID,
00634       nsIOServiceConstructor },
00635     { NS_IOTHREADPOOL_CLASSNAME,
00636       NS_IOTHREADPOOL_CID,
00637       NS_IOTHREADPOOL_CONTRACTID,
00638       net_NewIOThreadPool },
00639     { NS_STREAMTRANSPORTSERVICE_CLASSNAME,
00640       NS_STREAMTRANSPORTSERVICE_CID,
00641       NS_STREAMTRANSPORTSERVICE_CONTRACTID,
00642       nsStreamTransportServiceConstructor },
00643     { NS_SOCKETTRANSPORTSERVICE_CLASSNAME,
00644       NS_SOCKETTRANSPORTSERVICE_CID,
00645       NS_SOCKETTRANSPORTSERVICE_CONTRACTID,
00646       nsSocketTransportServiceConstructor },
00647     { NS_SERVERSOCKET_CLASSNAME,
00648       NS_SERVERSOCKET_CID,
00649       NS_SERVERSOCKET_CONTRACTID,
00650       nsServerSocketConstructor },
00651     { NS_SOCKETPROVIDERSERVICE_CLASSNAME,
00652       NS_SOCKETPROVIDERSERVICE_CID,
00653       NS_SOCKETPROVIDERSERVICE_CONTRACTID,
00654       nsSocketProviderService::Create },
00655     { NS_DNSSERVICE_CLASSNAME,
00656       NS_DNSSERVICE_CID,
00657       NS_DNSSERVICE_CONTRACTID,
00658       nsDNSServiceConstructor },
00659     { NS_IDNSERVICE_CLASSNAME,
00660       NS_IDNSERVICE_CID,
00661       NS_IDNSERVICE_CONTRACTID,
00662       nsIDNServiceConstructor },
00663     { NS_SIMPLEURI_CLASSNAME,
00664       NS_SIMPLEURI_CID,
00665       NS_SIMPLEURI_CONTRACTID,
00666       nsSimpleURI::Create },
00667     { NS_ASYNCSTREAMCOPIER_CLASSNAME,
00668       NS_ASYNCSTREAMCOPIER_CID,
00669       NS_ASYNCSTREAMCOPIER_CONTRACTID,
00670       nsAsyncStreamCopierConstructor },
00671     { NS_INPUTSTREAMPUMP_CLASSNAME,
00672       NS_INPUTSTREAMPUMP_CID,
00673       NS_INPUTSTREAMPUMP_CONTRACTID,
00674       nsInputStreamPumpConstructor },
00675     { NS_INPUTSTREAMCHANNEL_CLASSNAME,
00676       NS_INPUTSTREAMCHANNEL_CID,
00677       NS_INPUTSTREAMCHANNEL_CONTRACTID,
00678       nsInputStreamChannelConstructor },
00679     { NS_STREAMLOADER_CLASSNAME, 
00680       NS_STREAMLOADER_CID,
00681       NS_STREAMLOADER_CONTRACTID,
00682       nsStreamLoader::Create },
00683     { NS_UNICHARSTREAMLOADER_CLASSNAME, 
00684       NS_UNICHARSTREAMLOADER_CID,
00685       NS_UNICHARSTREAMLOADER_CONTRACTID,
00686       nsUnicharStreamLoader::Create },
00687     { NS_DOWNLOADER_CLASSNAME,
00688       NS_DOWNLOADER_CID,
00689       NS_DOWNLOADER_CONTRACTID,
00690       nsDownloaderConstructor },
00691     { NS_SYNCSTREAMLISTENER_CLASSNAME,
00692       NS_SYNCSTREAMLISTENER_CID,
00693       NS_SYNCSTREAMLISTENER_CONTRACTID,
00694       nsSyncStreamListenerConstructor },
00695     { NS_REQUESTOBSERVERPROXY_CLASSNAME,
00696       NS_REQUESTOBSERVERPROXY_CID,
00697       NS_REQUESTOBSERVERPROXY_CONTRACTID,
00698       nsRequestObserverProxyConstructor },
00699     { NS_SIMPLESTREAMLISTENER_CLASSNAME,
00700       NS_SIMPLESTREAMLISTENER_CID,
00701       NS_SIMPLESTREAMLISTENER_CONTRACTID,
00702       nsSimpleStreamListenerConstructor },
00703     { NS_ASYNCSTREAMLISTENER_CLASSNAME,
00704       NS_ASYNCSTREAMLISTENER_CID,
00705       NS_ASYNCSTREAMLISTENER_CONTRACTID,
00706       nsAsyncStreamListener::Create },
00707     { NS_STREAMLISTENERTEE_CLASSNAME,
00708       NS_STREAMLISTENERTEE_CID,
00709       NS_STREAMLISTENERTEE_CONTRACTID,
00710       nsStreamListenerTeeConstructor },
00711     { NS_LOADGROUP_CLASSNAME,
00712       NS_LOADGROUP_CID,
00713       NS_LOADGROUP_CONTRACTID,
00714       nsLoadGroup::Create },
00715     { NS_LOCALFILEINPUTSTREAM_CLASSNAME, 
00716       NS_LOCALFILEINPUTSTREAM_CID,
00717       NS_LOCALFILEINPUTSTREAM_CONTRACTID,
00718       nsFileInputStream::Create },
00719     { NS_LOCALFILEOUTPUTSTREAM_CLASSNAME, 
00720       NS_LOCALFILEOUTPUTSTREAM_CID,
00721       NS_LOCALFILEOUTPUTSTREAM_CONTRACTID,
00722       nsFileOutputStream::Create },
00723     { NS_SAFELOCALFILEOUTPUTSTREAM_CLASSNAME,
00724       NS_SAFELOCALFILEOUTPUTSTREAM_CID,
00725       NS_SAFELOCALFILEOUTPUTSTREAM_CONTRACTID,
00726       nsSafeFileOutputStreamConstructor
00727     },
00728     
00729     { "URIChecker",
00730       NS_URICHECKER_CID,
00731       NS_URICHECKER_CONTRACT_ID,
00732       nsURICheckerConstructor
00733     },
00734 
00735     { NS_INCREMENTALDOWNLOAD_CLASSNAME,
00736       NS_INCREMENTALDOWNLOAD_CID,
00737       NS_INCREMENTALDOWNLOAD_CONTRACTID,
00738       net_NewIncrementalDownload
00739     },
00740 
00741     // The register functions for the built-in 
00742     // parsers just need to be called once.
00743     { NS_STDURLPARSER_CLASSNAME,
00744       NS_STDURLPARSER_CID,
00745       NS_STDURLPARSER_CONTRACTID,
00746       nsStdURLParserConstructor},
00747     { NS_NOAUTHURLPARSER_CLASSNAME,
00748       NS_NOAUTHURLPARSER_CID,
00749       NS_NOAUTHURLPARSER_CONTRACTID,
00750       nsNoAuthURLParserConstructor },
00751     { NS_AUTHURLPARSER_CLASSNAME,
00752       NS_AUTHURLPARSER_CID,
00753       NS_AUTHURLPARSER_CONTRACTID,
00754       nsAuthURLParserConstructor },
00755 
00756     { NS_STANDARDURL_CLASSNAME,
00757       NS_STANDARDURL_CID,
00758       NS_STANDARDURL_CONTRACTID,
00759       nsStandardURLConstructor },
00760 
00761     { NS_BUFFEREDINPUTSTREAM_CLASSNAME, 
00762       NS_BUFFEREDINPUTSTREAM_CID,
00763       NS_BUFFEREDINPUTSTREAM_CONTRACTID,
00764       nsBufferedInputStream::Create },
00765     { NS_BUFFEREDOUTPUTSTREAM_CLASSNAME, 
00766       NS_BUFFEREDOUTPUTSTREAM_CID,
00767       NS_BUFFEREDOUTPUTSTREAM_CONTRACTID,
00768       nsBufferedOutputStream::Create },
00769     { NS_MIMEINPUTSTREAM_CLASSNAME,
00770       NS_MIMEINPUTSTREAM_CID,
00771       NS_MIMEINPUTSTREAM_CONTRACTID,
00772       nsMIMEInputStreamConstructor },
00773     { NS_PROTOCOLPROXYSERVICE_CLASSNAME,
00774       NS_PROTOCOLPROXYSERVICE_CID,
00775       NS_PROTOCOLPROXYSERVICE_CONTRACTID,
00776       nsProtocolProxyServiceConstructor },
00777 
00778     // from netwerk/streamconv:
00779 
00780     // this converter is "always" built.
00781     // HACK-ALERT, register *all* converters
00782     // in this converter's component manager 
00783     // registration. just piggy backing here until
00784     // you can add registration functions to
00785     // the generic module macro.
00786     { "Stream Converter Service", 
00787       NS_STREAMCONVERTERSERVICE_CID,
00788       "@mozilla.org/streamConverters;1", 
00789       CreateNewStreamConvServiceFactory,
00790       RegisterStreamConverters,   // registers *all* converters
00791       UnregisterStreamConverters  // unregisters *all* converters
00792     },
00793     
00794 #ifdef BUILD_APPLEFILE_DECODER
00795     { NS_APPLEFILEDECODER_CLASSNAME, 
00796       NS_APPLEFILEDECODER_CID,
00797       NS_IAPPLEFILEDECODER_CONTRACTID, 
00798       nsAppleFileDecoderConstructor
00799     },
00800 #endif
00801 
00802 #ifdef NECKO_PROTOCOL_ftp
00803     // from netwerk/streamconv/converters:
00804     { "FTPDirListingConverter", 
00805       NS_FTPDIRLISTINGCONVERTER_CID, 
00806       NS_ISTREAMCONVERTER_KEY FTP_TO_INDEX, 
00807       CreateNewFTPDirListingConv
00808     },
00809 #endif
00810 
00811 #ifdef NECKO_PROTOCOL_gopher
00812     { "GopherDirListingConverter",
00813       NS_GOPHERDIRLISTINGCONVERTER_CID,
00814       NS_ISTREAMCONVERTER_KEY GOPHER_TO_INDEX,
00815       CreateNewGopherDirListingConv
00816     },
00817 #endif
00818 
00819     { "Indexed to HTML Converter", 
00820       NS_NSINDEXEDTOHTMLCONVERTER_CID,
00821       NS_ISTREAMCONVERTER_KEY INDEX_TO_HTML, 
00822       nsIndexedToHTML::Create
00823     },
00824 
00825     { "Directory Index Parser",
00826       NS_DIRINDEXPARSER_CID,
00827       NS_DIRINDEXPARSER_CONTRACTID,
00828       nsDirIndexParserConstructor
00829     },
00830 
00831     { "MultiMixedConverter", 
00832       NS_MULTIMIXEDCONVERTER_CID,
00833       NS_ISTREAMCONVERTER_KEY MULTI_MIXED_X, 
00834       CreateNewMultiMixedConvFactory
00835     },
00836 
00837     { "MultiMixedByteRange", 
00838       NS_MULTIMIXEDCONVERTER_CID,
00839       NS_ISTREAMCONVERTER_KEY MULTI_BYTERANGES, 
00840       CreateNewMultiMixedConvFactory
00841     },
00842 
00843     { "MultiMixedConverter2",
00844       NS_MULTIMIXEDCONVERTER_CID,
00845       NS_ISTREAMCONVERTER_KEY MULTI_MIXED,
00846       CreateNewMultiMixedConvFactory
00847     },
00848 
00849     { "Unknown Content-Type Decoder",
00850       NS_UNKNOWNDECODER_CID,
00851       NS_ISTREAMCONVERTER_KEY UNKNOWN_CONTENT,
00852       CreateNewUnknownDecoderFactory
00853     },
00854 
00855     { "Unknown Content-Type Decoder",
00856       NS_UNKNOWNDECODER_CID,
00857       NS_GENERIC_CONTENT_SNIFFER,
00858       CreateNewUnknownDecoderFactory
00859     },
00860 
00861     { "Binary Detector",
00862       NS_BINARYDETECTOR_CID,
00863       NS_ISTREAMCONVERTER_KEY MAYBE_TEXT,
00864       CreateNewBinaryDetectorFactory
00865     },
00866 
00867     { "HttpCompressConverter", 
00868       NS_HTTPCOMPRESSCONVERTER_CID,
00869       NS_ISTREAMCONVERTER_KEY GZIP_TO_UNCOMPRESSED,
00870       CreateNewHTTPCompressConvFactory
00871     },
00872 
00873     { "HttpCompressConverter", 
00874       NS_HTTPCOMPRESSCONVERTER_CID,
00875       NS_ISTREAMCONVERTER_KEY XGZIP_TO_UNCOMPRESSED,
00876       CreateNewHTTPCompressConvFactory
00877     },
00878     { "HttpCompressConverter", 
00879       NS_HTTPCOMPRESSCONVERTER_CID,
00880       NS_ISTREAMCONVERTER_KEY COMPRESS_TO_UNCOMPRESSED,
00881       CreateNewHTTPCompressConvFactory
00882     },
00883     { "HttpCompressConverter", 
00884       NS_HTTPCOMPRESSCONVERTER_CID,
00885       NS_ISTREAMCONVERTER_KEY XCOMPRESS_TO_UNCOMPRESSED,
00886       CreateNewHTTPCompressConvFactory
00887     },
00888     { "HttpCompressConverter", 
00889       NS_HTTPCOMPRESSCONVERTER_CID,
00890       NS_ISTREAMCONVERTER_KEY DEFLATE_TO_UNCOMPRESSED,
00891       CreateNewHTTPCompressConvFactory
00892     },
00893     { "NSTXTToHTMLConverter",
00894       NS_NSTXTTOHTMLCONVERTER_CID,
00895       NS_ISTREAMCONVERTER_KEY PLAIN_TO_HTML,
00896       CreateNewNSTXTToHTMLConvFactory
00897     },
00898 #ifdef BUILD_BINHEX_DECODER
00899     { "nsBinHexConverter", NS_BINHEXDECODER_CID,
00900       NS_ISTREAMCONVERTER_KEY BINHEX_TO_WILD,
00901       nsBinHexDecoderConstructor
00902     },
00903 #endif
00904     // This is not a real stream converter, it's just
00905     // registering its cid factory here.
00906     { "HACK-TXTToHTMLConverter", 
00907       MOZITXTTOHTMLCONV_CID,
00908       MOZ_TXTTOHTMLCONV_CONTRACTID, 
00909       CreateNewTXTToHTMLConvFactory
00910     },
00911 
00912     { "Directory Index",
00913       NS_DIRINDEX_CID,
00914       "@mozilla.org/dirIndex;1",
00915       nsDirIndexConstructor
00916     },
00917 
00918     // from netwerk/mime:
00919     { "mime header param", 
00920       NS_MIMEHEADERPARAM_CID,
00921       NS_MIMEHEADERPARAM_CONTRACTID,
00922       nsMIMEHeaderParamImplConstructor
00923     },
00924 
00925 #ifdef NECKO_PROTOCOL_file
00926     // from netwerk/protocol/file:
00927     { NS_FILEPROTOCOLHANDLER_CLASSNAME,
00928       NS_FILEPROTOCOLHANDLER_CID,  
00929       NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "file", 
00930       nsFileProtocolHandlerConstructor
00931     },
00932 #endif
00933 
00934 #ifdef NECKO_PROTOCOL_http
00935     { "HTTP Handler",
00936       NS_HTTPPROTOCOLHANDLER_CID,
00937       NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http",
00938       nsHttpHandlerConstructor },
00939 
00940     { "HTTPS Handler",
00941       NS_HTTPSPROTOCOLHANDLER_CID,
00942       NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "https",
00943       nsHttpsHandlerConstructor },
00944 
00945     { "HTTP Basic Auth Encoder",
00946       NS_HTTPBASICAUTH_CID,
00947       NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX "basic",
00948       nsHttpBasicAuthConstructor },
00949 
00950     { "HTTP Digest Auth Encoder",
00951       NS_HTTPDIGESTAUTH_CID,
00952       NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX "digest",
00953       nsHttpDigestAuthConstructor },
00954 
00955     { "HTTP NTLM Auth Encoder",
00956       NS_HTTPNTLMAUTH_CID,
00957       NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX "ntlm",
00958       nsHttpNTLMAuthConstructor },
00959 
00960     { NS_HTTPAUTHMANAGER_CLASSNAME,
00961       NS_HTTPAUTHMANAGER_CID,
00962       NS_HTTPAUTHMANAGER_CONTRACTID,
00963       nsHttpAuthManagerConstructor },
00964 #endif // !NECKO_PROTOCOL_http
00965       
00966 #ifdef NECKO_PROTOCOL_ftp
00967     // from netwerk/protocol/ftp:
00968     { NS_FTPPROTOCOLHANDLER_CLASSNAME,
00969       NS_FTPPROTOCOLHANDLER_CID,
00970       NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "ftp",
00971       nsFtpProtocolHandlerConstructor
00972     },
00973 #endif
00974 
00975 #ifdef NECKO_PROTOCOL_res
00976     // from netwerk/protocol/res:
00977     { NS_RESPROTOCOLHANDLER_CLASSNAME,
00978       NS_RESPROTOCOLHANDLER_CID,
00979       NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "resource",
00980       nsResProtocolHandlerConstructor
00981     },
00982     { NS_RESURL_CLASSNAME, // needed only for fastload
00983       NS_RESURL_CID,
00984       nsnull,
00985       nsResURLConstructor
00986     },
00987 #endif
00988 
00989     // from netwerk/protocol/about (about:blank is mandatory):
00990     { "About Protocol Handler", 
00991       NS_ABOUTPROTOCOLHANDLER_CID,
00992       NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "about", 
00993       nsAboutProtocolHandler::Create
00994     },
00995     { "about:blank", 
00996       NS_ABOUT_BLANK_MODULE_CID,
00997       NS_ABOUT_MODULE_CONTRACTID_PREFIX "blank", 
00998       nsAboutBlank::Create
00999     },
01000 #ifdef NECKO_PROTOCOL_about
01001     { "about:bloat", 
01002       NS_ABOUT_BLOAT_MODULE_CID,
01003       NS_ABOUT_MODULE_CONTRACTID_PREFIX "bloat", 
01004       nsAboutBloat::Create
01005     },
01006     { "about:config",
01007       NS_ABOUT_REDIRECTOR_MODULE_CID,
01008       NS_ABOUT_MODULE_CONTRACTID_PREFIX "config",
01009       nsAboutRedirector::Create
01010     },
01011     { "about:credits",
01012       NS_ABOUT_REDIRECTOR_MODULE_CID,
01013       NS_ABOUT_MODULE_CONTRACTID_PREFIX "credits",
01014       nsAboutRedirector::Create
01015     },
01016     { "about:plugins",
01017       NS_ABOUT_REDIRECTOR_MODULE_CID,
01018       NS_ABOUT_MODULE_CONTRACTID_PREFIX "plugins",
01019       nsAboutRedirector::Create
01020     },
01021     { "about:mozilla",
01022       NS_ABOUT_REDIRECTOR_MODULE_CID,
01023       NS_ABOUT_MODULE_CONTRACTID_PREFIX "mozilla",
01024       nsAboutRedirector::Create
01025     },
01026     { "about:logo",
01027       NS_ABOUT_REDIRECTOR_MODULE_CID,
01028       NS_ABOUT_MODULE_CONTRACTID_PREFIX "logo",
01029       nsAboutRedirector::Create
01030     },
01031     { "about:buildconfig",
01032       NS_ABOUT_REDIRECTOR_MODULE_CID,
01033       NS_ABOUT_MODULE_CONTRACTID_PREFIX "buildconfig",
01034       nsAboutRedirector::Create
01035     },
01036     { "about:license",
01037       NS_ABOUT_REDIRECTOR_MODULE_CID,
01038       NS_ABOUT_MODULE_CONTRACTID_PREFIX "license",
01039       nsAboutRedirector::Create
01040     },
01041     { "about:licence",
01042       NS_ABOUT_REDIRECTOR_MODULE_CID,
01043       NS_ABOUT_MODULE_CONTRACTID_PREFIX "licence",
01044       nsAboutRedirector::Create
01045     },
01046     { "about:about",
01047       NS_ABOUT_REDIRECTOR_MODULE_CID,
01048       NS_ABOUT_MODULE_CONTRACTID_PREFIX "about",
01049       nsAboutRedirector::Create
01050     },
01051     { "about:neterror",
01052       NS_ABOUT_REDIRECTOR_MODULE_CID,
01053       NS_ABOUT_MODULE_CONTRACTID_PREFIX "neterror",
01054       nsAboutRedirector::Create
01055     },
01056 
01057     { "about:cache", 
01058       NS_ABOUT_CACHE_MODULE_CID,
01059       NS_ABOUT_MODULE_CONTRACTID_PREFIX "cache", 
01060       nsAboutCache::Create
01061     },
01062     { "about:cache-entry",
01063       NS_ABOUT_CACHE_ENTRY_MODULE_CID,
01064       NS_ABOUT_MODULE_CONTRACTID_PREFIX "cache-entry",
01065       nsAboutCacheEntryConstructor
01066     },
01067 #endif
01068 
01069     {  "nsSOCKSSocketProvider",
01070        NS_SOCKSSOCKETPROVIDER_CID,
01071        NS_NETWORK_SOCKET_CONTRACTID_PREFIX "socks",
01072        nsSOCKSSocketProvider::CreateV5
01073     },
01074 
01075     {  "nsSOCKS4SocketProvider",
01076        NS_SOCKS4SOCKETPROVIDER_CID,
01077        NS_NETWORK_SOCKET_CONTRACTID_PREFIX "socks4",
01078        nsSOCKSSocketProvider::CreateV4
01079     },
01080 
01081     {  NS_CACHESERVICE_CLASSNAME,
01082        NS_CACHESERVICE_CID,
01083        NS_CACHESERVICE_CONTRACTID,
01084        nsCacheService::Create
01085     },
01086 
01087 #ifdef NECKO_COOKIES
01088     { NS_COOKIEMANAGER_CLASSNAME,
01089       NS_COOKIEMANAGER_CID,
01090       NS_COOKIEMANAGER_CONTRACTID,
01091       nsCookieServiceConstructor
01092     },
01093 
01094     { NS_COOKIESERVICE_CLASSNAME,
01095       NS_COOKIESERVICE_CID,
01096       NS_COOKIESERVICE_CONTRACTID,
01097       nsCookieServiceConstructor
01098     },
01099 #endif
01100 
01101 #if defined(XP_WIN) && !defined(WINCE)
01102     { NS_NETWORK_LINK_SERVICE_CLASSNAME,
01103       NS_NETWORK_LINK_SERVICE_CID,
01104       NS_NETWORK_LINK_SERVICE_CONTRACTID,
01105       nsNotifyAddrListenerConstructor
01106     },
01107 #endif
01108 };
01109 
01110 NS_IMPL_NSGETMODULE_WITH_CTOR_DTOR(necko_core_and_primary_protocols,
01111                                    gNetModuleInfo,
01112                                    nsNetStartup, nsNetShutdown)