Renamed nsIURL to nsIURI in preperation for necko. More NECKO ifdefs too.

This commit is contained in:
warren@netscape.com
1999-06-23 03:29:44 +00:00
parent 7643979eb8
commit 753ac43fff
301 changed files with 5804 additions and 1911 deletions

View File

@@ -22,7 +22,7 @@
#include "nsString.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsIIOService.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
@@ -85,14 +85,14 @@ public:
NS_IMETHOD EndContext(PRInt32 aPosition){ return NS_OK; }
// nsIRobotSink
NS_IMETHOD Init(nsIURL* aDocumentURL);
NS_IMETHOD Init(nsIURI* aDocumentURL);
NS_IMETHOD AddObserver(nsIRobotSinkObserver* aObserver);
NS_IMETHOD RemoveObserver(nsIRobotSinkObserver* aObserver);
void ProcessLink(const nsString& aLink);
protected:
nsIURL* mDocumentURL;
nsIURI* mDocumentURL;
nsVoidArray mObservers;
};
@@ -286,7 +286,7 @@ NS_IMETHODIMP RobotSink::AddProcessingInstruction(const nsIParserNode& aNode) {
return result;
}
NS_IMETHODIMP RobotSink::Init(nsIURL* aDocumentURL)
NS_IMETHODIMP RobotSink::Init(nsIURI* aDocumentURL)
{
NS_IF_RELEASE(mDocumentURL);
mDocumentURL = aDocumentURL;
@@ -319,9 +319,9 @@ void RobotSink::ProcessLink(const nsString& aLink)
// Make link absolute
// XXX base tag handling
nsIURL* docURL = mDocumentURL;
nsIURI* docURL = mDocumentURL;
if (nsnull != docURL) {
nsIURL* absurl;
nsIURI* absurl;
nsresult rv;
#ifndef NECKO
rv = NS_NewURL(&absurl, aLink, docURL);
@@ -339,17 +339,24 @@ void RobotSink::ProcessLink(const nsString& aLink)
NS_RELEASE(baseUri);
if (NS_FAILED(rv)) return;
rv = uri->QueryInterface(nsIURL::GetIID(), (void**)&absurl);
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&absurl);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK == rv) {
absURLSpec.Truncate();
#ifdef NECKO
char* str;
absurl->GetSpec(&str);
absURLSpec = str;
nsCRT::free(str);
#else
PRUnichar* str;
absurl->ToString(&str);
absURLSpec = str;
NS_RELEASE(absurl);
delete str;
#endif
}
}