Added channel argument to nsIStreamObserver/nsIStreamListener/nsIProgressEventSink methods.

This commit is contained in:
warren%netscape.com 1999-07-07 08:19:38 +00:00
parent 3c47cbe1b2
commit 0efef3c3f9
3 changed files with 12 additions and 79 deletions

View File

@ -38,9 +38,7 @@
#include "nsISupportsArray.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#include "nsNeckoUtil.h"
#endif // NECKO
#include "nsFrame.h"
#include "nsIPresShell.h"
@ -1212,27 +1210,12 @@ nsGenericElement::TriggerLink(nsIPresContext& aPresContext,
// Resolve url to an absolute url
nsAutoString absURLSpec;
if (nsnull != aBaseURL) {
nsString empty;
#ifndef NECKO
nsString empty;
NS_MakeAbsoluteURL(aBaseURL, empty, aURLSpec, absURLSpec);
#else
nsresult rv;
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return;
nsIURI *baseUri = nsnull;
rv = aBaseURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
if (NS_FAILED(rv)) return;
char *absUrl = nsnull;
char *uriStr = aURLSpec.ToNewCString();
if (!uriStr) return NS_ERROR_OUT_OF_MEMORY;
rv = service->MakeAbsolute(uriStr, baseUri, &absUrl);
nsCRT::free(uriStr);
NS_RELEASE(baseUri);
if (NS_FAILED(rv)) return;
absURLSpec = absUrl;
delete [] absUrl;
rv = NS_MakeAbsoluteURI(aURLSpec, aBaseURL, absURLSpec);
NS_ASSERTION(NS_SUCCEEDED(rv), "XXX make this function return an nsresult, like it should!");
#endif // NECKO
}
else {

View File

@ -38,9 +38,7 @@
#include "nsISupportsArray.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#include "nsNeckoUtil.h"
#endif // NECKO
#include "nsFrame.h"
#include "nsIPresShell.h"
@ -1212,27 +1210,12 @@ nsGenericElement::TriggerLink(nsIPresContext& aPresContext,
// Resolve url to an absolute url
nsAutoString absURLSpec;
if (nsnull != aBaseURL) {
nsString empty;
#ifndef NECKO
nsString empty;
NS_MakeAbsoluteURL(aBaseURL, empty, aURLSpec, absURLSpec);
#else
nsresult rv;
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return;
nsIURI *baseUri = nsnull;
rv = aBaseURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
if (NS_FAILED(rv)) return;
char *absUrl = nsnull;
char *uriStr = aURLSpec.ToNewCString();
if (!uriStr) return NS_ERROR_OUT_OF_MEMORY;
rv = service->MakeAbsolute(uriStr, baseUri, &absUrl);
nsCRT::free(uriStr);
NS_RELEASE(baseUri);
if (NS_FAILED(rv)) return;
absURLSpec = absUrl;
delete [] absUrl;
rv = NS_MakeAbsoluteURI(aURLSpec, aBaseURL, absURLSpec);
NS_ASSERTION(NS_SUCCEEDED(rv), "XXX make this function return an nsresult, like it should!");
#endif // NECKO
}
else {

View File

@ -31,10 +31,7 @@
#include "nsIFrame.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#include "nsNeckoUtil.h"
#endif // NECKO
#include "nsITimer.h"
#include "nsIAtom.h"
@ -592,16 +589,7 @@ nsWebCrawler::OkToLoad(const nsString& aURLSpec)
#ifndef NECKO
rv = NS_NewURL(&url, aURLSpec);
#else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
nsIURI *uri = nsnull;
const char *uriStr = aURLSpec.GetBuffer();
rv = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(rv)) return rv;
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
rv = NS_NewURI(&url, aURLSpec);
#endif // NECKO
if (NS_OK == rv) {
@ -673,34 +661,13 @@ nsWebCrawler::FindURLsIn(nsIDocument* aDocument, nsIContent* aNode)
else {
aNode->GetAttribute(kNameSpaceID_HTML, mSrcAttr, src);
}
aNode->GetAttribute(kNameSpaceID_HTML, mBaseHrefAttr, base);/* XXX not public knowledge! */
nsIURI* docURL = aDocument->GetDocumentURL();
nsresult rv;
#ifndef NECKO
aNode->GetAttribute(kNameSpaceID_HTML, mBaseHrefAttr, base);/* XXX not public knowledge! */
rv = NS_MakeAbsoluteURL(docURL, base, src, absURLSpec);
#else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return;
nsIURI *baseUri = nsnull;
if (base.Length() > 0) {
char *uriStr = base.ToNewCString();
if (!uriStr) return NS_ERROR_OUT_OF_MEMORY;
rv = service->NewURI(uriStr, nsnull, &baseUri);
nsCRT::free(uriStr);
} else {
rv = docURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
}
if (NS_FAILED(rv)) return;
char *absUrlStr = nsnull;
char *urlSpec = src.ToNewCString();
if (!urlSpec) return NS_ERROR_OUT_OF_MEMORY;
rv = service->MakeAbsolute(urlSpec, baseUri, &absUrlStr);
NS_RELEASE(baseUri);
absURLSpec = absUrlStr;
delete [] absUrlStr;
rv = NS_MakeAbsoluteURI(src, docURL, absURLSpec);
#endif // NECKO
if (NS_OK == rv) {
nsIAtom* urlAtom = NS_NewAtom(absURLSpec);