From be8bf3fd762147b42cd557a151f653a369d707b2 Mon Sep 17 00:00:00 2001 From: "valeski%netscape.com" Date: Thu, 5 Aug 1999 01:28:30 +0000 Subject: [PATCH] api change to nsIWebShell and nsIDocumentLoaderObserver. I've replaced all the old method delarations with the new versions. We now pass 'nsresult' types into the On*() methods instead of PRInt32. The PRInt32 arg type was causing data loss. I also checked in a fix for bug 10848 (which prompted the api change), and 10549 (these changes were in nsWebShell.cpp). git-svn-id: svn://10.0.0.236/trunk@42245 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsWebShell.cpp | 70 ++++++++++++++++-- mozilla/editor/base/nsEditorShell.cpp | 4 +- mozilla/editor/base/nsEditorShell.h | 4 +- mozilla/editor/composer/src/nsEditorShell.cpp | 4 +- mozilla/editor/composer/src/nsEditorShell.h | 4 +- mozilla/uriloader/base/nsDocLoader.cpp | 71 +++---------------- .../embed/ActiveX/WebShellContainer.cpp | 6 +- .../embed/ActiveX/WebShellContainer.h | 4 +- .../public/nsIDocumentLoaderObserver.h | 4 +- mozilla/webshell/public/nsIWebShell.h | 2 +- mozilla/webshell/src/nsDocLoader.cpp | 71 +++---------------- mozilla/webshell/src/nsWebShell.cpp | 70 ++++++++++++++++-- .../webshell/tests/viewer/nsBrowserWindow.cpp | 2 +- .../webshell/tests/viewer/nsBrowserWindow.h | 2 +- .../webshell/tests/viewer/nsWebCrawler.cpp | 4 +- mozilla/webshell/tests/viewer/nsWebCrawler.h | 4 +- .../webshell/tests/viewer/nsXPBaseWindow.cpp | 2 +- .../webshell/tests/viewer/nsXPBaseWindow.h | 2 +- .../xpfe/AppCores/src/nsBrowserAppCore.cpp | 4 +- mozilla/xpfe/AppCores/src/nsBrowserAppCore.h | 4 +- .../xpfe/appshell/src/nsWebShellWindow.cpp | 6 +- mozilla/xpfe/appshell/src/nsWebShellWindow.h | 6 +- 22 files changed, 178 insertions(+), 172 deletions(-) diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index b2c315c0a4d..3b9f40f845c 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -269,7 +269,7 @@ public: NS_IMETHOD WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsLoadType aReason); NS_IMETHOD BeginLoadURL(nsIWebShell* aShell, const PRUnichar* aURL); NS_IMETHOD ProgressLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aProgress, PRInt32 aProgressMax); - NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus); + NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsresult aStatus); NS_IMETHOD NewWebShell(PRUint32 aChromeMask, PRBool aVisible, nsIWebShell *&aNewWebShell); @@ -314,7 +314,7 @@ public: const char* aCommand); NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, - PRInt32 aStatus, + nsresult aStatus, nsIDocumentLoaderObserver * ); NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, @@ -325,7 +325,7 @@ public: NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsString& aMsg); NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, - nsIChannel* channel, PRInt32 aStatus); + nsIChannel* channel, nsresult aStatus); NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader, nsIChannel* channel, const char *aContentType, @@ -2479,7 +2479,7 @@ nsWebShell::ProgressLoadURL(nsIWebShell* aShell, } NS_IMETHODIMP -nsWebShell::EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus) +nsWebShell::EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsresult aStatus) { nsresult rv = NS_OK; if (nsnull != mContainer) { @@ -3036,7 +3036,11 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader, #else nsIURI* aURL, #endif - PRInt32 aStatus, +#ifdef NECKO + nsresult aStatus, +#else + PRInt32 aStatus, +#endif nsIDocumentLoaderObserver * aWebShell) { nsresult rv = NS_ERROR_FAILURE; @@ -3121,6 +3125,57 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader, #endif } +#ifdef NECKO + if ( (mDocLoader == loader) && (aStatus == NS_ERROR_UNKNOWN_HOST) ) { + // We need to check for a dns failure in aStatus, but dns failure codes + // aren't proliferated yet. This checks for failure for a host lacking + // "www." and/or ".com" and munges the url acordingly, then fires off + // a new request. + // + // XXX This code may or may not have mem leaks depending on the version + // XXX stdurl that is in the tree at a given point in time. This needs to + // XXX be fixed once we have a solid version of std url in. + char *host = nsnull; + nsString2 hostStr; + rv = aURL->GetHost(&host); + if (NS_FAILED(rv)) return rv; + + hostStr.SetString(host); + nsAllocator::Free(host); + PRInt32 dotLoc = -1; + dotLoc = hostStr.Find('.'); + PRBool retry = PR_FALSE; + if (-1 == dotLoc) { + hostStr.Insert("www.", 0, 4); + hostStr.Append(".com"); + retry = PR_TRUE; + } else if ( (hostStr.Length() - dotLoc) == 3) { + hostStr.Insert("www.", 0, 4); + retry = PR_TRUE; + } + + if (retry) { + char *modHost = hostStr.ToNewCString(); + if (!modHost) + return NS_ERROR_OUT_OF_MEMORY; + rv = aURL->SetHost(modHost); + nsAllocator::Free(modHost); + modHost = nsnull; + if (NS_FAILED(rv)) return rv; + char *aSpec = nsnull; + rv = aURL->GetSpec(&aSpec); + if (NS_FAILED(rv)) return rv; + nsString2 newURL(aSpec); + // reload the url + //const PRUnichar *spec = newURL.GetUnicode(); + //if (spec) { + //rv = LoadURL(spec, "load"); + rv = DoLoadURL(newURL,"view", nsnull, nsIChannel::LOAD_NORMAL, 0); + //} + } // retry + } // unknown host +#endif //NECKO + } //!mProcessedEndDocumentLoad else { rv = NS_OK; @@ -3236,11 +3291,12 @@ nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader, NS_IMETHODIMP nsWebShell::OnEndURLLoad(nsIDocumentLoader* loader, #ifdef NECKO - nsIChannel* channel, + nsIChannel* channel, + nsresult aStatus) #else nsIURI* aURL, -#endif PRInt32 aStatus) +#endif // NECKO { #if 0 const char* spec; diff --git a/mozilla/editor/base/nsEditorShell.cpp b/mozilla/editor/base/nsEditorShell.cpp index d13b202ac62..ee4483b41e0 100644 --- a/mozilla/editor/base/nsEditorShell.cpp +++ b/mozilla/editor/base/nsEditorShell.cpp @@ -2897,7 +2897,7 @@ NS_IMETHODIMP nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus, nsIDocumentLoaderObserver * aObserver) #else -nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus, +nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus, nsIDocumentLoaderObserver * aObserver) #endif // NECKO { @@ -2955,7 +2955,7 @@ nsEditorShell::OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus) #else nsEditorShell::OnEndURLLoad(nsIDocumentLoader* loader, - nsIChannel* channel, PRInt32 aStatus) + nsIChannel* channel, nsresult aStatus) #endif // NECKO { return NS_OK; diff --git a/mozilla/editor/base/nsEditorShell.h b/mozilla/editor/base/nsEditorShell.h index d3bef5ab930..13bc408c1f6 100644 --- a/mozilla/editor/base/nsEditorShell.h +++ b/mozilla/editor/base/nsEditorShell.h @@ -239,7 +239,7 @@ class nsEditorShell : public nsIEditorShell, NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus, nsIDocumentLoaderObserver * aObserver); #else - NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus, + NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus, nsIDocumentLoaderObserver * aObserver); #endif // NECKO @@ -268,7 +268,7 @@ class nsEditorShell : public nsIEditorShell, #ifndef NECKO NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus); #else - NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus); + NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus); #endif // NECKO #ifndef NECKO diff --git a/mozilla/editor/composer/src/nsEditorShell.cpp b/mozilla/editor/composer/src/nsEditorShell.cpp index d13b202ac62..ee4483b41e0 100644 --- a/mozilla/editor/composer/src/nsEditorShell.cpp +++ b/mozilla/editor/composer/src/nsEditorShell.cpp @@ -2897,7 +2897,7 @@ NS_IMETHODIMP nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus, nsIDocumentLoaderObserver * aObserver) #else -nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus, +nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus, nsIDocumentLoaderObserver * aObserver) #endif // NECKO { @@ -2955,7 +2955,7 @@ nsEditorShell::OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus) #else nsEditorShell::OnEndURLLoad(nsIDocumentLoader* loader, - nsIChannel* channel, PRInt32 aStatus) + nsIChannel* channel, nsresult aStatus) #endif // NECKO { return NS_OK; diff --git a/mozilla/editor/composer/src/nsEditorShell.h b/mozilla/editor/composer/src/nsEditorShell.h index d3bef5ab930..13bc408c1f6 100644 --- a/mozilla/editor/composer/src/nsEditorShell.h +++ b/mozilla/editor/composer/src/nsEditorShell.h @@ -239,7 +239,7 @@ class nsEditorShell : public nsIEditorShell, NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus, nsIDocumentLoaderObserver * aObserver); #else - NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus, + NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus, nsIDocumentLoaderObserver * aObserver); #endif // NECKO @@ -268,7 +268,7 @@ class nsEditorShell : public nsIEditorShell, #ifndef NECKO NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus); #else - NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus); + NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus); #endif // NECKO #ifndef NECKO diff --git a/mozilla/uriloader/base/nsDocLoader.cpp b/mozilla/uriloader/base/nsDocLoader.cpp index c2ae0083eac..d4902cc74a2 100644 --- a/mozilla/uriloader/base/nsDocLoader.cpp +++ b/mozilla/uriloader/base/nsDocLoader.cpp @@ -269,7 +269,7 @@ public: nsIURI* aURL, const char* aCommand); void FireOnEndDocumentLoad(nsIDocumentLoader* aLoadInitiator, - PRInt32 aStatus); + nsresult aStatus); void FireOnStartURLLoad(nsIDocumentLoader* aLoadInitiator, @@ -300,7 +300,7 @@ public: #ifdef NECKO void FireOnEndURLLoad(nsIDocumentLoader* aLoadInitiator, - nsIChannel* channel, PRInt32 aStatus); + nsIChannel* channel, nsresult aStatus); #else void FireOnEndURLLoad(nsIDocumentLoader* aLoadInitiator, nsIURI* aURL, PRInt32 aStatus); @@ -308,7 +308,7 @@ public: #ifdef NECKO nsresult LoadURLComplete(nsIChannel* channel, nsISupports* ctxt, - nsISupports* aLoader, PRInt32 aStatus, + nsISupports* aLoader, nsresult aStatus, const PRUnichar* aMsg); #else nsresult LoadURLComplete(nsIURI* aURL, nsISupports* aLoader, PRInt32 aStatus); @@ -346,7 +346,7 @@ protected: void ChildDocLoaderFiredEndDocumentLoad(nsDocLoaderImpl* aChild, nsIDocumentLoader* aLoadInitiator, - PRInt32 aStatus); + nsresult aStatus); #ifndef NECKO private: @@ -1084,7 +1084,7 @@ void nsDocLoaderImpl::FireOnStartDocumentLoad(nsIDocumentLoader* aLoadInitiator, } void nsDocLoaderImpl::FireOnEndDocumentLoad(nsIDocumentLoader* aLoadInitiator, - PRInt32 aStatus) + nsresult aStatus) { PRInt32 count = mDocObservers.Count(); @@ -1134,7 +1134,7 @@ void nsDocLoaderImpl::FireOnEndDocumentLoad(nsIDocumentLoader* aLoadInitiator, void nsDocLoaderImpl::ChildDocLoaderFiredEndDocumentLoad(nsDocLoaderImpl* aChild, nsIDocumentLoader* aLoadInitiator, - PRInt32 aStatus) + nsresult aStatus) { PRBool busy; IsBusy(busy); @@ -1255,7 +1255,7 @@ void nsDocLoaderImpl::FireOnStatusURLLoad(nsIDocumentLoader* aLoadInitiator, #ifdef NECKO void nsDocLoaderImpl::FireOnEndURLLoad(nsIDocumentLoader* aLoadInitiator, - nsIChannel* channel, PRInt32 aStatus) + nsIChannel* channel, nsresult aStatus) #else void nsDocLoaderImpl::FireOnEndURLLoad(nsIDocumentLoader* aLoadInitiator, nsIURI* aURL, PRInt32 aStatus) @@ -1292,7 +1292,7 @@ void nsDocLoaderImpl::FireOnEndURLLoad(nsIDocumentLoader* aLoadInitiator, #ifdef NECKO nsresult nsDocLoaderImpl::LoadURLComplete(nsIChannel* channel, nsISupports* ctxt, - nsISupports* aBindInfo, PRInt32 aStatus, + nsISupports* aBindInfo, nsresult aStatus, const PRUnichar* aMsg) #else nsresult nsDocLoaderImpl::LoadURLComplete(nsIURI* aURL, nsISupports* aBindInfo, PRInt32 aStatus) @@ -2073,7 +2073,7 @@ done: NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult aStatus, const PRUnichar *aMsg) #else -NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg) +NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIURI* aURL, PRInt32 aStatus, const PRUnichar* aMsg) #endif { nsresult rv = NS_OK; @@ -2162,59 +2162,6 @@ NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIURI* aURL, nsresult aStatus, cons #endif NS_IF_RELEASE(m_NextStream); -#ifdef NECKO - if (aStatus == NS_ERROR_UNKNOWN_HOST) { - // We need to check for a dns failure in aStatus, but dns failure codes - // aren't proliferated yet. This checks for failure for a host lacking - // "www." and/or ".com" and munges the url acordingly, then fires off - // a new request. - // - // XXX This code may or may not have mem leaks depending on the version - // XXX stdurl that is in the tree at a given point in time. This needs to - // XXX be fixed once we have a solid version of std url in. - char *host = nsnull; - nsString2 hostStr; - rv = aURL->GetHost(&host); - if (NS_FAILED(rv)) return rv; - - hostStr.SetString(host); - PRInt32 dotLoc = -1; - dotLoc = hostStr.Find('.'); - PRBool retry = PR_FALSE; - if (-1 == dotLoc) { - hostStr.Insert("www.", 0, 4); - hostStr.Append(".com"); - retry = PR_TRUE; - } else if ( (hostStr.Length() - dotLoc) == 3) { - hostStr.Insert("www.", 0, 4); - retry = PR_TRUE; - } - - if (retry) { - char *modHost = hostStr.ToNewCString(); - if (!modHost) - return NS_ERROR_OUT_OF_MEMORY; - rv = aURL->SetHost(modHost); - delete [] modHost; - modHost = nsnull; - if (NS_FAILED(rv)) return rv; - char *aSpec = nsnull; - rv = aURL->GetSpec(&aSpec); - if (NS_FAILED(rv)) return rv; - nsString2 newURL(aSpec); - - return m_DocLoader->LoadDocument(newURL, - m_Command, - m_Container, - nsnull, // XXX need to pass post data along - m_ExtraInfo, - m_Observer, - nsIChannel::LOAD_NORMAL, - 0); - } - } -#endif // NECKO - return rv; } diff --git a/mozilla/webshell/embed/ActiveX/WebShellContainer.cpp b/mozilla/webshell/embed/ActiveX/WebShellContainer.cpp index 74780971936..e909be4a7bd 100644 --- a/mozilla/webshell/embed/ActiveX/WebShellContainer.cpp +++ b/mozilla/webshell/embed/ActiveX/WebShellContainer.cpp @@ -526,7 +526,7 @@ CWebShellContainer::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, // we need this to fire the document complete NS_IMETHODIMP -CWebShellContainer::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel *aChannel, PRInt32 aStatus, nsIDocumentLoaderObserver * aObserver) +CWebShellContainer::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel *aChannel, nsresult aStatus, nsIDocumentLoaderObserver * aObserver) { char* aString = nsnull; nsIURI* uri = nsnull; @@ -647,7 +647,7 @@ CWebShellContainer::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, // we need this to fire the document complete NS_IMETHODIMP -CWebShellContainer::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus, nsIDocumentLoaderObserver * aObserver) +CWebShellContainer::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, nsresult aStatus, nsIDocumentLoaderObserver * aObserver) { PRUnichar* wString = nsnull; @@ -691,7 +691,7 @@ CWebShellContainer::OnStatusURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, nsS NS_IMETHODIMP -CWebShellContainer::OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus) +CWebShellContainer::OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, nsresult aStatus) { return NS_OK; } diff --git a/mozilla/webshell/embed/ActiveX/WebShellContainer.h b/mozilla/webshell/embed/ActiveX/WebShellContainer.h index ab5414edb96..d5082ffdcf5 100644 --- a/mozilla/webshell/embed/ActiveX/WebShellContainer.h +++ b/mozilla/webshell/embed/ActiveX/WebShellContainer.h @@ -96,11 +96,11 @@ public: // nsIDocumentLoaderObserver NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand); - NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus, nsIDocumentLoaderObserver* aObserver); + NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus, nsIDocumentLoaderObserver* aObserver); NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsIContentViewer* aViewer); NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRUint32 aProgress, PRUint32 aProgressMax); NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsString& aMsg); - NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus); + NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus); NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader, nsIChannel* channel, const char *aContentType,const char *aCommand ); #else // nsIStreamObserver diff --git a/mozilla/webshell/public/nsIDocumentLoaderObserver.h b/mozilla/webshell/public/nsIDocumentLoaderObserver.h index ef8793349ae..449d1df954e 100644 --- a/mozilla/webshell/public/nsIDocumentLoaderObserver.h +++ b/mozilla/webshell/public/nsIDocumentLoaderObserver.h @@ -55,7 +55,7 @@ public: * Notify the observer that a document has been completely loaded. */ #ifdef NECKO - NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus, + NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus, nsIDocumentLoaderObserver * aObserver) = 0; #else NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus, @@ -104,7 +104,7 @@ public: * Notify the observer that the specified nsIURI has finished loading. */ #ifdef NECKO - NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus) = 0; + NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus) = 0; #else NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus) = 0; #endif diff --git a/mozilla/webshell/public/nsIWebShell.h b/mozilla/webshell/public/nsIWebShell.h index 9c0d6fbd081..89afb0ab260 100644 --- a/mozilla/webshell/public/nsIWebShell.h +++ b/mozilla/webshell/public/nsIWebShell.h @@ -92,7 +92,7 @@ public: NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, - PRInt32 aStatus) = 0; + nsresult aStatus) = 0; //instances diff --git a/mozilla/webshell/src/nsDocLoader.cpp b/mozilla/webshell/src/nsDocLoader.cpp index c2ae0083eac..d4902cc74a2 100644 --- a/mozilla/webshell/src/nsDocLoader.cpp +++ b/mozilla/webshell/src/nsDocLoader.cpp @@ -269,7 +269,7 @@ public: nsIURI* aURL, const char* aCommand); void FireOnEndDocumentLoad(nsIDocumentLoader* aLoadInitiator, - PRInt32 aStatus); + nsresult aStatus); void FireOnStartURLLoad(nsIDocumentLoader* aLoadInitiator, @@ -300,7 +300,7 @@ public: #ifdef NECKO void FireOnEndURLLoad(nsIDocumentLoader* aLoadInitiator, - nsIChannel* channel, PRInt32 aStatus); + nsIChannel* channel, nsresult aStatus); #else void FireOnEndURLLoad(nsIDocumentLoader* aLoadInitiator, nsIURI* aURL, PRInt32 aStatus); @@ -308,7 +308,7 @@ public: #ifdef NECKO nsresult LoadURLComplete(nsIChannel* channel, nsISupports* ctxt, - nsISupports* aLoader, PRInt32 aStatus, + nsISupports* aLoader, nsresult aStatus, const PRUnichar* aMsg); #else nsresult LoadURLComplete(nsIURI* aURL, nsISupports* aLoader, PRInt32 aStatus); @@ -346,7 +346,7 @@ protected: void ChildDocLoaderFiredEndDocumentLoad(nsDocLoaderImpl* aChild, nsIDocumentLoader* aLoadInitiator, - PRInt32 aStatus); + nsresult aStatus); #ifndef NECKO private: @@ -1084,7 +1084,7 @@ void nsDocLoaderImpl::FireOnStartDocumentLoad(nsIDocumentLoader* aLoadInitiator, } void nsDocLoaderImpl::FireOnEndDocumentLoad(nsIDocumentLoader* aLoadInitiator, - PRInt32 aStatus) + nsresult aStatus) { PRInt32 count = mDocObservers.Count(); @@ -1134,7 +1134,7 @@ void nsDocLoaderImpl::FireOnEndDocumentLoad(nsIDocumentLoader* aLoadInitiator, void nsDocLoaderImpl::ChildDocLoaderFiredEndDocumentLoad(nsDocLoaderImpl* aChild, nsIDocumentLoader* aLoadInitiator, - PRInt32 aStatus) + nsresult aStatus) { PRBool busy; IsBusy(busy); @@ -1255,7 +1255,7 @@ void nsDocLoaderImpl::FireOnStatusURLLoad(nsIDocumentLoader* aLoadInitiator, #ifdef NECKO void nsDocLoaderImpl::FireOnEndURLLoad(nsIDocumentLoader* aLoadInitiator, - nsIChannel* channel, PRInt32 aStatus) + nsIChannel* channel, nsresult aStatus) #else void nsDocLoaderImpl::FireOnEndURLLoad(nsIDocumentLoader* aLoadInitiator, nsIURI* aURL, PRInt32 aStatus) @@ -1292,7 +1292,7 @@ void nsDocLoaderImpl::FireOnEndURLLoad(nsIDocumentLoader* aLoadInitiator, #ifdef NECKO nsresult nsDocLoaderImpl::LoadURLComplete(nsIChannel* channel, nsISupports* ctxt, - nsISupports* aBindInfo, PRInt32 aStatus, + nsISupports* aBindInfo, nsresult aStatus, const PRUnichar* aMsg) #else nsresult nsDocLoaderImpl::LoadURLComplete(nsIURI* aURL, nsISupports* aBindInfo, PRInt32 aStatus) @@ -2073,7 +2073,7 @@ done: NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIChannel* channel, nsISupports *ctxt, nsresult aStatus, const PRUnichar *aMsg) #else -NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg) +NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIURI* aURL, PRInt32 aStatus, const PRUnichar* aMsg) #endif { nsresult rv = NS_OK; @@ -2162,59 +2162,6 @@ NS_METHOD nsDocumentBindInfo::OnStopRequest(nsIURI* aURL, nsresult aStatus, cons #endif NS_IF_RELEASE(m_NextStream); -#ifdef NECKO - if (aStatus == NS_ERROR_UNKNOWN_HOST) { - // We need to check for a dns failure in aStatus, but dns failure codes - // aren't proliferated yet. This checks for failure for a host lacking - // "www." and/or ".com" and munges the url acordingly, then fires off - // a new request. - // - // XXX This code may or may not have mem leaks depending on the version - // XXX stdurl that is in the tree at a given point in time. This needs to - // XXX be fixed once we have a solid version of std url in. - char *host = nsnull; - nsString2 hostStr; - rv = aURL->GetHost(&host); - if (NS_FAILED(rv)) return rv; - - hostStr.SetString(host); - PRInt32 dotLoc = -1; - dotLoc = hostStr.Find('.'); - PRBool retry = PR_FALSE; - if (-1 == dotLoc) { - hostStr.Insert("www.", 0, 4); - hostStr.Append(".com"); - retry = PR_TRUE; - } else if ( (hostStr.Length() - dotLoc) == 3) { - hostStr.Insert("www.", 0, 4); - retry = PR_TRUE; - } - - if (retry) { - char *modHost = hostStr.ToNewCString(); - if (!modHost) - return NS_ERROR_OUT_OF_MEMORY; - rv = aURL->SetHost(modHost); - delete [] modHost; - modHost = nsnull; - if (NS_FAILED(rv)) return rv; - char *aSpec = nsnull; - rv = aURL->GetSpec(&aSpec); - if (NS_FAILED(rv)) return rv; - nsString2 newURL(aSpec); - - return m_DocLoader->LoadDocument(newURL, - m_Command, - m_Container, - nsnull, // XXX need to pass post data along - m_ExtraInfo, - m_Observer, - nsIChannel::LOAD_NORMAL, - 0); - } - } -#endif // NECKO - return rv; } diff --git a/mozilla/webshell/src/nsWebShell.cpp b/mozilla/webshell/src/nsWebShell.cpp index b2c315c0a4d..3b9f40f845c 100644 --- a/mozilla/webshell/src/nsWebShell.cpp +++ b/mozilla/webshell/src/nsWebShell.cpp @@ -269,7 +269,7 @@ public: NS_IMETHOD WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsLoadType aReason); NS_IMETHOD BeginLoadURL(nsIWebShell* aShell, const PRUnichar* aURL); NS_IMETHOD ProgressLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aProgress, PRInt32 aProgressMax); - NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus); + NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsresult aStatus); NS_IMETHOD NewWebShell(PRUint32 aChromeMask, PRBool aVisible, nsIWebShell *&aNewWebShell); @@ -314,7 +314,7 @@ public: const char* aCommand); NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, - PRInt32 aStatus, + nsresult aStatus, nsIDocumentLoaderObserver * ); NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, @@ -325,7 +325,7 @@ public: NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsString& aMsg); NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, - nsIChannel* channel, PRInt32 aStatus); + nsIChannel* channel, nsresult aStatus); NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader, nsIChannel* channel, const char *aContentType, @@ -2479,7 +2479,7 @@ nsWebShell::ProgressLoadURL(nsIWebShell* aShell, } NS_IMETHODIMP -nsWebShell::EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus) +nsWebShell::EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsresult aStatus) { nsresult rv = NS_OK; if (nsnull != mContainer) { @@ -3036,7 +3036,11 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader, #else nsIURI* aURL, #endif - PRInt32 aStatus, +#ifdef NECKO + nsresult aStatus, +#else + PRInt32 aStatus, +#endif nsIDocumentLoaderObserver * aWebShell) { nsresult rv = NS_ERROR_FAILURE; @@ -3121,6 +3125,57 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader, #endif } +#ifdef NECKO + if ( (mDocLoader == loader) && (aStatus == NS_ERROR_UNKNOWN_HOST) ) { + // We need to check for a dns failure in aStatus, but dns failure codes + // aren't proliferated yet. This checks for failure for a host lacking + // "www." and/or ".com" and munges the url acordingly, then fires off + // a new request. + // + // XXX This code may or may not have mem leaks depending on the version + // XXX stdurl that is in the tree at a given point in time. This needs to + // XXX be fixed once we have a solid version of std url in. + char *host = nsnull; + nsString2 hostStr; + rv = aURL->GetHost(&host); + if (NS_FAILED(rv)) return rv; + + hostStr.SetString(host); + nsAllocator::Free(host); + PRInt32 dotLoc = -1; + dotLoc = hostStr.Find('.'); + PRBool retry = PR_FALSE; + if (-1 == dotLoc) { + hostStr.Insert("www.", 0, 4); + hostStr.Append(".com"); + retry = PR_TRUE; + } else if ( (hostStr.Length() - dotLoc) == 3) { + hostStr.Insert("www.", 0, 4); + retry = PR_TRUE; + } + + if (retry) { + char *modHost = hostStr.ToNewCString(); + if (!modHost) + return NS_ERROR_OUT_OF_MEMORY; + rv = aURL->SetHost(modHost); + nsAllocator::Free(modHost); + modHost = nsnull; + if (NS_FAILED(rv)) return rv; + char *aSpec = nsnull; + rv = aURL->GetSpec(&aSpec); + if (NS_FAILED(rv)) return rv; + nsString2 newURL(aSpec); + // reload the url + //const PRUnichar *spec = newURL.GetUnicode(); + //if (spec) { + //rv = LoadURL(spec, "load"); + rv = DoLoadURL(newURL,"view", nsnull, nsIChannel::LOAD_NORMAL, 0); + //} + } // retry + } // unknown host +#endif //NECKO + } //!mProcessedEndDocumentLoad else { rv = NS_OK; @@ -3236,11 +3291,12 @@ nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader, NS_IMETHODIMP nsWebShell::OnEndURLLoad(nsIDocumentLoader* loader, #ifdef NECKO - nsIChannel* channel, + nsIChannel* channel, + nsresult aStatus) #else nsIURI* aURL, -#endif PRInt32 aStatus) +#endif // NECKO { #if 0 const char* spec; diff --git a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp index edc18b14e9d..6f04bf3f468 100644 --- a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp +++ b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp @@ -1742,7 +1742,7 @@ nsBrowserWindow::ProgressLoadURL(nsIWebShell* aShell, NS_IMETHODIMP nsBrowserWindow::EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, - PRInt32 aStatus) + nsresult aStatus) { if (aShell == mWebShell) { PRTime endLoadTime = PR_Now(); diff --git a/mozilla/webshell/tests/viewer/nsBrowserWindow.h b/mozilla/webshell/tests/viewer/nsBrowserWindow.h index 12c602a1fb8..1cca2ff2ddf 100644 --- a/mozilla/webshell/tests/viewer/nsBrowserWindow.h +++ b/mozilla/webshell/tests/viewer/nsBrowserWindow.h @@ -132,7 +132,7 @@ public: NS_IMETHOD WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsLoadType aReason); NS_IMETHOD BeginLoadURL(nsIWebShell* aShell, const PRUnichar* aURL); NS_IMETHOD ProgressLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aProgress, PRInt32 aProgressMax); - NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus); + NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsresult aStatus); NS_IMETHOD NewWebShell(PRUint32 aChromeMask, PRBool aVisible, nsIWebShell *&aNewWebShell); diff --git a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp index 096c2777cd9..96cda27a964 100644 --- a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp +++ b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp @@ -212,7 +212,7 @@ NS_IMETHODIMP #ifdef NECKO nsWebCrawler::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, - PRInt32 aStatus, + nsresult aStatus, nsIDocumentLoaderObserver* aObserver) #else nsWebCrawler::OnEndDocumentLoad(nsIDocumentLoader* loader, @@ -370,7 +370,7 @@ nsWebCrawler::OnStatusURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, NS_IMETHODIMP #ifdef NECKO nsWebCrawler::OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, - PRInt32 aStatus) + nsresult aStatus) #else nsWebCrawler::OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus) diff --git a/mozilla/webshell/tests/viewer/nsWebCrawler.h b/mozilla/webshell/tests/viewer/nsWebCrawler.h index 9e7448d888e..356c4ca25d8 100644 --- a/mozilla/webshell/tests/viewer/nsWebCrawler.h +++ b/mozilla/webshell/tests/viewer/nsWebCrawler.h @@ -45,11 +45,11 @@ public: // nsIDocumentLoaderObserver #ifdef NECKO NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand); - NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus, nsIDocumentLoaderObserver* aObserver); + NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus, nsIDocumentLoaderObserver* aObserver); NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsIContentViewer* aViewer); NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRUint32 aProgress, PRUint32 aProgressMax); NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsString& aMsg); - NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus); + NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus); NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader, nsIChannel* channel, const char *aContentType,const char *aCommand ); #else NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, diff --git a/mozilla/webshell/tests/viewer/nsXPBaseWindow.cpp b/mozilla/webshell/tests/viewer/nsXPBaseWindow.cpp index 6552f672b2b..44a4699c691 100644 --- a/mozilla/webshell/tests/viewer/nsXPBaseWindow.cpp +++ b/mozilla/webshell/tests/viewer/nsXPBaseWindow.cpp @@ -414,7 +414,7 @@ NS_IMETHODIMP nsXPBaseWindow::ProgressLoadURL(nsIWebShell* aShell, const PRUnich } //----------------------------------------------------------------- -NS_IMETHODIMP nsXPBaseWindow::EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus) +NS_IMETHODIMP nsXPBaseWindow::EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsresult aStatus) { // Find the Root Conent Node for this Window nsIPresShell* shell; diff --git a/mozilla/webshell/tests/viewer/nsXPBaseWindow.h b/mozilla/webshell/tests/viewer/nsXPBaseWindow.h index f682480cee8..c6c2612d951 100644 --- a/mozilla/webshell/tests/viewer/nsXPBaseWindow.h +++ b/mozilla/webshell/tests/viewer/nsXPBaseWindow.h @@ -106,7 +106,7 @@ public: NS_IMETHOD WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsLoadType aReason); NS_IMETHOD BeginLoadURL(nsIWebShell* aShell, const PRUnichar* aURL); NS_IMETHOD ProgressLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aProgress, PRInt32 aProgressMax); - NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus); + NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsresult aStatus); NS_IMETHOD NewWebShell(PRUint32 aChromeMask, PRBool aVisible, nsIWebShell *&aNewWebShell); diff --git a/mozilla/xpfe/AppCores/src/nsBrowserAppCore.cpp b/mozilla/xpfe/AppCores/src/nsBrowserAppCore.cpp index 9dc399a3694..607cd27860e 100644 --- a/mozilla/xpfe/AppCores/src/nsBrowserAppCore.cpp +++ b/mozilla/xpfe/AppCores/src/nsBrowserAppCore.cpp @@ -1126,7 +1126,7 @@ nsBrowserAppCore::OnStartDocumentLoad(nsIDocumentLoader* aLoader, nsIURI* aURL, NS_IMETHODIMP #ifdef NECKO -nsBrowserAppCore::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIChannel* channel, PRInt32 aStatus, +nsBrowserAppCore::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIChannel* channel, nsresult aStatus, nsIDocumentLoaderObserver * aObserver) #else nsBrowserAppCore::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIURI *aUrl, PRInt32 aStatus, @@ -1384,7 +1384,7 @@ nsBrowserAppCore::OnStatusURLLoad(nsIDocumentLoader* loader, NS_IMETHODIMP #ifdef NECKO nsBrowserAppCore::OnEndURLLoad(nsIDocumentLoader* loader, - nsIChannel* channel, PRInt32 aStatus) + nsIChannel* channel, nsresult aStatus) #else nsBrowserAppCore::OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus) diff --git a/mozilla/xpfe/AppCores/src/nsBrowserAppCore.h b/mozilla/xpfe/AppCores/src/nsBrowserAppCore.h index 7030b6afc9d..7211393c5c7 100644 --- a/mozilla/xpfe/AppCores/src/nsBrowserAppCore.h +++ b/mozilla/xpfe/AppCores/src/nsBrowserAppCore.h @@ -109,11 +109,11 @@ class nsBrowserAppCore : public nsBaseAppCore, // nsIDocumentLoaderObserver #ifdef NECKO NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand); - NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus, nsIDocumentLoaderObserver* aObserver); + NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus, nsIDocumentLoaderObserver* aObserver); NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsIContentViewer* aViewer); NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRUint32 aProgress, PRUint32 aProgressMax); NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsString& aMsg); - NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus); + NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus); NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader, nsIChannel* channel, const char *aContentType,const char *aCommand ); #else NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand); diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp index 459a281bb4d..27e905fc2b5 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp @@ -551,7 +551,7 @@ nsWebShellWindow::ProgressLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, NS_IMETHODIMP nsWebShellWindow::EndLoadURL(nsIWebShell* aWebShell, const PRUnichar* aURL, - PRInt32 aStatus) + nsresult aStatus) { return NS_OK; } @@ -1779,7 +1779,7 @@ nsWebShellWindow::OnStartDocumentLoad(nsIDocumentLoader* loader, NS_IMETHODIMP #ifdef NECKO nsWebShellWindow::OnEndDocumentLoad(nsIDocumentLoader* loader, - nsIChannel* channel, PRInt32 aStatus, + nsIChannel* channel, nsresult aStatus, nsIDocumentLoaderObserver * aDocObserver) #else nsWebShellWindow::OnEndDocumentLoad(nsIDocumentLoader* loader, @@ -1917,7 +1917,7 @@ nsWebShellWindow::OnStatusURLLoad(nsIDocumentLoader* loader, NS_IMETHODIMP #ifdef NECKO nsWebShellWindow::OnEndURLLoad(nsIDocumentLoader* loader, - nsIChannel* channel, PRInt32 aStatus) + nsIChannel* channel, nsresult aStatus) #else nsWebShellWindow::OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus) diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.h b/mozilla/xpfe/appshell/src/nsWebShellWindow.h index 2f07337659a..e8ac91e26e1 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.h +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.h @@ -89,7 +89,7 @@ public: NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, - PRInt32 aStatus); + nsresult aStatus); NS_IMETHOD CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupContent, @@ -147,11 +147,11 @@ public: // nsIDocumentLoaderObserver #ifdef NECKO NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand); - NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus, nsIDocumentLoaderObserver* aObserver); + NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus, nsIDocumentLoaderObserver* aObserver); NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsIContentViewer* aViewer); NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRUint32 aProgress, PRUint32 aProgressMax); NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsString& aMsg); - NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus); + NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus); NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader, nsIChannel* channel, const char *aContentType,const char *aCommand ); #else NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,