diff --git a/mozilla/content/base/public/nsIDocument.h b/mozilla/content/base/public/nsIDocument.h index ac72bf1feaa..958e17fd420 100644 --- a/mozilla/content/base/public/nsIDocument.h +++ b/mozilla/content/base/public/nsIDocument.h @@ -89,6 +89,7 @@ public: NS_IMETHOD StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif diff --git a/mozilla/content/base/src/nsDocument.cpp b/mozilla/content/base/src/nsDocument.cpp index 577956a0055..882c0ec5753 100644 --- a/mozilla/content/base/src/nsDocument.cpp +++ b/mozilla/content/base/src/nsDocument.cpp @@ -826,7 +826,7 @@ nsIArena* nsDocument::GetArena() nsresult #ifdef NECKO -nsDocument::Reset(nsIChannel* aChannel) +nsDocument::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup) #else nsDocument::Reset(nsIURI *aURL) #endif @@ -885,7 +885,9 @@ nsDocument::Reset(nsIURI *aURL) #ifdef NECKO (void)aChannel->GetURI(&mDocumentURL); - (void)aChannel->GetLoadGroup(&mDocumentLoadGroup); +// (void)aChannel->GetLoadGroup(&mDocumentLoadGroup); + mDocumentLoadGroup = aLoadGroup; + NS_ASSERTION(mDocumentLoadGroup, "Should have a load group now on construction."); #else mDocumentURL = aURL; if (nsnull != aURL) { @@ -905,6 +907,7 @@ nsresult nsDocument::StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aURL, #endif @@ -912,7 +915,7 @@ nsDocument::StartDocumentLoad(const char* aCommand, nsIStreamListener **aDocListener) { #ifdef NECKO - return Reset(aChannel); + return Reset(aChannel, aLoadGroup); #else return Reset(aURL); #endif diff --git a/mozilla/content/base/src/nsDocument.h b/mozilla/content/base/src/nsDocument.h index c3d6363a303..31611b20829 100644 --- a/mozilla/content/base/src/nsDocument.h +++ b/mozilla/content/base/src/nsDocument.h @@ -113,6 +113,7 @@ public: NS_IMETHOD StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif @@ -417,7 +418,7 @@ protected: const nsIContent* aTest1, const nsIContent* aTest2) const; #ifdef NECKO - virtual nsresult Reset(nsIChannel* aChannel); + virtual nsresult Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup); #else virtual nsresult Reset(nsIURI* aURL); #endif diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index c074ea40e2b..9909d746dcb 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -3012,17 +3012,15 @@ HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode& aNode) // onto it as opaque data. NS_ADDREF(this); - nsILoadGroup* loadGroup = mDocument->GetDocumentLoadGroup(); nsIUnicharStreamLoader* loader; rv = NS_NewUnicharStreamLoader(&loader, url, #ifdef NECKO - loadGroup, + nsCOMPtr(mDocument->GetDocumentLoadGroup()), #endif (nsStreamCompleteFunc)nsDoneLoadingScript, (void *)this); NS_RELEASE(url); - NS_IF_RELEASE(loadGroup); if (NS_OK == rv) { rv = NS_ERROR_HTMLPARSER_BLOCK; } diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp index 5b008a7b8d2..54ce8d9ecd0 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp @@ -261,13 +261,13 @@ nsrefcnt nsHTMLDocument::Release() nsresult #ifdef NECKO -nsHTMLDocument::Reset(nsIChannel* aChannel) +nsHTMLDocument::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup) #else nsHTMLDocument::Reset(nsIURI *aURL) #endif { #ifdef NECKO - nsresult result = nsDocument::Reset(aChannel); + nsresult result = nsDocument::Reset(aChannel, aLoadGroup); nsCOMPtr aURL; result = aChannel->GetURI(getter_AddRefs(aURL)); if (NS_FAILED(result)) return result; @@ -347,6 +347,7 @@ NS_IMETHODIMP nsHTMLDocument::StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aURL, #endif @@ -355,7 +356,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, { nsresult rv = nsDocument::StartDocumentLoad(aCommand, #ifdef NECKO - aChannel, + aChannel, aLoadGroup, #else aURL, #endif @@ -1441,7 +1442,11 @@ nsHTMLDocument::OpenCommon(nsIURI* aSourceURL) // So we reset the document and create a new one. if (nsnull == mParser) { #ifdef NECKO - // XXX help! + nsCOMPtr channel; + result = NS_OpenURI(getter_AddRefs(channel), aSourceURL); + if (NS_FAILED(result)) return result; + result = Reset(channel, mDocumentLoadGroup); + if (NS_FAILED(result)) return result; #else result = Reset(aSourceURL); #endif diff --git a/mozilla/content/html/document/src/nsHTMLDocument.h b/mozilla/content/html/document/src/nsHTMLDocument.h index d3ca9ab3043..a6bf843a145 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.h +++ b/mozilla/content/html/document/src/nsHTMLDocument.h @@ -62,6 +62,7 @@ public: NS_IMETHOD StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif @@ -187,7 +188,7 @@ protected: nsresult GetBodyElement(nsIDOMHTMLBodyElement** aBody); #ifdef NECKO - virtual nsresult Reset(nsIChannel* aChannel); + virtual nsresult Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup); #else virtual nsresult Reset(nsIURI *aURL); #endif diff --git a/mozilla/content/html/document/src/nsImageDocument.cpp b/mozilla/content/html/document/src/nsImageDocument.cpp index 3a029e4410e..05c272045d7 100644 --- a/mozilla/content/html/document/src/nsImageDocument.cpp +++ b/mozilla/content/html/document/src/nsImageDocument.cpp @@ -60,6 +60,7 @@ public: NS_IMETHOD StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif @@ -256,6 +257,7 @@ NS_IMETHODIMP nsImageDocument::StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aURL, #endif @@ -264,7 +266,7 @@ nsImageDocument::StartDocumentLoad(const char* aCommand, { nsresult rv = nsDocument::StartDocumentLoad(aCommand, #ifdef NECKO - aChannel, + aChannel, aLoadGroup, #else aURL, #endif diff --git a/mozilla/content/html/style/src/nsCSSLoader.cpp b/mozilla/content/html/style/src/nsCSSLoader.cpp index 1b0d4604876..331819a2a86 100644 --- a/mozilla/content/html/style/src/nsCSSLoader.cpp +++ b/mozilla/content/html/style/src/nsCSSLoader.cpp @@ -41,6 +41,7 @@ #include "nsCRT.h" #include "nsVoidArray.h" #include "nsISupportsArray.h" +#include "nsCOMPtr.h" #include @@ -1068,14 +1069,12 @@ CSSLoaderImpl::LoadSheet(URLKey& aKey, SheetLoadData* aData) nsIURI* urlClone = CloneURL(aKey.mURL); // don't give the key to netlib, it munges it if (urlClone) { #endif - nsILoadGroup* loadGroup = mDocument->GetDocumentLoadGroup(); - result = NS_NewUnicharStreamLoader(&loader, urlClone, + result = NS_NewUnicharStreamLoader(&loader, urlClone, #ifdef NECKO - loadGroup, + nsCOMPtr(mDocument->GetDocumentLoadGroup()), #endif DoneLoadingStyle, aData); NS_RELEASE(urlClone); - NS_IF_RELEASE(loadGroup); if (NS_SUCCEEDED(result)) { mLoadingSheets.Put(&aKey, aData); // grab any pending alternates that have this URL @@ -1284,13 +1283,7 @@ CSSLoaderImpl::LoadAgentSheet(nsIURI* aURL, if (urlClone) { #endif #ifdef NECKO -#if 0 - nsILoadGroup* loadGroup = nsnull; - if (mDocument) { - loadGroup = mDocument->GetDocumentLoadGroup(); - } -#endif - result = NS_OpenURI(&in, urlClone/*, loadGroup*/); + result = NS_OpenURI(&in, urlClone); #else result = NS_OpenURL(urlClone, &in); #endif diff --git a/mozilla/content/xml/document/src/nsXMLContentSink.cpp b/mozilla/content/xml/document/src/nsXMLContentSink.cpp index 97c3e4d4132..911d461344d 100644 --- a/mozilla/content/xml/document/src/nsXMLContentSink.cpp +++ b/mozilla/content/xml/document/src/nsXMLContentSink.cpp @@ -1836,16 +1836,14 @@ nsXMLContentSink::ProcessStartSCRIPTTag(const nsIParserNode& aNode) NS_ADDREF(this); nsIUnicharStreamLoader* loader; - nsILoadGroup* loadGroup = mDocument->GetDocumentLoadGroup(); rv = NS_NewUnicharStreamLoader(&loader, url, #ifdef NECKO - loadGroup, + nsCOMPtr(mDocument->GetDocumentLoadGroup()), #endif (nsStreamCompleteFunc)nsDoneLoadingScript, (void *)this); NS_RELEASE(url); - NS_IF_RELEASE(loadGroup); if (NS_OK == rv) { rv = NS_ERROR_HTMLPARSER_BLOCK; } diff --git a/mozilla/content/xml/document/src/nsXMLDocument.cpp b/mozilla/content/xml/document/src/nsXMLDocument.cpp index d5ba6855db1..2f8c371ff85 100644 --- a/mozilla/content/xml/document/src/nsXMLDocument.cpp +++ b/mozilla/content/xml/document/src/nsXMLDocument.cpp @@ -155,13 +155,13 @@ nsrefcnt nsXMLDocument::Release() nsresult #ifdef NECKO -nsXMLDocument::Reset(nsIChannel* aChannel) +nsXMLDocument::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup) #else nsXMLDocument::Reset(nsIURI* aURL) #endif { #ifdef NECKO - nsresult result = nsDocument::Reset(aChannel); + nsresult result = nsDocument::Reset(aChannel, aLoadGroup); nsCOMPtr aURL; result = aChannel->GetURI(getter_AddRefs(aURL)); if (NS_FAILED(result)) return result; @@ -206,6 +206,7 @@ NS_IMETHODIMP nsXMLDocument::StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif @@ -214,7 +215,7 @@ nsXMLDocument::StartDocumentLoad(const char* aCommand, { nsresult rv = nsDocument::StartDocumentLoad(aCommand, #ifdef NECKO - aChannel, + aChannel, aLoadGroup, #else aUrl, #endif diff --git a/mozilla/content/xml/document/src/nsXMLDocument.h b/mozilla/content/xml/document/src/nsXMLDocument.h index e1d8df1f2ad..375e17827a4 100644 --- a/mozilla/content/xml/document/src/nsXMLDocument.h +++ b/mozilla/content/xml/document/src/nsXMLDocument.h @@ -50,6 +50,7 @@ public: NS_IMETHOD StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif @@ -84,7 +85,7 @@ protected: virtual void InternalAddStyleSheet(nsIStyleSheet* aSheet); // subclass hook for sheet ordering virtual void InternalInsertStyleSheetAt(nsIStyleSheet* aSheet, PRInt32 aIndex); #ifdef NECKO - virtual nsresult Reset(nsIChannel* aChannel); + virtual nsresult Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup); #else virtual nsresult Reset(nsIURI* aUrl); #endif diff --git a/mozilla/content/xul/document/src/nsXULDocument.cpp b/mozilla/content/xul/document/src/nsXULDocument.cpp index d6cb2172312..af1da08587c 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.cpp +++ b/mozilla/content/xul/document/src/nsXULDocument.cpp @@ -425,6 +425,7 @@ public: NS_IMETHOD StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif @@ -730,7 +731,7 @@ protected: nsIContentViewerContainer* aContainer, const char* aCommand, #ifdef NECKO - nsIChannel* aChannel + nsIChannel* aChannel, nsILoadGroup* aLoadGroup #else nsIURI* aOptionalURL = 0 #endif @@ -1092,7 +1093,7 @@ XULDocumentImpl::PrepareToLoad( nsCOMPtr* created_parser, nsIContentViewerContainer* aContainer, const char* aCommand, #ifdef NECKO - nsIChannel* aChannel + nsIChannel* aChannel, nsILoadGroup* aLoadGroup #else nsIURI* aOptionalURL #endif @@ -1132,7 +1133,7 @@ XULDocumentImpl::PrepareToLoad( nsCOMPtr* created_parser, mDocumentURL = syntheticURL; #ifdef NECKO - (void)aChannel->GetLoadGroup(getter_AddRefs(mDocumentLoadGroup)); + mDocumentLoadGroup = aLoadGroup; #else syntheticURL->GetLoadGroup(getter_AddRefs(mDocumentLoadGroup)); #endif @@ -1271,6 +1272,7 @@ NS_IMETHODIMP XULDocumentImpl::StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aURL, #endif @@ -1288,7 +1290,7 @@ XULDocumentImpl::StartDocumentLoad(const char* aCommand, do { #ifdef NECKO - status = PrepareToLoad(&parser, aContainer, aCommand, aChannel); + status = PrepareToLoad(&parser, aContainer, aCommand, aChannel, aLoadGroup); #else status = PrepareToLoad(&parser, aContainer, aCommand, aURL); #endif @@ -1321,7 +1323,11 @@ XULDocumentImpl::LoadFromStream( nsIInputStream& xulStream, { nsresult status; nsCOMPtr parser; +#ifdef NECKO + if ( NS_SUCCEEDED(status = PrepareToLoad(&parser, aContainer, aCommand, nsnull, nsnull)) ) +#else if ( NS_SUCCEEDED(status = PrepareToLoad(&parser, aContainer, aCommand, nsnull)) ) +#endif parser->Parse(xulStream); return status; diff --git a/mozilla/extensions/pics/src/nsPICS.cpp b/mozilla/extensions/pics/src/nsPICS.cpp index 3f685b0d300..f7ae7fb443e 100644 --- a/mozilla/extensions/pics/src/nsPICS.cpp +++ b/mozilla/extensions/pics/src/nsPICS.cpp @@ -1562,7 +1562,7 @@ nsPICS::GetRootURL(nsIURI* aURL) return rv; mParser->Parse(aURL); #ifdef NECKO - rv = NS_OpenURI(lsnr, nsnull, aURL, nsnull); // XXX need the nsILoadGroup here! + rv = NS_OpenURI(lsnr, nsnull, aURL); #else rv = NS_OpenURL(aURL, lsnr); #endif diff --git a/mozilla/gfx/src/nsImageNetContextAsync.cpp b/mozilla/gfx/src/nsImageNetContextAsync.cpp index a59748e5026..82856ef2878 100644 --- a/mozilla/gfx/src/nsImageNetContextAsync.cpp +++ b/mozilla/gfx/src/nsImageNetContextAsync.cpp @@ -264,10 +264,10 @@ ImageConsumer::OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUint32 err = pIStream->Read(mBuffer, max_read, &nb); - if (err == NS_BASE_STREAM_WOULD_BLOCK) { - err = NS_OK; - break; - } + if (err == NS_BASE_STREAM_WOULD_BLOCK) { + err = NS_OK; + break; + } if (err != NS_OK) { break; } @@ -577,7 +577,7 @@ ImageNetContextImpl::GetURL (ilIURL * aURL, } else { #ifdef NECKO - nsresult rv = NS_OpenURI(ic, nsnull, nsurl, mLoadGroup); + nsresult rv = NS_OpenURI(ic, nsnull, nsurl); #else nsresult rv = NS_OpenURL(nsurl, ic); #endif diff --git a/mozilla/layout/base/public/nsIDocument.h b/mozilla/layout/base/public/nsIDocument.h index ac72bf1feaa..958e17fd420 100644 --- a/mozilla/layout/base/public/nsIDocument.h +++ b/mozilla/layout/base/public/nsIDocument.h @@ -89,6 +89,7 @@ public: NS_IMETHOD StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif diff --git a/mozilla/layout/base/src/nsDocument.cpp b/mozilla/layout/base/src/nsDocument.cpp index 577956a0055..882c0ec5753 100644 --- a/mozilla/layout/base/src/nsDocument.cpp +++ b/mozilla/layout/base/src/nsDocument.cpp @@ -826,7 +826,7 @@ nsIArena* nsDocument::GetArena() nsresult #ifdef NECKO -nsDocument::Reset(nsIChannel* aChannel) +nsDocument::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup) #else nsDocument::Reset(nsIURI *aURL) #endif @@ -885,7 +885,9 @@ nsDocument::Reset(nsIURI *aURL) #ifdef NECKO (void)aChannel->GetURI(&mDocumentURL); - (void)aChannel->GetLoadGroup(&mDocumentLoadGroup); +// (void)aChannel->GetLoadGroup(&mDocumentLoadGroup); + mDocumentLoadGroup = aLoadGroup; + NS_ASSERTION(mDocumentLoadGroup, "Should have a load group now on construction."); #else mDocumentURL = aURL; if (nsnull != aURL) { @@ -905,6 +907,7 @@ nsresult nsDocument::StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aURL, #endif @@ -912,7 +915,7 @@ nsDocument::StartDocumentLoad(const char* aCommand, nsIStreamListener **aDocListener) { #ifdef NECKO - return Reset(aChannel); + return Reset(aChannel, aLoadGroup); #else return Reset(aURL); #endif diff --git a/mozilla/layout/base/src/nsDocument.h b/mozilla/layout/base/src/nsDocument.h index c3d6363a303..31611b20829 100644 --- a/mozilla/layout/base/src/nsDocument.h +++ b/mozilla/layout/base/src/nsDocument.h @@ -113,6 +113,7 @@ public: NS_IMETHOD StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif @@ -417,7 +418,7 @@ protected: const nsIContent* aTest1, const nsIContent* aTest2) const; #ifdef NECKO - virtual nsresult Reset(nsIChannel* aChannel); + virtual nsresult Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup); #else virtual nsresult Reset(nsIURI* aURL); #endif diff --git a/mozilla/layout/build/nsLayoutDLF.cpp b/mozilla/layout/build/nsLayoutDLF.cpp index b6dc72da008..d40288c7619 100644 --- a/mozilla/layout/build/nsLayoutDLF.cpp +++ b/mozilla/layout/build/nsLayoutDLF.cpp @@ -125,6 +125,7 @@ public: NS_IMETHOD CreateInstance(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI* aURL, #endif @@ -152,6 +153,7 @@ public: nsresult CreateDocument(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI* aURL, #endif @@ -163,6 +165,7 @@ public: nsresult CreateRDFDocument(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI* aURL, #endif @@ -243,6 +246,7 @@ NS_IMETHODIMP nsLayoutDLF::CreateInstance(const char *aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI* aURL, #endif @@ -269,7 +273,7 @@ nsLayoutDLF::CreateInstance(const char *aCommand, if (0== PL_strcmp(gHTMLTypes[typeIndex++], aContentType)) { return CreateDocument(aCommand, #ifdef NECKO - aChannel, + aChannel, aLoadGroup, #else aURL, #endif @@ -284,7 +288,7 @@ nsLayoutDLF::CreateInstance(const char *aCommand, if (0== PL_strcmp(gXMLTypes[typeIndex++], aContentType)) { return CreateDocument(aCommand, #ifdef NECKO - aChannel, + aChannel, aLoadGroup, #else aURL, #endif @@ -299,7 +303,7 @@ nsLayoutDLF::CreateInstance(const char *aCommand, if (0 == PL_strcmp(gRDFTypes[typeIndex++], aContentType)) { return CreateRDFDocument(aCommand, #ifdef NECKO - aChannel, + aChannel, aLoadGroup, #else aURL, #endif @@ -314,7 +318,7 @@ nsLayoutDLF::CreateInstance(const char *aCommand, if (0== PL_strcmp(gImageTypes[typeIndex++], aContentType)) { return CreateDocument(aCommand, #ifdef NECKO - aChannel, + aChannel, aLoadGroup, #else aURL, #endif @@ -369,6 +373,7 @@ nsresult nsLayoutDLF::CreateDocument(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI* aURL, #endif @@ -419,7 +424,7 @@ nsLayoutDLF::CreateDocument(const char* aCommand, // nsIStreamListener connected to the parser is returned in // aDocListener. #ifdef NECKO - rv = doc->StartDocumentLoad(aCommand, aChannel, aContainer, aDocListener); + rv = doc->StartDocumentLoad(aCommand, aChannel, aLoadGroup, aContainer, aDocListener); #else rv = doc->StartDocumentLoad(aCommand, aURL, aContainer, aDocListener); #endif @@ -530,6 +535,7 @@ nsresult nsLayoutDLF::CreateRDFDocument(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI* aURL, #endif @@ -559,7 +565,7 @@ nsLayoutDLF::CreateRDFDocument(const char* aCommand, * aDocListener. */ #ifdef NECKO - rv = doc->StartDocumentLoad(aCommand, aChannel, aContainer, aDocListener); + rv = doc->StartDocumentLoad(aCommand, aChannel, aLoadGroup, aContainer, aDocListener); #else rv = doc->StartDocumentLoad(aCommand, aURL, aContainer, aDocListener); #endif diff --git a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp index c074ea40e2b..9909d746dcb 100644 --- a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp @@ -3012,17 +3012,15 @@ HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode& aNode) // onto it as opaque data. NS_ADDREF(this); - nsILoadGroup* loadGroup = mDocument->GetDocumentLoadGroup(); nsIUnicharStreamLoader* loader; rv = NS_NewUnicharStreamLoader(&loader, url, #ifdef NECKO - loadGroup, + nsCOMPtr(mDocument->GetDocumentLoadGroup()), #endif (nsStreamCompleteFunc)nsDoneLoadingScript, (void *)this); NS_RELEASE(url); - NS_IF_RELEASE(loadGroup); if (NS_OK == rv) { rv = NS_ERROR_HTMLPARSER_BLOCK; } diff --git a/mozilla/layout/html/document/src/nsHTMLDocument.cpp b/mozilla/layout/html/document/src/nsHTMLDocument.cpp index 5b008a7b8d2..54ce8d9ecd0 100644 --- a/mozilla/layout/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/layout/html/document/src/nsHTMLDocument.cpp @@ -261,13 +261,13 @@ nsrefcnt nsHTMLDocument::Release() nsresult #ifdef NECKO -nsHTMLDocument::Reset(nsIChannel* aChannel) +nsHTMLDocument::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup) #else nsHTMLDocument::Reset(nsIURI *aURL) #endif { #ifdef NECKO - nsresult result = nsDocument::Reset(aChannel); + nsresult result = nsDocument::Reset(aChannel, aLoadGroup); nsCOMPtr aURL; result = aChannel->GetURI(getter_AddRefs(aURL)); if (NS_FAILED(result)) return result; @@ -347,6 +347,7 @@ NS_IMETHODIMP nsHTMLDocument::StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aURL, #endif @@ -355,7 +356,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand, { nsresult rv = nsDocument::StartDocumentLoad(aCommand, #ifdef NECKO - aChannel, + aChannel, aLoadGroup, #else aURL, #endif @@ -1441,7 +1442,11 @@ nsHTMLDocument::OpenCommon(nsIURI* aSourceURL) // So we reset the document and create a new one. if (nsnull == mParser) { #ifdef NECKO - // XXX help! + nsCOMPtr channel; + result = NS_OpenURI(getter_AddRefs(channel), aSourceURL); + if (NS_FAILED(result)) return result; + result = Reset(channel, mDocumentLoadGroup); + if (NS_FAILED(result)) return result; #else result = Reset(aSourceURL); #endif diff --git a/mozilla/layout/html/document/src/nsHTMLDocument.h b/mozilla/layout/html/document/src/nsHTMLDocument.h index d3ca9ab3043..a6bf843a145 100644 --- a/mozilla/layout/html/document/src/nsHTMLDocument.h +++ b/mozilla/layout/html/document/src/nsHTMLDocument.h @@ -62,6 +62,7 @@ public: NS_IMETHOD StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif @@ -187,7 +188,7 @@ protected: nsresult GetBodyElement(nsIDOMHTMLBodyElement** aBody); #ifdef NECKO - virtual nsresult Reset(nsIChannel* aChannel); + virtual nsresult Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup); #else virtual nsresult Reset(nsIURI *aURL); #endif diff --git a/mozilla/layout/html/document/src/nsImageDocument.cpp b/mozilla/layout/html/document/src/nsImageDocument.cpp index 3a029e4410e..05c272045d7 100644 --- a/mozilla/layout/html/document/src/nsImageDocument.cpp +++ b/mozilla/layout/html/document/src/nsImageDocument.cpp @@ -60,6 +60,7 @@ public: NS_IMETHOD StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif @@ -256,6 +257,7 @@ NS_IMETHODIMP nsImageDocument::StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aURL, #endif @@ -264,7 +266,7 @@ nsImageDocument::StartDocumentLoad(const char* aCommand, { nsresult rv = nsDocument::StartDocumentLoad(aCommand, #ifdef NECKO - aChannel, + aChannel, aLoadGroup, #else aURL, #endif diff --git a/mozilla/layout/html/style/src/nsCSSLoader.cpp b/mozilla/layout/html/style/src/nsCSSLoader.cpp index 1b0d4604876..331819a2a86 100644 --- a/mozilla/layout/html/style/src/nsCSSLoader.cpp +++ b/mozilla/layout/html/style/src/nsCSSLoader.cpp @@ -41,6 +41,7 @@ #include "nsCRT.h" #include "nsVoidArray.h" #include "nsISupportsArray.h" +#include "nsCOMPtr.h" #include @@ -1068,14 +1069,12 @@ CSSLoaderImpl::LoadSheet(URLKey& aKey, SheetLoadData* aData) nsIURI* urlClone = CloneURL(aKey.mURL); // don't give the key to netlib, it munges it if (urlClone) { #endif - nsILoadGroup* loadGroup = mDocument->GetDocumentLoadGroup(); - result = NS_NewUnicharStreamLoader(&loader, urlClone, + result = NS_NewUnicharStreamLoader(&loader, urlClone, #ifdef NECKO - loadGroup, + nsCOMPtr(mDocument->GetDocumentLoadGroup()), #endif DoneLoadingStyle, aData); NS_RELEASE(urlClone); - NS_IF_RELEASE(loadGroup); if (NS_SUCCEEDED(result)) { mLoadingSheets.Put(&aKey, aData); // grab any pending alternates that have this URL @@ -1284,13 +1283,7 @@ CSSLoaderImpl::LoadAgentSheet(nsIURI* aURL, if (urlClone) { #endif #ifdef NECKO -#if 0 - nsILoadGroup* loadGroup = nsnull; - if (mDocument) { - loadGroup = mDocument->GetDocumentLoadGroup(); - } -#endif - result = NS_OpenURI(&in, urlClone/*, loadGroup*/); + result = NS_OpenURI(&in, urlClone); #else result = NS_OpenURL(urlClone, &in); #endif diff --git a/mozilla/layout/html/tests/TestAttributes.cpp b/mozilla/layout/html/tests/TestAttributes.cpp index 06640e84964..54984d06c96 100644 --- a/mozilla/layout/html/tests/TestAttributes.cpp +++ b/mozilla/layout/html/tests/TestAttributes.cpp @@ -174,6 +174,7 @@ public: NS_IMETHOD StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif diff --git a/mozilla/layout/html/tests/TestInlineFrame.cpp b/mozilla/layout/html/tests/TestInlineFrame.cpp index 4404d5f4733..d7b97d757b6 100644 --- a/mozilla/layout/html/tests/TestInlineFrame.cpp +++ b/mozilla/layout/html/tests/TestInlineFrame.cpp @@ -42,6 +42,7 @@ public: NS_IMETHOD StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif diff --git a/mozilla/layout/style/nsCSSLoader.cpp b/mozilla/layout/style/nsCSSLoader.cpp index 1b0d4604876..331819a2a86 100644 --- a/mozilla/layout/style/nsCSSLoader.cpp +++ b/mozilla/layout/style/nsCSSLoader.cpp @@ -41,6 +41,7 @@ #include "nsCRT.h" #include "nsVoidArray.h" #include "nsISupportsArray.h" +#include "nsCOMPtr.h" #include @@ -1068,14 +1069,12 @@ CSSLoaderImpl::LoadSheet(URLKey& aKey, SheetLoadData* aData) nsIURI* urlClone = CloneURL(aKey.mURL); // don't give the key to netlib, it munges it if (urlClone) { #endif - nsILoadGroup* loadGroup = mDocument->GetDocumentLoadGroup(); - result = NS_NewUnicharStreamLoader(&loader, urlClone, + result = NS_NewUnicharStreamLoader(&loader, urlClone, #ifdef NECKO - loadGroup, + nsCOMPtr(mDocument->GetDocumentLoadGroup()), #endif DoneLoadingStyle, aData); NS_RELEASE(urlClone); - NS_IF_RELEASE(loadGroup); if (NS_SUCCEEDED(result)) { mLoadingSheets.Put(&aKey, aData); // grab any pending alternates that have this URL @@ -1284,13 +1283,7 @@ CSSLoaderImpl::LoadAgentSheet(nsIURI* aURL, if (urlClone) { #endif #ifdef NECKO -#if 0 - nsILoadGroup* loadGroup = nsnull; - if (mDocument) { - loadGroup = mDocument->GetDocumentLoadGroup(); - } -#endif - result = NS_OpenURI(&in, urlClone/*, loadGroup*/); + result = NS_OpenURI(&in, urlClone); #else result = NS_OpenURL(urlClone, &in); #endif diff --git a/mozilla/layout/xml/document/src/nsXMLContentSink.cpp b/mozilla/layout/xml/document/src/nsXMLContentSink.cpp index 97c3e4d4132..911d461344d 100644 --- a/mozilla/layout/xml/document/src/nsXMLContentSink.cpp +++ b/mozilla/layout/xml/document/src/nsXMLContentSink.cpp @@ -1836,16 +1836,14 @@ nsXMLContentSink::ProcessStartSCRIPTTag(const nsIParserNode& aNode) NS_ADDREF(this); nsIUnicharStreamLoader* loader; - nsILoadGroup* loadGroup = mDocument->GetDocumentLoadGroup(); rv = NS_NewUnicharStreamLoader(&loader, url, #ifdef NECKO - loadGroup, + nsCOMPtr(mDocument->GetDocumentLoadGroup()), #endif (nsStreamCompleteFunc)nsDoneLoadingScript, (void *)this); NS_RELEASE(url); - NS_IF_RELEASE(loadGroup); if (NS_OK == rv) { rv = NS_ERROR_HTMLPARSER_BLOCK; } diff --git a/mozilla/layout/xml/document/src/nsXMLDocument.cpp b/mozilla/layout/xml/document/src/nsXMLDocument.cpp index d5ba6855db1..2f8c371ff85 100644 --- a/mozilla/layout/xml/document/src/nsXMLDocument.cpp +++ b/mozilla/layout/xml/document/src/nsXMLDocument.cpp @@ -155,13 +155,13 @@ nsrefcnt nsXMLDocument::Release() nsresult #ifdef NECKO -nsXMLDocument::Reset(nsIChannel* aChannel) +nsXMLDocument::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup) #else nsXMLDocument::Reset(nsIURI* aURL) #endif { #ifdef NECKO - nsresult result = nsDocument::Reset(aChannel); + nsresult result = nsDocument::Reset(aChannel, aLoadGroup); nsCOMPtr aURL; result = aChannel->GetURI(getter_AddRefs(aURL)); if (NS_FAILED(result)) return result; @@ -206,6 +206,7 @@ NS_IMETHODIMP nsXMLDocument::StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif @@ -214,7 +215,7 @@ nsXMLDocument::StartDocumentLoad(const char* aCommand, { nsresult rv = nsDocument::StartDocumentLoad(aCommand, #ifdef NECKO - aChannel, + aChannel, aLoadGroup, #else aUrl, #endif diff --git a/mozilla/layout/xml/document/src/nsXMLDocument.h b/mozilla/layout/xml/document/src/nsXMLDocument.h index e1d8df1f2ad..375e17827a4 100644 --- a/mozilla/layout/xml/document/src/nsXMLDocument.h +++ b/mozilla/layout/xml/document/src/nsXMLDocument.h @@ -50,6 +50,7 @@ public: NS_IMETHOD StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif @@ -84,7 +85,7 @@ protected: virtual void InternalAddStyleSheet(nsIStyleSheet* aSheet); // subclass hook for sheet ordering virtual void InternalInsertStyleSheetAt(nsIStyleSheet* aSheet, PRInt32 aIndex); #ifdef NECKO - virtual nsresult Reset(nsIChannel* aChannel); + virtual nsresult Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup); #else virtual nsresult Reset(nsIURI* aUrl); #endif diff --git a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp index 76a0f8879f0..d501f2deba6 100644 --- a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -1136,10 +1136,7 @@ nsresult nsPluginStreamListenerPeer::SetUpCache(nsIURI* aURL) { nsPluginCacheListener* cacheListener = new nsPluginCacheListener(this); #ifdef NECKO - nsILoadGroup* loadGroup = GetLoadGroup(); - nsresult rv = NS_OpenURI(cacheListener, nsnull, aURL, loadGroup); - NS_IF_RELEASE(loadGroup); - return rv; + return NS_OpenURI(cacheListener, nsnull, aURL); #else return NS_OpenURL(aURL, cacheListener); #endif @@ -2276,9 +2273,7 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL, if (NS_OK == rv) { #ifdef NECKO - nsILoadGroup* loadGroup = listenerPeer->GetLoadGroup(); - rv = NS_OpenURI(listenerPeer, nsnull, url, loadGroup); - NS_IF_RELEASE(loadGroup); + rv = NS_OpenURI(listenerPeer, nsnull, url); #else rv = NS_OpenURL(url, listenerPeer); #endif @@ -2332,9 +2327,7 @@ nsresult nsPluginHostImpl::NewEmbededPluginStream(nsIURI* aURL, if (NS_OK == rv) { #ifdef NECKO - nsILoadGroup* loadGroup = listener->GetLoadGroup(); - rv = NS_OpenURI(listener, nsnull, aURL, loadGroup); - NS_IF_RELEASE(loadGroup); + rv = NS_OpenURI(listener, nsnull, aURL); #else rv = NS_OpenURL(aURL, listener); #endif diff --git a/mozilla/modules/plugin/nglsrc/nsPluginHostImpl.cpp b/mozilla/modules/plugin/nglsrc/nsPluginHostImpl.cpp index 76a0f8879f0..d501f2deba6 100644 --- a/mozilla/modules/plugin/nglsrc/nsPluginHostImpl.cpp +++ b/mozilla/modules/plugin/nglsrc/nsPluginHostImpl.cpp @@ -1136,10 +1136,7 @@ nsresult nsPluginStreamListenerPeer::SetUpCache(nsIURI* aURL) { nsPluginCacheListener* cacheListener = new nsPluginCacheListener(this); #ifdef NECKO - nsILoadGroup* loadGroup = GetLoadGroup(); - nsresult rv = NS_OpenURI(cacheListener, nsnull, aURL, loadGroup); - NS_IF_RELEASE(loadGroup); - return rv; + return NS_OpenURI(cacheListener, nsnull, aURL); #else return NS_OpenURL(aURL, cacheListener); #endif @@ -2276,9 +2273,7 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL, if (NS_OK == rv) { #ifdef NECKO - nsILoadGroup* loadGroup = listenerPeer->GetLoadGroup(); - rv = NS_OpenURI(listenerPeer, nsnull, url, loadGroup); - NS_IF_RELEASE(loadGroup); + rv = NS_OpenURI(listenerPeer, nsnull, url); #else rv = NS_OpenURL(url, listenerPeer); #endif @@ -2332,9 +2327,7 @@ nsresult nsPluginHostImpl::NewEmbededPluginStream(nsIURI* aURL, if (NS_OK == rv) { #ifdef NECKO - nsILoadGroup* loadGroup = listener->GetLoadGroup(); - rv = NS_OpenURI(listener, nsnull, aURL, loadGroup); - NS_IF_RELEASE(loadGroup); + rv = NS_OpenURI(listener, nsnull, aURL); #else rv = NS_OpenURL(aURL, listener); #endif diff --git a/mozilla/netwerk/base/public/nsIChannel.idl b/mozilla/netwerk/base/public/nsIChannel.idl index 82430242368..ae46b2141f8 100644 --- a/mozilla/netwerk/base/public/nsIChannel.idl +++ b/mozilla/netwerk/base/public/nsIChannel.idl @@ -23,7 +23,6 @@ interface nsIInputStream; interface nsIOutputStream; interface nsIStreamObserver; interface nsIStreamListener; -interface nsILoadGroup; typedef unsigned long nsLoadFlags; @@ -70,8 +69,7 @@ interface nsIChannel : nsIRequest void AsyncRead(in unsigned long startPosition, in long readCount, in nsISupports ctxt, - in nsIStreamListener listener, - in nsILoadGroup group); + in nsIStreamListener listener); /** * Writes asynchronously to the URL's specified destination. Notifications @@ -86,8 +84,7 @@ interface nsIChannel : nsIRequest in unsigned long startPosition, in long writeCount, in nsISupports ctxt, - in nsIStreamObserver observer, - in nsILoadGroup group); + in nsIStreamObserver observer); /** * Load attribute flags. These may be or'd together. @@ -119,10 +116,5 @@ interface nsIChannel : nsIRequest */ readonly attribute string ContentType; - /** - * Returns the load group in which the channel is a currently a member. - */ - readonly attribute nsILoadGroup LoadGroup; - }; diff --git a/mozilla/netwerk/base/public/nsIIOService.idl b/mozilla/netwerk/base/public/nsIIOService.idl index 4e5ec14a0fd..90055fa97f0 100644 --- a/mozilla/netwerk/base/public/nsIIOService.idl +++ b/mozilla/netwerk/base/public/nsIIOService.idl @@ -30,6 +30,7 @@ interface nsIInputStream; interface nsIBufferOutputStream; interface nsIFileChannel; interface nsILoadGroup; +interface nsILoadGroupObserver; [scriptable, uuid(01f0a170-1881-11d3-9337-00104ba0fd40)] interface nsIIOService : nsISupports diff --git a/mozilla/netwerk/base/src/nsIOService.cpp b/mozilla/netwerk/base/src/nsIOService.cpp index bbe63355a68..97eb7427795 100644 --- a/mozilla/netwerk/base/src/nsIOService.cpp +++ b/mozilla/netwerk/base/src/nsIOService.cpp @@ -366,5 +366,3 @@ nsIOService::NewInputStreamChannel(nsIURI* uri, const char *contentType, } //////////////////////////////////////////////////////////////////////////////// - - diff --git a/mozilla/netwerk/base/src/nsInputStreamChannel.cpp b/mozilla/netwerk/base/src/nsInputStreamChannel.cpp index 09a5c1b6a15..a16e32ad1e5 100644 --- a/mozilla/netwerk/base/src/nsInputStreamChannel.cpp +++ b/mozilla/netwerk/base/src/nsInputStreamChannel.cpp @@ -25,7 +25,7 @@ // nsInputStreamChannel methods: nsInputStreamChannel::nsInputStreamChannel() - : mURI(nsnull), mContentType(nsnull), mInputStream(nsnull), mLoadGroup(nsnull) + : mURI(nsnull), mContentType(nsnull), mInputStream(nsnull) { NS_INIT_REFCNT(); } @@ -124,8 +124,7 @@ nsInputStreamChannel::OpenOutputStream(PRUint32 startPosition, nsIOutputStream * NS_IMETHODIMP nsInputStreamChannel::AsyncRead(PRUint32 startPosition, PRInt32 readCount, - nsISupports *ctxt, nsIStreamListener *listener, - nsILoadGroup* group) + nsISupports *ctxt, nsIStreamListener *listener) { // currently this happens before AsyncRead returns -- hope that's ok nsresult rv; @@ -134,14 +133,6 @@ nsInputStreamChannel::AsyncRead(PRUint32 startPosition, PRInt32 readCount, // the listener prematurely. nsCOMPtr l(listener); - NS_ASSERTION(mLoadGroup == nsnull, "recursively entered AsyncRead?"); - mLoadGroup = group; - NS_ADDREF(mLoadGroup); - - if (group) { - (void)group->AddChannel(this, ctxt); - } - rv = listener->OnStartRequest(this, ctxt); if (NS_FAILED(rv)) return rv; @@ -162,19 +153,13 @@ nsInputStreamChannel::AsyncRead(PRUint32 startPosition, PRInt32 readCount, } rv = listener->OnStopRequest(this, ctxt, rv, nsnull); // XXX error message - - if (group) { - (void)group->RemoveChannel(this, ctxt, rv, nsnull); // XXX error message - } - NS_RELEASE(mLoadGroup); - return rv; } NS_IMETHODIMP nsInputStreamChannel::AsyncWrite(nsIInputStream *fromStream, PRUint32 startPosition, PRInt32 writeCount, nsISupports *ctxt, - nsIStreamObserver *observer, nsILoadGroup* group) + nsIStreamObserver *observer) { // we don't do output return NS_ERROR_FAILURE; @@ -201,12 +186,4 @@ nsInputStreamChannel::GetContentType(char * *aContentType) return *aContentType ? NS_OK : NS_ERROR_OUT_OF_MEMORY; } -NS_IMETHODIMP -nsInputStreamChannel::GetLoadGroup(nsILoadGroup * *aLoadGroup) -{ - *aLoadGroup = mLoadGroup; - NS_ADDREF(*aLoadGroup); - return NS_OK; -} - //////////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/netwerk/base/src/nsInputStreamChannel.h b/mozilla/netwerk/base/src/nsInputStreamChannel.h index 5fe1c4c7dd5..fc7636c7d9d 100644 --- a/mozilla/netwerk/base/src/nsInputStreamChannel.h +++ b/mozilla/netwerk/base/src/nsInputStreamChannel.h @@ -41,15 +41,13 @@ public: nsIInputStream **_retval); NS_IMETHOD OpenOutputStream(PRUint32 startPosition, nsIOutputStream **_retval); NS_IMETHOD AsyncRead(PRUint32 startPosition, PRInt32 readCount, - nsISupports *ctxt, nsIStreamListener *listener, - nsILoadGroup* group); + nsISupports *ctxt, nsIStreamListener *listener); NS_IMETHOD AsyncWrite(nsIInputStream *fromStream, PRUint32 startPosition, PRInt32 writeCount, nsISupports *ctxt, - nsIStreamObserver *observer, nsILoadGroup* group); + nsIStreamObserver *observer); NS_IMETHOD GetLoadAttributes(nsLoadFlags *aLoadAttributes); NS_IMETHOD SetLoadAttributes(nsLoadFlags aLoadAttributes); NS_IMETHOD GetContentType(char * *aContentType); - NS_IMETHOD GetLoadGroup(nsILoadGroup * *aLoadGroup); // nsInputStreamChannel methods: nsInputStreamChannel(); @@ -64,7 +62,6 @@ protected: nsIURI* mURI; char* mContentType; nsIInputStream* mInputStream; - nsILoadGroup* mLoadGroup; }; #define NS_INPUTSTREAMCHANNEL_CID \ diff --git a/mozilla/netwerk/base/src/nsSocketTransport.cpp b/mozilla/netwerk/base/src/nsSocketTransport.cpp index ac81d2aa17f..5b15a39af69 100644 --- a/mozilla/netwerk/base/src/nsSocketTransport.cpp +++ b/mozilla/netwerk/base/src/nsSocketTransport.cpp @@ -1212,8 +1212,7 @@ nsSocketTransport::GetURI(nsIURI * *aURL) NS_IMETHODIMP nsSocketTransport::AsyncRead(PRUint32 startPosition, PRInt32 readCount, nsISupports* aContext, - nsIStreamListener* aListener, - nsILoadGroup* group) + nsIStreamListener* aListener) { // XXX deal with startPosition and readCount parameters nsresult rv = NS_OK; @@ -1268,8 +1267,6 @@ nsSocketTransport::AsyncRead(PRUint32 startPosition, PRInt32 readCount, mOperation = eSocketOperation_ReadWrite; SetReadType(eSocketRead_Async); - mLoadGroup = group; // might be null - rv = mService->AddToWorkQ(this); } @@ -1285,8 +1282,7 @@ NS_IMETHODIMP nsSocketTransport::AsyncWrite(nsIInputStream* aFromStream, PRUint32 startPosition, PRInt32 writeCount, nsISupports* aContext, - nsIStreamObserver* aObserver, - nsILoadGroup* group) + nsIStreamObserver* aObserver) { // XXX deal with startPosition and writeCount parameters nsresult rv = NS_OK; @@ -1331,8 +1327,6 @@ nsSocketTransport::AsyncWrite(nsIInputStream* aFromStream, mOperation = eSocketOperation_ReadWrite; SetWriteType(eSocketWrite_Async); - mLoadGroup = group; // might be null - rv = mService->AddToWorkQ(this); } @@ -1478,10 +1472,3 @@ nsSocketTransport::GetContentType(char * *aContentType) return NS_ERROR_FAILURE; // XXX doesn't make sense for transports } -NS_IMETHODIMP -nsSocketTransport::GetLoadGroup(nsILoadGroup * *aLoadGroup) -{ - *aLoadGroup = mLoadGroup; - NS_ADDREF(*aLoadGroup); - return NS_OK; -} diff --git a/mozilla/netwerk/base/src/nsSocketTransport.h b/mozilla/netwerk/base/src/nsSocketTransport.h index 665764596d8..22795df949e 100644 --- a/mozilla/netwerk/base/src/nsSocketTransport.h +++ b/mozilla/netwerk/base/src/nsSocketTransport.h @@ -120,17 +120,14 @@ public: NS_IMETHOD OpenOutputStream(PRUint32 startPosition, nsIOutputStream **_retval); NS_IMETHOD AsyncRead(PRUint32 startPosition, PRInt32 readCount, nsISupports *ctxt, - nsIStreamListener *listener, - nsILoadGroup* group); + nsIStreamListener *listener); NS_IMETHOD AsyncWrite(nsIInputStream *fromStream, PRUint32 startPosition, PRInt32 writeCount, nsISupports *ctxt, - nsIStreamObserver *observer, - nsILoadGroup* group); + nsIStreamObserver *observer); NS_IMETHOD GetLoadAttributes(PRUint32 *aLoadAttributes); NS_IMETHOD SetLoadAttributes(PRUint32 aLoadAttributes); NS_IMETHOD GetContentType(char * *aContentType); - NS_IMETHOD GetLoadGroup(nsILoadGroup * *aLoadGroup); // nsIBufferObserver methods: NS_IMETHOD OnFull (nsIBuffer* aBuffer); @@ -222,7 +219,6 @@ protected: nsSocketTransportService* mService; PRUint32 mLoadAttributes; - nsCOMPtr mLoadGroup; }; diff --git a/mozilla/netwerk/protocol/file/src/nsFileChannel.cpp b/mozilla/netwerk/protocol/file/src/nsFileChannel.cpp index f200d5979bf..2d1aca15830 100644 --- a/mozilla/netwerk/protocol/file/src/nsFileChannel.cpp +++ b/mozilla/netwerk/protocol/file/src/nsFileChannel.cpp @@ -408,8 +408,7 @@ nsFileChannel::OpenOutputStream(PRUint32 startPosition, nsIOutputStream **result NS_IMETHODIMP nsFileChannel::AsyncRead(PRUint32 startPosition, PRInt32 readCount, nsISupports *ctxt, - nsIStreamListener *listener, - nsILoadGroup* group) + nsIStreamListener *listener) { nsAutoMonitor mon(mMonitor); @@ -448,7 +447,6 @@ nsFileChannel::AsyncRead(PRUint32 startPosition, PRInt32 readCount, NS_ASSERTION(mContext == nsnull, "context not released"); mContext = ctxt; NS_IF_ADDREF(mContext); - mLoadGroup = group; mState = START_READ; mSourceOffset = startPosition; @@ -464,8 +462,7 @@ NS_IMETHODIMP nsFileChannel::AsyncWrite(nsIInputStream *fromStream, PRUint32 startPosition, PRInt32 writeCount, nsISupports *ctxt, - nsIStreamObserver *observer, - nsILoadGroup* group) + nsIStreamObserver *observer) { nsAutoMonitor mon(mMonitor); @@ -528,14 +525,6 @@ nsFileChannel::GetContentType(char * *aContentType) } } -NS_IMETHODIMP -nsFileChannel::GetLoadGroup(nsILoadGroup * *aLoadGroup) -{ - *aLoadGroup = mLoadGroup; - NS_IF_ADDREF(*aLoadGroup); - return NS_OK; -} - //////////////////////////////////////////////////////////////////////////////// // nsIRunnable methods: //////////////////////////////////////////////////////////////////////////////// @@ -571,8 +560,6 @@ nsFileChannel::Process(void) nsISupports* fs; if (mListener) { - if (mLoadGroup) - (void)mLoadGroup->AddChannel(this, mContext); mStatus = mListener->OnStartRequest(this, mContext); // always send the start notification if (NS_FAILED(mStatus)) goto error; } @@ -668,10 +655,6 @@ nsFileChannel::Process(void) if (mListener) { // XXX where do we get the error message? (void)mListener->OnStopRequest(this, mContext, mStatus, nsnull); - if (mLoadGroup) { - (void)mLoadGroup->RemoveChannel(this, mContext, mStatus, nsnull); - mLoadGroup = null_nsCOMPtr(); - } NS_RELEASE(mListener); } diff --git a/mozilla/netwerk/protocol/file/src/nsFileChannel.h b/mozilla/netwerk/protocol/file/src/nsFileChannel.h index f857f66d6d4..edfbd2f3230 100644 --- a/mozilla/netwerk/protocol/file/src/nsFileChannel.h +++ b/mozilla/netwerk/protocol/file/src/nsFileChannel.h @@ -71,11 +71,11 @@ public: /* nsIOutputStream OpenOutputStream (); */ NS_IMETHOD OpenOutputStream(PRUint32 startPosition, nsIOutputStream **_retval); - /* void AsyncRead (in unsigned long startPosition, in long readCount, in nsISupports ctxt, in nsIStreamListener listener, in nsILoadGroup group); */ - NS_IMETHOD AsyncRead(PRUint32 startPosition, PRInt32 readCount, nsISupports *ctxt, nsIStreamListener *listener, nsILoadGroup *group); + /* void AsyncRead (in unsigned long startPosition, in long readCount, in nsISupports ctxt, in nsIStreamListener listener); */ + NS_IMETHOD AsyncRead(PRUint32 startPosition, PRInt32 readCount, nsISupports *ctxt, nsIStreamListener *listener); - /* void AsyncWrite (in nsIInputStream fromStream, in unsigned long startPosition, in long writeCount, in nsISupports ctxt, in nsIStreamObserver observer, in nsILoadGroup group); */ - NS_IMETHOD AsyncWrite(nsIInputStream *fromStream, PRUint32 startPosition, PRInt32 writeCount, nsISupports *ctxt, nsIStreamObserver *observer, nsILoadGroup *group); + /* void AsyncWrite (in nsIInputStream fromStream, in unsigned long startPosition, in long writeCount, in nsISupports ctxt, in nsIStreamObserver observer); */ + NS_IMETHOD AsyncWrite(nsIInputStream *fromStream, PRUint32 startPosition, PRInt32 writeCount, nsISupports *ctxt, nsIStreamObserver *observer); /* attribute boolean LoadQuiet; */ NS_IMETHOD GetLoadAttributes(PRUint32 *aLoadAttributes); @@ -84,8 +84,6 @@ public: /* readonly attribute string ContentType; */ NS_IMETHOD GetContentType(char * *aContentType); - NS_IMETHOD GetLoadGroup(nsILoadGroup * *aLoadGroup); - //////////////////////////////////////////////////////////////////////////// // from nsIFileChannel: @@ -203,7 +201,6 @@ protected: PRMonitor* mMonitor; PRUint32 mLoadAttributes; - nsCOMPtr mLoadGroup; }; #define NS_FILE_TRANSPORT_SEGMENT_SIZE (4*1024) diff --git a/mozilla/netwerk/protocol/ftp/src/nsFTPChannel.cpp b/mozilla/netwerk/protocol/ftp/src/nsFTPChannel.cpp index 9814d49f956..f7e86ca43fd 100644 --- a/mozilla/netwerk/protocol/ftp/src/nsFTPChannel.cpp +++ b/mozilla/netwerk/protocol/ftp/src/nsFTPChannel.cpp @@ -181,8 +181,7 @@ nsFTPChannel::OpenOutputStream(PRUint32 startPosition, nsIOutputStream **_retval NS_IMETHODIMP nsFTPChannel::AsyncRead(PRUint32 startPosition, PRInt32 readCount, nsISupports *ctxt, - nsIStreamListener *listener, - nsILoadGroup* group) + nsIStreamListener *listener) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -192,8 +191,7 @@ nsFTPChannel::AsyncWrite(nsIInputStream *fromStream, PRUint32 startPosition, PRInt32 writeCount, nsISupports *ctxt, - nsIStreamObserver *observer, - nsILoadGroup* group) + nsIStreamObserver *observer) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -220,14 +218,6 @@ nsFTPChannel::GetContentType(char* *contentType) { return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP -nsFTPChannel::GetLoadGroup(nsILoadGroup * *aLoadGroup) -{ - *aLoadGroup = mLoadGroup; - NS_ADDREF(*aLoadGroup); - return NS_OK; -} - //////////////////////////////////////////////////////////////////////////////// // nsIFTPChannel methods: diff --git a/mozilla/netwerk/protocol/ftp/src/nsFTPChannel.h b/mozilla/netwerk/protocol/ftp/src/nsFTPChannel.h index e06f76122e0..364cdf48277 100644 --- a/mozilla/netwerk/protocol/ftp/src/nsFTPChannel.h +++ b/mozilla/netwerk/protocol/ftp/src/nsFTPChannel.h @@ -49,18 +49,15 @@ public: NS_IMETHOD AsyncRead(PRUint32 startPosition, PRInt32 readCount, nsISupports *ctxt, - nsIStreamListener *listener, - nsILoadGroup *group); + nsIStreamListener *listener); NS_IMETHOD AsyncWrite(nsIInputStream *fromStream, PRUint32 startPosition, PRInt32 writeCount, nsISupports *ctxt, - nsIStreamObserver *observer, - nsILoadGroup *group); + nsIStreamObserver *observer); NS_IMETHOD GetLoadAttributes(PRUint32 *aLoadAttributes); NS_IMETHOD SetLoadAttributes(PRUint32 aLoadAttributes); NS_IMETHOD GetContentType(char * *aContentType); - NS_IMETHOD GetLoadGroup(nsILoadGroup * *aLoadGroup); // nsIFTPChannel methods: NS_IMETHOD Get(void); @@ -98,7 +95,6 @@ protected: PRBool mConnected; nsIStreamListener* mListener; PRUint32 mLoadAttributes; - nsILoadGroup* mLoadGroup; }; #endif /* nsFTPChannel_h___ */ diff --git a/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp b/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp index c4852299556..28714ce43cc 100644 --- a/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp @@ -19,7 +19,7 @@ #include "nsHTTPChannel.h" #include "netCore.h" #include "nsIHttpEventSink.h" -#include "nsIHTTPHandler.h" +#include "nsIHTTPProtocolHandler.h" #include "nsHTTPRequest.h" #include "nsHTTPResponse.h" #include "nsIChannel.h" @@ -45,7 +45,7 @@ static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); nsHTTPChannel::nsHTTPChannel(nsIURI* i_URL, nsIHTTPEventSink* i_HTTPEventSink, - nsIHTTPHandler* i_Handler): + nsHTTPHandler* i_Handler): m_URI(dont_QueryInterface(i_URL)), m_bConnected(PR_FALSE), m_State(HS_IDLE), @@ -168,8 +168,7 @@ nsHTTPChannel::OpenOutputStream(PRUint32 startPosition, nsIOutputStream **_retva NS_IMETHODIMP nsHTTPChannel::AsyncRead(PRUint32 startPosition, PRInt32 readCount, nsISupports *aContext, - nsIStreamListener *listener, - nsILoadGroup* group) + nsIStreamListener *listener) { nsresult rv = NS_OK; @@ -187,7 +186,6 @@ nsHTTPChannel::AsyncRead(PRUint32 startPosition, PRInt32 readCount, NS_ADDREF(m_pResponseDataListener); mResponseContext = aContext; - mLoadGroup = group; rv = Open(); } @@ -200,8 +198,7 @@ nsHTTPChannel::AsyncWrite(nsIInputStream *fromStream, PRUint32 startPosition, PRInt32 writeCount, nsISupports *ctxt, - nsIStreamObserver *observer, - nsILoadGroup* group) + nsIStreamObserver *observer) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -275,14 +272,6 @@ nsHTTPChannel::GetContentType(char * *aContentType) return rv; } -NS_IMETHODIMP -nsHTTPChannel::GetLoadGroup(nsILoadGroup * *aLoadGroup) -{ - *aLoadGroup = mLoadGroup; - NS_IF_ADDREF(*aLoadGroup); - return NS_OK; -} - //////////////////////////////////////////////////////////////////////////////// // nsIHTTPChannel methods: @@ -539,7 +528,7 @@ nsHTTPChannel::Open(void) // Write the request to the server... rv = stream->GetLength(&count); - rv = channel->AsyncWrite(stream, 0, count, this , m_pRequest, nsnull); + rv = channel->AsyncWrite(stream, 0, count, this , m_pRequest); if (NS_FAILED(rv)) return rv; m_State = HS_WAITING_FOR_RESPONSE; diff --git a/mozilla/netwerk/protocol/http/src/nsHTTPChannel.h b/mozilla/netwerk/protocol/http/src/nsHTTPChannel.h index 7d094904505..cbde08e16bf 100644 --- a/mozilla/netwerk/protocol/http/src/nsHTTPChannel.h +++ b/mozilla/netwerk/protocol/http/src/nsHTTPChannel.h @@ -48,7 +48,7 @@ public: // Constructors and Destructor nsHTTPChannel(nsIURI* i_URL, nsIHTTPEventSink* i_HTTPEventSink, - nsIHTTPHandler* i_Handler); + nsHTTPHandler* i_Handler); virtual ~nsHTTPChannel(); @@ -67,18 +67,15 @@ public: NS_IMETHOD OpenOutputStream(PRUint32 startPosition, nsIOutputStream **_retval); NS_IMETHOD AsyncRead(PRUint32 startPosition, PRInt32 readCount, nsISupports *ctxt, - nsIStreamListener *listener, - nsILoadGroup* group); + nsIStreamListener *listener); NS_IMETHOD AsyncWrite(nsIInputStream *fromStream, PRUint32 startPosition, PRInt32 writeCount, nsISupports *ctxt, - nsIStreamObserver *observer, - nsILoadGroup* group); + nsIStreamObserver *observer); NS_IMETHOD GetLoadAttributes(PRUint32 *aLoadAttributes); NS_IMETHOD SetLoadAttributes(PRUint32 aLoadAttributes); NS_IMETHOD GetContentType(char * *aContentType); - NS_IMETHOD GetLoadGroup(nsILoadGroup * *aLoadGroup); // nsIHTTPChannel methods: NS_IMETHOD GetRequestHeader(const char *headerName, char **_retval); @@ -96,12 +93,10 @@ public: nsresult SetResponse(nsHTTPResponse* i_pResp); nsresult GetResponseContext(nsISupports** aContext); - nsILoadGroup* GetLoadGroup() { return mLoadGroup; } - protected: nsCOMPtr m_URI; PRBool m_bConnected; - nsCOMPtr m_pHandler; + nsCOMPtr m_pHandler; HTTPState m_State; nsCOMPtr m_pEventSink; nsHTTPRequest* m_pRequest; @@ -110,7 +105,6 @@ protected: PRUint32 mLoadAttributes; nsCOMPtr mResponseContext; - nsCOMPtr mLoadGroup; }; #endif /* _nsHTTPChannel_h_ */ diff --git a/mozilla/netwerk/protocol/http/src/nsHTTPHandlerFactory.cpp b/mozilla/netwerk/protocol/http/src/nsHTTPHandlerFactory.cpp index 803c4e827b3..7852fdf5514 100644 --- a/mozilla/netwerk/protocol/http/src/nsHTTPHandlerFactory.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHTTPHandlerFactory.cpp @@ -28,7 +28,7 @@ #include "nsCOMPtr.h" #include "nscore.h" -#include "nsIHTTPHandler.h" +#include "nsIHTTPProtocolHandler.h" #include "nsHTTPCID.h" #include "nsHTTPHandlerFactory.h" #include "nsIComponentManager.h" @@ -96,7 +96,7 @@ nsHTTPHandlerFactory::CreateInstance(nsISupports *aOuter, nsISupports *inst = nsnull; if (mClassID.Equals(kHTTPHandlerCID)) { - if (NS_FAILED(rv = CreateOrGetHTTPHandler((nsIHTTPHandler**) &inst))) + if (NS_FAILED(rv = NS_CreateOrGetHTTPHandler((nsIHTTPProtocolHandler**) &inst))) return rv; } else { diff --git a/mozilla/netwerk/protocol/http/src/nsHTTPRequest.cpp b/mozilla/netwerk/protocol/http/src/nsHTTPRequest.cpp index 01a99dffbdf..04731b0e0e3 100644 --- a/mozilla/netwerk/protocol/http/src/nsHTTPRequest.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHTTPRequest.cpp @@ -958,13 +958,6 @@ nsHTTPRequest::OnStartRequest(nsIChannel* channel, nsISupports* i_pContext) PR_LOG(gHTTPLog, PR_LOG_DEBUG, ("nsHTTPRequest [this=%x]. Starting to write request to server.\n", this)); - - if (m_pConnection->GetLoadGroup()) { - nsCOMPtr context; - m_pConnection->GetResponseContext(getter_AddRefs(context)); - m_pConnection->GetLoadGroup()->AddChannel(m_pConnection, context); - } - return NS_OK; } @@ -989,8 +982,7 @@ nsHTTPRequest::OnStopRequest(nsIChannel* channel, nsISupports* i_pContext, NS_ADDREF(pListener); rv = m_pTransport->AsyncRead(0, -1, i_pContext, - pListener, - nsnull); + pListener); NS_RELEASE(pListener); } else { rv = NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/netwerk/protocol/http/src/nsHTTPResponseListener.cpp b/mozilla/netwerk/protocol/http/src/nsHTTPResponseListener.cpp index 644cd93fa40..44bed7187cb 100644 --- a/mozilla/netwerk/protocol/http/src/nsHTTPResponseListener.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHTTPResponseListener.cpp @@ -216,9 +216,6 @@ nsHTTPResponseListener::OnStopRequest(nsIChannel* channel, rv = m_pConsumer->OnStopRequest(m_pConnection, m_ResponseContext, i_Status, i_pMsg); } - if (m_pConnection->GetLoadGroup()) - m_pConnection->GetLoadGroup()->RemoveChannel(m_pConnection, m_ResponseContext, i_Status, i_pMsg); - // The Consumer is no longer needed... NS_IF_RELEASE(m_pConsumer); @@ -695,12 +692,12 @@ nsresult nsHTTPResponseListener::ProcessRedirection(PRInt32 aStatusCode) #endif /* PR_LOGGING */ #if 0 // Expanded inline to avoid linking with neckoutils.... (temporary) - rv = NS_OpenURI(m_pConsumer, m_ResponseContext, newURL, nsnull); + rv = NS_OpenURI(m_pConsumer, m_ResponseContext, newURL); #else nsIChannel* channel; rv = serv->NewChannelFromURI("load", newURL, nsnull, &channel); if (NS_SUCCEEDED(rv)) { - rv = channel->AsyncRead(0, -1, m_ResponseContext, m_pConsumer, nsnull); + rv = channel->AsyncRead(0, -1, m_ResponseContext, m_pConsumer); NS_RELEASE(channel); } #endif diff --git a/mozilla/netwerk/test/TestFileInput.cpp b/mozilla/netwerk/test/TestFileInput.cpp index 285214f07a3..1753606c6ac 100644 --- a/mozilla/netwerk/test/TestFileInput.cpp +++ b/mozilla/netwerk/test/TestFileInput.cpp @@ -344,7 +344,7 @@ ParallelReadTest(char* dirName, nsIFileTransportService* fts) rv = fts->CreateTransport(spec, &trans); NS_ASSERTION(NS_SUCCEEDED(rv), "create failed"); - rv = trans->AsyncRead(0, -1, nsnull, listener, nsnull); + rv = trans->AsyncRead(0, -1, nsnull, listener); NS_ASSERTION(NS_SUCCEEDED(rv), "AsyncRead failed"); // the reader thread will hang on to these objects until it quits diff --git a/mozilla/netwerk/test/TestProtocols.cpp b/mozilla/netwerk/test/TestProtocols.cpp index addc592b1e4..0465dbcdb75 100644 --- a/mozilla/netwerk/test/TestProtocols.cpp +++ b/mozilla/netwerk/test/TestProtocols.cpp @@ -421,8 +421,7 @@ nsresult StartLoadingURL(const char* aUrlString) rv = pChannel->AsyncRead(0, // staring position -1, // number of bytes to read info, // ISupports context - listener, // IStreamListener consumer - nsnull); // load group + listener); // IStreamListener consumer if (NS_SUCCEEDED(rv)) { gKeepRunning += 1; } diff --git a/mozilla/netwerk/test/TestSocketIO.cpp b/mozilla/netwerk/test/TestSocketIO.cpp index c6505eefd51..37664b693fb 100644 --- a/mozilla/netwerk/test/TestSocketIO.cpp +++ b/mozilla/netwerk/test/TestSocketIO.cpp @@ -174,7 +174,7 @@ TestWriteObserver::OnStopRequest(nsIChannel* channel, nsISupports* context, printf("\n+++ TestWriteObserver::OnStopRequest (status = %x) +++\n", aStatus); if (NS_SUCCEEDED(aStatus)) { - mTransport->AsyncRead(0, -1, nsnull, new InputTestConsumer, nsnull); + mTransport->AsyncRead(0, -1, nsnull, new InputTestConsumer); } else { gKeepRunning = 0; } @@ -259,7 +259,7 @@ main(int argc, char* argv[]) TestWriteObserver* observer = new TestWriteObserver(transport); gElapsedTime = PR_Now(); - transport->AsyncWrite(stream, 0, bytesWritten, nsnull, observer, nsnull); + transport->AsyncWrite(stream, 0, bytesWritten, nsnull, observer); NS_RELEASE(transport); } diff --git a/mozilla/netwerk/test/TestSocketInput.cpp b/mozilla/netwerk/test/TestSocketInput.cpp index 5716fe054b3..3e98e15f6f8 100644 --- a/mozilla/netwerk/test/TestSocketInput.cpp +++ b/mozilla/netwerk/test/TestSocketInput.cpp @@ -158,7 +158,7 @@ main(int argc, char* argv[]) rv = sts->CreateTransport(hostName, port, &transport); if (NS_SUCCEEDED(rv)) { - transport->AsyncRead(0, -1, nsnull, new InputTestConsumer, nsnull); + transport->AsyncRead(0, -1, nsnull, new InputTestConsumer); NS_RELEASE(transport); } diff --git a/mozilla/netwerk/test/TestSocketTransport.cpp b/mozilla/netwerk/test/TestSocketTransport.cpp index 1576e0c60af..6375bc4a9e6 100644 --- a/mozilla/netwerk/test/TestSocketTransport.cpp +++ b/mozilla/netwerk/test/TestSocketTransport.cpp @@ -295,7 +295,7 @@ TestConnection::Run(void) // // Initiate an async read... // - rv = mTransport->AsyncRead(0, -1, mTransport, this, nsnull); + rv = mTransport->AsyncRead(0, -1, mTransport, this); if (NS_FAILED(rv)) { printf("Error: AsyncRead failed..."); @@ -359,7 +359,7 @@ nsresult TestConnection::WriteBuffer(void) // Write the buffer to the server... if (NS_SUCCEEDED(rv)) { rv = mTransport->AsyncWrite(mStream, 0, bytesWritten, mTransport, - /* mOutputObserver */ nsnull, nsnull); + /* mOutputObserver */ nsnull); } // Wait for the write to complete... if (NS_FAILED(rv)) { diff --git a/mozilla/netwerk/util/public/nsNeckoUtil.h b/mozilla/netwerk/util/public/nsNeckoUtil.h index efbeb32eb86..adbf048037f 100644 --- a/mozilla/netwerk/util/public/nsNeckoUtil.h +++ b/mozilla/netwerk/util/public/nsNeckoUtil.h @@ -44,8 +44,7 @@ extern nsresult NS_OpenURI(nsIInputStream* *result, nsIURI* uri); extern nsresult -NS_OpenURI(nsIStreamListener* aConsumer, nsISupports* context, - nsIURI* uri, nsILoadGroup* group); +NS_OpenURI(nsIStreamListener* aConsumer, nsISupports* context, nsIURI* uri); extern nsresult NS_MakeAbsoluteURI(const char* spec, nsIURI* baseURI, char* *result); @@ -57,4 +56,8 @@ extern nsresult NS_NewLoadGroup(nsISupports* outer, nsIStreamObserver* observer, nsILoadGroup* parent, nsILoadGroup* *result); +extern nsresult +NS_NewPostDataStream(PRBool isFile, const char *data, + nsIInputStream **result); + #endif // nsNeckoUtil_h__ diff --git a/mozilla/netwerk/util/src/makefile.win b/mozilla/netwerk/util/src/makefile.win index d883a662c10..6fc07c9eeaa 100644 --- a/mozilla/netwerk/util/src/makefile.win +++ b/mozilla/netwerk/util/src/makefile.win @@ -39,7 +39,7 @@ INCS = $(INCS) \ include <$(DEPTH)\config\rules.mak> libs:: $(LIBRARY) - $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib + $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib clobber:: rm -f $(DIST)\lib\$(LIBRARY_NAME).lib diff --git a/mozilla/netwerk/util/src/nsNeckoUtil.cpp b/mozilla/netwerk/util/src/nsNeckoUtil.cpp index 5bfd1c31672..7547c6d6513 100644 --- a/mozilla/netwerk/util/src/nsNeckoUtil.cpp +++ b/mozilla/netwerk/util/src/nsNeckoUtil.cpp @@ -21,6 +21,8 @@ #include "nsIServiceManager.h" #include "nsIChannel.h" #include "nsIAllocator.h" +#include "nsCOMPtr.h" +#include "nsIHTTPProtocolHandler.h" static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); @@ -83,8 +85,7 @@ NS_OpenURI(nsIInputStream* *result, nsIURI* uri) } nsresult -NS_OpenURI(nsIStreamListener* aConsumer, nsISupports* context, - nsIURI* uri, nsILoadGroup* group) +NS_OpenURI(nsIStreamListener* aConsumer, nsISupports* context, nsIURI* uri) { nsresult rv; nsIChannel* channel; @@ -92,7 +93,7 @@ NS_OpenURI(nsIStreamListener* aConsumer, nsISupports* context, rv = NS_OpenURI(&channel, uri); if (NS_FAILED(rv)) return rv; - rv = channel->AsyncRead(0, -1, context, aConsumer, group); + rv = channel->AsyncRead(0, -1, context, aConsumer); NS_RELEASE(channel); return rv; } @@ -134,4 +135,22 @@ NS_NewLoadGroup(nsISupports* outer, nsIStreamObserver* observer, return serv->NewLoadGroup(outer, observer, parent, result); } +nsresult +NS_NewPostDataStream(PRBool isFile, const char *data, + nsIInputStream **result) +{ + nsresult rv; + NS_WITH_SERVICE(nsIIOService, serv, kIOServiceCID, &rv); + if (NS_FAILED(rv)) return rv; + + nsCOMPtr handler; + rv = serv->GetProtocolHandler("http", getter_AddRefs(handler)); + if (NS_FAILED(rv)) return rv; + + nsCOMPtr http = do_QueryInterface(handler, &rv); + if (NS_FAILED(rv)) return rv; + + return http->NewPostDataStream(isFile, data, result); +} + //////////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/netwerk/util/src/nsNetStreamLoader.cpp b/mozilla/netwerk/util/src/nsNetStreamLoader.cpp index f0a0a79c2f5..c79e16cf4ad 100644 --- a/mozilla/netwerk/util/src/nsNetStreamLoader.cpp +++ b/mozilla/netwerk/util/src/nsNetStreamLoader.cpp @@ -25,6 +25,9 @@ #include "nsIURL.h" #include "nsNeckoUtil.h" #include "nsIBufferInputStream.h" +#include "nsCOMPtr.h" +#include "nsILoadGroup.h" +#include "nsIChannel.h" static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID); static NS_DEFINE_IID(kIUnicharStreamLoaderIID, NS_IUNICHARSTREAMLOADER_IID); @@ -59,6 +62,7 @@ protected: nsStreamCompleteFunc mFunc; void* mRef; nsString* mData; + nsCOMPtr mLoadGroup; }; @@ -70,16 +74,25 @@ nsUnicharStreamLoader::nsUnicharStreamLoader(nsIURI* aURL, nsILoadGroup* aLoadGr mFunc = aFunc; mRef = aRef; mData = new nsString(); + mLoadGroup = aLoadGroup; - // XXX This is vile vile vile!!! + // XXX This is vile vile vile!!! if (aURL) { - *rv = NS_OpenURI(this, nsnull, aURL, aLoadGroup); - if ((NS_OK != *rv) && (nsnull != mFunc)) { + nsCOMPtr channel; + *rv = NS_OpenURI(getter_AddRefs(channel), aURL); + if (NS_FAILED(*rv) && (nsnull != mFunc)) { // Thou shalt not call out of scope whilst ones refcnt is zero mRefCnt = 999; (*mFunc)(this, *mData, mRef, *rv); mRefCnt = 0; + return; } + + *rv = mLoadGroup->AddChannel(channel, nsnull); + if (NS_FAILED(*rv)) return; + + *rv = channel->AsyncRead(0, -1, nsnull, this); + if (NS_FAILED(*rv)) return; } } @@ -146,8 +159,7 @@ nsUnicharStreamLoader::OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg) { (*mFunc)(this, *mData, mRef, status); - - return NS_OK; + return mLoadGroup->RemoveChannel(channel, ctxt, status, errorMsg); } #define BUF_SIZE 1024 diff --git a/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp b/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp index 99519e7906e..329ecdd92bc 100644 --- a/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp +++ b/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp @@ -915,7 +915,7 @@ RDFXMLDataSourceImpl::Refresh(PRBool aBlocking) } else { #ifdef NECKO - rv = NS_OpenURI(lsnr, nsnull, mURL, nsnull); // XXX need the nsILoadGroup here! + rv = NS_OpenURI(lsnr, nsnull, mURL); #else rv = NS_OpenURL(mURL, lsnr); #endif diff --git a/mozilla/rdf/content/src/nsXULDocument.cpp b/mozilla/rdf/content/src/nsXULDocument.cpp index d6cb2172312..af1da08587c 100644 --- a/mozilla/rdf/content/src/nsXULDocument.cpp +++ b/mozilla/rdf/content/src/nsXULDocument.cpp @@ -425,6 +425,7 @@ public: NS_IMETHOD StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif @@ -730,7 +731,7 @@ protected: nsIContentViewerContainer* aContainer, const char* aCommand, #ifdef NECKO - nsIChannel* aChannel + nsIChannel* aChannel, nsILoadGroup* aLoadGroup #else nsIURI* aOptionalURL = 0 #endif @@ -1092,7 +1093,7 @@ XULDocumentImpl::PrepareToLoad( nsCOMPtr* created_parser, nsIContentViewerContainer* aContainer, const char* aCommand, #ifdef NECKO - nsIChannel* aChannel + nsIChannel* aChannel, nsILoadGroup* aLoadGroup #else nsIURI* aOptionalURL #endif @@ -1132,7 +1133,7 @@ XULDocumentImpl::PrepareToLoad( nsCOMPtr* created_parser, mDocumentURL = syntheticURL; #ifdef NECKO - (void)aChannel->GetLoadGroup(getter_AddRefs(mDocumentLoadGroup)); + mDocumentLoadGroup = aLoadGroup; #else syntheticURL->GetLoadGroup(getter_AddRefs(mDocumentLoadGroup)); #endif @@ -1271,6 +1272,7 @@ NS_IMETHODIMP XULDocumentImpl::StartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aURL, #endif @@ -1288,7 +1290,7 @@ XULDocumentImpl::StartDocumentLoad(const char* aCommand, do { #ifdef NECKO - status = PrepareToLoad(&parser, aContainer, aCommand, aChannel); + status = PrepareToLoad(&parser, aContainer, aCommand, aChannel, aLoadGroup); #else status = PrepareToLoad(&parser, aContainer, aCommand, aURL); #endif @@ -1321,7 +1323,11 @@ XULDocumentImpl::LoadFromStream( nsIInputStream& xulStream, { nsresult status; nsCOMPtr parser; +#ifdef NECKO + if ( NS_SUCCEEDED(status = PrepareToLoad(&parser, aContainer, aCommand, nsnull, nsnull)) ) +#else if ( NS_SUCCEEDED(status = PrepareToLoad(&parser, aContainer, aCommand, nsnull)) ) +#endif parser->Parse(xulStream); return status; diff --git a/mozilla/rdf/datasource/src/nsFTPDataSource.cpp b/mozilla/rdf/datasource/src/nsFTPDataSource.cpp index c71eaad8775..77f15e7220d 100644 --- a/mozilla/rdf/datasource/src/nsFTPDataSource.cpp +++ b/mozilla/rdf/datasource/src/nsFTPDataSource.cpp @@ -835,8 +835,7 @@ FTPDataSource::GetFTPListing(nsIRDFResource *source, nsISimpleEnumerator** aResu FTPDataSourceCallback *callback = new FTPDataSourceCallback(mInner, source); if (nsnull != callback) { - rv = NS_OpenURI(NS_STATIC_CAST(nsIStreamListener *, callback), nsnull, - url, nsnull); // XXX need the nsILoadGroup here! + rv = NS_OpenURI(NS_STATIC_CAST(nsIStreamListener *, callback), nsnull, url); } } #endif // NECKO diff --git a/mozilla/rdf/datasource/src/nsSearchDataSource.cpp b/mozilla/rdf/datasource/src/nsSearchDataSource.cpp index 1540bcfbdbf..8b4f6395245 100755 --- a/mozilla/rdf/datasource/src/nsSearchDataSource.cpp +++ b/mozilla/rdf/datasource/src/nsSearchDataSource.cpp @@ -1042,8 +1042,7 @@ SearchDataSource::DoSearch(nsIRDFResource *source, nsIRDFResource *engine, nsStr if (nsnull != callback) { #ifdef NECKO - rv = NS_OpenURI(NS_STATIC_CAST(nsIStreamListener *, callback), nsnull, - url, nsnull); // XXX need the nsILoadGroup here! + rv = NS_OpenURI(NS_STATIC_CAST(nsIStreamListener *, callback), nsnull, url); #else rv = NS_OpenURL(url, NS_STATIC_CAST(nsIStreamListener *, callback)); #endif diff --git a/mozilla/rdf/datasource/src/nsXULContentSink.cpp b/mozilla/rdf/datasource/src/nsXULContentSink.cpp index be4c9bcc80c..8cd347309cd 100644 --- a/mozilla/rdf/datasource/src/nsXULContentSink.cpp +++ b/mozilla/rdf/datasource/src/nsXULContentSink.cpp @@ -856,8 +856,8 @@ XULContentSinkImpl::ProcessStyleLink(nsIContent* aElement, if ((0 == mimeType.Length()) || mimeType.EqualsIgnoreCase(kCSSType)) { nsIURI* url = nsnull; -#ifdef NECKO // we need to be passed the nsILoadGroup here - result = NS_NewURI(&url, aHref, mDocumentBaseURL/*, group*/); +#ifdef NECKO + result = NS_NewURI(&url, aHref, mDocumentBaseURL); #else nsILoadGroup* LoadGroup = nsnull; mDocumentBaseURL->GetLoadGroup(&LoadGroup); @@ -1614,8 +1614,8 @@ XULContentSinkImpl::OpenScript(const nsIParserNode& aNode) // Use the SRC attribute value to load the URL nsIURI* url = nsnull; nsAutoString absURL; -#ifdef NECKO // we need to be passed the nsILoadGroup here - rv = NS_NewURI(&url, src, mDocumentBaseURL/*, group*/); +#ifdef NECKO + rv = NS_NewURI(&url, src, mDocumentBaseURL); #else nsILoadGroup* LoadGroup; @@ -1637,17 +1637,15 @@ XULContentSinkImpl::OpenScript(const nsIParserNode& aNode) // onto it as opaque data. NS_ADDREF(this); - nsILoadGroup* loadGroup = mDocument->GetDocumentLoadGroup(); nsIUnicharStreamLoader* loader; rv = NS_NewUnicharStreamLoader(&loader, url, #ifdef NECKO - loadGroup, + nsCOMPtr(mDocument->GetDocumentLoadGroup()), #endif (nsStreamCompleteFunc)DoneLoadingScript, (void *)this); NS_RELEASE(url); - NS_IF_RELEASE(loadGroup); if (NS_OK == rv) { rv = NS_ERROR_HTMLPARSER_BLOCK; } diff --git a/mozilla/uriloader/base/nsDocLoader.cpp b/mozilla/uriloader/base/nsDocLoader.cpp index 410b0fb1ee7..502e9c06a62 100644 --- a/mozilla/uriloader/base/nsDocLoader.cpp +++ b/mozilla/uriloader/base/nsDocLoader.cpp @@ -40,6 +40,7 @@ #else #include "nsIIOService.h" #include "nsILoadGroup.h" +//#include "nsILoadGroupObserver.h" #include "nsNeckoUtil.h" #include "nsIURL.h" @@ -304,9 +305,11 @@ public: #endif #ifdef NECKO - void LoadURLComplete(nsIChannel* channel, nsISupports* aLoader, PRInt32 aStatus); + nsresult LoadURLComplete(nsIChannel* channel, nsISupports* ctxt, + nsISupports* aLoader, PRInt32 aStatus, + const PRUnichar* aMsg); #else - void LoadURLComplete(nsIURI* aURL, nsISupports* aLoader, PRInt32 aStatus); + nsresult LoadURLComplete(nsIURI* aURL, nsISupports* aLoader, PRInt32 aStatus); #endif void SetParent(nsDocLoaderImpl* aParent); #ifdef NECKO @@ -570,7 +573,7 @@ nsDocLoaderImpl::CreateContentViewer(const char *aCommand, // Now create an instance of the content viewer rv = factory->CreateInstance(aCommand, #ifdef NECKO - channel, + channel, mLoadGroup, #else aURL, #endif @@ -1264,13 +1267,13 @@ void nsDocLoaderImpl::FireOnEndURLLoad(nsIDocumentLoader* aLoadInitiator, #ifdef NECKO -void nsDocLoaderImpl::LoadURLComplete(nsIChannel* channel, nsISupports* aBindInfo, PRInt32 aStatus) +nsresult nsDocLoaderImpl::LoadURLComplete(nsIChannel* channel, nsISupports* ctxt, + nsISupports* aBindInfo, PRInt32 aStatus, + const PRUnichar* aMsg) #else -void nsDocLoaderImpl::LoadURLComplete(nsIURI* aURL, nsISupports* aBindInfo, PRInt32 aStatus) +nsresult nsDocLoaderImpl::LoadURLComplete(nsIURI* aURL, nsISupports* aBindInfo, PRInt32 aStatus) #endif { - PRBool isForegroundURL = PR_FALSE; - /* * If the entry is not found in the list, then it must have been cancelled * via Stop(...). So ignore just it... @@ -1290,7 +1293,9 @@ void nsDocLoaderImpl::LoadURLComplete(nsIURI* aURL, nsISupports* aBindInfo, PRIn } } #endif /* DEBUG */ -#else +#else // !NECKO + PRBool isForegroundURL = PR_FALSE; + PRBool removed = m_LoadingDocsList->RemoveElement(aBindInfo); if (removed) { nsILoadAttribs* loadAttributes; @@ -1322,7 +1327,7 @@ void nsDocLoaderImpl::LoadURLComplete(nsIURI* aURL, nsISupports* aBindInfo, PRIn this, buffer, mForegroundURLs, mTotalURLs)); #endif /* DEBUG */ } -#endif +#endif // !NECKO /* * Fire the OnEndURLLoad notification to any observers... @@ -1333,6 +1338,9 @@ void nsDocLoaderImpl::LoadURLComplete(nsIURI* aURL, nsISupports* aBindInfo, PRIn FireOnEndURLLoad((nsIDocumentLoader *) this, aURL, aStatus); #endif +#ifdef NECKO + return GetLoadGroup()->RemoveChannel(channel, ctxt, aStatus, aMsg); +#else /* * Fire the OnEndDocumentLoad notification to any observers... */ @@ -1340,26 +1348,19 @@ void nsDocLoaderImpl::LoadURLComplete(nsIURI* aURL, nsISupports* aBindInfo, PRIn IsBusy(busy); if (isForegroundURL && !busy) { #if defined(DEBUG) -#ifdef NECKO - nsCOMPtr uri; - channel->GetURI(getter_AddRefs(uri)); - char* buffer; -#else const char* buffer; nsIURI* uri = mDocumentUrl; -#endif uri->GetSpec(&buffer); PR_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: OnEndDocumentLoad(...) called for %s.\n", this, buffer)); -#ifdef NECKO - nsCRT::free(buffer); -#endif #endif /* DEBUG */ FireOnEndDocumentLoad((nsIDocumentLoader *) this, aStatus); } + return NS_OK; +#endif } void nsDocLoaderImpl::SetParent(nsDocLoaderImpl* aParent) @@ -1656,7 +1657,9 @@ nsresult nsDocumentBindInfo::Bind(nsIURI* aURL, nsIStreamListener* aListener) m_DocLoader->SetDocumentChannel(channel); - rv = channel->AsyncRead(0, -1, nsnull, this, loadGroup); + rv = loadGroup->AddChannel(channel, nsnull); + if (NS_FAILED(rv)) return rv; + rv = channel->AsyncRead(0, -1, nsnull, this); if (NS_FAILED(rv)) return rv; #endif // NECKO @@ -2109,9 +2112,10 @@ NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIURI* aURL, nsresult aStatus, cons * The stream is complete... Tell the DocumentLoader to release us... */ #ifdef NECKO - m_DocLoader->LoadURLComplete(channel, (nsIStreamListener *)this, aStatus); + rv = m_DocLoader->LoadURLComplete(channel, ctxt, (nsIStreamListener *)this, + aStatus, aMsg); #else - m_DocLoader->LoadURLComplete(aURL, (nsIStreamListener *)this, aStatus); + rv = m_DocLoader->LoadURLComplete(aURL, (nsIStreamListener *)this, aStatus); #endif NS_IF_RELEASE(m_NextStream); diff --git a/mozilla/webshell/embed/ActiveX/WebShellContainer.cpp b/mozilla/webshell/embed/ActiveX/WebShellContainer.cpp index 452c65335af..86a1436b7f0 100644 --- a/mozilla/webshell/embed/ActiveX/WebShellContainer.cpp +++ b/mozilla/webshell/embed/ActiveX/WebShellContainer.cpp @@ -488,6 +488,7 @@ NS_IMETHODIMP CWebShellContainer::OnStartDocumentLoad(const char* aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI *aUrl, #endif diff --git a/mozilla/webshell/public/nsIDocumentLoader.h b/mozilla/webshell/public/nsIDocumentLoader.h index a4be3fb64db..bd81cec1edd 100644 --- a/mozilla/webshell/public/nsIDocumentLoader.h +++ b/mozilla/webshell/public/nsIDocumentLoader.h @@ -40,6 +40,7 @@ class nsIStreamObserver; class nsIDocumentLoaderObserver; class nsIDocument; class nsIChannel; +class nsILoadGroup; /* f43ba260-0737-11d2-beb9-00805f8a66dc */ #define NS_IDOCUMENTLOADERFACTORY_IID \ @@ -69,6 +70,7 @@ public: NS_IMETHOD CreateInstance(const char *aCommand, #ifdef NECKO nsIChannel* aChannel, + nsILoadGroup* aLoadGroup, #else nsIURI* aURL, #endif diff --git a/mozilla/webshell/src/nsDocLoader.cpp b/mozilla/webshell/src/nsDocLoader.cpp index 410b0fb1ee7..502e9c06a62 100644 --- a/mozilla/webshell/src/nsDocLoader.cpp +++ b/mozilla/webshell/src/nsDocLoader.cpp @@ -40,6 +40,7 @@ #else #include "nsIIOService.h" #include "nsILoadGroup.h" +//#include "nsILoadGroupObserver.h" #include "nsNeckoUtil.h" #include "nsIURL.h" @@ -304,9 +305,11 @@ public: #endif #ifdef NECKO - void LoadURLComplete(nsIChannel* channel, nsISupports* aLoader, PRInt32 aStatus); + nsresult LoadURLComplete(nsIChannel* channel, nsISupports* ctxt, + nsISupports* aLoader, PRInt32 aStatus, + const PRUnichar* aMsg); #else - void LoadURLComplete(nsIURI* aURL, nsISupports* aLoader, PRInt32 aStatus); + nsresult LoadURLComplete(nsIURI* aURL, nsISupports* aLoader, PRInt32 aStatus); #endif void SetParent(nsDocLoaderImpl* aParent); #ifdef NECKO @@ -570,7 +573,7 @@ nsDocLoaderImpl::CreateContentViewer(const char *aCommand, // Now create an instance of the content viewer rv = factory->CreateInstance(aCommand, #ifdef NECKO - channel, + channel, mLoadGroup, #else aURL, #endif @@ -1264,13 +1267,13 @@ void nsDocLoaderImpl::FireOnEndURLLoad(nsIDocumentLoader* aLoadInitiator, #ifdef NECKO -void nsDocLoaderImpl::LoadURLComplete(nsIChannel* channel, nsISupports* aBindInfo, PRInt32 aStatus) +nsresult nsDocLoaderImpl::LoadURLComplete(nsIChannel* channel, nsISupports* ctxt, + nsISupports* aBindInfo, PRInt32 aStatus, + const PRUnichar* aMsg) #else -void nsDocLoaderImpl::LoadURLComplete(nsIURI* aURL, nsISupports* aBindInfo, PRInt32 aStatus) +nsresult nsDocLoaderImpl::LoadURLComplete(nsIURI* aURL, nsISupports* aBindInfo, PRInt32 aStatus) #endif { - PRBool isForegroundURL = PR_FALSE; - /* * If the entry is not found in the list, then it must have been cancelled * via Stop(...). So ignore just it... @@ -1290,7 +1293,9 @@ void nsDocLoaderImpl::LoadURLComplete(nsIURI* aURL, nsISupports* aBindInfo, PRIn } } #endif /* DEBUG */ -#else +#else // !NECKO + PRBool isForegroundURL = PR_FALSE; + PRBool removed = m_LoadingDocsList->RemoveElement(aBindInfo); if (removed) { nsILoadAttribs* loadAttributes; @@ -1322,7 +1327,7 @@ void nsDocLoaderImpl::LoadURLComplete(nsIURI* aURL, nsISupports* aBindInfo, PRIn this, buffer, mForegroundURLs, mTotalURLs)); #endif /* DEBUG */ } -#endif +#endif // !NECKO /* * Fire the OnEndURLLoad notification to any observers... @@ -1333,6 +1338,9 @@ void nsDocLoaderImpl::LoadURLComplete(nsIURI* aURL, nsISupports* aBindInfo, PRIn FireOnEndURLLoad((nsIDocumentLoader *) this, aURL, aStatus); #endif +#ifdef NECKO + return GetLoadGroup()->RemoveChannel(channel, ctxt, aStatus, aMsg); +#else /* * Fire the OnEndDocumentLoad notification to any observers... */ @@ -1340,26 +1348,19 @@ void nsDocLoaderImpl::LoadURLComplete(nsIURI* aURL, nsISupports* aBindInfo, PRIn IsBusy(busy); if (isForegroundURL && !busy) { #if defined(DEBUG) -#ifdef NECKO - nsCOMPtr uri; - channel->GetURI(getter_AddRefs(uri)); - char* buffer; -#else const char* buffer; nsIURI* uri = mDocumentUrl; -#endif uri->GetSpec(&buffer); PR_LOG(gDocLoaderLog, PR_LOG_DEBUG, ("DocLoader:%p: OnEndDocumentLoad(...) called for %s.\n", this, buffer)); -#ifdef NECKO - nsCRT::free(buffer); -#endif #endif /* DEBUG */ FireOnEndDocumentLoad((nsIDocumentLoader *) this, aStatus); } + return NS_OK; +#endif } void nsDocLoaderImpl::SetParent(nsDocLoaderImpl* aParent) @@ -1656,7 +1657,9 @@ nsresult nsDocumentBindInfo::Bind(nsIURI* aURL, nsIStreamListener* aListener) m_DocLoader->SetDocumentChannel(channel); - rv = channel->AsyncRead(0, -1, nsnull, this, loadGroup); + rv = loadGroup->AddChannel(channel, nsnull); + if (NS_FAILED(rv)) return rv; + rv = channel->AsyncRead(0, -1, nsnull, this); if (NS_FAILED(rv)) return rv; #endif // NECKO @@ -2109,9 +2112,10 @@ NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIURI* aURL, nsresult aStatus, cons * The stream is complete... Tell the DocumentLoader to release us... */ #ifdef NECKO - m_DocLoader->LoadURLComplete(channel, (nsIStreamListener *)this, aStatus); + rv = m_DocLoader->LoadURLComplete(channel, ctxt, (nsIStreamListener *)this, + aStatus, aMsg); #else - m_DocLoader->LoadURLComplete(aURL, (nsIStreamListener *)this, aStatus); + rv = m_DocLoader->LoadURLComplete(aURL, (nsIStreamListener *)this, aStatus); #endif NS_IF_RELEASE(m_NextStream); diff --git a/mozilla/xpcom/io/nsIFileStream.cpp b/mozilla/xpcom/io/nsIFileStream.cpp index 1ebff89be2c..d9100ffab66 100644 --- a/mozilla/xpcom/io/nsIFileStream.cpp +++ b/mozilla/xpcom/io/nsIFileStream.cpp @@ -46,6 +46,7 @@ class FileImpl , mFailed(PR_FALSE) , mEOF(PR_FALSE) , mLength(-1) + , mNSPRMode(0) { NS_INIT_REFCNT(); } @@ -56,6 +57,8 @@ class FileImpl : mFileDesc(nsnull) , mFailed(PR_FALSE) , mEOF(PR_FALSE) + , mLength(-1) + , mNSPRMode(-1) { NS_INIT_REFCNT(); Open(inFile, nsprMode, accessMode); @@ -90,7 +93,7 @@ class FileImpl if (!aLength) return NS_ERROR_NULL_POINTER; if (mLength < 0) - return NS_FILE_RESULT(NS_ERROR_UNEXPECTED); + return NS_ERROR_UNEXPECTED; *aLength = mLength; return NS_OK; } diff --git a/mozilla/xpfe/components/related/src/nsRelatedLinksHandler.cpp b/mozilla/xpfe/components/related/src/nsRelatedLinksHandler.cpp index 913ae2fb1b6..36071cea3d5 100644 --- a/mozilla/xpfe/components/related/src/nsRelatedLinksHandler.cpp +++ b/mozilla/xpfe/components/related/src/nsRelatedLinksHandler.cpp @@ -853,7 +853,7 @@ RelatedLinksHandlerImpl::SetURL(char* aURL) if (NS_FAILED(rv)) return rv; #ifdef NECKO - rv = NS_OpenURI(listener, nsnull, url, nsnull); // XXX need the nsILoadGroup here! + rv = NS_OpenURI(listener, nsnull, url); #else rv = NS_OpenURL(url, listener); #endif diff --git a/mozilla/xpfe/components/xfer/src/nsDownloadProgressDialog.cpp b/mozilla/xpfe/components/xfer/src/nsDownloadProgressDialog.cpp index 894d935fbcc..a6b8314a215 100644 --- a/mozilla/xpfe/components/xfer/src/nsDownloadProgressDialog.cpp +++ b/mozilla/xpfe/components/xfer/src/nsDownloadProgressDialog.cpp @@ -79,7 +79,7 @@ nsDownloadProgressDialog::OnStart() { __FILE__, (int)__LINE__, (int)rv ); } #else - nsresult rv = NS_OpenURI(this, nsnull, mUrl, nsnull); // XXX need the nsILoadGroup here! + nsresult rv = NS_OpenURI(this, nsnull, mUrl); NS_ASSERTION(NS_SUCCEEDED(rv), "OnStart doesn't return rv!"); #endif // NECKO } diff --git a/mozilla/xpinstall/src/nsXPInstallManager.cpp b/mozilla/xpinstall/src/nsXPInstallManager.cpp index 00fb7525552..edccc843349 100644 --- a/mozilla/xpinstall/src/nsXPInstallManager.cpp +++ b/mozilla/xpinstall/src/nsXPInstallManager.cpp @@ -211,7 +211,7 @@ nsresult nsXPInstallManager::DownloadNext() #endif if (NS_SUCCEEDED(rv)) { #ifdef NECKO - rv = NS_OpenURI( this, nsnull, pURL, nsnull ); // XXX need the nsILoadGroup here! + rv = NS_OpenURI( this, nsnull, pURL ); #else rv = NS_OpenURL( pURL, this ); #endif