diff --git a/mozilla/network/module/Makefile b/mozilla/network/module/Makefile index 6f10b869d8f..cd764d57434 100644 --- a/mozilla/network/module/Makefile +++ b/mozilla/network/module/Makefile @@ -27,6 +27,7 @@ CPPSRCS = \ nsHttpUrl.cpp \ nsStubContext.cpp \ nsNetStubs.cpp \ + nsNetIDs.cpp \ $(NULL) REQUIRES = raptor js dbm nspr security pref xpcom util img \ diff --git a/mozilla/network/module/makefile.win b/mozilla/network/module/makefile.win index ad7f47188cb..7c1788853c7 100644 --- a/mozilla/network/module/makefile.win +++ b/mozilla/network/module/makefile.win @@ -62,6 +62,7 @@ OBJS= \ .\$(OBJDIR)\nsHttpUrl.obj \ .\$(OBJDIR)\nsStubContext.obj \ .\$(OBJDIR)\nsNetStubs.obj \ + .\$(OBJDIR)\nsNetIDs.obj \ $(NULL) #//------------------------------------------------------------------------ diff --git a/mozilla/network/module/nsNetIDs.cpp b/mozilla/network/module/nsNetIDs.cpp new file mode 100644 index 00000000000..5cce809c64b --- /dev/null +++ b/mozilla/network/module/nsNetIDs.cpp @@ -0,0 +1,2 @@ +#define NS_IMPL_IDS +#include "nsIPref.h" diff --git a/mozilla/network/module/nsNetService.cpp b/mozilla/network/module/nsNetService.cpp index 1b199001836..03c4ce443f0 100644 --- a/mozilla/network/module/nsNetService.cpp +++ b/mozilla/network/module/nsNetService.cpp @@ -16,10 +16,18 @@ * Reserved. */ +#include "nsRepository.h" #include "nsNetService.h" #include "nsNetStream.h" #include "net.h" +extern "C" { +#include "mkutils.h" +#include "mkgeturl.h" #include "mktrace.h" +#include "mkstream.h" +#include "cvchunk.h" +}; +#include "netcache.h" #include "plstr.h" #include "nsString.h" @@ -54,6 +62,12 @@ extern const char *XP_AppName; extern const char *XP_AppLanguage; extern const char *XP_AppPlatform; #endif + +PUBLIC NET_StreamClass * +NET_NGLayoutConverter(FO_Present_Types format_out, + void *converter_obj, + URL_Struct *URL_s, + MWContext *context); }; /* @@ -86,6 +100,17 @@ nsNetlibService::nsNetlibService(nsINetContainerApplication *aContainerApp) /* Initialize the file extension -> content-type mappings */ NET_InitFileFormatTypes(nsnull, nsnull); + NET_FinishInitNetLib(); + + NET_RegisterContentTypeConverter("*", FO_CACHE_AND_NGLAYOUT, NULL, + NET_CacheConverter); + NET_RegisterContentTypeConverter("*", FO_NGLAYOUT, NULL, + NET_NGLayoutConverter); + + NET_RegisterUniversalEncodingConverter("chunked", + NULL, + NET_ChunkedDecoderStream); + mContainer = aContainerApp; NS_IF_ADDREF(mContainer); if (NULL != mContainer) { @@ -199,7 +224,7 @@ nsresult nsNetlibService::OpenStream(nsIURL *aUrl, /* Start the URL load... */ NET_GetURL (URL_s, /* URL_Struct */ - FO_CACHE_AND_PRESENT, /* FO_Present_type */ + FO_CACHE_AND_NGLAYOUT, /* FO_Present_type */ (MWContext *)m_stubContext, /* MWContext */ bam_exit_routine); /* Exit routine... */ @@ -284,7 +309,7 @@ nsresult nsNetlibService::OpenBlockingStream(nsIURL *aUrl, /* Start the URL load... */ NET_GetURL (URL_s, /* URL_Struct */ - FO_CACHE_AND_PRESENT, /* FO_Present_type */ + FO_CACHE_AND_NGLAYOUT, /* FO_Present_type */ (MWContext *)m_stubContext, /* MWContext */ bam_exit_routine); /* Exit routine... */ diff --git a/mozilla/network/module/nsNetService.h b/mozilla/network/module/nsNetService.h index 6f73e0cc814..47d53b0132b 100644 --- a/mozilla/network/module/nsNetService.h +++ b/mozilla/network/module/nsNetService.h @@ -20,6 +20,7 @@ #define net_serv_h___ #include "nspr.h" +#include "nsIPref.h" #include "nsINetService.h" class nsINetContainerApplication; @@ -47,6 +48,7 @@ private: /* XXX: This is temporary until bamwrap.cpp is removed... */ void *m_stubContext; nsINetContainerApplication *mContainer; + nsIPref *mPref; }; diff --git a/mozilla/network/module/nsNetStubs.cpp b/mozilla/network/module/nsNetStubs.cpp index 359f433b333..5de0bec7853 100644 --- a/mozilla/network/module/nsNetStubs.cpp +++ b/mozilla/network/module/nsNetStubs.cpp @@ -42,7 +42,7 @@ extern "C" { extern "C" { -#if defined(XP_PC) || defined(XP_UNIX) +#if defined(XP_UNIX) || defined(XP_WIN) DB * dbopen(const char *fname, int flags,int mode, DBTYPE type, const void *openinfo) @@ -1308,31 +1308,6 @@ LO_getNextTabableElement( MWContext *context, LO_TabFocusData *pCurrentFocus, in return FALSE; } -/* - * Random libnet functions... - */ -NET_StreamClass * -NET_NewStream (char *name, - MKStreamWriteFunc process, - MKStreamCompleteFunc complete, - MKStreamAbortFunc abort, - MKStreamWriteReadyFunc ready, - void *streamData, - MWContext *windowID) -{ - return NULL; -} - -#ifdef DEBUG -MODULE_PRIVATE void -NET_DisplayStreamInfoAsHTML(ActiveEntry *cur_entry) -{ - MOZ_FUNCTION_STUB; -} -#endif /* DEBUG */ - - - PUBLIC int NET_ParseNetHelpURL(URL_Struct *URL_s) { diff --git a/mozilla/network/module/nsStubContext.cpp b/mozilla/network/module/nsStubContext.cpp index b7d60e0d368..b7a5da573e8 100644 --- a/mozilla/network/module/nsStubContext.cpp +++ b/mozilla/network/module/nsStubContext.cpp @@ -417,9 +417,10 @@ extern "C" { *Find a converter routine to create a stream and return the stream struct */ PUBLIC NET_StreamClass * -NET_StreamBuilder (FO_Present_Types format_out, - URL_Struct *URL_s, - MWContext *context) +NET_NGLayoutConverter(FO_Present_Types format_out, + void *converter_obj, + URL_Struct *URL_s, + MWContext *context) { NET_StreamClass *stream = NULL; PRBool bSuccess = PR_TRUE;