Removed unused NECKO ifdefs.

a=leaf


git-svn-id: svn://10.0.0.236/trunk@52607 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cls%seawood.org 1999-11-02 23:34:03 +00:00
parent e1ba1048c5
commit 3e1a9ca95a
162 changed files with 6 additions and 4709 deletions

View File

@ -29,9 +29,7 @@
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
static NS_DEFINE_CID(kGenericFactoryCID, NS_GENERICFACTORY_CID);
static NS_DEFINE_CID(kChromeRegistryCID, NS_CHROMEREGISTRY_CID);
#ifdef NECKO
static NS_DEFINE_CID(kChromeProtocolHandlerCID, NS_CHROMEPROTOCOLHANDLER_CID);
#endif
static NS_IMETHODIMP
NS_ConstructChromeRegistry(nsISupports *aOuter, REFNSIID aIID, void **aResult)

View File

@ -16,8 +16,6 @@
* Reserved.
*/
#ifdef NECKO
#include "nsChromeProtocolHandler.h"
#include "nsCRT.h"
#include "nsIComponentManager.h"
@ -191,4 +189,3 @@ nsChromeProtocolHandler::NewChannel(const char* verb, nsIURI* uri,
}
////////////////////////////////////////////////////////////////////////////////
#endif // NECKO

View File

@ -90,12 +90,8 @@ public:
virtual nsIArena* GetArena() = 0;
NS_IMETHOD StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aUrl,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener) = 0;

View File

@ -21,12 +21,8 @@
#include "nsDocument.h"
#include "nsIArena.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsILoadGroup.h"
#include "nsIChannel.h"
#else
#include "nsIURLGroup.h"
#endif
#include "nsString.h"
#include "nsIContent.h"
#include "nsIDocumentObserver.h"
@ -769,11 +765,7 @@ nsIArena* nsDocument::GetArena()
}
nsresult
#ifdef NECKO
nsDocument::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup)
#else
nsDocument::Reset(nsIURI *aURL)
#endif
{
nsresult rv = NS_OK;
@ -846,20 +838,12 @@ nsDocument::Reset(nsIURI *aURL)
nsresult
nsDocument::StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aURL,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener)
{
#ifdef NECKO
return Reset(aChannel, aLoadGroup);
#else
return Reset(aURL);
#endif
}
const nsString* nsDocument::GetDocumentTitle() const

View File

@ -117,12 +117,8 @@ public:
virtual nsIArena* GetArena();
NS_IMETHOD StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aUrl,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener);
@ -427,11 +423,7 @@ protected:
nsIContent* FindContent(const nsIContent* aStartNode,
const nsIContent* aTest1,
const nsIContent* aTest2) const;
#ifdef NECKO
virtual nsresult Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup);
#else
virtual nsresult Reset(nsIURI* aURL);
#endif
// this enum is temporary; there should be no knowledge of HTML in
// nsDocument. That will be fixed when content sink stream factories

View File

@ -37,9 +37,7 @@
#include "nsISizeOfHandler.h"
#include "nsISupportsArray.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#endif // NECKO
#include "nsFrame.h"
#include "nsIPresShell.h"
#include "nsIView.h"
@ -1248,13 +1246,8 @@ nsGenericElement::TriggerLink(nsIPresContext& aPresContext,
// Resolve url to an absolute url
nsAutoString absURLSpec;
if (nsnull != aBaseURL) {
#ifndef NECKO
nsString empty;
NS_MakeAbsoluteURL(aBaseURL, empty, aURLSpec, absURLSpec);
#else
rv = NS_MakeAbsoluteURI(aURLSpec, aBaseURL, absURLSpec);
NS_ASSERTION(NS_SUCCEEDED(rv), "XXX make this function return an nsresult, like it should!");
#endif // NECKO
}
else {
absURLSpec = aURLSpec;

View File

@ -44,11 +44,7 @@
#include "nsIStyleRule.h"
#include "nsISupportsArray.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#else
#include "nsIURLGroup.h"
#endif // NECKO
#include "nsStyleConsts.h"
#include "nsXIFConverter.h"
#include "nsFrame.h"
@ -1071,21 +1067,8 @@ nsGenericHTMLElement::GetBaseURL(const nsHTMLValue& aBaseHref,
aBaseHref.GetStringValue(baseHref);
nsIURI* url = nsnull;
#ifndef NECKO
nsILoadGroup* LoadGroup = nsnull;
docBaseURL->GetLoadGroup(&LoadGroup);
if (LoadGroup) {
result = LoadGroup->CreateURL(&url, docBaseURL, baseHref, nsnull);
NS_RELEASE(LoadGroup);
}
else
#endif
{
#ifndef NECKO
result = NS_NewURL(&url, baseHref, docBaseURL);
#else
result = NS_NewURI(&url, baseHref, docBaseURL);
#endif // NECKO
}
NS_IF_RELEASE(docBaseURL);
*aBaseURL = url;
@ -2272,11 +2255,7 @@ nsGenericHTMLElement::MapBackgroundAttributesInto(const nsIHTMLMappedAttributes*
aAttributes->GetAttribute(nsHTMLAtoms::_baseHref, baseHref);
nsGenericHTMLElement::GetBaseURL(baseHref, doc,
getter_AddRefs(docURL));
#ifndef NECKO
rv = NS_MakeAbsoluteURL(docURL, "", spec, absURLSpec);
#else
rv = NS_MakeAbsoluteURI(spec, docURL, absURLSpec);
#endif // NECKO
if (NS_SUCCEEDED(rv)) {
nsStyleColor* color = (nsStyleColor*)
aContext->GetMutableStyleData(eStyleStruct_Color);

View File

@ -38,13 +38,11 @@
#include "nsIScriptContext.h"
#include "nsIScriptGlobalObject.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsNeckoUtil.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
// XXX nav attrs: suppress
@ -535,11 +533,7 @@ nsHTMLImageElement::SetSrc(const nsString& aSrc)
empty.Truncate();
result = mOwnerDocument->GetBaseURL(baseURL);
if (NS_SUCCEEDED(result)) {
#ifndef NECKO
result = NS_MakeAbsoluteURL(baseURL, empty, aSrc, url);
#else
result = NS_MakeAbsoluteURI(aSrc, baseURL, url);
#endif // NECKO
if (NS_FAILED(result)) {
url = aSrc;
}

View File

@ -42,14 +42,9 @@
#include "nsIDOMHTMLFormElement.h"
#include "nsIStreamListener.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsNeckoUtil.h"
#else
#include "nsIPostToServer.h"
#include "nsIURLGroup.h"
#endif // NECKO
#include "nsIContentViewerContainer.h"
#include "nsIWebShell.h"
#include "nsIWebShellServices.h"
@ -61,12 +56,8 @@
#include "nsICodebasePrincipal.h"
#include "nsIScriptSecurityManager.h"
#ifndef NECKO
#include "nsINetService.h"
#else
#include "nsIIOService.h"
#include "nsICookieService.h"
#endif // NECKO
#include "nsIParserService.h"
#include "nsIServiceManager.h"
@ -100,9 +91,7 @@ static PRBool gPlugDetector = PR_FALSE;
#include "net.h"
#endif
#ifdef NECKO
#include "prmem.h"
#endif
// Find/Serach Includes
const PRInt32 kForward = 0;
@ -125,14 +114,9 @@ static NS_DEFINE_IID(kIHTMLDocumentIID, NS_IHTMLDOCUMENT_IID);
static NS_DEFINE_IID(kIDOMHTMLDocumentIID, NS_IDOMHTMLDOCUMENT_IID);
static NS_DEFINE_IID(kIDOMNSHTMLDocumentIID, NS_IDOMNSHTMLDOCUMENT_IID);
#ifndef NECKO
static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID);
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
#else
static NS_DEFINE_IID(kIIOServiceIID, NS_IIOSERVICE_IID);
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
static NS_DEFINE_IID(kCookieServiceCID, NS_COOKIESERVICE_CID);
#endif // NECKO
@ -312,20 +296,12 @@ nsrefcnt nsHTMLDocument::Release()
}
nsresult
#ifdef NECKO
nsHTMLDocument::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup)
#else
nsHTMLDocument::Reset(nsIURI *aURL)
#endif
{
#ifdef NECKO
nsresult result = nsDocument::Reset(aChannel, aLoadGroup);
nsCOMPtr<nsIURI> aURL;
result = aChannel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(result)) return result;
#else
nsresult result = nsDocument::Reset(aURL);
#endif
if (NS_FAILED(result)) {
return result;
}
@ -397,21 +373,13 @@ nsHTMLDocument::CreateShell(nsIPresContext* aContext,
NS_IMETHODIMP
nsHTMLDocument::StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aURL,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener)
{
nsresult rv = nsDocument::StartDocumentLoad(aCommand,
#ifdef NECKO
aChannel, aLoadGroup,
#else
aURL,
#endif
aContainer,
aDocListener);
if (NS_FAILED(rv)) {
@ -422,7 +390,6 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
nsAutoString charset = "ISO-8859-1"; // fallback value in case webShell return error
nsCharsetSource charsetSource = kCharsetFromWeakDocTypeDefault;
#ifdef NECKO
nsCOMPtr<nsIURI> aURL;
rv = aChannel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(rv)) return rv;
@ -498,7 +465,6 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
// could just be that the response header wasn't found.
rv = NS_OK;
}
#endif
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
@ -827,21 +793,8 @@ nsHTMLDocument:: SetBaseURL(const nsString& aURLSpec)
NS_IF_RELEASE(mBaseURL);
if (0 < aURLSpec.Length()) {
#ifndef NECKO
nsILoadGroup* LoadGroup = nsnull;
(void)mDocumentURL->GetLoadGroup(&LoadGroup);
if (LoadGroup) {
result = LoadGroup->CreateURL(&mBaseURL, mDocumentURL, aURLSpec, nsnull);
NS_RELEASE(LoadGroup);
}
else
#endif
{
#ifndef NECKO
result = NS_NewURL(&mBaseURL, aURLSpec, mDocumentURL);
#else
result = NS_NewURI(&mBaseURL, aURLSpec, mDocumentURL);
#endif // NECKO
}
}
return result;
@ -1416,19 +1369,10 @@ NS_IMETHODIMP
nsHTMLDocument::GetURL(nsString& aURL)
{
if (nsnull != mDocumentURL) {
#ifdef NECKO
char* str;
mDocumentURL->GetSpec(&str);
#else
PRUnichar* str;
mDocumentURL->ToString(&str);
#endif
aURL = str;
#ifdef NECKO
nsCRT::free(str);
#else
delete[] str;
#endif
}
return NS_OK;
}
@ -1591,41 +1535,23 @@ nsHTMLDocument::GetAnchors(nsIDOMHTMLCollection** aAnchors)
NS_IMETHODIMP
nsHTMLDocument::GetCookie(nsString& aCookie)
{
#ifndef NECKO
nsresult result = NS_OK;
NS_WITH_SERVICE(nsINetService, service, kNetServiceCID, &result);
if ((NS_OK == result) && (nsnull != service) && (nsnull != mDocumentURL)) {
result = service->GetCookieString(mDocumentURL, aCookie);
}
return result;
#else
nsresult result = NS_OK;
NS_WITH_SERVICE(nsICookieService, service, kCookieServiceCID, &result);
if ((NS_OK == result) && (nsnull != service) && (nsnull != mDocumentURL)) {
result = service->GetCookieString(mDocumentURL, aCookie);
}
return result;
#endif // NECKO
}
NS_IMETHODIMP
nsHTMLDocument::SetCookie(const nsString& aCookie)
{
#ifndef NECKO
nsresult result = NS_OK;
NS_WITH_SERVICE(nsINetService, service, kNetServiceCID, &result);
if ((NS_OK == result) && (nsnull != service) && (nsnull != mDocumentURL)) {
result = service->SetCookieString(mDocumentURL, aCookie);
}
return result;
#else
nsresult result = NS_OK;
NS_WITH_SERVICE(nsICookieService, service, kCookieServiceCID, &result);
if ((NS_OK == result) && (nsnull != service) && (nsnull != mDocumentURL)) {
result = service->SetCookieString(mDocumentURL, aCookie);
}
return result;
#endif // NECKO
}
nsresult
@ -1676,7 +1602,6 @@ nsHTMLDocument::OpenCommon(nsIURI* aSourceURL)
// The open occurred after the document finished loading.
// So we reset the document and create a new one.
if (nsnull == mParser) {
#ifdef NECKO
nsCOMPtr<nsIChannel> channel;
nsCOMPtr<nsILoadGroup> group = do_QueryReferent(mDocumentLoadGroup);
@ -1684,9 +1609,6 @@ nsHTMLDocument::OpenCommon(nsIURI* aSourceURL)
if (NS_FAILED(result)) return result;
result = Reset(channel, group);
if (NS_FAILED(result)) return result;
#else
result = Reset(aSourceURL);
#endif
if (NS_OK == result) {
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
@ -1739,11 +1661,7 @@ nsHTMLDocument::Open()
// XXX For the non-script Open case, we have to make
// up a URL.
#ifdef NECKO
result = NS_NewURI(&sourceURL, "about:blank");
#else
result = NS_NewURL(&sourceURL, "about:blank");
#endif // NECKO
if (NS_SUCCEEDED(result)) {
result = OpenCommon(sourceURL);
@ -1764,11 +1682,7 @@ nsHTMLDocument::Open(JSContext *cx, jsval *argv, PRUint32 argc)
result = GetSourceDocumentURL(cx, &sourceURL);
// Recover if we had a problem obtaining the source URL
if (nsnull == sourceURL) {
#ifndef NECKO
result = NS_NewURL(&sourceURL, "about:blank");
#else
result = NS_NewURI(&sourceURL, "about:blank");
#endif // NECKO
}
if (NS_SUCCEEDED(result)) {

View File

@ -60,12 +60,8 @@ public:
nsIPresShell** aInstancePtrResult);
NS_IMETHOD StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aUrl,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener);
@ -195,11 +191,7 @@ protected:
NS_IMETHOD GetDomainURI(nsIURI **uri);
#ifdef NECKO
virtual nsresult Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup);
#else
virtual nsresult Reset(nsIURI *aURL);
#endif
nsresult WriteCommon(const nsString& aText,
PRBool aNewlineTerminate);
nsresult ScriptWriteCommon(JSContext *cx,

View File

@ -31,9 +31,7 @@
#include "nsIPresShell.h"
#include "nsIPresContext.h"
#include "nsIViewManager.h"
#ifdef NECKO
#include "nsIChannel.h"
#endif
// XXX TODO:
@ -58,27 +56,17 @@ public:
virtual ~nsImageDocument();
NS_IMETHOD StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aUrl,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener);
nsresult CreateSyntheticDocument();
nsresult StartImageLoad(nsIURI* aURL, nsIStreamListener*& aListener);
#ifdef NECKO
nsresult EndLayout(nsISupports *ctxt,
nsresult status,
const PRUnichar *errorMsg);
#else
nsresult EndLayout(nsIURI* aURL,
nsresult aStatus,
const PRUnichar* aMsg);
#endif
void StartLayout();
@ -94,22 +82,11 @@ public:
virtual ~ImageListener();
NS_DECL_ISUPPORTS
#ifdef NECKO
// nsIStreamObserver methods:
NS_DECL_NSISTREAMOBSERVER
// nsIStreamListener methods:
NS_DECL_NSISTREAMLISTENER
#else
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopRequest(nsIURI* aURL, nsresult aStatus,
const PRUnichar* aMsg);
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
PRUint32 aCount);
#endif
nsImageDocument* mDocument;
nsIStreamListener* mNextStream;
@ -131,13 +108,8 @@ ImageListener::~ImageListener()
NS_IMPL_ISUPPORTS(ImageListener, kIStreamListenerIID)
NS_IMETHODIMP
#ifdef NECKO
ImageListener::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
#else
ImageListener::OnStartRequest(nsIURI* aURL, const char *aContentType)
#endif
{
#ifdef NECKO
nsresult rv;
nsIURI* uri;
rv = channel->GetURI(&uri);
@ -145,89 +117,31 @@ ImageListener::OnStartRequest(nsIURI* aURL, const char *aContentType)
mDocument->StartImageLoad(uri, mNextStream);
NS_RELEASE(uri);
#else
mDocument->StartImageLoad(aURL, mNextStream);
#endif
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
#ifdef NECKO
return mNextStream->OnStartRequest(channel, ctxt);
#else
return mNextStream->OnStartRequest(aURL, aContentType);
#endif
}
#ifndef NECKO
NS_IMETHODIMP
ImageListener::OnProgress(nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->OnProgress(aURL, aProgress, aProgressMax);
}
NS_IMETHODIMP
ImageListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->OnStatus(aURL, aMsg);
}
#endif
NS_IMETHODIMP
#ifdef NECKO
ImageListener::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
nsresult status, const PRUnichar *errorMsg)
#else
ImageListener::OnStopRequest(nsIURI* aURL, nsresult aStatus,
const PRUnichar* aMsg)
#endif
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
#ifdef NECKO
mDocument->EndLayout(ctxt, status, errorMsg);
return mNextStream->OnStopRequest(channel, ctxt, status, errorMsg);
#else
mDocument->EndLayout(aURL, aStatus, aMsg);
return mNextStream->OnStopRequest(aURL, aStatus, aMsg);
#endif
}
#ifndef NECKO
NS_IMETHODIMP
ImageListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->GetBindInfo(aURL, aInfo);
}
#endif
NS_IMETHODIMP
#ifdef NECKO
ImageListener::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count)
#else
ImageListener::OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
PRUint32 aCount)
#endif
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
#ifdef NECKO
return mNextStream->OnDataAvailable(channel, ctxt, inStr, sourceOffset, count);
#else
return mNextStream->OnDataAvailable(aURL, aStream, aCount);
#endif
}
//----------------------------------------------------------------------
@ -254,21 +168,13 @@ nsImageDocument::~nsImageDocument()
NS_IMETHODIMP
nsImageDocument::StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aURL,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener)
{
nsresult rv = nsDocument::StartDocumentLoad(aCommand,
#ifdef NECKO
aChannel, aLoadGroup,
#else
aURL,
#endif
aContainer,
aDocListener);
if (NS_FAILED(rv)) {
@ -303,19 +209,13 @@ nsImageDocument::StartImageLoad(nsIURI* aURL, nsIStreamListener*& aListener)
nsIImageGroup* group = nsnull;
cx->GetImageGroup(&group);
if (nsnull != group) {
#ifdef NECKO
char* spec;
#else
const char* spec;
#endif
(void)aURL->GetSpec(&spec);
nsIStreamListener* listener = nsnull;
rv = group->GetImageFromStream(spec, nsnull, nsnull,
0, 0, 0,
mImageRequest, listener);
#ifdef NECKO
nsCRT::free(spec);
#endif
aListener = listener;
NS_RELEASE(group);
}
@ -372,13 +272,8 @@ nsImageDocument::CreateSyntheticDocument()
}
image->SetDocument(this, PR_FALSE);
#ifdef NECKO
char* src;
mDocumentURL->GetSpec(&src);
#else
PRUnichar* src;
mDocumentURL->ToString(&src);
#endif
nsHTMLValue val(src);
delete[] src;
image->SetHTMLAttribute(nsHTMLAtoms::src, val, PR_FALSE);
@ -427,15 +322,9 @@ nsImageDocument::StartLayout()
}
nsresult
#ifdef NECKO
nsImageDocument::EndLayout(nsISupports *ctxt,
nsresult status,
const PRUnichar *errorMsg)
#else
nsImageDocument::EndLayout(nsIURI* aURL,
nsresult aStatus,
const PRUnichar* aMsg)
#endif
{
nsString titleStr = "Image ";
if (mImageRequest) {

View File

@ -171,13 +171,9 @@ void nsMarkupDocument::StyleSheetsToXIF(nsXIFConverter& aConverter)
if (nsnull == sheetURL) {
break;
}
#ifdef NECKO
PRBool eq;
nsresult rv = sheetURL->Equals(mDocumentURL, &eq);
if (NS_FAILED(rv) || !eq)
#else
if (!sheetURL->Equals(mDocumentURL))
#endif
{
NS_RELEASE(sheetURL);
break;

View File

@ -31,12 +31,8 @@
#include "nsICSSDeclaration.h"
#include "nsStyleConsts.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#include "nsCOMPtr.h"
#else
#include "nsIURLGroup.h"
#endif // NECKO
#include "nsString.h"
#include "nsIAtom.h"
#include "nsVoidArray.h"
@ -849,20 +845,8 @@ PRBool CSSParserImpl::ProcessImport(PRInt32& aErrorCode, const nsString& aURLSpe
// XXX probably need a way to encode unicode junk for the part of
// the url that follows a "?"
nsIURI* url;
#ifdef NECKO
// XXX need to have nsILoadGroup passed in here
aErrorCode = NS_NewURI(&url, aURLSpec, mURL/*, group*/);
#else
nsILoadGroup* loadGroup = nsnull;
mURL->GetLoadGroup(&loadGroup);
if (loadGroup) {
aErrorCode = loadGroup->CreateURL(&url, mURL, aURLSpec, nsnull);
NS_RELEASE(loadGroup);
}
else {
aErrorCode = NS_NewURL(&url, aURLSpec, mURL);
}
#endif
if (NS_FAILED(aErrorCode)) {
// import url is bad
@ -2489,15 +2473,11 @@ PRBool CSSParserImpl::ParseURL(PRInt32& aErrorCode, nsCSSValue& aValue)
if (nsnull != mURL) {
nsAutoString baseURL;
nsresult rv;
#ifdef NECKO
nsCOMPtr<nsIURI> base;
rv = mURL->Clone(getter_AddRefs(base));
if (NS_SUCCEEDED(rv)) {
rv = NS_MakeAbsoluteURI(tk->mIdent, base, absURL);
}
#else
rv = NS_MakeAbsoluteURL(mURL, baseURL, tk->mIdent, absURL);
#endif // NECKO
if (NS_FAILED(rv)) {
absURL = tk->mIdent;
}

View File

@ -21,13 +21,11 @@
#include "nsCRT.h"
#include "nsIAtom.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsNeckoUtil.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsISupportsArray.h"
#include "nsHashtable.h"
#include "nsICSSStyleRuleProcessor.h"
@ -1290,14 +1288,10 @@ CSSStyleSheetImpl::Init(nsIURI* aURL)
return NS_ERROR_ALREADY_INITIALIZED;
if (mInner->mURL) {
#ifdef NECKO
#ifdef DEBUG
PRBool eq;
nsresult rv = mInner->mURL->Equals(aURL, &eq);
NS_ASSERTION(NS_SUCCEEDED(rv) && eq, "bad inner");
#endif
#else
NS_ASSERTION(mInner->mURL->Equals(aURL), "bad inner");
#endif
}
else {
@ -1469,13 +1463,9 @@ CSSStyleSheetImpl::ContainsStyleSheet(nsIURI* aURL) const
{
NS_PRECONDITION(nsnull != aURL, "null arg");
#ifdef NECKO
PRBool result;
nsresult rv = mInner->mURL->Equals(aURL, &result);
if (NS_FAILED(rv)) result = PR_FALSE;
#else
PRBool result = mInner->mURL->Equals(aURL);
#endif
const CSSStyleSheetImpl* child = mFirstChild;
while ((PR_FALSE == result) && (nsnull != child)) {
@ -1794,22 +1784,12 @@ void CSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const
}
fputs("CSS Style Sheet: ", out);
#ifdef NECKO
char* urlSpec = nsnull;
nsresult rv = mInner->mURL->GetSpec(&urlSpec);
if (NS_SUCCEEDED(rv) && urlSpec) {
fputs(urlSpec, out);
nsCRT::free(urlSpec);
}
#else
PRUnichar* urlSpec = nsnull;
mInner->mURL->ToString(&urlSpec);
if (urlSpec) {
nsAutoString buffer(urlSpec);
delete [] urlSpec;
fputs(buffer, out);
}
#endif
if (mMedia) {
fputs(" media: ", out);
@ -1946,19 +1926,12 @@ NS_IMETHODIMP
CSSStyleSheetImpl::GetHref(nsString& aHref)
{
if (mInner && mInner->mURL) {
#ifdef NECKO
char* str = nsnull;
mInner->mURL->GetSpec(&str);
aHref = str;
if (str) {
nsCRT::free(str);
}
#else
PRUnichar* str;
mInner->mURL->ToString(&str);
aHref = str;
delete [] str;
#endif
}
else {
aHref.SetLength(0);
@ -2532,9 +2505,6 @@ static PRBool SelectorMatches(nsIPresContext* aPresContext,
}
nsAutoString absURLSpec;
#ifndef NECKO
NS_MakeAbsoluteURL(docURL, base, href, absURLSpec);
#else
nsresult rv;
nsIURI *baseUri = nsnull;
rv = docURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
@ -2542,7 +2512,6 @@ static PRBool SelectorMatches(nsIPresContext* aPresContext,
NS_MakeAbsoluteURI(href, baseUri, absURLSpec);
NS_RELEASE(baseUri);
#endif // NECKO
NS_IF_RELEASE(docURL);
linkHandler->GetLinkState(absURLSpec.GetUnicode(), linkState);

View File

@ -651,22 +651,12 @@ void HTMLCSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
fputs("HTML CSS Style Sheet: ", out);
#ifdef NECKO
char* urlSpec = nsnull;
mURL->GetSpec(&urlSpec);
if (urlSpec) {
fputs(urlSpec, out);
nsCRT::free(urlSpec);
}
#else
PRUnichar* urlSpec = nsnull;
mURL->ToString(&urlSpec);
if (urlSpec) {
nsAutoString buffer(urlSpec);
fputs(buffer, out);
delete [] urlSpec;
}
#endif
fputs("\n", out);
}

View File

@ -21,13 +21,11 @@
#include "nsCRT.h"
#include "nsIAtom.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsNeckoUtil.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsISupportsArray.h"
#include "nsHashtable.h"
#include "nsIHTMLContent.h"
@ -657,9 +655,6 @@ HTMLStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
nsAutoString absURLSpec;
nsresult rv;
#ifndef NECKO
rv = NS_MakeAbsoluteURL(docURL, base, href, absURLSpec);
#else
nsIURI *baseUri = nsnull;
rv = docURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
if (NS_FAILED(rv)) return 0;
@ -667,7 +662,6 @@ HTMLStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
rv = NS_MakeAbsoluteURI(href, baseUri, absURLSpec);
NS_RELEASE(baseUri);
#endif // NECKO
NS_IF_RELEASE(docURL);
nsLinkState state;
@ -1153,22 +1147,12 @@ void HTMLStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
fputs("HTML Style Sheet: ", out);
#ifdef NECKO
char* urlSpec = nsnull;
mURL->GetSpec(&urlSpec);
if (urlSpec) {
fputs(urlSpec, out);
nsCRT::free(urlSpec);
}
#else
PRUnichar* urlSpec = nsnull;
mURL->ToString(&urlSpec);
if (urlSpec) {
nsAutoString buffer(urlSpec);
fputs(buffer, out);
delete [] urlSpec;
}
#endif
fputs("\n", out);
}

View File

@ -26,12 +26,8 @@
#include "nsIXMLContent.h"
#include "nsIScriptObjectOwner.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIURL.h"
#include "nsNeckoUtil.h"
#else
#include "nsIURLGroup.h"
#endif // NECKO
#include "nsIWebShell.h"
#include "nsIContent.h"
#include "nsITextContent.h"
@ -1125,27 +1121,7 @@ nsXMLContentSink::CreateStyleSheetURL(nsIURI** aUrl,
const nsAutoString& aHref)
{
nsresult result = NS_OK;
#ifdef NECKO
result = NS_NewURI(aUrl, aHref, mDocumentBaseURL);
#else
nsAutoString absURL;
nsIURI* docURL = mDocument->GetDocumentURL();
nsILoadGroup* LoadGroup;
result = docURL->GetLoadGroup(&LoadGroup);
if ((NS_SUCCEEDED(result)) && LoadGroup) {
result = LoadGroup->CreateURL(aUrl, docURL, aHref, nsnull);
NS_RELEASE(LoadGroup);
}
else {
result = NS_MakeAbsoluteURL(docURL, nsnull, aHref, absURL);
if (NS_SUCCEEDED(result)) {
result = NS_NewURL(aUrl, absURL);
}
}
NS_RELEASE(docURL);
#endif
return result;
}
@ -1266,20 +1242,9 @@ nsXMLContentSink::ProcessCSSStyleLink(nsIContent* aElement,
if ((0 == mimeType.Length()) || mimeType.EqualsIgnoreCase("text/css")) {
nsIURI* url = nsnull;
#ifdef NECKO // XXX we need to get passed in the nsILoadGroup here!
// XXX we need to get passed in the nsILoadGroup here!
// nsILoadGroup* group = mDocument->GetDocumentLoadGroup();
result = NS_NewURI(&url, aHref, mDocumentBaseURL/*, group*/);
#else
nsILoadGroup* LoadGroup = nsnull;
mDocumentBaseURL->GetLoadGroup(&LoadGroup);
if (LoadGroup) {
result = LoadGroup->CreateURL(&url, mDocumentBaseURL, aHref, nsnull);
NS_RELEASE(LoadGroup);
}
else {
result = NS_NewURL(&url, aHref, mDocumentBaseURL);
}
#endif
if (NS_OK != result) {
return NS_OK; // The URL is bad, move along, don't propogate the error (for now)
}
@ -1586,7 +1551,6 @@ nsXMLContentSink::StartLayout()
// If the document we are loading has a reference or it is a top level
// frameset document, disable the scroll bars on the views.
#ifdef NECKO
char* ref = nsnull;
nsIURL* url;
nsresult rv = mDocumentURL->QueryInterface(nsIURL::GetIID(), (void**)&url);
@ -1594,10 +1558,6 @@ nsXMLContentSink::StartLayout()
rv = url->GetRef(&ref);
NS_RELEASE(url);
}
#else
const char* ref;
(void)mDocumentURL->GetRef(&ref);
#endif
PRBool topLevelFrameset = PR_FALSE;
if (mWebShell) {
nsIWebShell* rootWebShell;
@ -1637,10 +1597,8 @@ nsXMLContentSink::StartLayout()
NS_RELEASE(shell);
}
}
#ifdef NECKO
// XXX who actually uses ref here anyway?
nsCRT::free(ref);
#endif
}
}
@ -1672,11 +1630,7 @@ nsXMLContentSink::EvaluateScript(nsString& aScript, PRUint32 aLineNo, const char
}
nsIURI* docURL = mDocument->GetDocumentURL();
#ifdef NECKO
char* url;
#else
const char* url;
#endif
if (docURL) {
rv = docURL->GetSpec(&url);
}
@ -1692,9 +1646,7 @@ nsXMLContentSink::EvaluateScript(nsString& aScript, PRUint32 aLineNo, const char
NS_RELEASE(context);
NS_RELEASE(owner);
#ifdef NECKO
nsCRT::free(url);
#endif
}
}
}
@ -1836,22 +1788,9 @@ nsXMLContentSink::ProcessStartSCRIPTTag(const nsIParserNode& aNode)
// Use the SRC attribute value to load the URL
nsIURI* url = nsnull;
nsAutoString absURL;
#ifdef NECKO // XXX we need to get passed in the nsILoadGroup here!
// XXX we need to get passed in the nsILoadGroup here!
// nsILoadGroup* group = mDocument->GetDocumentLoadGroup();
rv = NS_NewURI(&url, src, mDocumentBaseURL);
#else
nsIURI* docURL = mDocument->GetDocumentURL();
nsILoadGroup* group = nsnull;
rv = docURL->GetLoadGroup(&group);
if ((NS_OK == rv) && group) {
rv = group->CreateURL(&url, docURL, src, nsnull);
NS_RELEASE(group);
}
else {
rv = NS_NewURL(&url, absURL);
}
NS_RELEASE(docURL);
#endif
if (NS_OK != rv) {
return rv;
}

View File

@ -43,10 +43,8 @@
#include "nsExpatDTD.h"
#include "nsINameSpaceManager.h"
#include "nsICSSLoader.h"
#ifdef NECKO
#include "nsCOMPtr.h"
#include "nsIURI.h"
#endif
#include "nsXPIDLString.h"
#include "nsIHTTPChannel.h"
#include "nsIServiceManager.h"
@ -149,20 +147,12 @@ nsrefcnt nsXMLDocument::Release()
}
nsresult
#ifdef NECKO
nsXMLDocument::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup)
#else
nsXMLDocument::Reset(nsIURI* aURL)
#endif
{
#ifdef NECKO
nsresult result = nsDocument::Reset(aChannel, aLoadGroup);
nsCOMPtr<nsIURI> aURL;
result = aChannel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(result)) return result;
#else
nsresult result = nsDocument::Reset(aURL);
#endif
if (NS_FAILED(result)) {
return result;
}
@ -199,21 +189,13 @@ nsXMLDocument::GetContentType(nsString& aContentType) const
NS_IMETHODIMP
nsXMLDocument::StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aUrl,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener)
{
nsresult rv = nsDocument::StartDocumentLoad(aCommand,
#ifdef NECKO
aChannel, aLoadGroup,
#else
aUrl,
#endif
aContainer,
aDocListener);
if (NS_FAILED(rv)) {
@ -224,7 +206,6 @@ nsXMLDocument::StartDocumentLoad(const char* aCommand,
nsAutoString charset("utf-8");
nsCharsetSource charsetSource = kCharsetFromDocTypeDefault;
#ifdef NECKO
nsCOMPtr<nsIURI> aUrl;
rv = aChannel->GetURI(getter_AddRefs(aUrl));
if (NS_FAILED(rv)) return rv;
@ -266,7 +247,6 @@ nsXMLDocument::StartDocumentLoad(const char* aCommand,
}
}
}
#endif
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);

View File

@ -48,12 +48,8 @@ public:
NS_IMETHOD GetContentType(nsString& aContentType) const;
NS_IMETHOD StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aUrl,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener);
@ -84,11 +80,7 @@ public:
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, nsILoadGroup* aLoadGroup);
#else
virtual nsresult Reset(nsIURI* aUrl);
#endif
// For HTML elements in our content model
nsIHTMLStyleSheet* mAttrStyleSheet;

View File

@ -505,11 +505,7 @@ void
nsXULDocument::SetDocumentURLAndGroup(nsIURI* anURL)
{
mDocumentURL = dont_QueryInterface(anURL);
#ifdef NECKO
// XXX help
#else
anURL->GetLoadGroup(getter_AddRefs(mDocumentLoadGroup));
#endif
}
NS_IMETHODIMP

View File

@ -19,13 +19,11 @@
#include "nsGlobalWindow.h"
#include "nsIWebShell.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsNeckoUtil.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "plstr.h"
#include "prmem.h"
#include "nsCOMPtr.h"
@ -156,16 +154,10 @@ nsresult
LocationImpl::SetURL(nsIURI* aURL)
{
if (nsnull != mWebShell) {
#ifdef NECKO
char* spec;
aURL->GetSpec(&spec);
nsAutoString s = spec;
nsCRT::free(spec);
#else
const char* spec;
aURL->GetSpec(&spec);
nsAutoString s = spec;
#endif
if (NS_FAILED(CheckURL(aURL)))
return NS_ERROR_FAILURE;
@ -186,14 +178,9 @@ LocationImpl::GetHash(nsString& aHash)
result = GetHref(href);
if (NS_OK == result) {
#ifndef NECKO
result = NS_NewURL(&uri, href);
#else
result = NS_NewURI(&uri, href);
#endif // NECKO
if (NS_OK == result) {
#ifdef NECKO
char *ref;
nsIURL* url;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
@ -201,16 +188,10 @@ LocationImpl::GetHash(nsString& aHash)
result = url->GetRef(&ref);
NS_RELEASE(url);
}
#else
const char *ref;
result = uri->GetRef(&ref);
#endif
if (result == NS_OK && (nsnull != ref) && ('\0' != *ref)) {
aHash.SetString("#");
aHash.Append(ref);
#ifdef NECKO
nsCRT::free(ref);
#endif
}
else {
aHash.SetLength(0);
@ -231,16 +212,6 @@ LocationImpl::SetHash(const nsString& aHash)
result = GetHref(href);
if (NS_OK == result) {
#ifndef NECKO
result = NS_NewURL(&uri, href);
if (NS_OK == result) {
char *buf = aHash.ToNewCString();
uri->SetRef(buf);
SetURL(uri);
nsCRT::free(buf);
NS_RELEASE(uri);
}
#else
result = NS_NewURI(&uri, href);
if (NS_FAILED(result)) return result;
nsIURL* url;
@ -253,7 +224,6 @@ LocationImpl::SetHash(const nsString& aHash)
nsCRT::free(buf);
NS_RELEASE(url);
}
#endif // NECKO
}
return result;
@ -268,28 +238,15 @@ LocationImpl::GetHost(nsString& aHost)
result = GetHref(href);
if (NS_OK == result) {
#ifndef NECKO
result = NS_NewURL(&url, href);
#else
result = NS_NewURI(&url, href);
#endif // NECKO
if (NS_OK == result) {
#ifdef NECKO
char* host;
#else
const char* host;
#endif
result = url->GetHost(&host);
if (result == NS_OK) {
aHost.SetString(host);
#ifdef NECKO
nsCRT::free(host);
PRInt32 port;
(void)url->GetPort(&port);
#else
PRUint32 port;
(void)url->GetHostPort(&port);
#endif
if (-1 != port) {
aHost.Append(":");
aHost.Append(port, 10);
@ -311,11 +268,7 @@ LocationImpl::SetHost(const nsString& aHost)
result = GetHref(href);
if (NS_OK == result) {
#ifndef NECKO
result = NS_NewURL(&url, href);
#else
result = NS_NewURI(&url, href);
#endif // NECKO
if (NS_OK == result) {
char *buf = aHost.ToNewCString();
url->SetHost(buf);
@ -337,23 +290,13 @@ LocationImpl::GetHostname(nsString& aHostname)
result = GetHref(href);
if (NS_OK == result) {
#ifndef NECKO
result = NS_NewURL(&url, href);
#else
result = NS_NewURI(&url, href);
#endif // NECKO
if (NS_OK == result) {
#ifdef NECKO
char* host;
#else
const char* host;
#endif
result = url->GetHost(&host);
if (result == NS_OK) {
aHostname.SetString(host);
#ifdef NECKO
nsCRT::free(host);
#endif
}
NS_RELEASE(url);
}
@ -371,11 +314,7 @@ LocationImpl::SetHostname(const nsString& aHostname)
result = GetHref(href);
if (NS_OK == result) {
#ifndef NECKO
result = NS_NewURL(&url, href);
#else
result = NS_NewURI(&url, href);
#endif // NECKO
if (NS_OK == result) {
char *buf = aHostname.ToNewCString();
url->SetHost(buf);
@ -417,11 +356,7 @@ LocationImpl::SetHref(const nsString& aHref)
result = GetHref(oldHref);
if (NS_OK == result) {
#ifndef NECKO
result = NS_NewURL(&oldUrl, oldHref);
#else
result = NS_NewURI(&oldUrl, oldHref);
#endif // NECKO
if (NS_OK == result) {
result = SetHrefWithBase(aHref, oldUrl, PR_TRUE);
NS_RELEASE(oldUrl);
@ -440,23 +375,13 @@ LocationImpl::SetHrefWithBase(const nsString& aHref,
nsCOMPtr<nsIURI> newUrl;
nsAutoString newHref;
#ifndef NECKO
result = NS_NewURL(getter_AddRefs(newUrl), aHref, aBase);
#else
result = NS_NewURI(getter_AddRefs(newUrl), aHref, aBase);
#endif // NECKO
if (NS_OK == result) {
#ifdef NECKO
char* spec;
#else
const char* spec;
#endif
result = newUrl->GetSpec(&spec);
if (NS_SUCCEEDED(result)) {
newHref.SetString(spec);
#ifdef NECKO
nsCRT::free(spec);
#endif
}
}
@ -481,24 +406,13 @@ LocationImpl::GetPathname(nsString& aPathname)
result = GetHref(href);
if (NS_OK == result) {
#ifndef NECKO
result = NS_NewURL(&url, href);
#else
result = NS_NewURI(&url, href);
#endif // NECKO
if (NS_OK == result) {
#ifdef NECKO
char* file;
result = url->GetPath(&file);
#else
const char* file;
result = url->GetFile(&file);
#endif
if (result == NS_OK) {
aPathname.SetString(file);
#ifdef NECKO
nsCRT::free(file);
#endif
}
NS_IF_RELEASE(url);
}
@ -516,18 +430,10 @@ LocationImpl::SetPathname(const nsString& aPathname)
result = GetHref(href);
if (NS_OK == result) {
#ifndef NECKO
result = NS_NewURL(&url, href);
#else
result = NS_NewURI(&url, href);
#endif // NECKO
if (NS_OK == result) {
char *buf = aPathname.ToNewCString();
#ifdef NECKO
url->SetPath(buf);
#else
url->SetFile(buf);
#endif
SetURL(url);
nsCRT::free(buf);
NS_RELEASE(url);
@ -546,20 +452,11 @@ LocationImpl::GetPort(nsString& aPort)
result = GetHref(href);
if (NS_OK == result) {
#ifndef NECKO
result = NS_NewURL(&url, href);
#else
result = NS_NewURI(&url, href);
#endif // NECKO
if (NS_OK == result) {
aPort.SetLength(0);
#ifdef NECKO
PRInt32 port;
(void)url->GetPort(&port);
#else
PRUint32 port;
(void)url->GetHostPort(&port);
#endif
if (-1 != port) {
aPort.Append(port, 10);
}
@ -579,11 +476,7 @@ LocationImpl::SetPort(const nsString& aPort)
result = GetHref(href);
if (NS_OK == result) {
#ifndef NECKO
result = NS_NewURL(&url, href);
#else
result = NS_NewURI(&url, href);
#endif // NECKO
if (NS_OK == result) {
char *buf = aPort.ToNewCString();
PRInt32 port = -1;
@ -596,11 +489,7 @@ LocationImpl::SetPort(const nsString& aPort)
port = atol(buf);
}
}
#ifdef NECKO
url->SetPort(port);
#else
url->SetHostPort(port);
#endif
SetURL(url);
nsCRT::free(buf);
NS_RELEASE(url);
@ -619,25 +508,14 @@ LocationImpl::GetProtocol(nsString& aProtocol)
result = GetHref(href);
if (NS_OK == result) {
#ifndef NECKO
result = NS_NewURL(&url, href);
#else
result = NS_NewURI(&url, href);
#endif // NECKO
if (NS_OK == result) {
#ifdef NECKO
char* protocol;
result = url->GetScheme(&protocol);
#else
const char* protocol;
result = url->GetProtocol(&protocol);
#endif
if (result == NS_OK) {
aProtocol.SetString(protocol);
aProtocol.Append(":");
#ifdef NECKO
nsCRT::free(protocol);
#endif
}
NS_RELEASE(url);
}
@ -655,18 +533,10 @@ LocationImpl::SetProtocol(const nsString& aProtocol)
result = GetHref(href);
if (NS_OK == result) {
#ifndef NECKO
result = NS_NewURL(&url, href);
#else
result = NS_NewURI(&url, href);
#endif // NECKO
if (NS_OK == result) {
char *buf = aProtocol.ToNewCString();
#ifdef NECKO
url->SetScheme(buf);
#else
url->SetProtocol(buf);
#endif
SetURL(url);
nsCRT::free(buf);
NS_RELEASE(url);
@ -685,13 +555,8 @@ LocationImpl::GetSearch(nsString& aSearch)
result = GetHref(href);
if (NS_OK == result) {
#ifndef NECKO
result = NS_NewURL(&uri, href);
#else
result = NS_NewURI(&uri, href);
#endif // NECKO
if (NS_OK == result) {
#ifdef NECKO
char *search;
nsIURL* url;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
@ -699,16 +564,10 @@ LocationImpl::GetSearch(nsString& aSearch)
result = url->GetQuery(&search);
NS_RELEASE(url);
}
#else
const char *search;
result = uri->GetSearch(&search);
#endif
if (result == NS_OK && (nsnull != search) && ('\0' != *search)) {
aSearch.SetString("?");
aSearch.Append(search);
#ifdef NECKO
nsCRT::free(search);
#endif
}
else {
aSearch.SetLength(0);
@ -729,23 +588,15 @@ LocationImpl::SetSearch(const nsString& aSearch)
result = GetHref(href);
if (NS_OK == result) {
#ifndef NECKO
result = NS_NewURL(&uri, href);
#else
result = NS_NewURI(&uri, href);
#endif // NECKO
if (NS_OK == result) {
char *buf = aSearch.ToNewCString();
#ifdef NECKO
nsIURL* url;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
if (NS_SUCCEEDED(result)) {
result = url->SetQuery(buf);
NS_RELEASE(url);
}
#else
result = uri->SetSearch(buf);
#endif
SetURL(uri);
nsCRT::free(buf);
NS_RELEASE(uri);
@ -761,11 +612,7 @@ LocationImpl::Reload(PRBool aForceget)
nsresult result = NS_OK;
if (nsnull != mWebShell) {
#ifdef NECKO
result = mWebShell->Reload(nsIChannel::LOAD_NORMAL);
#else
result = mWebShell->Reload(nsURLReload);
#endif
}
return result;
@ -780,11 +627,7 @@ LocationImpl::Replace(const nsString& aUrl)
result = GetHref(oldHref);
if (NS_OK == result) {
#ifndef NECKO
result = NS_NewURL(&oldUrl, oldHref);
#else
result = NS_NewURI(&oldUrl, oldHref);
#endif // NECKO
if (NS_OK == result) {
result = SetHrefWithBase(aUrl, oldUrl, PR_FALSE);
NS_RELEASE(oldUrl);
@ -864,11 +707,7 @@ LocationImpl::GetSourceURL(JSContext* cx,
// XXX Ughh - incorrect ownership rules for url?
webShell->GetURL(&url);
#ifndef NECKO
result = NS_NewURL(sourceURL, url);
#else
result = NS_NewURI(sourceURL, url);
#endif // NECKO
}
}
}

View File

@ -59,11 +59,7 @@
#include "nsIStringStream.h"
#include "nsITextContent.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#else
#include "nsIURL.h"
#endif // NECKO
#include "nsIContent.h"
#include "nsIContentIterator.h"

View File

@ -113,10 +113,6 @@ static NS_DEFINE_CID(kCStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
static NS_DEFINE_CID(kCommonDialogsCID, NS_CommonDialog_CID );
static NS_DEFINE_CID(kDialogParamBlockCID, NS_DialogParamBlock_CID);
/* Define Interface IDs */
#ifdef NECKO
#else
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
#endif
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
#define APP_DEBUG 0
@ -694,11 +690,7 @@ NS_IMETHODIMP nsEditorShell::SetDisplayMode(PRInt32 aDisplayMode)
nsAutoString styleURL("chrome://editor/content/EditorContent.css");
nsCOMPtr<nsIURI>uaURL;
#ifndef NECKO
rv = NS_NewURL(getter_AddRefs(uaURL), styleURL);
#else
rv = NS_NewURI(getter_AddRefs(uaURL), styleURL);
#endif // NECKO
if (NS_SUCCEEDED(rv))
{
@ -3553,13 +3545,8 @@ nsEditorShell::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, cons
}
NS_IMETHODIMP
#ifndef NECKO
nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver)
#else
nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus,
nsIDocumentLoaderObserver * aObserver)
#endif // NECKO
{
// for pages with charsets, this gets called the first time with a
// non-zero status value. Don't prepare the editor that time.
@ -3577,70 +3564,41 @@ nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel,
}
NS_IMETHODIMP
#ifndef NECKO
nsEditorShell::OnStartURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, const char* aContentType,
nsIContentViewer* aViewer)
#else
nsEditorShell::OnStartURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
nsIContentViewer* aViewer)
#endif // NECKO
{
return NS_OK;
}
NS_IMETHODIMP
#ifndef NECKO
nsEditorShell::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax)
#else
nsEditorShell::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel, PRUint32 aProgress,
PRUint32 aProgressMax)
#endif // NECKO
{
return NS_OK;
}
NS_IMETHODIMP
#ifndef NECKO
nsEditorShell::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, nsString& aMsg)
#else
nsEditorShell::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel, nsString& aMsg)
#endif // NECKO
{
return NS_OK;
}
NS_IMETHODIMP
#ifndef NECKO
nsEditorShell::OnEndURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, PRInt32 aStatus)
#else
nsEditorShell::OnEndURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel, nsresult aStatus)
#endif // NECKO
{
return NS_OK;
}
NS_IMETHODIMP
#ifndef NECKO
nsEditorShell::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURI *aURL,
const char *aContentType,
const char *aCommand )
#else
nsEditorShell::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIChannel* channel,
const char *aContentType,
const char *aCommand )
#endif // NECKO
{
return NS_OK;
}

View File

@ -28,11 +28,7 @@
#include "nsIEditorShell.h"
#include "nsIDocumentLoaderObserver.h"
#include "nsIDOMSelectionListener.h"
#ifdef NECKO
#include "nsIPrompt.h"
#else
#include "nsINetSupport.h"
#endif
#include "nsIStreamObserver.h"
#include "nsIDOMDocument.h"
#include "nsVoidArray.h"
@ -93,53 +89,20 @@ class nsEditorShell : public nsIEditorShell,
// nsIDocumentLoaderObserver
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand);
#ifndef NECKO
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver);
#else
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus,
nsIDocumentLoaderObserver * aObserver);
#endif // NECKO
#ifndef NECKO
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aContentType,
nsIContentViewer* aViewer);
#else
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* channel,
nsIContentViewer* aViewer);
#endif // NECKO
#ifndef NECKO
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax);
#else
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRUint32 aProgress,
PRUint32 aProgressMax);
#endif // NECKO
#ifndef NECKO
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, nsString& aMsg);
#else
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsString& aMsg);
#endif // NECKO
#ifndef NECKO
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus);
#else
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus);
#endif // NECKO
#ifndef NECKO
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURI *aURL,
const char *aContentType,
const char *aCommand );
#else
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
nsIChannel* channel,
const char *aContentType,
const char *aCommand );
#endif // NECKO
protected:
nsIDOMWindow *mToolbarWindow; // weak reference

View File

@ -2939,11 +2939,7 @@ nsHTMLEditor::ApplyDocumentOrOverrideStyleSheet(const nsString& aURL, PRBool aOv
nsresult rv = NS_OK;
nsCOMPtr<nsIURI> uaURL;
#ifndef NECKO
rv = NS_NewURL(getter_AddRefs(uaURL), aURL);
#else
rv = NS_NewURI(getter_AddRefs(uaURL), aURL);
#endif // NECKO
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIDocument> document;

View File

@ -113,10 +113,6 @@ static NS_DEFINE_CID(kCStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
static NS_DEFINE_CID(kCommonDialogsCID, NS_CommonDialog_CID );
static NS_DEFINE_CID(kDialogParamBlockCID, NS_DialogParamBlock_CID);
/* Define Interface IDs */
#ifdef NECKO
#else
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
#endif
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
#define APP_DEBUG 0
@ -694,11 +690,7 @@ NS_IMETHODIMP nsEditorShell::SetDisplayMode(PRInt32 aDisplayMode)
nsAutoString styleURL("chrome://editor/content/EditorContent.css");
nsCOMPtr<nsIURI>uaURL;
#ifndef NECKO
rv = NS_NewURL(getter_AddRefs(uaURL), styleURL);
#else
rv = NS_NewURI(getter_AddRefs(uaURL), styleURL);
#endif // NECKO
if (NS_SUCCEEDED(rv))
{
@ -3553,13 +3545,8 @@ nsEditorShell::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, cons
}
NS_IMETHODIMP
#ifndef NECKO
nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver)
#else
nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus,
nsIDocumentLoaderObserver * aObserver)
#endif // NECKO
{
// for pages with charsets, this gets called the first time with a
// non-zero status value. Don't prepare the editor that time.
@ -3577,70 +3564,41 @@ nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel,
}
NS_IMETHODIMP
#ifndef NECKO
nsEditorShell::OnStartURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, const char* aContentType,
nsIContentViewer* aViewer)
#else
nsEditorShell::OnStartURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
nsIContentViewer* aViewer)
#endif // NECKO
{
return NS_OK;
}
NS_IMETHODIMP
#ifndef NECKO
nsEditorShell::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax)
#else
nsEditorShell::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel, PRUint32 aProgress,
PRUint32 aProgressMax)
#endif // NECKO
{
return NS_OK;
}
NS_IMETHODIMP
#ifndef NECKO
nsEditorShell::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, nsString& aMsg)
#else
nsEditorShell::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel, nsString& aMsg)
#endif // NECKO
{
return NS_OK;
}
NS_IMETHODIMP
#ifndef NECKO
nsEditorShell::OnEndURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, PRInt32 aStatus)
#else
nsEditorShell::OnEndURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel, nsresult aStatus)
#endif // NECKO
{
return NS_OK;
}
NS_IMETHODIMP
#ifndef NECKO
nsEditorShell::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURI *aURL,
const char *aContentType,
const char *aCommand )
#else
nsEditorShell::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIChannel* channel,
const char *aContentType,
const char *aCommand )
#endif // NECKO
{
return NS_OK;
}

View File

@ -28,11 +28,7 @@
#include "nsIEditorShell.h"
#include "nsIDocumentLoaderObserver.h"
#include "nsIDOMSelectionListener.h"
#ifdef NECKO
#include "nsIPrompt.h"
#else
#include "nsINetSupport.h"
#endif
#include "nsIStreamObserver.h"
#include "nsIDOMDocument.h"
#include "nsVoidArray.h"
@ -93,53 +89,20 @@ class nsEditorShell : public nsIEditorShell,
// nsIDocumentLoaderObserver
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand);
#ifndef NECKO
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver);
#else
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus,
nsIDocumentLoaderObserver * aObserver);
#endif // NECKO
#ifndef NECKO
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aContentType,
nsIContentViewer* aViewer);
#else
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* channel,
nsIContentViewer* aViewer);
#endif // NECKO
#ifndef NECKO
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax);
#else
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRUint32 aProgress,
PRUint32 aProgressMax);
#endif // NECKO
#ifndef NECKO
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, nsString& aMsg);
#else
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsString& aMsg);
#endif // NECKO
#ifndef NECKO
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus);
#else
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus);
#endif // NECKO
#ifndef NECKO
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURI *aURL,
const char *aContentType,
const char *aCommand );
#else
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
nsIChannel* channel,
const char *aContentType,
const char *aCommand );
#endif // NECKO
protected:
nsIDOMWindow *mToolbarWindow; // weak reference

View File

@ -59,11 +59,7 @@
#include "nsIStringStream.h"
#include "nsITextContent.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#else
#include "nsIURL.h"
#endif // NECKO
#include "nsIContent.h"
#include "nsIContentIterator.h"

View File

@ -2939,11 +2939,7 @@ nsHTMLEditor::ApplyDocumentOrOverrideStyleSheet(const nsString& aURL, PRBool aOv
nsresult rv = NS_OK;
nsCOMPtr<nsIURI> uaURL;
#ifndef NECKO
rv = NS_NewURL(getter_AddRefs(uaURL), aURL);
#else
rv = NS_NewURI(getter_AddRefs(uaURL), aURL);
#endif // NECKO
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIDocument> document;

View File

@ -171,29 +171,17 @@ XP_MakeHTMLDialog2(XPDialogInfo *dialogInfo) {
nsIURI* url;
char* separator;
#ifndef NECKO
nsINetService *netservice;
nsresult res;
res = nsServiceManager::GetService(kNetServiceCID,
kINetServiceIID,
(nsISupports **)&netservice);
#else
nsIOService *netservice;
nsresult res;
res = nsServiceManager::GetService(kIOServiceCID,
kIIOServiceIID,
(nsISupports **)&netservice);
#endif // NECKO
if ((NS_OK == res) && (nsnull != netservice)) {
const nsAutoString html_dlgs = nsAutoString(HTML_DLGS_URL);
if (!NS_FAILED(NS_NewURL(&url, html_dlgs))) {
#ifndef NECKO
res = netservice->GetCookieString(url, *nsCookie);
#else
return;
#endif // NECKO
/* convert cookie to a C string */

View File

@ -26,10 +26,8 @@
#include "nsIPICS.h"
#include "nsIPref.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#include "nsCOMPtr.h"
#endif // NECKO
#include "nsIParser.h"
#include "nsParserCIID.h"
#include "nsIHTMLContentSink.h"
@ -147,7 +145,6 @@ public:
virtual ~nsPICS(void);
// nsIDocumentLoaderObserver
#ifdef NECKO
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus, nsIDocumentLoaderObserver* aObserver);
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsIContentViewer* aViewer);
@ -155,29 +152,6 @@ public:
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsString& aMsg);
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);
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIURI* aURL,
PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver);
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, const char* aContentType,
nsIContentViewer* aViewer);
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax);
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, PRInt32 aStatus);
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURI* aURL,
const char *aContentType,
const char *aCommand );
#endif
// NS_IMETHOD OnConnectionsComplete();
@ -769,17 +743,10 @@ nsPICS::OnStartDocumentLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
#ifdef NECKO
nsPICS::OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
nsresult aStatus,
nsIDocumentLoaderObserver* aObserver)
#else
nsPICS::OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIURI* aURL,
PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver)
#endif
{
nsresult rv = NS_OK;
@ -805,20 +772,12 @@ nsPICS::OnEndDocumentLoad(nsIDocumentLoader* loader,
}
NS_IMETHODIMP
#ifdef NECKO
nsPICS::OnStartURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
nsIContentViewer* aViewer)
#else
nsPICS::OnStartURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL,
const char* aContentType,
nsIContentViewer* aViewer)
#endif
{
nsresult rv = NS_OK;
#ifdef NECKO
nsCOMPtr<nsIURI> aURL;
rv = channel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(rv)) return rv;
@ -826,7 +785,6 @@ nsPICS::OnStartURLLoad(nsIDocumentLoader* loader,
char* aContentType;
rv = channel->GetContentType(&aContentType);
if (NS_FAILED(rv)) return rv;
#endif
nsIContentViewerContainer *cont;
@ -893,24 +851,15 @@ nsPICS::OnStartURLLoad(nsIDocumentLoader* loader,
}
done:
#ifdef NECKO
nsCRT::free(aContentType);
#endif
return rv;
}
NS_IMETHODIMP
#ifdef NECKO
nsPICS::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
PRUint32 aProgress,
PRUint32 aProgressMax)
#else
nsPICS::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL,
PRUint32 aProgress,
PRUint32 aProgressMax)
#endif
{
if(!mPICSRatingsEnabled)
return NS_OK;
@ -918,15 +867,9 @@ nsPICS::OnProgressURLLoad(nsIDocumentLoader* loader,
}
NS_IMETHODIMP
#ifdef NECKO
nsPICS::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
nsString& aMsg)
#else
nsPICS::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL,
nsString& aMsg)
#endif
{
if(!mPICSRatingsEnabled)
return NS_OK;
@ -934,34 +877,20 @@ nsPICS::OnStatusURLLoad(nsIDocumentLoader* loader,
}
NS_IMETHODIMP
#ifdef NECKO
nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
nsresult aStatus)
#else
nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL,
PRInt32 aStatus)
#endif
{
nsresult rv;
#ifdef NECKO
nsCOMPtr<nsIURI> aURL;
rv = channel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(rv)) return rv;
#endif
nsIContentViewerContainer *cont;
#ifdef NECKO
char* uProtocol;
char* uHost;
char* uFile;
#else
const char* uProtocol;
const char* uHost;
const char* uFile;
#endif
nsIURI* rootURL;
nsIWebShellServices *ws;
@ -999,13 +928,8 @@ nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
PICS_URLData* urlData = (PICS_URLData*)currentURLList->ElementAt(i);
if(urlData == nsnull)
continue;
#ifdef NECKO
char* spec1;
char* spec2;
#else
const char* spec1;
const char* spec2;
#endif
if(aURL == nsnull)
continue;
@ -1015,17 +939,13 @@ nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
continue;
if(urlData->url == nsnull) {
#ifdef NECKO
nsCRT::free(spec1);
#endif
continue;
}
(urlData->url)->GetSpec(&spec2);
if(spec2 == nsnull) {
#ifdef NECKO
nsCRT::free(spec1);
#endif
continue;
}
@ -1033,15 +953,9 @@ nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
if(!urlData->notified) {
currentURLList->RemoveElementAt(i);
if (nsnull != aURL) {
#ifdef NECKO
aURL->GetScheme(&uProtocol);
aURL->GetHost(&uHost);
aURL->GetPath(&uFile);
#else
aURL->GetProtocol(&uProtocol);
aURL->GetHost(&uHost);
aURL->GetFile(&uFile);
#endif
if ((0 != PL_strcmp("/", uFile)) && (0 != PL_strcmp("/index.html", uFile))) {
if (0 != PL_strcmp("file", uProtocol)) {
nsAutoString protocolStr(uProtocol);
@ -1051,26 +965,18 @@ nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
nsAutoString rootStr = protocolStr + "://" + hostStr + "/";
// XXX if we're no longer calling GetRootURL, these calls can go away
#ifndef NECKO
// rv = NS_NewURL(&rootURL, rootStr);
#else
// rv = NS_NewURI(&rootURL, rootStr);
#endif // NECKO
// rv = GetRootURL(rootURL);
}
}
#ifdef NECKO
nsCRT::free(uProtocol);
nsCRT::free(uHost);
nsCRT::free(uFile);
#endif
}
}
}
#ifdef NECKO
nsCRT::free(spec1);
nsCRT::free(spec2);
#endif
}
}
}
@ -1080,17 +986,10 @@ nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
}
NS_IMETHODIMP
#ifdef NECKO
nsPICS::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIChannel* channel,
const char *aContentType,
const char *aCommand )
#else
nsPICS::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURI* aURL,
const char *aContentType,
const char *aCommand )
#endif
{
// If we have a doc loader observer, let it respond to this.
// return mDocLoaderObserver ? mDocLoaderObserver->HandleUnknownContentType( mDocLoader, aURL, aContentType, aCommand )
@ -1564,14 +1463,10 @@ nsPICS::GetRootURL(nsIURI* aURL)
if (NS_FAILED(rv = mParser->QueryInterface(kIStreamListenerIID, (void**) &lsnr)))
return rv;
mParser->Parse(aURL);
#ifdef NECKO
rv = NS_OpenURI(lsnr,
nsnull, // null context
aURL, // nsIURI
nsnull); // null load group
#else
rv = NS_OpenURL(aURL, lsnr);
#endif
}
NS_RELEASE(sink);
}

View File

@ -23,12 +23,10 @@
#include "nsRepository.h"
//#include "nsIObserver.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsPICSElementObserver.h"
#include "nsString.h"
#include "nsIPICS.h"
@ -162,9 +160,6 @@ NS_IMETHODIMP nsPICSElementObserver::Notify(PRUint32 aDocumentID,
char *label = theValue2.ToNewCString();
if (valueArray[numOfAttributes]) {
const nsString& theURLValue=valueArray[numOfAttributes];
#ifndef NECKO
rv = NS_NewURL(&uaURL, theURLValue);
#else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
@ -176,7 +171,6 @@ NS_IMETHODIMP nsPICSElementObserver::Notify(PRUint32 aDocumentID,
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&uaURL);
NS_RELEASE(uri);
if (NS_FAILED(rv)) return rv;
#endif // NECKO
}
nsIPICS *pics = NULL;
rv = nsRepository::CreateInstance(kPICSCID,

View File

@ -7,11 +7,7 @@
#include "nsIParser.h"
#include "nsParserCIID.h"
#ifndef NECKO
#include "nsINetService.h"
#else
#include "nsIIOService.h"
#endif // NECKO
#include "nsIObserverService.h"
#include "nsString.h"
@ -34,12 +30,7 @@ static NS_DEFINE_IID(kPICSCID, NS_PICS_CID);
static NS_DEFINE_IID(kIPrefIID, NS_IPREF_IID);
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
#ifndef NECKO
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
#else
static NS_DEFINE_IID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
@ -94,11 +85,7 @@ PRInt32 main(PRInt32 argc, char *argv[])
// Load preferences
nsComponentManager::RegisterComponent(kPrefCID, NULL, NULL, PREF_DLL, PR_FALSE, PR_FALSE);
#ifndef NECKO
nsComponentManager::RegisterComponent(kNetServiceCID, NULL, NULL, NETLIB_DLL, PR_FALSE, PR_FALSE);
#else
nsComponentManager::RegisterComponent(kIOServiceCID, NULL, NULL, NETLIB_DLL, PR_FALSE, PR_FALSE);
#endif // NECKO
nsComponentManager::RegisterComponent(kCParserCID, NULL, NULL, RAPTORHTMLPARS_DLL, PR_FALSE, PR_FALSE);

View File

@ -20,11 +20,7 @@
#include "nsIAllocator.h"
#include "plstr.h"
#include "stdio.h"
#ifdef NECKO
#include "nsICookieService.h"
#else
#include "nsINetService.h"
#endif
#include "nsIServiceManager.h"
#include "nsIDOMWindow.h"
#include "nsCOMPtr.h"
@ -33,13 +29,8 @@
#include "nsIScriptGlobalObject.h"
#include "nsICookieViewer.h"
#ifdef NECKO
static NS_DEFINE_IID(kICookieServiceIID, NS_ICOOKIESERVICE_IID);
static NS_DEFINE_IID(kCookieServiceCID, NS_COOKIESERVICE_CID);
#else
static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID);
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
#endif
class CookieViewerImpl : public nsICookieViewer
{
@ -93,7 +84,6 @@ CookieViewerImpl::GetCookieValue(char** aValue)
}
nsresult res;
#ifdef NECKO
NS_WITH_SERVICE(nsICookieService, cookieservice, kCookieServiceCID, &res);
if (NS_FAILED(res)) return res;
nsAutoString cookieList;
@ -101,19 +91,6 @@ CookieViewerImpl::GetCookieValue(char** aValue)
if (NS_SUCCEEDED(res)) {
*aValue = cookieList.ToNewCString();
}
#else
nsINetService *netservice;
res = nsServiceManager::GetService(kNetServiceCID,
kINetServiceIID,
(nsISupports **)&netservice);
if ((NS_SUCCEEDED(res)) && (nsnull != netservice)) {
nsAutoString cookieList;
res = netservice->Cookie_GetCookieListForViewer(cookieList);
if (NS_SUCCEEDED(res)) {
*aValue = cookieList.ToNewCString();
}
}
#endif
return res;
}
@ -126,7 +103,6 @@ CookieViewerImpl::GetPermissionValue(char** aValue)
}
nsresult res;
#ifdef NECKO
NS_WITH_SERVICE(nsICookieService, cookieservice, kCookieServiceCID, &res);
if (NS_FAILED(res)) return res;
nsAutoString PermissionList;
@ -134,19 +110,6 @@ CookieViewerImpl::GetPermissionValue(char** aValue)
if (NS_SUCCEEDED(res)) {
*aValue = PermissionList.ToNewCString();
}
#else
nsINetService *netservice;
res = nsServiceManager::GetService(kNetServiceCID,
kINetServiceIID,
(nsISupports **)&netservice);
if ((NS_SUCCEEDED(res)) && (nsnull != netservice)) {
nsAutoString PermissionList;
res = netservice->Cookie_GetPermissionListForViewer(PermissionList);
if (NS_SUCCEEDED(res)) {
*aValue = PermissionList.ToNewCString();
}
}
#endif
return res;
}
@ -159,20 +122,9 @@ CookieViewerImpl::SetValue(const char* aValue, nsIDOMWindow* win)
return NS_ERROR_NULL_POINTER;
}
nsresult res;
#ifdef NECKO
NS_WITH_SERVICE(nsICookieService, cookieservice, kCookieServiceCID, &res);
if (NS_FAILED(res)) return res;
nsAutoString netList = aValue;
res = cookieservice->Cookie_CookieViewerReturn(netList);
#else
nsINetService *netservice;
res = nsServiceManager::GetService(kNetServiceCID,
kINetServiceIID,
(nsISupports **)&netservice);
if ((NS_SUCCEEDED(res)) && (nsnull != netservice)) {
nsAutoString netList = aValue;
res = netservice->Cookie_CookieViewerReturn(netList);
}
#endif
return res;
}

View File

@ -170,24 +170,12 @@ XP_MakeHTMLDialog2(XPDialogInfo *dialogInfo) {
char* separator;
nsresult res;
#ifndef NECKO
nsINetService *netservice;
res = nsServiceManager::GetService(kNetServiceCID,
kINetServiceIID,
(nsISupports **)&netservice);
#else
NS_WITH_SERVICE(nsIIOService, netservice, kIOServiceCID, &res);
#endif // NECKO
if ((NS_SUCCEEDED(res)) && (nsnull != netservice)) {
const nsAutoString html_dlgs = nsAutoString(HTML_DLGS_URL);
#ifndef NECKO
if (!NS_FAILED(NS_NewURL(&url, html_dlgs))) {
res = netservice->GetCookieString(url, *nsCookie);
#else
if (1) {
return; // NECKO XXX
#endif // NECKO
/* convert cookie to a C string */

View File

@ -215,13 +215,8 @@ nsWalletlibService::OnStartDocumentLoad(nsIDocumentLoader* aLoader, nsIURI* aURL
#include "prmem.h"
NS_IMETHODIMP
#ifdef NECKO
nsWalletlibService::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIChannel* channel, nsresult aStatus,
nsIDocumentLoaderObserver * aObserver)
#else
nsWalletlibService::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIURI *aUrl, PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver)
#endif
{
nsresult rv = NS_OK;
nsIContentViewerContainer *cont = nsnull;
@ -267,11 +262,7 @@ nsWalletlibService::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIURI *aUrl,
/* get url name as ascii string */
char *URLName = nsnull;
nsIURI* docURL = nsnull;
#ifdef NECKO
char* spec;
#else
const char* spec;
#endif
if (!doc) {
return NS_OK;
}
@ -283,9 +274,7 @@ nsWalletlibService::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIURI *aUrl,
URLName = (char*)PR_Malloc(PL_strlen(spec)+1);
PL_strcpy(URLName, spec);
NS_IF_RELEASE(docURL);
#ifdef NECKO
nsCRT::free(spec);
#endif
nsIDOMHTMLDocument *htmldoc = nsnull;
rv = doc->QueryInterface(kIDOMHTMLDocumentIID, (void**)&htmldoc);
@ -379,61 +368,37 @@ nsWalletlibService::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIURI *aUrl,
}
NS_IMETHODIMP
#ifdef NECKO
nsWalletlibService::OnStartURLLoad
(nsIDocumentLoader* loader, nsIChannel* channel, nsIContentViewer* aViewer)
#else
nsWalletlibService::OnStartURLLoad
(nsIDocumentLoader* loader, nsIURI* aURL, const char* aContentType, nsIContentViewer* aViewer)
#endif
{
return NS_OK;
}
NS_IMETHODIMP
#ifdef NECKO
nsWalletlibService::OnProgressURLLoad
(nsIDocumentLoader* loader, nsIChannel* channel, PRUint32 aProgress, PRUint32 aProgressMax)
#else
nsWalletlibService::OnProgressURLLoad
(nsIDocumentLoader* loader, nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
#endif
{
return NS_OK;
}
NS_IMETHODIMP
#ifdef NECKO
nsWalletlibService::OnStatusURLLoad
(nsIDocumentLoader* loader, nsIChannel* channel, nsString& aMsg)
#else
nsWalletlibService::OnStatusURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, nsString& aMsg)
#endif
{
return NS_OK;
}
NS_IMETHODIMP
#ifdef NECKO
nsWalletlibService::OnEndURLLoad
(nsIDocumentLoader* loader, nsIChannel* channel, nsresult aStatus)
#else
nsWalletlibService::OnEndURLLoad
(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus)
#endif
{
return NS_OK;
}
NS_IMETHODIMP
#ifdef NECKO
nsWalletlibService::HandleUnknownContentType
(nsIDocumentLoader* loader, nsIChannel* channel, const char *aContentType, const char *aCommand )
#else
nsWalletlibService::HandleUnknownContentType
(nsIDocumentLoader* loader, nsIURI *aURL, const char *aContentType, const char *aCommand )
#endif
{
return NS_OK;
}

View File

@ -67,7 +67,6 @@ public:
NS_IMETHOD Notify(nsIContent* formNode);
// nsIDocumentLoaderObserver
#ifdef NECKO
NS_IMETHOD OnStartDocumentLoad
(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand);
NS_IMETHOD OnEndDocumentLoad
@ -85,24 +84,6 @@ public:
NS_IMETHOD HandleUnknownContentType
(nsIDocumentLoader* loader, nsIChannel* channel, const char *aContentType,
const char *aCommand );
#else
NS_IMETHOD OnStartDocumentLoad
(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand);
NS_IMETHOD OnEndDocumentLoad
(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver);
NS_IMETHOD OnStartURLLoad
(nsIDocumentLoader* loader, nsIURI* aURL, const char* aContentType,
nsIContentViewer* aViewer);
NS_IMETHOD OnProgressURLLoad
(nsIDocumentLoader* loader, nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus);
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURI *aURL,
const char *aContentType,
const char *aCommand );
#endif
protected:
virtual ~nsWalletlibService();

View File

@ -2060,21 +2060,6 @@ SINGSIGN_RestoreSignonData (char* URLName, char* name, char** value) {
/* restore the data from previous time this URL was visited */
#ifndef NECKO
/* fix bug 9326 */
/*
* This is a temporary hack until necko lands because it is believed necko will fix this
* The problem is that if the database of saved passwords had not already been unlocked,
* a dialog will come up at this time asking for password to unlock the database. But
* that dialog was coming up blank because we are on the netlib thread. Hack is to not
* attempt to prefill with saved passwords at this time if the database has not been
* previously unlocked. Such unlocking could be done by doing edit/wallet/wallet-contents
* for example.
*/
extern PRBool keySet;
if (!keySet) user=0; else
#endif
user = si_GetUser(URLName, PR_FALSE, name);
if (user) {
SI_LoadSignonData(PR_TRUE); /* this destroys user so need to recaculate it */

View File

@ -22,13 +22,9 @@
*/
#include "wallet.h"
#ifndef NECKO
#include "nsINetService.h"
#else
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIChannel.h"
#endif // NECKO
#include "nsIServiceManager.h"
#include "nsIDocument.h"
@ -62,13 +58,8 @@ static NS_DEFINE_IID(kIDOMHTMLInputElementIID, NS_IDOMHTMLINPUTELEMENT_IID);
static NS_DEFINE_IID(kIDOMHTMLSelectElementIID, NS_IDOMHTMLSELECTELEMENT_IID);
static NS_DEFINE_IID(kIDOMHTMLOptionElementIID, NS_IDOMHTMLOPTIONELEMENT_IID);
#ifndef NECKO
static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID);
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
#else
static NS_DEFINE_IID(kIIOServiceIID, NS_IIOSERVICE_IID);
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
static NS_DEFINE_CID(kNetSupportDialogCID, NS_NETSUPPORTDIALOG_CID);
static NS_DEFINE_CID(kProfileCID, NS_PROFILE_CID);
@ -637,15 +628,9 @@ Wallet_Localize(char* genericString) {
nsAutoString v("");
/* create a URL for the string resource file */
#ifndef NECKO
nsINetService* pNetService = nsnull;
ret = nsServiceManager::GetService(kNetServiceCID, kINetServiceIID,
(nsISupports**) &pNetService);
#else
nsIIOService* pNetService = nsnull;
ret = nsServiceManager::GetService(kIOServiceCID, kIIOServiceIID,
(nsISupports**) &pNetService);
#endif // NECKO
if (NS_FAILED(ret)) {
printf("cannot get net service\n");
@ -653,12 +638,6 @@ Wallet_Localize(char* genericString) {
}
nsIURI *url = nsnull;
#ifndef NECKO
ret = pNetService->CreateURL(&url, nsString(PROPERTIES_URL), nsnull, nsnull,
nsnull);
nsServiceManager::ReleaseService(kNetServiceCID, pNetService);
#else
nsIURI *uri = nsnull;
ret = pNetService->NewURI(PROPERTIES_URL, nsnull, &uri);
if (NS_FAILED(ret)) {
@ -670,8 +649,6 @@ Wallet_Localize(char* genericString) {
ret = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
nsServiceManager::ReleaseService(kIOServiceCID, pNetService);
#endif // NECKO
if (NS_FAILED(ret)) {
printf("cannot create URL\n");
return v.ToNewUnicode();
@ -688,24 +665,16 @@ Wallet_Localize(char* genericString) {
nsILocale* locale = nsnull;
nsIStringBundle* bundle = nsnull;
#if 1
#ifndef NECKO
const char* spec = nsnull;
#else
char* spec = nsnull;
#endif /* NECKO */
ret = url->GetSpec(&spec);
if (NS_FAILED(ret)) {
printf("cannot get url spec\n");
nsServiceManager::ReleaseService(kStringBundleServiceCID, pStringService);
#ifdef NECKO
nsCRT::free(spec);
#endif /* NECKO */
return v.ToNewUnicode();
}
ret = pStringService->CreateBundle(spec, locale, &bundle);
#ifdef NECKO
nsCRT::free(spec);
#endif /* NECKO */
#else
ret = pStringService->CreateBundle(url, locale, &bundle);
#endif
@ -812,7 +781,6 @@ Wallet_3ButtonConfirm(PRUnichar * szMessage)
PUBLIC void
Wallet_Alert(PRUnichar * szMessage)
{
#ifdef NECKO
nsresult res;
NS_WITH_SERVICE(nsIPrompt, dialog, kNetSupportDialogCID, &res);
if (NS_FAILED(res)) {
@ -822,26 +790,11 @@ Wallet_Alert(PRUnichar * szMessage)
const nsString message = szMessage;
res = dialog->Alert(message.GetUnicode());
return; // XXX should return the error
#else
nsINetSupportDialogService* dialog = NULL;
nsresult res = nsServiceManager::GetService(kNetSupportDialogCID,
nsINetSupportDialogService::GetIID(), (nsISupports**)&dialog);
if (NS_FAILED(res)) {
return;
}
if (dialog) {
const nsString message = szMessage;
dialog->Alert(message);
}
nsServiceManager::ReleaseService(kNetSupportDialogCID, dialog);
return;
#endif
}
PUBLIC PRBool
Wallet_CheckConfirmYN(PRUnichar * szMessage, char * szCheckMessage, PRBool* checkValue)
{
#ifdef NECKO
PRBool retval = PR_TRUE; /* default value */
nsresult res;
@ -866,31 +819,10 @@ Wallet_CheckConfirmYN(PRUnichar * szMessage, char * szCheckMessage, PRBool* chec
*checkValue = 0; /* this should never happen but it is happening!!! */
}
return retval;
#else
PRBool retval = PR_TRUE; /* default value */
nsINetSupportDialogService* dialog = NULL;
nsresult res = nsServiceManager::GetService(kNetSupportDialogCID,
nsINetSupportDialogService::GetIID(), (nsISupports**)&dialog);
if (NS_FAILED(res)) {
return retval;
}
if (dialog) {
const nsString message = szMessage;
const nsString checkMessage = szCheckMessage;
retval = PR_FALSE; /* in case user exits dialog by clicking X */
dialog->ConfirmCheckYN(message, checkMessage, &retval, checkValue);
if (*checkValue!=0 && *checkValue!=1) {
*checkValue = 0; /* this should never happen but it is happening!!! */
}
}
nsServiceManager::ReleaseService(kNetSupportDialogCID, dialog);
return retval;
#endif
}
char * wallet_GetString(PRUnichar * szMessage)
{
#ifdef NECKO
nsString password;
PRBool retval;
@ -915,27 +847,6 @@ char * wallet_GetString(PRUnichar * szMessage)
} else {
return NULL; /* user pressed cancel */
}
#else
nsString password;
PRBool retval;
nsINetSupportDialogService* dialog = NULL;
nsresult res = nsServiceManager::GetService(kNetSupportDialogCID,
nsINetSupportDialogService::GetIID(), (nsISupports**)&dialog);
if (NS_FAILED(res)) {
return NULL; /* failure value */
}
if (dialog) {
const nsString message = szMessage;
retval = PR_FALSE; /* in case user exits dialog by clicking X */
dialog->PromptPassword(message, password, &retval);
}
nsServiceManager::ReleaseService(kNetSupportDialogCID, dialog);
if (retval) {
return password.ToNewCString();
} else {
return NULL; /* user pressed cancel */
}
#endif
}
char * wallet_GetDoubleString(PRUnichar * szMessage, PRUnichar * szMessage2, PRBool& matched)

View File

@ -29,11 +29,7 @@
#include "il_util.h"
#include "nsIDeviceContext.h"
#include "nsIStreamListener.h"
#ifdef NECKO
#include "nsILoadGroup.h"
#else
#include "nsIURLGroup.h"
#endif
static NS_DEFINE_IID(kIImageGroupIID, NS_IIMAGEGROUP_IID);

View File

@ -27,26 +27,17 @@
#include "plstr.h"
//#include "il_strm.h"
#ifndef NECKO
#include "nsINetService.h"
#else
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIChannel.h"
#endif // NECKO
#include "nsIServiceManager.h"
static NS_DEFINE_IID(kIImageNetContextIID, IL_INETCONTEXT_IID);
static NS_DEFINE_IID(kIURLIID, NS_IURL_IID);
#ifndef NECKO
static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID);
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
#else
static NS_DEFINE_IID(kIIOServiceIID, NS_IIOSERVICE_IID);
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
class ImageNetContextSyncImpl : public ilINetContext {
public:
@ -188,22 +179,11 @@ ImageNetContextSyncImpl::GetURL(ilIURL* aURL,
nsresult res;
// Get a network service interface which we'll use to create a stream
#ifndef NECKO
NS_WITH_SERVICE(nsINetService, service, kNetServiceCID, &res)
#else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &res);
#endif // NECKO
if (NS_SUCCEEDED(res)) {
nsIInputStream* stream = nsnull;
#ifndef NECKO
// Initiate a synchronous URL load
if (NS_SUCCEEDED(service->OpenBlockingStream(url, nsnull, &stream)) &&
(aReader->StreamCreated(aURL, "unknown") == PR_TRUE)) {
#else
nsIURI *uri = nsnull;
nsresult rv;
@ -239,8 +219,6 @@ ImageNetContextSyncImpl::GetURL(ilIURL* aURL,
if (aReader->StreamCreated(aURL, aContentType) == PR_TRUE) {
#endif // NECKO
// Read the URL data
char buf[2048];
PRUint32 count;

View File

@ -22,13 +22,8 @@
#include "ilINetReader.h"
#include "ilIURL.h"
#include "nsIURL.h"
#ifndef NECKO
#include "nsIURLGroup.h"
#include "nsILoadAttribs.h"
#else
#include "nsIURL.h"
#include "nsNeckoUtil.h"
#endif // NECKO
#include "nsString.h"
@ -42,11 +37,7 @@ public:
NS_DECL_ISUPPORTS
#ifdef NECKO
nsresult Init(const char *aURL);
#else
nsresult Init(const char *aURL, nsILoadGroup* aLoadGroup);
#endif
virtual void SetReader(ilINetReader *aReader);
@ -54,11 +45,7 @@ public:
virtual int GetContentLength();
#ifdef NECKO
virtual char* GetAddress();
#else
virtual const char* GetAddress();
#endif
virtual time_t GetExpires();
@ -70,11 +57,7 @@ public:
virtual void SetOwnerId(int aOwnderId);
private:
#ifdef NECKO
nsIURI *mURL;
#else
nsIURI *mURL;
#endif
ilINetReader *mReader;
PRBool mBackgroundLoad;
};
@ -87,25 +70,11 @@ ImageURLImpl::ImageURLImpl(void)
}
nsresult
#ifdef NECKO
ImageURLImpl::Init(const char *aURL)
#else
ImageURLImpl::Init(const char *aURL, nsILoadGroup* aLoadGroup)
#endif
{
nsresult rv;
#ifndef NECKO
if (nsnull != aLoadGroup) {
rv = aLoadGroup->CreateURL(&mURL, nsnull, aURL, nsnull);
}
else
#endif
{
#ifdef NECKO
rv = NS_NewURI(&mURL, aURL);
#else
rv = NS_NewURL(&mURL, aURL);
#endif
}
return rv;
}
@ -184,19 +153,11 @@ ImageURLImpl::GetContentLength()
return 0;
}
#ifdef NECKO
char*
#else
const char*
#endif
ImageURLImpl::GetAddress()
{
if (mURL != nsnull) {
#ifdef NECKO
char* spec;
#else
const char* spec;
#endif
mURL->GetSpec(&spec);
return spec;
}
@ -219,24 +180,8 @@ PRBool ImageURLImpl::GetBackgroundLoad()
void
ImageURLImpl::SetBackgroundLoad(PRBool aBgload)
{
#ifdef NECKO
// XXX help!
mBackgroundLoad = aBgload;
#else
nsILoadAttribs* loadAttributes;
if (nsnull != mURL) {
nsresult rv = mURL->GetLoadAttribs(&loadAttributes);
if (rv == NS_OK && nsnull != loadAttributes) {
if (aBgload) {
loadAttributes->SetLoadType(nsURLLoadBackground);
} else {
loadAttributes->SetLoadType(nsURLLoadNormal);
}
NS_RELEASE(loadAttributes);
}
}
#endif
}
int
@ -263,11 +208,7 @@ NS_NewImageURL(ilIURL **aInstancePtrResult, const char *aURL,
if (url == nsnull) {
return NS_ERROR_OUT_OF_MEMORY;
}
#ifdef NECKO
nsresult rv = url->Init(aURL);
#else
nsresult rv = url->Init(aURL, aLoadGroup);
#endif
if (rv != NS_OK) {
delete url;
return rv;

View File

@ -24,12 +24,10 @@
#include "nsVoidArray.h"
#include "nsString.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIServiceManager.h"
#include "nsIURL.h"
#include "nsIIOService.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsIDTDDebug.h"
#include "nsIComponentManager.h"
#include "nsParserCIID.h"
@ -278,9 +276,6 @@ extern "C" NS_EXPORT int DebugRobot(
// Create url
nsIURI* url;
nsresult rv;
#ifndef NECKO
rv = NS_NewURL(&url, *urlName);
#else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
@ -293,7 +288,6 @@ extern "C" NS_EXPORT int DebugRobot(
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK != rv) {
printf("invalid URL: '");
fputs(*urlName, stdout);
@ -344,16 +338,10 @@ extern "C" NS_EXPORT int DebugRobot(
parser->Parse(url, nsnull,PR_TRUE);/* XXX hook up stream listener here! */
while (!g_bReadyForNextUrl) {
if (yieldProc != NULL) {
#ifdef NECKO
char* spec;
(void)url->GetSpec(&spec);
(*yieldProc)(spec);
nsCRT::free(spec);
#else
const char* spec;
(void)url->GetSpec(&spec);
(*yieldProc)(spec);
#endif
}
}
g_bReadyForNextUrl = PR_FALSE;
@ -365,28 +353,16 @@ extern "C" NS_EXPORT int DebugRobot(
docLoader->AddObserver(pl);
NS_RELEASE(docLoader);
}
#ifdef NECKO
char* spec;
(void)url->GetSpec(&spec);
nsAutoString theSpec(spec);
nsCRT::free(spec);
#else
const char* spec;
(void)url->GetSpec(&spec);
nsAutoString theSpec(spec);
#endif
ww->LoadURL(theSpec.GetUnicode());/* XXX hook up stream listener here! */
while (!g_bReadyForNextUrl) {
if (yieldProc != NULL) {
#ifdef NECKO
(void)url->GetSpec(&spec);
(*yieldProc)(spec);
nsCRT::free(spec);
#else
const char* spec;
(void)url->GetSpec(&spec);
(*yieldProc)(spec);
#endif
}
}
}

View File

@ -21,12 +21,10 @@
#include "nsIParser.h"
#include "nsString.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsIIOService.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsCRT.h"
#include "nsVoidArray.h"
class nsIDocument;
@ -337,9 +335,6 @@ void RobotSink::ProcessLink(const nsString& aLink)
if (nsnull != docURL) {
nsIURI* absurl;
nsresult rv;
#ifndef NECKO
rv = NS_NewURL(&absurl, aLink, docURL);
#else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return;
@ -357,22 +352,13 @@ void RobotSink::ProcessLink(const nsString& aLink)
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
}
}

View File

@ -32,11 +32,7 @@
#include "prmem.h"
#include "nsIUnicharInputStream.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#else
#include "nsINetService.h"
#endif
#include "nsIServiceManager.h"
#include "nsCOMPtr.h"
#include "nsSpecialSystemDirectory.h"
@ -51,12 +47,6 @@ static NS_DEFINE_IID(kITokenizerIID, NS_ITOKENIZER_IID);
static NS_DEFINE_IID(kHTMLTokenizerIID, NS_HTMLTOKENIZER_IID);
static NS_DEFINE_IID(kClassIID, NS_EXPATTOKENIZER_IID);
#ifndef NECKO
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID);
#endif
static CTokenRecycler* gTokenRecycler=0;
static nsDeque* gTokenDeque=0;
static XML_Parser gExpatParser=0;
@ -565,37 +555,6 @@ nsExpatTokenizer::OpenInputStream(const nsString& aURLStr,
nsString* aAbsURL)
{
nsresult rv;
#ifndef NECKO
nsCOMPtr<nsINetService> pNetService = nsnull;
aAbsURL->Truncate(0);
rv = nsServiceManager::GetService(kNetServiceCID,
kINetServiceIID, (nsISupports**) getter_AddRefs(pNetService));
if (NS_SUCCEEDED(rv) && nsnull != pNetService) {
nsCOMPtr<nsIURI> contextURL = nsnull;
rv = pNetService->CreateURL(getter_AddRefs(contextURL), aBaseURL);
if (NS_SUCCEEDED(rv) && nsnull != contextURL) {
nsCOMPtr<nsIURI> url = nsnull;
rv = pNetService->CreateURL(getter_AddRefs(url), aURLStr, contextURL);
if (NS_SUCCEEDED(rv) && nsnull != url) {
char* protocol = nsnull;
rv = url->GetProtocol(&protocol);
if (NS_SUCCEEDED(rv) &&
nsnull != protocol &&
PL_strcmp(protocol, kChromeProtocol) == 0 ) {
rv = pNetService->OpenBlockingStream(url, nsnull, in);
const char* absURL = nsnull;
url->GetSpec(&absURL);
aAbsURL->Append(absURL);
}
else {
rv = NS_ERROR_NOT_IMPLEMENTED;
}
}
}
}
#else // NECKO
nsCOMPtr<nsIURI> baseURI;
rv = NS_NewURI(getter_AddRefs(baseURI), aBaseURL);
if (NS_SUCCEEDED(rv) && nsnull != baseURI) {
@ -614,7 +573,6 @@ nsExpatTokenizer::OpenInputStream(const nsString& aURLStr,
}
}
}
#endif // NECKO
return rv;
}

View File

@ -33,11 +33,9 @@
#include "nsViewSourceHTML.h"
#include "nsHTMLContentSinkStream.h" //this is here so we can get a null sink, which really should be gotten from nsICOntentSink.h
#include "nsIStringStream.h"
#ifdef NECKO
#include "nsIChannel.h"
#include "nsIProgressEventSink.h"
#include "nsIBufferInputStream.h"
#endif
#undef rickgdebug
#ifdef rickgdebug
@ -196,9 +194,7 @@ nsParser::nsParser(nsITokenObserver* anObserver) : mCommand(""), mUnusedInput(""
NS_INIT_REFCNT();
mParserFilter = 0;
mObserver = 0;
#ifdef NECKO
mProgressEventSink = nsnull;
#endif
mSink=0;
mParserContext=0;
mTokenObserver=anObserver;
@ -225,9 +221,7 @@ nsParser::nsParser(nsITokenObserver* anObserver) : mCommand(""), mUnusedInput(""
*/
nsParser::~nsParser() {
NS_IF_RELEASE(mObserver);
#ifdef NECKO
NS_IF_RELEASE(mProgressEventSink);
#endif
NS_IF_RELEASE(mSink);
//don't forget to add code here to delete
@ -263,11 +257,9 @@ nsresult nsParser::QueryInterface(const nsIID& aIID, void** aInstancePtr)
else if(aIID.Equals(kIParserIID)) { //do IParser base class...
*aInstancePtr = (nsIParser*)(this);
}
#ifdef NECKO
else if(aIID.Equals(nsIProgressEventSink::GetIID())) {
*aInstancePtr = (nsIStreamListener*)(this);
}
#endif
else if(aIID.Equals(nsIStreamObserver::GetIID())) {
*aInstancePtr = (nsIStreamObserver*)(this);
}
@ -726,20 +718,14 @@ nsresult nsParser::Parse(nsIURI* aURL,nsIStreamObserver* aListener,PRBool aVerif
nsresult result=kBadURL;
mDTDVerification=aVerifyEnabled;
if(aURL) {
#ifdef NECKO
char* spec;
#else
const char* spec;
#endif
nsresult rv = aURL->GetSpec(&spec);
if (rv != NS_OK) {
NS_STOP_STOPWATCH(mTotalTime)
return rv;
}
nsAutoString theName(spec);
#ifdef NECKO
nsCRT::free(spec);
#endif
nsScanner* theScanner=new nsScanner(theName,PR_FALSE,mCharset,mCharsetSource);
CParserContext* pc=new CParserContext(theScanner,aKey,aListener);
@ -1088,20 +1074,6 @@ nsITokenizer* nsParser::GetTokenizer(void) {
These methods are used to talk to the netlib system...
*******************************************************************/
#ifndef NECKO
/**
*
*
* @update gess 5/12/98
* @param
* @return error code -- 0 if ok, non-zero if error.
*/
nsresult nsParser::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo){
nsresult result=0;
return result;
}
#endif
/**
*
*
@ -1110,22 +1082,12 @@ nsresult nsParser::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo){
* @return error code -- 0 if ok, non-zero if error.
*/
nsresult
#ifdef NECKO
nsParser::OnProgress(nsIChannel* channel, nsISupports* aContext, PRUint32 aProgress, PRUint32 aProgressMax)
#else
nsParser::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
#endif
{
nsresult result=0;
#ifdef NECKO
if (nsnull != mProgressEventSink) {
mProgressEventSink->OnProgress(channel, aContext, aProgress, aProgressMax);
}
#else
if (nsnull != mObserver) {
mObserver->OnProgress(aURL, aProgress, aProgressMax);
}
#endif
return result;
}
@ -1137,22 +1099,12 @@ nsParser::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
* @return error code -- 0 if ok, non-zero if error.
*/
nsresult
#ifdef NECKO
nsParser::OnStatus(nsIChannel* channel, nsISupports* aContext, const PRUnichar* aMsg)
#else
nsParser::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
#endif
{
nsresult result=0;
#ifdef NECKO
if (nsnull != mProgressEventSink) {
mProgressEventSink->OnStatus(channel, aContext, aMsg);
}
#else
if (nsnull != mObserver) {
mObserver->OnStatus(aURL, aMsg);
}
#endif
return result;
}
@ -1168,25 +1120,16 @@ nsParser::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
* @param
* @return error code -- 0 if ok, non-zero if error.
*/
#ifdef NECKO
nsresult nsParser::OnStartRequest(nsIChannel* channel, nsISupports* aContext)
#else
nsresult nsParser::OnStartRequest(nsIURI* aURL, const char *aSourceType)
#endif
{
NS_PRECONDITION((eNone==mParserContext->mStreamListenerState),kBadListenerInit);
if (nsnull != mObserver) {
#ifdef NECKO
mObserver->OnStartRequest(channel, aContext);
#else
mObserver->OnStartRequest(aURL, aSourceType);
#endif
}
mParserContext->mStreamListenerState=eOnStart;
mParserContext->mAutoDetectStatus=eUnknownDetect;
mParserContext->mDTD=0;
#ifdef NECKO
nsresult rv;
char* contentType = nsnull;
rv = channel->GetContentType(&contentType);
@ -1198,10 +1141,6 @@ nsresult nsParser::OnStartRequest(nsIURI* aURL, const char *aSourceType)
else
NS_ASSERTION(contentType, "parser needs a content type to find a dtd");
#else
mParserContext->mSourceType=aSourceType;
#endif
#ifdef rickgdebug
gDumpFile = new fstream("c:/temp/out.file",ios::trunc);
#endif
@ -1322,12 +1261,8 @@ static PRBool detectByteOrderMark(const unsigned char* aBytes, PRInt32 aLen,
* @param length is the number of bytes waiting input
* @return error code (usually 0)
*/
#ifdef NECKO
nsresult nsParser::OnDataAvailable(nsIChannel* channel, nsISupports* aContext,
nsIInputStream *pIStream, PRUint32 sourceOffset, PRUint32 aLength)
#else
nsresult nsParser::OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUint32 aLength)
#endif
{
NS_PRECONDITION(((eOnStart==mParserContext->mStreamListenerState)||(eOnDataAvail==mParserContext->mStreamListenerState)),kOnStartNotCalled);
@ -1410,12 +1345,8 @@ nsresult nsParser::OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUin
* @param
* @return
*/
#ifdef NECKO
nsresult nsParser::OnStopRequest(nsIChannel* channel, nsISupports* aContext,
nsresult status, const PRUnichar* aMsg)
#else
nsresult nsParser::OnStopRequest(nsIURI* aURL, nsresult status, const PRUnichar* aMsg)
#endif
{
NS_START_STOPWATCH(mTotalTime)
@ -1447,11 +1378,7 @@ nsresult nsParser::OnStopRequest(nsIURI* aURL, nsresult status, const PRUnichar*
// XXX Should we wait to notify our observers as well if the
// parser isn't yet enabled?
if (nsnull != mObserver) {
#ifdef NECKO
mObserver->OnStopRequest(channel, aContext, status, aMsg);
#else
mObserver->OnStopRequest(aURL, status, aMsg);
#endif
}
#ifdef rickgdebug

View File

@ -70,9 +70,7 @@ class IContentSink;
class nsIDTD;
class nsScanner;
class nsIParserFilter;
#ifdef NECKO
class nsIProgressEventSink;
#endif
#include <fstream.h>
@ -245,7 +243,6 @@ CLASS_EXPORT_HTMLPARS nsParser : public nsIParser, public nsIStreamListener {
// These methods are callback methods used by
// net lib to let us know about our inputstream.
//*********************************************
#ifdef NECKO
// nsIProgressEventSink methods:
NS_IMETHOD OnProgress(nsIChannel* channel, nsISupports* context, PRUint32 Progress, PRUint32 ProgressMax);
NS_IMETHOD OnStatus(nsIChannel* channel, nsISupports* context, const PRUnichar* aMmsg);
@ -256,15 +253,6 @@ CLASS_EXPORT_HTMLPARS nsParser : public nsIParser, public nsIStreamListener {
// nsIStreamListener methods:
NS_DECL_NSISTREAMLISTENER
#else
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 Progress, PRUint32 ProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMmsg);
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUint32 length);
NS_IMETHOD OnStopRequest(nsIURI* aURL, nsresult status, const PRUnichar* aMsg);
#endif
void PushContext(CParserContext& aContext);
CParserContext* PopContext();
CParserContext* PeekContext() {return mParserContext;}
@ -378,9 +366,7 @@ protected:
PRInt32 mMinorIteration;
nsIStreamObserver* mObserver;
#ifdef NECKO
nsIProgressEventSink* mProgressEventSink;
#endif
nsIContentSink* mSink;
nsIParserFilter* mParserFilter;
PRBool mDTDVerification;

View File

@ -20,13 +20,9 @@
#include "nsIInputStream.h"
#include "nsIURL.h"
#ifndef NECKO
#include "nsINetService.h"
#else
#include "nsIIOService.h"
#include "nsIChannel.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsString.h"
#include "nsCRT.h"
@ -225,12 +221,6 @@ PageGrabber::Grab(const nsString& aURL)
nsIURI* url = NULL;
nsresult rv;
#ifndef NECKO
rv = NS_NewURL(&url, aURL);
if (NS_OK != rv) {
return rv;
}
#else
rv = NS_WITH_SERVICE(nsIIOService, ioService, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
@ -238,18 +228,13 @@ PageGrabber::Grab(const nsString& aURL)
// XXX NECKO what verb? what eventSinkGetter?
rv = ioService->NewChannel("load", aURL, nsnull, nsnull, &channel);
if (NS_FAILED(rv)) return rv;
#endif // NECKO
// Start the URL load...
StreamToFile* copier = new StreamToFile(fp);
if(copier) {
NS_ADDREF(copier);
#ifndef NECKO
rv = url->Open(copier);
#else
rv = channel->AsyncRead(0, -1, nsnull, copier);
#endif // NECKO
if (NS_OK != rv) {
NS_RELEASE(copier);

View File

@ -27,11 +27,7 @@
#include "nsIAllocator.h"
#include "plstr.h"
#ifndef NECKO
#include "nsINetService.h"
#else
#include "nsNeckoUtil.h"
#endif // NECKO
#include "nsIURL.h"
#include "nsIComponentManager.h"
@ -53,11 +49,6 @@ NS_DEFINE_IID(kIStringBundleIID, NS_ISTRINGBUNDLE_IID);
NS_DEFINE_IID(kIStringBundleServiceIID, NS_ISTRINGBUNDLESERVICE_IID);
NS_DEFINE_IID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
#ifndef NECKO
static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID);
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
#endif // NECKO
static NS_DEFINE_IID(kIPersistentPropertiesIID, NS_IPERSISTENTPROPERTIES_IID);
class nsStringBundle : public nsIStringBundle
@ -275,44 +266,12 @@ nsStringBundle::OpenInputStream(nsString2& aURLStr, nsIInputStream*& in)
}
#endif
nsresult ret;
#ifndef NECKO
nsINetService* pNetService = nsnull;
ret = nsServiceManager::GetService(kNetServiceCID,
kINetServiceIID, (nsISupports**) &pNetService);
/* get the url
*/
nsIURI *url = nsnull;
ret = pNetService->CreateURL(&url, aURLStr, nsnull, nsnull,
nsnull);
if (NS_FAILED(ret)) {
#ifdef DEBUG_tao
char *s = aURLStr.ToNewCString();
printf("\n** cannot create URL for %s\n", s?s:"null");
delete s;
#endif
return ret;
}
//
ret = pNetService->OpenBlockingStream(url, nsnull, &in);
NS_RELEASE(url);
#ifdef DEBUG_tao
if (NS_FAILED(ret) || !in) {
char *s = aURLStr.ToNewCString();
printf("\n** cannot open stream: %s\n", s?s:"null");
delete s;
}
#endif
#else // NECKO
nsIURI* uri;
ret = NS_NewURI(&uri, aURLStr);
if (NS_FAILED(ret)) return ret;
ret = NS_OpenURI(&in, uri);
NS_RELEASE(uri);
#endif // NECKO
return ret;
}

View File

@ -24,13 +24,9 @@
#include "nsILocale.h"
#include <iostream.h>
#ifndef NECKO
#include "nsINetService.h"
#else
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
#endif
#include "nsIServiceManager.h"
#include "nsIComponentManager.h"
@ -60,13 +56,8 @@
static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
static NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID);
#ifndef NECKO
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID);
#else
static NS_DEFINE_IID(kIIOServiceIID, NS_IIOSERVICE_IID);
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
static NS_DEFINE_IID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
static NS_DEFINE_IID(kIStringBundleServiceIID, NS_ISTRINGBUNDLESERVICE_IID);
@ -145,11 +136,7 @@ nsresult NS_AutoregisterComponents()
NULL, NULL,
XPCOM_DLL,
PR_FALSE, PR_FALSE);
#ifndef NECKO
nsComponentManager::RegisterComponent(kNetServiceCID, NULL, NULL, NETLIB_DLL, PR_FALSE, PR_FALSE);
#else
nsComponentManager::RegisterComponent(kIOServiceCID, NULL, NULL, NETLIB_DLL, PR_FALSE, PR_FALSE);
#endif // NECKO
// Create the Event Queue for this thread...
nsIEventQueueService* pEventQService;

View File

@ -21,19 +21,10 @@
#include "nsIComponentManager.h"
#include "nsIURL.h"
#ifndef NECKO
#include "nsINetService.h"
#else
#include "nsNeckoUtil.h"
#endif // NECKO
static NS_DEFINE_IID(kIPersistentPropertiesIID, NS_IPERSISTENTPROPERTIES_IID);
#ifndef NECKO
static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID);
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
#endif // NECKO
nsURLProperties::nsURLProperties(nsString& aUrl)
{
mDelegate = nsnull;
@ -41,26 +32,12 @@ nsURLProperties::nsURLProperties(nsString& aUrl)
nsIURI* url = nsnull;
nsIInputStream* in = nsnull;
#ifndef NECKO
nsINetService* pNetService = nsnull;
if(NS_SUCCEEDED(res))
res = nsServiceManager::GetService( kNetServiceCID,
kINetServiceIID,
(nsISupports**) &pNetService);
if(NS_SUCCEEDED(res))
res = pNetService->CreateURL(&url, aUrl, nsnull, nsnull, nsnull);
if(NS_SUCCEEDED(res))
res = pNetService->OpenBlockingStream(url, nsnull, &in);
#else
res = NS_NewURI(&url, aUrl, nsnull);
if (NS_FAILED(res)) return;
res = NS_OpenURI(&in, url);
NS_RELEASE(url);
if (NS_FAILED(res)) return;
#endif // NECKO
if(NS_SUCCEEDED(res))
res = nsComponentManager::CreateInstance(kPersistentPropertiesCID, NULL,
@ -80,11 +57,6 @@ nsURLProperties::nsURLProperties(nsString& aUrl)
NS_IF_RELEASE(mDelegate);
mDelegate=nsnull;
}
#ifndef NECKO
if(pNetService)
res = nsServiceManager::ReleaseService( kNetServiceCID,
pNetService);
#endif // NECKO
NS_IF_RELEASE(in);
}

View File

@ -28,11 +28,7 @@
#include "nsIRenderingContext.h"
#include "nsEventStateManager.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsILoadGroup.h"
#else
#include "nsIURLGroup.h"
#endif
#include "nsIDocument.h"
#include "nsIStyleContext.h"
#include "nsLayoutAtoms.h"
@ -759,7 +755,6 @@ nsPresContext::GetImageGroup(nsIImageGroup** aResult)
// Initialize the image group
nsCOMPtr<nsILoadGroup> loadGroup;
#ifdef NECKO
nsCOMPtr<nsIDocument> doc;
if (NS_SUCCEEDED(mShell->GetDocument(getter_AddRefs(doc)))) {
NS_ASSERTION(doc, "expect document here");
@ -767,9 +762,6 @@ nsPresContext::GetImageGroup(nsIImageGroup** aResult)
doc->GetDocumentLoadGroup(getter_AddRefs(loadGroup));
}
}
#else
rv = mBaseURL->GetLoadGroup(getter_AddRefs(loadGroup));
#endif
if (rv == NS_OK)
rv = mImageGroup->Init(mDeviceContext, loadGroup);
if (NS_OK != rv) {

View File

@ -90,12 +90,8 @@ public:
virtual nsIArena* GetArena() = 0;
NS_IMETHOD StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aUrl,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener) = 0;

View File

@ -21,12 +21,8 @@
#include "nsDocument.h"
#include "nsIArena.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsILoadGroup.h"
#include "nsIChannel.h"
#else
#include "nsIURLGroup.h"
#endif
#include "nsString.h"
#include "nsIContent.h"
#include "nsIDocumentObserver.h"
@ -769,11 +765,7 @@ nsIArena* nsDocument::GetArena()
}
nsresult
#ifdef NECKO
nsDocument::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup)
#else
nsDocument::Reset(nsIURI *aURL)
#endif
{
nsresult rv = NS_OK;
@ -846,20 +838,12 @@ nsDocument::Reset(nsIURI *aURL)
nsresult
nsDocument::StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aURL,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener)
{
#ifdef NECKO
return Reset(aChannel, aLoadGroup);
#else
return Reset(aURL);
#endif
}
const nsString* nsDocument::GetDocumentTitle() const

View File

@ -117,12 +117,8 @@ public:
virtual nsIArena* GetArena();
NS_IMETHOD StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aUrl,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener);
@ -427,11 +423,7 @@ protected:
nsIContent* FindContent(const nsIContent* aStartNode,
const nsIContent* aTest1,
const nsIContent* aTest2) const;
#ifdef NECKO
virtual nsresult Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup);
#else
virtual nsresult Reset(nsIURI* aURL);
#endif
// this enum is temporary; there should be no knowledge of HTML in
// nsDocument. That will be fixed when content sink stream factories

View File

@ -37,9 +37,7 @@
#include "nsISizeOfHandler.h"
#include "nsISupportsArray.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#endif // NECKO
#include "nsFrame.h"
#include "nsIPresShell.h"
#include "nsIView.h"
@ -1248,13 +1246,8 @@ nsGenericElement::TriggerLink(nsIPresContext& aPresContext,
// Resolve url to an absolute url
nsAutoString absURLSpec;
if (nsnull != aBaseURL) {
#ifndef NECKO
nsString empty;
NS_MakeAbsoluteURL(aBaseURL, empty, aURLSpec, absURLSpec);
#else
rv = NS_MakeAbsoluteURI(aURLSpec, aBaseURL, absURLSpec);
NS_ASSERTION(NS_SUCCEEDED(rv), "XXX make this function return an nsresult, like it should!");
#endif // NECKO
}
else {
absURLSpec = aURLSpec;

View File

@ -24,10 +24,8 @@
#include "nsIPluginInstance.h"
#include "nsIStreamListener.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIChannel.h"
#include "nsNeckoUtil.h"
#endif // NECKO
#include "nsIComponentManager.h"
#include "nsWidgetsCID.h"
#include "nsILinkHandler.h"
@ -62,23 +60,11 @@ public:
// nsISupports
NS_DECL_ISUPPORTS
#ifdef NECKO
// nsIStreamObserver methods:
NS_DECL_NSISTREAMOBSERVER
// nsIStreamListener methods:
NS_DECL_NSISTREAMLISTENER
#else
// nsIStreamListener
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopRequest(nsIURI* aURL, nsresult aStatus,
const PRUnichar* aMsg);
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
PRUint32 aCount);
#endif
PluginViewerImpl* mViewer;
nsIStreamListener* mNextStream;
@ -160,32 +146,18 @@ public:
nsIDeviceContext* aDeviceContext,
const nsRect& aBounds);
#ifdef NECKO
nsresult StartLoad(nsIChannel* channel, nsIStreamListener*& aResult);
#else
nsresult StartLoad(nsIURI* aURL, const char* aContentType,
nsIStreamListener*& aResult);
#endif
void ForceRefresh(void);
#ifdef NECKO
nsresult GetURI(nsIURI* *aURI);
#else
nsresult GetURL(nsIURI *&aURL);
#endif
nsresult GetDocument(nsIDocument* *aDocument);
nsIWidget* mWindow;
nsIDocument* mDocument;
nsIContentViewerContainer* mContainer;
#ifdef NECKO
nsIChannel* mChannel;
#else
nsIURI* mURL;
nsString mContentType;
#endif
pluginInstanceOwner *mOwner;
PRBool mEnableRendering;
};
@ -262,11 +234,7 @@ PluginViewerImpl::~PluginViewerImpl()
}
NS_IF_RELEASE(mDocument);
NS_IF_RELEASE(mContainer);
#ifdef NECKO
NS_IF_RELEASE(mChannel);
#else
NS_IF_RELEASE(mURL);
#endif
}
/*
@ -321,14 +289,8 @@ PluginViewerImpl::Init(nsNativeWidget aNativeParent,
}
nsresult
#ifdef NECKO
PluginViewerImpl::StartLoad(nsIChannel* channel, nsIStreamListener*& aResult)
#else
PluginViewerImpl::StartLoad(nsIURI* aURL, const char* aContentType,
nsIStreamListener*& aResult)
#endif
{
#ifdef NECKO
NS_IF_RELEASE(mChannel);
mChannel = channel;
NS_ADDREF(mChannel);
@ -340,15 +302,6 @@ PluginViewerImpl::StartLoad(nsIURI* aURL, const char* aContentType,
nsCRT::free(contentType);
#endif
#else
printf("PluginViewerImpl::StartLoad: content-type=%s\n", aContentType);
NS_IF_RELEASE(mURL);
mURL = aURL;
NS_IF_ADDREF(aURL);
mContentType = aContentType;
#endif
aResult = nsnull;
// Only instantiate the plugin if our container can host it
@ -387,7 +340,6 @@ PluginViewerImpl::CreatePlugin(nsIPluginHost* aHost, const nsRect& aBounds,
win->ws_info = nsnull; //XXX need to figure out what this is. MMP
#endif
#ifdef NECKO
nsIURI* uri;
rv = mChannel->GetURI(&uri);
if (NS_FAILED(rv)) return rv;
@ -403,14 +355,6 @@ PluginViewerImpl::CreatePlugin(nsIPluginHost* aHost, const nsRect& aBounds,
rv = mChannel->GetContentType(&ct);
if (NS_FAILED(rv)) return rv;
rv = aHost->InstantiateFullPagePlugin(ct, str, aResult, mOwner);
#else
PRUnichar* fullurl;
mURL->ToString(&fullurl);
char* ct = mContentType.ToNewCString();
nsAutoString str = fullurl;
rv = aHost->InstantiateFullPagePlugin(ct, str, aResult, mOwner);
delete fullurl;
#endif
delete[] ct;
}
@ -578,19 +522,10 @@ PluginViewerImpl::ForceRefresh()
mWindow->Invalidate(PR_TRUE);
}
#ifdef NECKO
nsresult PluginViewerImpl::GetURI(nsIURI* *aURI)
{
return mChannel->GetURI(aURI);
}
#else
nsresult PluginViewerImpl::GetURL(nsIURI *&aURL)
{
NS_IF_ADDREF(mURL);
aURL = mURL;
return NS_OK;
}
#endif
nsresult PluginViewerImpl::GetDocument(nsIDocument* *aDocument)
{
@ -617,13 +552,8 @@ PluginListener::~PluginListener()
NS_IMPL_ISUPPORTS(PluginListener, kIStreamListenerIID)
NS_IMETHODIMP
#ifdef NECKO
PluginListener::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
#else
PluginListener::OnStartRequest(nsIURI* aURL, const char *contentType)
#endif
{
#ifdef NECKO
nsresult rv;
char* contentType = nsnull;
@ -636,86 +566,29 @@ PluginListener::OnStartRequest(nsIURI* aURL, const char *contentType)
if (NS_FAILED(rv)) {
return rv;
}
#else
mViewer->StartLoad(aURL, contentType, mNextStream);
#endif
if (nsnull == mNextStream)
return NS_ERROR_FAILURE;
#ifdef NECKO
return mNextStream->OnStartRequest(channel, ctxt);
#else
return mNextStream->OnStartRequest(aURL, contentType);
#endif
}
#ifndef NECKO
NS_IMETHODIMP
PluginListener::OnProgress(nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->OnProgress(aURL, aProgress, aProgressMax);
}
NS_IMETHODIMP
PluginListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->OnStatus(aURL, aMsg);
}
#endif
NS_IMETHODIMP
#ifdef NECKO
PluginListener::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
nsresult status, const PRUnichar *errorMsg)
#else
PluginListener::OnStopRequest(nsIURI* aURL, nsresult aStatus,
const PRUnichar* aMsg)
#endif
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
#ifdef NECKO
return mNextStream->OnStopRequest(channel, ctxt, status, errorMsg);
#else
return mNextStream->OnStopRequest(aURL, aStatus, aMsg);
#endif
}
#ifndef NECKO
NS_IMETHODIMP
PluginListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->GetBindInfo(aURL, aInfo);
}
#endif
NS_IMETHODIMP
#ifdef NECKO
PluginListener::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count)
#else
PluginListener::OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
PRUint32 aCount)
#endif
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
#ifdef NECKO
return mNextStream->OnDataAvailable(channel, ctxt, inStr, sourceOffset, count);
#else
return mNextStream->OnDataAvailable(aURL, aStream, aCount);
#endif
}
//----------------------------------------------------------------------
@ -819,32 +692,17 @@ NS_IMETHODIMP pluginInstanceOwner :: GetURL(const char *aURL, const char *aTarge
if (NS_OK == rv)
{
#ifdef NECKO
nsIURI *uri;
rv = mViewer->GetURI(&uri);
#else
nsIURI *url;
rv = mViewer->GetURL(url);
#endif
if (NS_OK == rv)
{
// Create an absolute URL
#ifdef NECKO
char* absURIStr;
rv = NS_MakeAbsoluteURI(aURL, uri, &absURIStr);
NS_RELEASE(uri);
nsAutoString fullurl(absURIStr);
nsCRT::free(absURIStr);
#else
nsAutoString uniurl = nsAutoString(aURL);
const char* spec;
(void)url->GetSpec(&spec);
nsAutoString base = nsAutoString(spec);
nsAutoString fullurl;
rv = NS_MakeAbsoluteURL(url, base, uniurl, fullurl);
NS_RELEASE(url);
#endif
if (NS_OK == rv) {
nsAutoString unitarget = nsAutoString(aTarget);

View File

@ -28,11 +28,7 @@
#include "nsIRenderingContext.h"
#include "nsEventStateManager.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsILoadGroup.h"
#else
#include "nsIURLGroup.h"
#endif
#include "nsIDocument.h"
#include "nsIStyleContext.h"
#include "nsLayoutAtoms.h"
@ -759,7 +755,6 @@ nsPresContext::GetImageGroup(nsIImageGroup** aResult)
// Initialize the image group
nsCOMPtr<nsILoadGroup> loadGroup;
#ifdef NECKO
nsCOMPtr<nsIDocument> doc;
if (NS_SUCCEEDED(mShell->GetDocument(getter_AddRefs(doc)))) {
NS_ASSERTION(doc, "expect document here");
@ -767,9 +762,6 @@ nsPresContext::GetImageGroup(nsIImageGroup** aResult)
doc->GetDocumentLoadGroup(getter_AddRefs(loadGroup));
}
}
#else
rv = mBaseURL->GetLoadGroup(getter_AddRefs(loadGroup));
#endif
if (rv == NS_OK)
rv = mImageGroup->Init(mDeviceContext, loadGroup);
if (NS_OK != rv) {

View File

@ -26,9 +26,7 @@
#include "nsIComponentManager.h"
#include "nsIStreamListener.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#endif // NECKO
#include "nsIDocument.h"
#include "nsIView.h"
#include "nsIViewManager.h"
@ -637,12 +635,8 @@ void TempMakeAbsURL(nsIContent* aContent, nsString& aRelURL, nsString& aAbsURL)
}
nsString empty;
#ifndef NECKO
NS_MakeAbsoluteURL(baseURL, empty, aRelURL, aAbsURL);
#else
nsresult rv = NS_MakeAbsoluteURI(aRelURL, baseURL, aAbsURL);
NS_ASSERTION(NS_SUCCEEDED(rv), "XXX make this function return an nsresult, like it should!");
#endif // NECKO
NS_IF_RELEASE(baseURL);
}

View File

@ -35,13 +35,11 @@
#include "nsImageMap.h"
#include "nsILinkHandler.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsNeckoUtil.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsIView.h"
#include "nsIViewManager.h"
#include "nsHTMLContainerFrame.h"
@ -764,12 +762,7 @@ nsImageFrame::HandleEvent(nsIPresContext& aPresContext,
// element to provide the basis for the destination url.
nsAutoString src;
if (GetAnchorHREF(src)) {
#ifndef NECKO
nsString empty;
NS_MakeAbsoluteURL(baseURL, empty, src, absURL);
#else
NS_MakeAbsoluteURI(src, baseURL, absURL);
#endif // NECKO
NS_IF_RELEASE(baseURL);
// XXX if the mouse is over/clicked in the border/padding area

View File

@ -22,11 +22,9 @@
#include "nsIRenderingContext.h"
#include "nsIPresContext.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsNeckoUtil.h"
#endif // NECKO
#include "nsXIFConverter.h"
#include "nsISizeOfHandler.h"
#include "nsTextFragment.h"
@ -871,9 +869,6 @@ nsImageMap::IsInside(nscoord aX, nscoord aY,
for (i = 0; i < n; i++) {
Area* area = (Area*) mAreas.ElementAt(i);
if (area->IsInside(aX, aY) && area->mHasURL) {
#ifndef NECKO
NS_MakeAbsoluteURL(aDocURL, area->mBase, area->mHREF, aAbsURL);
#else
nsresult rv;
// Set the image loader's source URL and base URL
nsIURI* baseUri = nsnull;
@ -898,7 +893,6 @@ nsImageMap::IsInside(nscoord aX, nscoord aY,
NS_MakeAbsoluteURI(area->mHREF, baseUri, aAbsURL);
NS_RELEASE(baseUri);
#endif // NECKO
aTarget = area->mTarget;
if (mMap && (aTarget.Length() == 0)) {
nsIHTMLContent* content = nsnull;

View File

@ -33,11 +33,7 @@
#include "nsHTMLAtoms.h"
#include "nsIDocument.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#else
#include "nsIURLGroup.h"
#endif // NECKO
#include "nsIPluginInstanceOwner.h"
#include "nsIHTMLContent.h"
#include "nsISupportsArray.h"
@ -637,22 +633,12 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
if((rv = GetBaseURL(baseURL)) != NS_OK)
return rv;
#ifndef NECKO
nsILoadGroup* group = nsnull;
if (nsnull != baseURL)
baseURL->GetLoadGroup(&group);
#endif
nsAutoString codeBase;
if(NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase) &&
!bJavaPluginClsid)
{
nsIURI* codeBaseURL = nsnull;
#ifdef NECKO
rv = NS_NewURI(&codeBaseURL, codeBase, baseURL);
#else
rv = NS_NewURL(&codeBaseURL, codeBase, baseURL, nsnull, group);
#endif
if(rv == NS_OK)
{
NS_IF_RELEASE(baseURL);
@ -660,27 +646,15 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
}
}
#ifndef NECKO // unused urlxxx?
const char* urlxxx;
(void)baseURL->GetSpec(&urlxxx);
#endif
// Create an absolute URL
if(bJavaPluginClsid) {
#ifdef NECKO
rv = NS_NewURI(&fullURL, classid, baseURL);
#else
rv = NS_NewURL(&fullURL, classid, baseURL, nsnull, group);
#endif
}
else
{
fullURL = baseURL;
NS_IF_ADDREF(fullURL);
}
#ifndef NECKO
NS_IF_RELEASE(group);
#endif
// get the nsIPluginHost interface
if((rv = aPresContext.GetContainer(&container)) != NS_OK)
@ -716,22 +690,12 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
if((rv = GetBaseURL(baseURL)) != NS_OK)
return rv;
#ifndef NECKO
nsILoadGroup* group = nsnull;
if(nsnull != baseURL)
baseURL->GetLoadGroup(&group);
#endif
// if we have a codebase, add it to the fullURL
nsAutoString codeBase;
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase))
{
nsIURI* codeBaseURL = nsnull;
#ifdef NECKO
rv = NS_NewURI(&fullURL, codeBase, baseURL);
#else
rv = NS_NewURL(&fullURL, codeBase, baseURL, nsnull, group);
#endif
if(rv == NS_OK)
{
NS_IF_RELEASE(baseURL);
@ -742,10 +706,6 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
NS_IF_ADDREF(fullURL);
}
#ifndef NECKO
NS_IF_RELEASE(group);
#endif
// get the nsIPluginHost interface
if((rv = aPresContext.GetContainer(&container)) != NS_OK)
return rv;
@ -827,21 +787,12 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::code, src))
{
#ifndef NECKO
nsILoadGroup* group = nsnull;
if (nsnull != baseURL)
baseURL->GetLoadGroup(&group);
#endif
nsAutoString codeBase;
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase))
{
nsIURI* codeBaseURL = nsnull;
#ifdef NECKO
rv = NS_NewURI(&codeBaseURL, codeBase, baseURL);
#else
rv = NS_NewURL(&codeBaseURL, codeBase, baseURL, nsnull, group);
#endif
if(rv == NS_OK)
{
NS_IF_RELEASE(baseURL);
@ -850,12 +801,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
}
// Create an absolute URL
#ifdef NECKO
rv = NS_NewURI(&fullURL, src, baseURL);
#else
rv = NS_NewURL(&fullURL, src, baseURL, nsnull, group);
NS_IF_RELEASE(group);
#endif
}
rv = InstantiatePlugin(aPresContext, aMetrics, aReflowState, pluginHost, mimeType, fullURL);
@ -876,33 +822,13 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
//stream in the object source if there is one...
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, src))
{
#ifdef NECKO
// Create an absolute URL
rv = NS_NewURI(&fullURL, src, baseURL);
#else
nsILoadGroup* group = nsnull;
if (nsnull != baseURL)
baseURL->GetLoadGroup(&group);
// Create an absolute URL
rv = NS_NewURL(&fullURL, src, baseURL, nsnull, group);
NS_IF_RELEASE(group);
#endif
}
else if(NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::data, src))
{
#ifdef NECKO
// Create an absolute URL
rv = NS_NewURI(&fullURL, src, baseURL);
#else
nsILoadGroup* group = nsnull;
if (nsnull != baseURL)
baseURL->GetLoadGroup(&group);
// Create an absolute URL
rv = NS_NewURL(&fullURL, src, baseURL, nsnull, group);
NS_IF_RELEASE(group);
#endif
} else {// we didn't find a src or data param, so just set the url to the base
fullURL = baseURL;
NS_IF_ADDREF(fullURL);
@ -1789,11 +1715,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL, const char *aTarge
mOwner->GetFullURL(baseURL);
// Create an absolute URL
#ifndef NECKO
rv = NS_MakeAbsoluteURL(baseURL, nsString(), uniurl, fullurl);
#else
rv = NS_MakeAbsoluteURI(uniurl, baseURL, fullurl);
#endif // NECKO
NS_IF_RELEASE(baseURL);
@ -2104,17 +2026,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetDocumentBase(const char* *result)
nsCOMPtr<nsIURI> docURL( dont_AddRef(doc->GetDocumentURL()) );
#ifdef NECKO
rv = docURL->GetSpec(&mDocumentBase);
#else
const char* spec;
rv = docURL->GetSpec(&spec);
if (rv == NS_OK) {
mDocumentBase = nsCRT::strdup(spec);
if (*result == nsnull)
rv = NS_ERROR_OUT_OF_MEMORY;
}
#endif
}
if (rv == NS_OK)
*result = mDocumentBase;

View File

@ -35,13 +35,11 @@
#include "nsImageMap.h"
#include "nsILinkHandler.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsNeckoUtil.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsIView.h"
#include "nsIViewManager.h"
#include "nsHTMLContainerFrame.h"
@ -764,12 +762,7 @@ nsImageFrame::HandleEvent(nsIPresContext& aPresContext,
// element to provide the basis for the destination url.
nsAutoString src;
if (GetAnchorHREF(src)) {
#ifndef NECKO
nsString empty;
NS_MakeAbsoluteURL(baseURL, empty, src, absURL);
#else
NS_MakeAbsoluteURI(src, baseURL, absURL);
#endif // NECKO
NS_IF_RELEASE(baseURL);
// XXX if the mouse is over/clicked in the border/padding area

View File

@ -22,11 +22,9 @@
#include "nsIRenderingContext.h"
#include "nsIPresContext.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsNeckoUtil.h"
#endif // NECKO
#include "nsXIFConverter.h"
#include "nsISizeOfHandler.h"
#include "nsTextFragment.h"
@ -871,9 +869,6 @@ nsImageMap::IsInside(nscoord aX, nscoord aY,
for (i = 0; i < n; i++) {
Area* area = (Area*) mAreas.ElementAt(i);
if (area->IsInside(aX, aY) && area->mHasURL) {
#ifndef NECKO
NS_MakeAbsoluteURL(aDocURL, area->mBase, area->mHREF, aAbsURL);
#else
nsresult rv;
// Set the image loader's source URL and base URL
nsIURI* baseUri = nsnull;
@ -898,7 +893,6 @@ nsImageMap::IsInside(nscoord aX, nscoord aY,
NS_MakeAbsoluteURI(area->mHREF, baseUri, aAbsURL);
NS_RELEASE(baseUri);
#endif // NECKO
aTarget = area->mTarget;
if (mMap && (aTarget.Length() == 0)) {
nsIHTMLContent* content = nsnull;

View File

@ -33,11 +33,7 @@
#include "nsHTMLAtoms.h"
#include "nsIDocument.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#else
#include "nsIURLGroup.h"
#endif // NECKO
#include "nsIPluginInstanceOwner.h"
#include "nsIHTMLContent.h"
#include "nsISupportsArray.h"
@ -637,22 +633,12 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
if((rv = GetBaseURL(baseURL)) != NS_OK)
return rv;
#ifndef NECKO
nsILoadGroup* group = nsnull;
if (nsnull != baseURL)
baseURL->GetLoadGroup(&group);
#endif
nsAutoString codeBase;
if(NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase) &&
!bJavaPluginClsid)
{
nsIURI* codeBaseURL = nsnull;
#ifdef NECKO
rv = NS_NewURI(&codeBaseURL, codeBase, baseURL);
#else
rv = NS_NewURL(&codeBaseURL, codeBase, baseURL, nsnull, group);
#endif
if(rv == NS_OK)
{
NS_IF_RELEASE(baseURL);
@ -660,27 +646,15 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
}
}
#ifndef NECKO // unused urlxxx?
const char* urlxxx;
(void)baseURL->GetSpec(&urlxxx);
#endif
// Create an absolute URL
if(bJavaPluginClsid) {
#ifdef NECKO
rv = NS_NewURI(&fullURL, classid, baseURL);
#else
rv = NS_NewURL(&fullURL, classid, baseURL, nsnull, group);
#endif
}
else
{
fullURL = baseURL;
NS_IF_ADDREF(fullURL);
}
#ifndef NECKO
NS_IF_RELEASE(group);
#endif
// get the nsIPluginHost interface
if((rv = aPresContext.GetContainer(&container)) != NS_OK)
@ -716,22 +690,12 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
if((rv = GetBaseURL(baseURL)) != NS_OK)
return rv;
#ifndef NECKO
nsILoadGroup* group = nsnull;
if(nsnull != baseURL)
baseURL->GetLoadGroup(&group);
#endif
// if we have a codebase, add it to the fullURL
nsAutoString codeBase;
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase))
{
nsIURI* codeBaseURL = nsnull;
#ifdef NECKO
rv = NS_NewURI(&fullURL, codeBase, baseURL);
#else
rv = NS_NewURL(&fullURL, codeBase, baseURL, nsnull, group);
#endif
if(rv == NS_OK)
{
NS_IF_RELEASE(baseURL);
@ -742,10 +706,6 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
NS_IF_ADDREF(fullURL);
}
#ifndef NECKO
NS_IF_RELEASE(group);
#endif
// get the nsIPluginHost interface
if((rv = aPresContext.GetContainer(&container)) != NS_OK)
return rv;
@ -827,21 +787,12 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::code, src))
{
#ifndef NECKO
nsILoadGroup* group = nsnull;
if (nsnull != baseURL)
baseURL->GetLoadGroup(&group);
#endif
nsAutoString codeBase;
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase))
{
nsIURI* codeBaseURL = nsnull;
#ifdef NECKO
rv = NS_NewURI(&codeBaseURL, codeBase, baseURL);
#else
rv = NS_NewURL(&codeBaseURL, codeBase, baseURL, nsnull, group);
#endif
if(rv == NS_OK)
{
NS_IF_RELEASE(baseURL);
@ -850,12 +801,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
}
// Create an absolute URL
#ifdef NECKO
rv = NS_NewURI(&fullURL, src, baseURL);
#else
rv = NS_NewURL(&fullURL, src, baseURL, nsnull, group);
NS_IF_RELEASE(group);
#endif
}
rv = InstantiatePlugin(aPresContext, aMetrics, aReflowState, pluginHost, mimeType, fullURL);
@ -876,33 +822,13 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
//stream in the object source if there is one...
if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, src))
{
#ifdef NECKO
// Create an absolute URL
rv = NS_NewURI(&fullURL, src, baseURL);
#else
nsILoadGroup* group = nsnull;
if (nsnull != baseURL)
baseURL->GetLoadGroup(&group);
// Create an absolute URL
rv = NS_NewURL(&fullURL, src, baseURL, nsnull, group);
NS_IF_RELEASE(group);
#endif
}
else if(NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::data, src))
{
#ifdef NECKO
// Create an absolute URL
rv = NS_NewURI(&fullURL, src, baseURL);
#else
nsILoadGroup* group = nsnull;
if (nsnull != baseURL)
baseURL->GetLoadGroup(&group);
// Create an absolute URL
rv = NS_NewURL(&fullURL, src, baseURL, nsnull, group);
NS_IF_RELEASE(group);
#endif
} else {// we didn't find a src or data param, so just set the url to the base
fullURL = baseURL;
NS_IF_ADDREF(fullURL);
@ -1789,11 +1715,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL, const char *aTarge
mOwner->GetFullURL(baseURL);
// Create an absolute URL
#ifndef NECKO
rv = NS_MakeAbsoluteURL(baseURL, nsString(), uniurl, fullurl);
#else
rv = NS_MakeAbsoluteURI(uniurl, baseURL, fullurl);
#endif // NECKO
NS_IF_RELEASE(baseURL);
@ -2104,17 +2026,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetDocumentBase(const char* *result)
nsCOMPtr<nsIURI> docURL( dont_AddRef(doc->GetDocumentURL()) );
#ifdef NECKO
rv = docURL->GetSpec(&mDocumentBase);
#else
const char* spec;
rv = docURL->GetSpec(&spec);
if (rv == NS_OK) {
mDocumentBase = nsCRT::strdup(spec);
if (*result == nsnull)
rv = NS_ERROR_OUT_OF_MEMORY;
}
#endif
}
if (rv == NS_OK)
*result = mDocumentBase;

View File

@ -44,11 +44,7 @@
#include "nsIStyleRule.h"
#include "nsISupportsArray.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#else
#include "nsIURLGroup.h"
#endif // NECKO
#include "nsStyleConsts.h"
#include "nsXIFConverter.h"
#include "nsFrame.h"
@ -1071,21 +1067,8 @@ nsGenericHTMLElement::GetBaseURL(const nsHTMLValue& aBaseHref,
aBaseHref.GetStringValue(baseHref);
nsIURI* url = nsnull;
#ifndef NECKO
nsILoadGroup* LoadGroup = nsnull;
docBaseURL->GetLoadGroup(&LoadGroup);
if (LoadGroup) {
result = LoadGroup->CreateURL(&url, docBaseURL, baseHref, nsnull);
NS_RELEASE(LoadGroup);
}
else
#endif
{
#ifndef NECKO
result = NS_NewURL(&url, baseHref, docBaseURL);
#else
result = NS_NewURI(&url, baseHref, docBaseURL);
#endif // NECKO
}
NS_IF_RELEASE(docBaseURL);
*aBaseURL = url;
@ -2272,11 +2255,7 @@ nsGenericHTMLElement::MapBackgroundAttributesInto(const nsIHTMLMappedAttributes*
aAttributes->GetAttribute(nsHTMLAtoms::_baseHref, baseHref);
nsGenericHTMLElement::GetBaseURL(baseHref, doc,
getter_AddRefs(docURL));
#ifndef NECKO
rv = NS_MakeAbsoluteURL(docURL, "", spec, absURLSpec);
#else
rv = NS_MakeAbsoluteURI(spec, docURL, absURLSpec);
#endif // NECKO
if (NS_SUCCEEDED(rv)) {
nsStyleColor* color = (nsStyleColor*)
aContext->GetMutableStyleData(eStyleStruct_Color);

View File

@ -38,13 +38,11 @@
#include "nsIScriptContext.h"
#include "nsIScriptGlobalObject.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsNeckoUtil.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
// XXX nav attrs: suppress
@ -535,11 +533,7 @@ nsHTMLImageElement::SetSrc(const nsString& aSrc)
empty.Truncate();
result = mOwnerDocument->GetBaseURL(baseURL);
if (NS_SUCCEEDED(result)) {
#ifndef NECKO
result = NS_MakeAbsoluteURL(baseURL, empty, aSrc, url);
#else
result = NS_MakeAbsoluteURI(aSrc, baseURL, url);
#endif // NECKO
if (NS_FAILED(result)) {
url = aSrc;
}

View File

@ -26,9 +26,7 @@
#include "nsIComponentManager.h"
#include "nsIStreamListener.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#endif // NECKO
#include "nsIDocument.h"
#include "nsIView.h"
#include "nsIViewManager.h"
@ -637,12 +635,8 @@ void TempMakeAbsURL(nsIContent* aContent, nsString& aRelURL, nsString& aAbsURL)
}
nsString empty;
#ifndef NECKO
NS_MakeAbsoluteURL(baseURL, empty, aRelURL, aAbsURL);
#else
nsresult rv = NS_MakeAbsoluteURI(aRelURL, baseURL, aAbsURL);
NS_ASSERTION(NS_SUCCEEDED(rv), "XXX make this function return an nsresult, like it should!");
#endif // NECKO
NS_IF_RELEASE(baseURL);
}

View File

@ -42,14 +42,9 @@
#include "nsIDOMHTMLFormElement.h"
#include "nsIStreamListener.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsNeckoUtil.h"
#else
#include "nsIPostToServer.h"
#include "nsIURLGroup.h"
#endif // NECKO
#include "nsIContentViewerContainer.h"
#include "nsIWebShell.h"
#include "nsIWebShellServices.h"
@ -61,12 +56,8 @@
#include "nsICodebasePrincipal.h"
#include "nsIScriptSecurityManager.h"
#ifndef NECKO
#include "nsINetService.h"
#else
#include "nsIIOService.h"
#include "nsICookieService.h"
#endif // NECKO
#include "nsIParserService.h"
#include "nsIServiceManager.h"
@ -100,9 +91,7 @@ static PRBool gPlugDetector = PR_FALSE;
#include "net.h"
#endif
#ifdef NECKO
#include "prmem.h"
#endif
// Find/Serach Includes
const PRInt32 kForward = 0;
@ -125,14 +114,9 @@ static NS_DEFINE_IID(kIHTMLDocumentIID, NS_IHTMLDOCUMENT_IID);
static NS_DEFINE_IID(kIDOMHTMLDocumentIID, NS_IDOMHTMLDOCUMENT_IID);
static NS_DEFINE_IID(kIDOMNSHTMLDocumentIID, NS_IDOMNSHTMLDOCUMENT_IID);
#ifndef NECKO
static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID);
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
#else
static NS_DEFINE_IID(kIIOServiceIID, NS_IIOSERVICE_IID);
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
static NS_DEFINE_IID(kCookieServiceCID, NS_COOKIESERVICE_CID);
#endif // NECKO
@ -312,20 +296,12 @@ nsrefcnt nsHTMLDocument::Release()
}
nsresult
#ifdef NECKO
nsHTMLDocument::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup)
#else
nsHTMLDocument::Reset(nsIURI *aURL)
#endif
{
#ifdef NECKO
nsresult result = nsDocument::Reset(aChannel, aLoadGroup);
nsCOMPtr<nsIURI> aURL;
result = aChannel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(result)) return result;
#else
nsresult result = nsDocument::Reset(aURL);
#endif
if (NS_FAILED(result)) {
return result;
}
@ -397,21 +373,13 @@ nsHTMLDocument::CreateShell(nsIPresContext* aContext,
NS_IMETHODIMP
nsHTMLDocument::StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aURL,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener)
{
nsresult rv = nsDocument::StartDocumentLoad(aCommand,
#ifdef NECKO
aChannel, aLoadGroup,
#else
aURL,
#endif
aContainer,
aDocListener);
if (NS_FAILED(rv)) {
@ -422,7 +390,6 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
nsAutoString charset = "ISO-8859-1"; // fallback value in case webShell return error
nsCharsetSource charsetSource = kCharsetFromWeakDocTypeDefault;
#ifdef NECKO
nsCOMPtr<nsIURI> aURL;
rv = aChannel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(rv)) return rv;
@ -498,7 +465,6 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
// could just be that the response header wasn't found.
rv = NS_OK;
}
#endif
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
@ -827,21 +793,8 @@ nsHTMLDocument:: SetBaseURL(const nsString& aURLSpec)
NS_IF_RELEASE(mBaseURL);
if (0 < aURLSpec.Length()) {
#ifndef NECKO
nsILoadGroup* LoadGroup = nsnull;
(void)mDocumentURL->GetLoadGroup(&LoadGroup);
if (LoadGroup) {
result = LoadGroup->CreateURL(&mBaseURL, mDocumentURL, aURLSpec, nsnull);
NS_RELEASE(LoadGroup);
}
else
#endif
{
#ifndef NECKO
result = NS_NewURL(&mBaseURL, aURLSpec, mDocumentURL);
#else
result = NS_NewURI(&mBaseURL, aURLSpec, mDocumentURL);
#endif // NECKO
}
}
return result;
@ -1416,19 +1369,10 @@ NS_IMETHODIMP
nsHTMLDocument::GetURL(nsString& aURL)
{
if (nsnull != mDocumentURL) {
#ifdef NECKO
char* str;
mDocumentURL->GetSpec(&str);
#else
PRUnichar* str;
mDocumentURL->ToString(&str);
#endif
aURL = str;
#ifdef NECKO
nsCRT::free(str);
#else
delete[] str;
#endif
}
return NS_OK;
}
@ -1591,41 +1535,23 @@ nsHTMLDocument::GetAnchors(nsIDOMHTMLCollection** aAnchors)
NS_IMETHODIMP
nsHTMLDocument::GetCookie(nsString& aCookie)
{
#ifndef NECKO
nsresult result = NS_OK;
NS_WITH_SERVICE(nsINetService, service, kNetServiceCID, &result);
if ((NS_OK == result) && (nsnull != service) && (nsnull != mDocumentURL)) {
result = service->GetCookieString(mDocumentURL, aCookie);
}
return result;
#else
nsresult result = NS_OK;
NS_WITH_SERVICE(nsICookieService, service, kCookieServiceCID, &result);
if ((NS_OK == result) && (nsnull != service) && (nsnull != mDocumentURL)) {
result = service->GetCookieString(mDocumentURL, aCookie);
}
return result;
#endif // NECKO
}
NS_IMETHODIMP
nsHTMLDocument::SetCookie(const nsString& aCookie)
{
#ifndef NECKO
nsresult result = NS_OK;
NS_WITH_SERVICE(nsINetService, service, kNetServiceCID, &result);
if ((NS_OK == result) && (nsnull != service) && (nsnull != mDocumentURL)) {
result = service->SetCookieString(mDocumentURL, aCookie);
}
return result;
#else
nsresult result = NS_OK;
NS_WITH_SERVICE(nsICookieService, service, kCookieServiceCID, &result);
if ((NS_OK == result) && (nsnull != service) && (nsnull != mDocumentURL)) {
result = service->SetCookieString(mDocumentURL, aCookie);
}
return result;
#endif // NECKO
}
nsresult
@ -1676,7 +1602,6 @@ nsHTMLDocument::OpenCommon(nsIURI* aSourceURL)
// The open occurred after the document finished loading.
// So we reset the document and create a new one.
if (nsnull == mParser) {
#ifdef NECKO
nsCOMPtr<nsIChannel> channel;
nsCOMPtr<nsILoadGroup> group = do_QueryReferent(mDocumentLoadGroup);
@ -1684,9 +1609,6 @@ nsHTMLDocument::OpenCommon(nsIURI* aSourceURL)
if (NS_FAILED(result)) return result;
result = Reset(channel, group);
if (NS_FAILED(result)) return result;
#else
result = Reset(aSourceURL);
#endif
if (NS_OK == result) {
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
@ -1739,11 +1661,7 @@ nsHTMLDocument::Open()
// XXX For the non-script Open case, we have to make
// up a URL.
#ifdef NECKO
result = NS_NewURI(&sourceURL, "about:blank");
#else
result = NS_NewURL(&sourceURL, "about:blank");
#endif // NECKO
if (NS_SUCCEEDED(result)) {
result = OpenCommon(sourceURL);
@ -1764,11 +1682,7 @@ nsHTMLDocument::Open(JSContext *cx, jsval *argv, PRUint32 argc)
result = GetSourceDocumentURL(cx, &sourceURL);
// Recover if we had a problem obtaining the source URL
if (nsnull == sourceURL) {
#ifndef NECKO
result = NS_NewURL(&sourceURL, "about:blank");
#else
result = NS_NewURI(&sourceURL, "about:blank");
#endif // NECKO
}
if (NS_SUCCEEDED(result)) {

View File

@ -60,12 +60,8 @@ public:
nsIPresShell** aInstancePtrResult);
NS_IMETHOD StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aUrl,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener);
@ -195,11 +191,7 @@ protected:
NS_IMETHOD GetDomainURI(nsIURI **uri);
#ifdef NECKO
virtual nsresult Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup);
#else
virtual nsresult Reset(nsIURI *aURL);
#endif
nsresult WriteCommon(const nsString& aText,
PRBool aNewlineTerminate);
nsresult ScriptWriteCommon(JSContext *cx,

View File

@ -31,9 +31,7 @@
#include "nsIPresShell.h"
#include "nsIPresContext.h"
#include "nsIViewManager.h"
#ifdef NECKO
#include "nsIChannel.h"
#endif
// XXX TODO:
@ -58,27 +56,17 @@ public:
virtual ~nsImageDocument();
NS_IMETHOD StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aUrl,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener);
nsresult CreateSyntheticDocument();
nsresult StartImageLoad(nsIURI* aURL, nsIStreamListener*& aListener);
#ifdef NECKO
nsresult EndLayout(nsISupports *ctxt,
nsresult status,
const PRUnichar *errorMsg);
#else
nsresult EndLayout(nsIURI* aURL,
nsresult aStatus,
const PRUnichar* aMsg);
#endif
void StartLayout();
@ -94,22 +82,11 @@ public:
virtual ~ImageListener();
NS_DECL_ISUPPORTS
#ifdef NECKO
// nsIStreamObserver methods:
NS_DECL_NSISTREAMOBSERVER
// nsIStreamListener methods:
NS_DECL_NSISTREAMLISTENER
#else
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopRequest(nsIURI* aURL, nsresult aStatus,
const PRUnichar* aMsg);
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
PRUint32 aCount);
#endif
nsImageDocument* mDocument;
nsIStreamListener* mNextStream;
@ -131,13 +108,8 @@ ImageListener::~ImageListener()
NS_IMPL_ISUPPORTS(ImageListener, kIStreamListenerIID)
NS_IMETHODIMP
#ifdef NECKO
ImageListener::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
#else
ImageListener::OnStartRequest(nsIURI* aURL, const char *aContentType)
#endif
{
#ifdef NECKO
nsresult rv;
nsIURI* uri;
rv = channel->GetURI(&uri);
@ -145,89 +117,31 @@ ImageListener::OnStartRequest(nsIURI* aURL, const char *aContentType)
mDocument->StartImageLoad(uri, mNextStream);
NS_RELEASE(uri);
#else
mDocument->StartImageLoad(aURL, mNextStream);
#endif
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
#ifdef NECKO
return mNextStream->OnStartRequest(channel, ctxt);
#else
return mNextStream->OnStartRequest(aURL, aContentType);
#endif
}
#ifndef NECKO
NS_IMETHODIMP
ImageListener::OnProgress(nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->OnProgress(aURL, aProgress, aProgressMax);
}
NS_IMETHODIMP
ImageListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->OnStatus(aURL, aMsg);
}
#endif
NS_IMETHODIMP
#ifdef NECKO
ImageListener::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
nsresult status, const PRUnichar *errorMsg)
#else
ImageListener::OnStopRequest(nsIURI* aURL, nsresult aStatus,
const PRUnichar* aMsg)
#endif
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
#ifdef NECKO
mDocument->EndLayout(ctxt, status, errorMsg);
return mNextStream->OnStopRequest(channel, ctxt, status, errorMsg);
#else
mDocument->EndLayout(aURL, aStatus, aMsg);
return mNextStream->OnStopRequest(aURL, aStatus, aMsg);
#endif
}
#ifndef NECKO
NS_IMETHODIMP
ImageListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->GetBindInfo(aURL, aInfo);
}
#endif
NS_IMETHODIMP
#ifdef NECKO
ImageListener::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count)
#else
ImageListener::OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
PRUint32 aCount)
#endif
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
#ifdef NECKO
return mNextStream->OnDataAvailable(channel, ctxt, inStr, sourceOffset, count);
#else
return mNextStream->OnDataAvailable(aURL, aStream, aCount);
#endif
}
//----------------------------------------------------------------------
@ -254,21 +168,13 @@ nsImageDocument::~nsImageDocument()
NS_IMETHODIMP
nsImageDocument::StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aURL,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener)
{
nsresult rv = nsDocument::StartDocumentLoad(aCommand,
#ifdef NECKO
aChannel, aLoadGroup,
#else
aURL,
#endif
aContainer,
aDocListener);
if (NS_FAILED(rv)) {
@ -303,19 +209,13 @@ nsImageDocument::StartImageLoad(nsIURI* aURL, nsIStreamListener*& aListener)
nsIImageGroup* group = nsnull;
cx->GetImageGroup(&group);
if (nsnull != group) {
#ifdef NECKO
char* spec;
#else
const char* spec;
#endif
(void)aURL->GetSpec(&spec);
nsIStreamListener* listener = nsnull;
rv = group->GetImageFromStream(spec, nsnull, nsnull,
0, 0, 0,
mImageRequest, listener);
#ifdef NECKO
nsCRT::free(spec);
#endif
aListener = listener;
NS_RELEASE(group);
}
@ -372,13 +272,8 @@ nsImageDocument::CreateSyntheticDocument()
}
image->SetDocument(this, PR_FALSE);
#ifdef NECKO
char* src;
mDocumentURL->GetSpec(&src);
#else
PRUnichar* src;
mDocumentURL->ToString(&src);
#endif
nsHTMLValue val(src);
delete[] src;
image->SetHTMLAttribute(nsHTMLAtoms::src, val, PR_FALSE);
@ -427,15 +322,9 @@ nsImageDocument::StartLayout()
}
nsresult
#ifdef NECKO
nsImageDocument::EndLayout(nsISupports *ctxt,
nsresult status,
const PRUnichar *errorMsg)
#else
nsImageDocument::EndLayout(nsIURI* aURL,
nsresult aStatus,
const PRUnichar* aMsg)
#endif
{
nsString titleStr = "Image ";
if (mImageRequest) {

View File

@ -171,13 +171,9 @@ void nsMarkupDocument::StyleSheetsToXIF(nsXIFConverter& aConverter)
if (nsnull == sheetURL) {
break;
}
#ifdef NECKO
PRBool eq;
nsresult rv = sheetURL->Equals(mDocumentURL, &eq);
if (NS_FAILED(rv) || !eq)
#else
if (!sheetURL->Equals(mDocumentURL))
#endif
{
NS_RELEASE(sheetURL);
break;

View File

@ -54,12 +54,10 @@
#include "nsIFormProcessor.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsNeckoUtil.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsIDocument.h"
#include "nsILinkHandler.h"
#include "nsRadioControlFrame.h"
@ -613,12 +611,7 @@ nsFormFrame::OnSubmit(nsIPresContext* aPresContext, nsIFrame* aFrame)
}
}
nsAutoString absURLSpec;
#ifndef NECKO
nsAutoString base;
result = NS_MakeAbsoluteURL(docURL, base, href, absURLSpec);
#else
result = NS_MakeAbsoluteURI(href, docURL, absURLSpec);
#endif // NECKO
NS_IF_RELEASE(docURL);
if (NS_FAILED(result)) return result;

View File

@ -31,12 +31,8 @@
#include "nsICSSDeclaration.h"
#include "nsStyleConsts.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#include "nsCOMPtr.h"
#else
#include "nsIURLGroup.h"
#endif // NECKO
#include "nsString.h"
#include "nsIAtom.h"
#include "nsVoidArray.h"
@ -849,20 +845,8 @@ PRBool CSSParserImpl::ProcessImport(PRInt32& aErrorCode, const nsString& aURLSpe
// XXX probably need a way to encode unicode junk for the part of
// the url that follows a "?"
nsIURI* url;
#ifdef NECKO
// XXX need to have nsILoadGroup passed in here
aErrorCode = NS_NewURI(&url, aURLSpec, mURL/*, group*/);
#else
nsILoadGroup* loadGroup = nsnull;
mURL->GetLoadGroup(&loadGroup);
if (loadGroup) {
aErrorCode = loadGroup->CreateURL(&url, mURL, aURLSpec, nsnull);
NS_RELEASE(loadGroup);
}
else {
aErrorCode = NS_NewURL(&url, aURLSpec, mURL);
}
#endif
if (NS_FAILED(aErrorCode)) {
// import url is bad
@ -2489,15 +2473,11 @@ PRBool CSSParserImpl::ParseURL(PRInt32& aErrorCode, nsCSSValue& aValue)
if (nsnull != mURL) {
nsAutoString baseURL;
nsresult rv;
#ifdef NECKO
nsCOMPtr<nsIURI> base;
rv = mURL->Clone(getter_AddRefs(base));
if (NS_SUCCEEDED(rv)) {
rv = NS_MakeAbsoluteURI(tk->mIdent, base, absURL);
}
#else
rv = NS_MakeAbsoluteURL(mURL, baseURL, tk->mIdent, absURL);
#endif // NECKO
if (NS_FAILED(rv)) {
absURL = tk->mIdent;
}

View File

@ -21,13 +21,11 @@
#include "nsCRT.h"
#include "nsIAtom.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsNeckoUtil.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsISupportsArray.h"
#include "nsHashtable.h"
#include "nsICSSStyleRuleProcessor.h"
@ -1290,14 +1288,10 @@ CSSStyleSheetImpl::Init(nsIURI* aURL)
return NS_ERROR_ALREADY_INITIALIZED;
if (mInner->mURL) {
#ifdef NECKO
#ifdef DEBUG
PRBool eq;
nsresult rv = mInner->mURL->Equals(aURL, &eq);
NS_ASSERTION(NS_SUCCEEDED(rv) && eq, "bad inner");
#endif
#else
NS_ASSERTION(mInner->mURL->Equals(aURL), "bad inner");
#endif
}
else {
@ -1469,13 +1463,9 @@ CSSStyleSheetImpl::ContainsStyleSheet(nsIURI* aURL) const
{
NS_PRECONDITION(nsnull != aURL, "null arg");
#ifdef NECKO
PRBool result;
nsresult rv = mInner->mURL->Equals(aURL, &result);
if (NS_FAILED(rv)) result = PR_FALSE;
#else
PRBool result = mInner->mURL->Equals(aURL);
#endif
const CSSStyleSheetImpl* child = mFirstChild;
while ((PR_FALSE == result) && (nsnull != child)) {
@ -1794,22 +1784,12 @@ void CSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const
}
fputs("CSS Style Sheet: ", out);
#ifdef NECKO
char* urlSpec = nsnull;
nsresult rv = mInner->mURL->GetSpec(&urlSpec);
if (NS_SUCCEEDED(rv) && urlSpec) {
fputs(urlSpec, out);
nsCRT::free(urlSpec);
}
#else
PRUnichar* urlSpec = nsnull;
mInner->mURL->ToString(&urlSpec);
if (urlSpec) {
nsAutoString buffer(urlSpec);
delete [] urlSpec;
fputs(buffer, out);
}
#endif
if (mMedia) {
fputs(" media: ", out);
@ -1946,19 +1926,12 @@ NS_IMETHODIMP
CSSStyleSheetImpl::GetHref(nsString& aHref)
{
if (mInner && mInner->mURL) {
#ifdef NECKO
char* str = nsnull;
mInner->mURL->GetSpec(&str);
aHref = str;
if (str) {
nsCRT::free(str);
}
#else
PRUnichar* str;
mInner->mURL->ToString(&str);
aHref = str;
delete [] str;
#endif
}
else {
aHref.SetLength(0);
@ -2532,9 +2505,6 @@ static PRBool SelectorMatches(nsIPresContext* aPresContext,
}
nsAutoString absURLSpec;
#ifndef NECKO
NS_MakeAbsoluteURL(docURL, base, href, absURLSpec);
#else
nsresult rv;
nsIURI *baseUri = nsnull;
rv = docURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
@ -2542,7 +2512,6 @@ static PRBool SelectorMatches(nsIPresContext* aPresContext,
NS_MakeAbsoluteURI(href, baseUri, absURLSpec);
NS_RELEASE(baseUri);
#endif // NECKO
NS_IF_RELEASE(docURL);
linkHandler->GetLinkState(absURLSpec.GetUnicode(), linkState);

View File

@ -651,22 +651,12 @@ void HTMLCSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
fputs("HTML CSS Style Sheet: ", out);
#ifdef NECKO
char* urlSpec = nsnull;
mURL->GetSpec(&urlSpec);
if (urlSpec) {
fputs(urlSpec, out);
nsCRT::free(urlSpec);
}
#else
PRUnichar* urlSpec = nsnull;
mURL->ToString(&urlSpec);
if (urlSpec) {
nsAutoString buffer(urlSpec);
fputs(buffer, out);
delete [] urlSpec;
}
#endif
fputs("\n", out);
}

View File

@ -21,13 +21,11 @@
#include "nsCRT.h"
#include "nsIAtom.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsNeckoUtil.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsISupportsArray.h"
#include "nsHashtable.h"
#include "nsIHTMLContent.h"
@ -657,9 +655,6 @@ HTMLStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
nsAutoString absURLSpec;
nsresult rv;
#ifndef NECKO
rv = NS_MakeAbsoluteURL(docURL, base, href, absURLSpec);
#else
nsIURI *baseUri = nsnull;
rv = docURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
if (NS_FAILED(rv)) return 0;
@ -667,7 +662,6 @@ HTMLStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
rv = NS_MakeAbsoluteURI(href, baseUri, absURLSpec);
NS_RELEASE(baseUri);
#endif // NECKO
NS_IF_RELEASE(docURL);
nsLinkState state;
@ -1153,22 +1147,12 @@ void HTMLStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
fputs("HTML Style Sheet: ", out);
#ifdef NECKO
char* urlSpec = nsnull;
mURL->GetSpec(&urlSpec);
if (urlSpec) {
fputs(urlSpec, out);
nsCRT::free(urlSpec);
}
#else
PRUnichar* urlSpec = nsnull;
mURL->ToString(&urlSpec);
if (urlSpec) {
nsAutoString buffer(urlSpec);
fputs(buffer, out);
delete [] urlSpec;
}
#endif
fputs("\n", out);
}

View File

@ -172,12 +172,8 @@ class MyDocument : public nsMarkupDocument {
public:
MyDocument();
NS_IMETHOD StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aUrl,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener)
{

View File

@ -20,13 +20,9 @@
#include "nsICSSStyleSheet.h"
#include "nsIStyleRule.h"
#include "nsIURL.h"
#ifndef NECKO
#include "nsINetService.h"
#else
#include "nsNeckoUtil.h"
#include "nsIIOService.h"
#include "nsIURL.h"
#endif // NECKO
#include "nsIInputStream.h"
#include "nsIUnicharInputStream.h"
#include "nsString.h"
@ -55,11 +51,7 @@
#endif
#endif
#ifndef NECKO
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
#else
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
static NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID);
@ -76,11 +68,7 @@ int main(int argc, char** argv)
{
nsComponentManager::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE);
#ifndef NECKO
nsComponentManager::RegisterComponent(kNetServiceCID, NULL, NULL, NETLIB_DLL, PR_FALSE, PR_FALSE);
#else
nsComponentManager::RegisterComponent(kIOServiceCID, NULL, NULL, NETLIB_DLL, PR_FALSE, PR_FALSE);
#endif // NECKO
nsComponentManager::RegisterComponent(kCSSParserCID, NULL, NULL, LAYOUT_DLL, PR_FALSE, PR_FALSE);
@ -151,9 +139,6 @@ int main(int argc, char** argv)
char* urlName = argv[i];
// Create url object
nsIURI* url;
#ifndef NECKO
rv = NS_NewURL(&url, urlName);
#else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return -1;
@ -163,7 +148,6 @@ int main(int argc, char** argv)
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK != rv) {
printf("invalid URL: '%s'\n", urlName);
return -1;
@ -171,11 +155,7 @@ int main(int argc, char** argv)
// Get an input stream from the url
nsIInputStream* in;
#ifndef NECKO
rv = NS_OpenURL(url, &in);
#else
rv = NS_OpenURI(&in, url);
#endif // NECKO
if (rv != NS_OK) {
printf("open of url('%s') failed: error=%x\n", urlName, rv);
continue;

View File

@ -18,13 +18,11 @@
#include <stdio.h>
#include "nsCSSScanner.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsIInputStream.h"
#include "nsIUnicharInputStream.h"
#include "nsString.h"
@ -40,9 +38,6 @@ int main(int argc, char** argv)
char* urlName = argv[1];
nsIURI* url;
nsresult rv;
#ifndef NECKO
rv = NS_NewURL(&url, urlName);
#else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return -1;
@ -52,7 +47,6 @@ int main(int argc, char** argv)
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK != rv) {
printf("invalid URL: '%s'\n", urlName);
return -1;
@ -60,11 +54,7 @@ int main(int argc, char** argv)
// Get an input stream from the url
nsIInputStream* in;
#ifndef NECKO
rv = NS_OpenURL(url, &in);
#else
rv = NS_OpenURI(&in, url);
#endif // NECKO
if (rv != NS_OK) {
printf("open of url('%s') failed: error=%x\n", urlName, rv);
return -1;

View File

@ -40,12 +40,8 @@ class MyDocument : public nsDocument {
public:
MyDocument();
NS_IMETHOD StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aUrl,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener)
{

View File

@ -31,12 +31,8 @@
#include "nsICSSDeclaration.h"
#include "nsStyleConsts.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#include "nsCOMPtr.h"
#else
#include "nsIURLGroup.h"
#endif // NECKO
#include "nsString.h"
#include "nsIAtom.h"
#include "nsVoidArray.h"
@ -849,20 +845,8 @@ PRBool CSSParserImpl::ProcessImport(PRInt32& aErrorCode, const nsString& aURLSpe
// XXX probably need a way to encode unicode junk for the part of
// the url that follows a "?"
nsIURI* url;
#ifdef NECKO
// XXX need to have nsILoadGroup passed in here
aErrorCode = NS_NewURI(&url, aURLSpec, mURL/*, group*/);
#else
nsILoadGroup* loadGroup = nsnull;
mURL->GetLoadGroup(&loadGroup);
if (loadGroup) {
aErrorCode = loadGroup->CreateURL(&url, mURL, aURLSpec, nsnull);
NS_RELEASE(loadGroup);
}
else {
aErrorCode = NS_NewURL(&url, aURLSpec, mURL);
}
#endif
if (NS_FAILED(aErrorCode)) {
// import url is bad
@ -2489,15 +2473,11 @@ PRBool CSSParserImpl::ParseURL(PRInt32& aErrorCode, nsCSSValue& aValue)
if (nsnull != mURL) {
nsAutoString baseURL;
nsresult rv;
#ifdef NECKO
nsCOMPtr<nsIURI> base;
rv = mURL->Clone(getter_AddRefs(base));
if (NS_SUCCEEDED(rv)) {
rv = NS_MakeAbsoluteURI(tk->mIdent, base, absURL);
}
#else
rv = NS_MakeAbsoluteURL(mURL, baseURL, tk->mIdent, absURL);
#endif // NECKO
if (NS_FAILED(rv)) {
absURL = tk->mIdent;
}

View File

@ -21,13 +21,11 @@
#include "nsCRT.h"
#include "nsIAtom.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsNeckoUtil.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsISupportsArray.h"
#include "nsHashtable.h"
#include "nsICSSStyleRuleProcessor.h"
@ -1290,14 +1288,10 @@ CSSStyleSheetImpl::Init(nsIURI* aURL)
return NS_ERROR_ALREADY_INITIALIZED;
if (mInner->mURL) {
#ifdef NECKO
#ifdef DEBUG
PRBool eq;
nsresult rv = mInner->mURL->Equals(aURL, &eq);
NS_ASSERTION(NS_SUCCEEDED(rv) && eq, "bad inner");
#endif
#else
NS_ASSERTION(mInner->mURL->Equals(aURL), "bad inner");
#endif
}
else {
@ -1469,13 +1463,9 @@ CSSStyleSheetImpl::ContainsStyleSheet(nsIURI* aURL) const
{
NS_PRECONDITION(nsnull != aURL, "null arg");
#ifdef NECKO
PRBool result;
nsresult rv = mInner->mURL->Equals(aURL, &result);
if (NS_FAILED(rv)) result = PR_FALSE;
#else
PRBool result = mInner->mURL->Equals(aURL);
#endif
const CSSStyleSheetImpl* child = mFirstChild;
while ((PR_FALSE == result) && (nsnull != child)) {
@ -1794,22 +1784,12 @@ void CSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const
}
fputs("CSS Style Sheet: ", out);
#ifdef NECKO
char* urlSpec = nsnull;
nsresult rv = mInner->mURL->GetSpec(&urlSpec);
if (NS_SUCCEEDED(rv) && urlSpec) {
fputs(urlSpec, out);
nsCRT::free(urlSpec);
}
#else
PRUnichar* urlSpec = nsnull;
mInner->mURL->ToString(&urlSpec);
if (urlSpec) {
nsAutoString buffer(urlSpec);
delete [] urlSpec;
fputs(buffer, out);
}
#endif
if (mMedia) {
fputs(" media: ", out);
@ -1946,19 +1926,12 @@ NS_IMETHODIMP
CSSStyleSheetImpl::GetHref(nsString& aHref)
{
if (mInner && mInner->mURL) {
#ifdef NECKO
char* str = nsnull;
mInner->mURL->GetSpec(&str);
aHref = str;
if (str) {
nsCRT::free(str);
}
#else
PRUnichar* str;
mInner->mURL->ToString(&str);
aHref = str;
delete [] str;
#endif
}
else {
aHref.SetLength(0);
@ -2532,9 +2505,6 @@ static PRBool SelectorMatches(nsIPresContext* aPresContext,
}
nsAutoString absURLSpec;
#ifndef NECKO
NS_MakeAbsoluteURL(docURL, base, href, absURLSpec);
#else
nsresult rv;
nsIURI *baseUri = nsnull;
rv = docURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
@ -2542,7 +2512,6 @@ static PRBool SelectorMatches(nsIPresContext* aPresContext,
NS_MakeAbsoluteURI(href, baseUri, absURLSpec);
NS_RELEASE(baseUri);
#endif // NECKO
NS_IF_RELEASE(docURL);
linkHandler->GetLinkState(absURLSpec.GetUnicode(), linkState);

View File

@ -651,22 +651,12 @@ void HTMLCSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
fputs("HTML CSS Style Sheet: ", out);
#ifdef NECKO
char* urlSpec = nsnull;
mURL->GetSpec(&urlSpec);
if (urlSpec) {
fputs(urlSpec, out);
nsCRT::free(urlSpec);
}
#else
PRUnichar* urlSpec = nsnull;
mURL->ToString(&urlSpec);
if (urlSpec) {
nsAutoString buffer(urlSpec);
fputs(buffer, out);
delete [] urlSpec;
}
#endif
fputs("\n", out);
}

View File

@ -21,13 +21,11 @@
#include "nsCRT.h"
#include "nsIAtom.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsNeckoUtil.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsISupportsArray.h"
#include "nsHashtable.h"
#include "nsIHTMLContent.h"
@ -657,9 +655,6 @@ HTMLStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
nsAutoString absURLSpec;
nsresult rv;
#ifndef NECKO
rv = NS_MakeAbsoluteURL(docURL, base, href, absURLSpec);
#else
nsIURI *baseUri = nsnull;
rv = docURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
if (NS_FAILED(rv)) return 0;
@ -667,7 +662,6 @@ HTMLStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
rv = NS_MakeAbsoluteURI(href, baseUri, absURLSpec);
NS_RELEASE(baseUri);
#endif // NECKO
NS_IF_RELEASE(docURL);
nsLinkState state;
@ -1153,22 +1147,12 @@ void HTMLStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
fputs("HTML Style Sheet: ", out);
#ifdef NECKO
char* urlSpec = nsnull;
mURL->GetSpec(&urlSpec);
if (urlSpec) {
fputs(urlSpec, out);
nsCRT::free(urlSpec);
}
#else
PRUnichar* urlSpec = nsnull;
mURL->ToString(&urlSpec);
if (urlSpec) {
nsAutoString buffer(urlSpec);
fputs(buffer, out);
delete [] urlSpec;
}
#endif
fputs("\n", out);
}

View File

@ -26,12 +26,8 @@
#include "nsIXMLContent.h"
#include "nsIScriptObjectOwner.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIURL.h"
#include "nsNeckoUtil.h"
#else
#include "nsIURLGroup.h"
#endif // NECKO
#include "nsIWebShell.h"
#include "nsIContent.h"
#include "nsITextContent.h"
@ -1125,27 +1121,7 @@ nsXMLContentSink::CreateStyleSheetURL(nsIURI** aUrl,
const nsAutoString& aHref)
{
nsresult result = NS_OK;
#ifdef NECKO
result = NS_NewURI(aUrl, aHref, mDocumentBaseURL);
#else
nsAutoString absURL;
nsIURI* docURL = mDocument->GetDocumentURL();
nsILoadGroup* LoadGroup;
result = docURL->GetLoadGroup(&LoadGroup);
if ((NS_SUCCEEDED(result)) && LoadGroup) {
result = LoadGroup->CreateURL(aUrl, docURL, aHref, nsnull);
NS_RELEASE(LoadGroup);
}
else {
result = NS_MakeAbsoluteURL(docURL, nsnull, aHref, absURL);
if (NS_SUCCEEDED(result)) {
result = NS_NewURL(aUrl, absURL);
}
}
NS_RELEASE(docURL);
#endif
return result;
}
@ -1266,20 +1242,9 @@ nsXMLContentSink::ProcessCSSStyleLink(nsIContent* aElement,
if ((0 == mimeType.Length()) || mimeType.EqualsIgnoreCase("text/css")) {
nsIURI* url = nsnull;
#ifdef NECKO // XXX we need to get passed in the nsILoadGroup here!
// XXX we need to get passed in the nsILoadGroup here!
// nsILoadGroup* group = mDocument->GetDocumentLoadGroup();
result = NS_NewURI(&url, aHref, mDocumentBaseURL/*, group*/);
#else
nsILoadGroup* LoadGroup = nsnull;
mDocumentBaseURL->GetLoadGroup(&LoadGroup);
if (LoadGroup) {
result = LoadGroup->CreateURL(&url, mDocumentBaseURL, aHref, nsnull);
NS_RELEASE(LoadGroup);
}
else {
result = NS_NewURL(&url, aHref, mDocumentBaseURL);
}
#endif
if (NS_OK != result) {
return NS_OK; // The URL is bad, move along, don't propogate the error (for now)
}
@ -1586,7 +1551,6 @@ nsXMLContentSink::StartLayout()
// If the document we are loading has a reference or it is a top level
// frameset document, disable the scroll bars on the views.
#ifdef NECKO
char* ref = nsnull;
nsIURL* url;
nsresult rv = mDocumentURL->QueryInterface(nsIURL::GetIID(), (void**)&url);
@ -1594,10 +1558,6 @@ nsXMLContentSink::StartLayout()
rv = url->GetRef(&ref);
NS_RELEASE(url);
}
#else
const char* ref;
(void)mDocumentURL->GetRef(&ref);
#endif
PRBool topLevelFrameset = PR_FALSE;
if (mWebShell) {
nsIWebShell* rootWebShell;
@ -1637,10 +1597,8 @@ nsXMLContentSink::StartLayout()
NS_RELEASE(shell);
}
}
#ifdef NECKO
// XXX who actually uses ref here anyway?
nsCRT::free(ref);
#endif
}
}
@ -1672,11 +1630,7 @@ nsXMLContentSink::EvaluateScript(nsString& aScript, PRUint32 aLineNo, const char
}
nsIURI* docURL = mDocument->GetDocumentURL();
#ifdef NECKO
char* url;
#else
const char* url;
#endif
if (docURL) {
rv = docURL->GetSpec(&url);
}
@ -1692,9 +1646,7 @@ nsXMLContentSink::EvaluateScript(nsString& aScript, PRUint32 aLineNo, const char
NS_RELEASE(context);
NS_RELEASE(owner);
#ifdef NECKO
nsCRT::free(url);
#endif
}
}
}
@ -1836,22 +1788,9 @@ nsXMLContentSink::ProcessStartSCRIPTTag(const nsIParserNode& aNode)
// Use the SRC attribute value to load the URL
nsIURI* url = nsnull;
nsAutoString absURL;
#ifdef NECKO // XXX we need to get passed in the nsILoadGroup here!
// XXX we need to get passed in the nsILoadGroup here!
// nsILoadGroup* group = mDocument->GetDocumentLoadGroup();
rv = NS_NewURI(&url, src, mDocumentBaseURL);
#else
nsIURI* docURL = mDocument->GetDocumentURL();
nsILoadGroup* group = nsnull;
rv = docURL->GetLoadGroup(&group);
if ((NS_OK == rv) && group) {
rv = group->CreateURL(&url, docURL, src, nsnull);
NS_RELEASE(group);
}
else {
rv = NS_NewURL(&url, absURL);
}
NS_RELEASE(docURL);
#endif
if (NS_OK != rv) {
return rv;
}

View File

@ -43,10 +43,8 @@
#include "nsExpatDTD.h"
#include "nsINameSpaceManager.h"
#include "nsICSSLoader.h"
#ifdef NECKO
#include "nsCOMPtr.h"
#include "nsIURI.h"
#endif
#include "nsXPIDLString.h"
#include "nsIHTTPChannel.h"
#include "nsIServiceManager.h"
@ -149,20 +147,12 @@ nsrefcnt nsXMLDocument::Release()
}
nsresult
#ifdef NECKO
nsXMLDocument::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup)
#else
nsXMLDocument::Reset(nsIURI* aURL)
#endif
{
#ifdef NECKO
nsresult result = nsDocument::Reset(aChannel, aLoadGroup);
nsCOMPtr<nsIURI> aURL;
result = aChannel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(result)) return result;
#else
nsresult result = nsDocument::Reset(aURL);
#endif
if (NS_FAILED(result)) {
return result;
}
@ -199,21 +189,13 @@ nsXMLDocument::GetContentType(nsString& aContentType) const
NS_IMETHODIMP
nsXMLDocument::StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aUrl,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener)
{
nsresult rv = nsDocument::StartDocumentLoad(aCommand,
#ifdef NECKO
aChannel, aLoadGroup,
#else
aUrl,
#endif
aContainer,
aDocListener);
if (NS_FAILED(rv)) {
@ -224,7 +206,6 @@ nsXMLDocument::StartDocumentLoad(const char* aCommand,
nsAutoString charset("utf-8");
nsCharsetSource charsetSource = kCharsetFromDocTypeDefault;
#ifdef NECKO
nsCOMPtr<nsIURI> aUrl;
rv = aChannel->GetURI(getter_AddRefs(aUrl));
if (NS_FAILED(rv)) return rv;
@ -266,7 +247,6 @@ nsXMLDocument::StartDocumentLoad(const char* aCommand,
}
}
}
#endif
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);

View File

@ -48,12 +48,8 @@ public:
NS_IMETHOD GetContentType(nsString& aContentType) const;
NS_IMETHOD StartDocumentLoad(const char* aCommand,
#ifdef NECKO
nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
#else
nsIURI *aUrl,
#endif
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener);
@ -84,11 +80,7 @@ public:
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, nsILoadGroup* aLoadGroup);
#else
virtual nsresult Reset(nsIURI* aUrl);
#endif
// For HTML elements in our content model
nsIHTMLStyleSheet* mAttrStyleSheet;

View File

@ -36,11 +36,7 @@ public:
virtual int GetContentLength()=0;
#ifdef NECKO
virtual char* GetAddress()=0;
#else
virtual const char* GetAddress()=0;
#endif
virtual time_t GetExpires()=0;

View File

@ -998,15 +998,9 @@ IL_StreamFirstWrite(il_container *ic, const unsigned char *str, int32 len)
FREE_IF_NOT_NULL(ic->fetch_url);
#ifdef NECKO
if (ic->url){
ic->fetch_url = ic->url->GetAddress();
}
#else
if((ic->url)&& ic->url->GetAddress()){
ic->fetch_url = PL_strdup(ic->url->GetAddress());
}
#endif
else{
if(ic->url_address) /* check needed because of mkicons.c */
ic->fetch_url = PL_strdup(ic->url_address);
@ -1612,14 +1606,9 @@ IL_StreamCreated(il_container *ic,
ic->type = nsCRT::strdup(type); //mime string
ic->content_length = url->GetContentLength();
#ifdef NECKO
char* addr = url->GetAddress();
ILTRACE(4,("il: new stream, type %s, %s", ic->type, addr));
nsCRT::free(addr);
#else
ILTRACE(4,("il: new stream, type %s, %s", ic->type,
url->GetAddress()));
#endif
ic->state = IC_STREAM;
#ifndef M12N /* XXXM12N Fix me. */

View File

@ -27,11 +27,7 @@
#include "nsIFactory.h"
#include "nsIComponentManager.h"
#ifdef XP_MAC
#ifdef NECKO
#include "nsIPrompt.h"
#else
#include "nsINetSupport.h"
#endif
#include "nsIStreamListener.h"
#endif /* XP_MAC */
#include "nsIServiceManager.h"

View File

@ -31,9 +31,6 @@
#include "nsXPIDLString.h"
#include "nsIPref.h"
#ifndef NECKO
#include "nsINetService.h"
#else
#include "nsIBufferInputStream.h"
#include "nsIIOService.h"
#include "nsIURL.h"
@ -44,8 +41,6 @@
#include "nsIDocument.h"
#include "nsNeckoUtil.h"
#endif // NECKO
#include "nsIServiceManager.h"
#include "nsICookieStorage.h"
#include "nsICookieService.h"
@ -86,12 +81,7 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID);
static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID);
#ifndef NECKO
static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID);
static NS_DEFINE_CID(kNetServiceCID, NS_NETSERVICE_CID);
#else
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
static NS_DEFINE_IID(kIFileUtilitiesIID, NS_IFILEUTILITIES_IID);
static NS_DEFINE_IID(kIOutputStreamIID, NS_IOUTPUTSTREAM_IID);
@ -392,9 +382,7 @@ nsPluginStreamInfo::SetURL(const char* url)
class nsPluginCacheListener;
class nsPluginStreamListenerPeer : public nsIStreamListener
#ifdef NECKO
, public nsIProgressEventSink
#endif
{
public:
nsPluginStreamListenerPeer();
@ -402,7 +390,6 @@ public:
NS_DECL_ISUPPORTS
#ifdef NECKO
// nsIProgressEventSink methods:
NS_DECL_NSIPROGRESSEVENTSINK
@ -412,25 +399,6 @@ public:
// nsIStreamListener methods:
NS_DECL_NSISTREAMLISTENER
#else
//nsIStreamObserver interface
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg);
//nsIStreamListener interface
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, PRUint32 aLength);
#endif // Necko
//locals
// Called by GetURL and PostURL (via NewStream)
@ -443,9 +411,7 @@ public:
nsresult OnFileAvailable(const char* aFilename);
#ifdef NECKO
nsILoadGroup* GetLoadGroup();
#endif
private:
@ -490,27 +456,8 @@ public:
NS_DECL_ISUPPORTS
#ifdef NECKO
NS_DECL_NSISTREAMOBSERVER
NS_DECL_NSISTREAMLISTENER
#else
//nsIStreamObserver interface
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg);
//nsIStreamListener interface
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, PRUint32 aLength);
#endif // NECKO
private:
@ -564,7 +511,6 @@ nsPluginCacheListener::~nsPluginCacheListener()
NS_IMPL_ISUPPORTS(nsPluginCacheListener, kIStreamListenerIID);
#ifdef NECKO
NS_IMETHODIMP
nsPluginCacheListener::OnStartRequest(nsIChannel* channel, nsISupports* ctxt)
{
@ -584,90 +530,12 @@ nsPluginCacheListener::OnStartRequest(nsIChannel* channel, nsISupports* ctxt)
return rv;
}
#else
NS_IMETHODIMP
nsPluginCacheListener::OnStartRequest(nsIURI* aURL, const char *aContentType)
{
#ifdef USE_CACHE
nsString urlString;
char* cString;
char* fileName;
aURL->ToString(urlString);
cString = urlString.ToNewCString();
mCachedFile = new nsCacheObject(cString);
delete [] cString;
if(mCachedFile == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
// use the actual filename of the net-based file as the cache filename
aURL->GetFile(fileName);
mCachedFile->Filename(fileName);
nsCacheManager* cacheManager = nsCacheManager::GetInstance();
nsDiskModule* diskCache = cacheManager->GetDiskModule();
diskCache->AddObject(mCachedFile);
#else // USE_CACHE
char buf[400], tpath[300];
#ifdef XP_PC
::GetTempPath(sizeof(tpath), tpath);
PRInt32 len = PL_strlen(tpath);
if((len > 0) && (tpath[len-1] != '\\'))
{
tpath[len] = '\\';
tpath[len+1] = 0;
}
#elif defined (XP_UNIX) || defined(XP_BEOS)
PL_strcpy(tpath, "/tmp/");
#else
tpath[0] = 0;
#endif // XP_PC
const char* pathName;
char* fileName;
aURL->GetFile(&pathName);
// since GetFile actually returns us the full path, move to the last \ and skip it
fileName = PL_strrchr(pathName, '/');
if(fileName)
++fileName;
// if we don't get a filename for some reason, just make one up using the address of this
// object to ensure uniqueness of the filename per stream
if(!fileName)
PR_snprintf(buf, sizeof(buf), "%s%08X.ngl", tpath, this);
else
PR_snprintf(buf, sizeof(buf), "%s%s", tpath, fileName);
mStreamFile = fopen(buf, "wb");
//setbuf(mStreamFile, NULL);
mFileName = PL_strdup(buf);
#endif // USE_CACHE
return NS_OK;
}
#endif // NECKO
#ifndef NECKO
NS_IMETHODIMP
nsPluginCacheListener::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
{
return NS_OK;
}
#endif
NS_IMETHODIMP
#ifdef NECKO
nsPluginCacheListener::OnDataAvailable(nsIChannel* channel, nsISupports* ctxt,
nsIInputStream* aIStream,
PRUint32 sourceOffset,
PRUint32 aLength)
#else
nsPluginCacheListener::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, PRUint32 aLength)
#endif
{
PRUint32 readlen;
@ -692,12 +560,8 @@ nsPluginCacheListener::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, P
}
NS_IMETHODIMP
#ifdef NECKO
nsPluginCacheListener::OnStopRequest(nsIChannel* channel, nsISupports* aContext,
nsresult aStatus, const PRUnichar* aMsg)
#else
nsPluginCacheListener::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
#endif // NECKO
{
#ifdef USE_CACHE
if (nsnull != mCachedFile)
@ -733,22 +597,6 @@ nsPluginCacheListener::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUni
return NS_OK;
}
#ifndef NECKO
NS_IMETHODIMP
nsPluginCacheListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
{
// not used
return NS_OK;
}
NS_IMETHODIMP
nsPluginCacheListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
{
// not used
return NS_OK;
}
#endif // !NECKO
///////////////////////////////////////////////////////////////////////////////////////////////////////
nsPluginStreamListenerPeer::nsPluginStreamListenerPeer()
@ -776,16 +624,10 @@ nsPluginStreamListenerPeer::~nsPluginStreamListenerPeer()
#ifdef NS_DEBUG
if(mURL != nsnull)
{
#ifdef NECKO
char* spec;
#else
const char* spec;
#endif
(void)mURL->GetSpec(&spec);
printf("killing stream for %s\n", mURL ? spec : "(unknown URL)");
#ifdef NECKO
nsCRT::free(spec);
#endif
}
#endif
@ -837,16 +679,10 @@ nsresult nsPluginStreamListenerPeer::Initialize(nsIURI *aURL, nsIPluginInstance
nsIPluginStreamListener* aListener)
{
#ifdef NS_DEBUG
#ifdef NECKO
char* spec;
#else
const char* spec;
#endif
(void)aURL->GetSpec(&spec);
printf("created stream for %s\n", spec);
#ifdef NECKO
nsCRT::free(spec);
#endif
#endif
mURL = aURL;
@ -874,16 +710,10 @@ nsresult nsPluginStreamListenerPeer::InitializeEmbeded(nsIURI *aURL, nsIPluginIn
nsIPluginHost *aHost)
{
#ifdef NS_DEBUG
#ifdef NECKO
char* spec;
#else
const char* spec;
#endif
(void)aURL->GetSpec(&spec);
printf("created stream for %s\n", spec);
#ifdef NECKO
nsCRT::free(spec);
#endif
#endif
mURL = aURL;
@ -925,23 +755,17 @@ nsresult nsPluginStreamListenerPeer::InitializeFullPage(nsIPluginInstance *aInst
}
#ifdef NECKO
NS_IMETHODIMP
nsPluginStreamListenerPeer::OnStartRequest(nsIChannel* channel, nsISupports* aContext)
#else
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartRequest(nsIURI* aURL, const char *aContentType)
#endif
{
nsresult rv = NS_OK;
#ifdef NECKO
char* aContentType = nsnull;
rv = channel->GetContentType(&aContentType);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIURI> aURL;
rv = channel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(rv)) return rv;
#endif
if (nsnull != aContentType)
mPluginStreamInfo->SetContentType(aContentType);
@ -977,9 +801,7 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartRequest(nsIURI* aURL, const cha
}
}
#ifdef NECKO
nsCRT::free(aContentType);
#endif //NECKO
//
// Set up the stream listener...
@ -998,81 +820,42 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartRequest(nsIURI* aURL, const cha
}
#ifdef NECKO
NS_IMETHODIMP nsPluginStreamListenerPeer::OnProgress(nsIChannel* channel,
nsISupports* aContext,
PRUint32 aProgress,
PRUint32 aProgressMax)
#else
NS_IMETHODIMP nsPluginStreamListenerPeer::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
#endif
{
nsresult rv = NS_OK;
#ifndef NECKO
mPluginStreamInfo->SetLength(aProgressMax);
if(mOnStartRequest == PR_TRUE && mSetUpListener == PR_FALSE)
rv = SetUpStreamListener(aURL);
mGotProgress = PR_TRUE;
#endif
return rv;
}
#ifdef NECKO
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStatus(nsIChannel* channel,
nsISupports* aContext, const PRUnichar* aMsg)
#else
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
#endif
{
return NS_OK;
}
#ifndef NECKO
NS_IMETHODIMP nsPluginStreamListenerPeer::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
{
return NS_OK;
}
#endif
#ifdef NECKO
NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIChannel* channel,
nsISupports* aContext,
nsIInputStream *aIStream,
PRUint32 sourceOffset,
PRUint32 aLength)
#else
NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream,
PRUint32 aLength)
#endif
{
nsresult rv = NS_OK;
#ifdef NECKO
nsCOMPtr<nsIURI> aURL;
rv = channel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(rv)) return rv;
char* url;
#else
const char* url;
#endif
if(!mPStreamListener)
return NS_ERROR_FAILURE;
#ifdef NECKO
char* urlString;
#else
const char* urlString;
#endif
aURL->GetSpec(&urlString);
mPluginStreamInfo->SetURL(urlString);
#ifdef NECKO
nsCRT::free(urlString);
#endif
// if the plugin has requested an AsFileOnly stream, then don't call OnDataAvailable
if(mStreamType != nsPluginStreamType_AsFileOnly)
@ -1093,35 +876,23 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInput
return rv;
}
#ifdef NECKO
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIChannel* channel,
nsISupports* aContext,
nsresult aStatus,
const PRUnichar* aMsg)
#else
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
#endif // NECKO
{
nsresult rv = NS_OK;
#ifdef NECKO
nsCOMPtr<nsIURI> aURL;
rv = channel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(rv)) return rv;
#endif // NECKO
// nsPluginReason reason = nsPluginReason_NoReason;
if(nsnull != mPStreamListener)
{
#ifdef NECKO
char* urlString;
#else
const char* urlString;
#endif
aURL->GetSpec(&urlString);
mPluginStreamInfo->SetURL(urlString);
#ifdef NECKO
nsCRT::free(urlString);
#endif
// tell the plugin that the stream has ended only if the cache is done
if(mCacheDone)
@ -1141,12 +912,8 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIURI* aURL, nsresult a
nsresult nsPluginStreamListenerPeer::SetUpCache(nsIURI* aURL)
{
nsPluginCacheListener* cacheListener = new nsPluginCacheListener(this);
#ifdef NECKO
// XXX: Null LoadGroup?
return NS_OpenURI(cacheListener, nsnull, aURL, nsnull);
#else
return NS_OpenURL(aURL, cacheListener);
#endif
}
nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIURI* aURL)
@ -1170,16 +937,10 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIURI* aURL)
mPluginStreamInfo->SetSeekable(PR_FALSE);
//mPluginStreamInfo->SetModified(??);
#ifdef NECKO
char* urlString;
aURL->GetSpec(&urlString);
mPluginStreamInfo->SetURL(urlString);
nsCRT::free(urlString);
#else
const char* urlString;
aURL->GetSpec(&urlString);
mPluginStreamInfo->SetURL(urlString);
#endif
rv = mPStreamListener->OnStartBinding((nsIPluginStreamInfo*)mPluginStreamInfo);
@ -1213,7 +974,6 @@ nsPluginStreamListenerPeer::OnFileAvailable(const char* aFilename)
return rv;
}
#ifdef NECKO
nsILoadGroup*
nsPluginStreamListenerPeer::GetLoadGroup()
{
@ -1226,7 +986,6 @@ nsPluginStreamListenerPeer::GetLoadGroup()
}
return loadGroup;
}
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////////
@ -1340,13 +1099,7 @@ nsresult nsPluginHostImpl::UserAgent(const char **retstring)
nsString ua;
nsINetService *service = nsnull;
#ifndef NECKO
res = nsServiceManager::GetService(kNetServiceCID,
kINetServiceIID,
(nsISupports **)&service);
#else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &res);
#endif // NECKO
if ((NS_OK == res) && (nsnull != service))
{
@ -1535,7 +1288,6 @@ printf("plugin manager2 notifystatuschange called\n");
NS_IMETHODIMP nsPluginHostImpl::FindProxyForURL(const char* url, char* *result)
{
nsresult res = NS_ERROR_NOT_IMPLEMENTED;
#ifdef NECKO
const PRInt32 bufLen = 80;
nsIURI *uriIn = nsnull;
@ -1607,7 +1359,6 @@ NS_IMETHODIMP nsPluginHostImpl::FindProxyForURL(const char* url, char* *result)
NS_RELEASE(uriIn);
#endif // NECKO
return res;
}
@ -1677,11 +1428,7 @@ NS_IMETHODIMP nsPluginHostImpl::Destroy(void)
/* Called by nsPluginInstanceOwner (nsObjectFrame.cpp - embeded case) */
NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbededPlugin(const char *aMimeType,
#ifdef NECKO
nsIURI* aURL,
#else
nsIURI* aURL,
#endif
nsIPluginInstanceOwner *aOwner)
{
nsresult rv;
@ -1766,11 +1513,7 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
//create a URL so that the instantiator can do file ext.
//based plugin lookups...
#ifndef NECKO
rv = NS_NewURL(&url, aURLSpec);
#else
rv = NS_NewURI(&url, aURLSpec);
#endif // NECKO
if (rv != NS_OK)
url = nsnull;
@ -1823,11 +1566,7 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
nsresult nsPluginHostImpl::FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstanceOwner *aOwner)
{
PRUint32 i;
#ifdef NECKO
char* url;
#else
const char* url;
#endif
if(!aURL)
return NS_ERROR_FAILURE;
@ -1852,25 +1591,18 @@ nsresult nsPluginHostImpl::FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstan
instance->SetWindow(window);
mActivePluginList[i].mStopped = PR_FALSE;
#ifdef NECKO
nsCRT::free(url);
#endif
return NS_OK;
}
}
#ifdef NECKO
nsCRT::free(url);
#endif
return NS_ERROR_FAILURE;
}
void nsPluginHostImpl::AddInstanceToActiveList(nsIPluginInstance* aInstance, nsIURI* aURL)
{
#ifdef NECKO
char* url;
#else
const char* url;
#endif
if(!aURL)
return;
@ -1906,9 +1638,7 @@ void nsPluginHostImpl::AddInstanceToActiveList(nsIPluginInstance* aInstance, nsI
if(mOldestActivePlugin == MAX_ACTIVE_PLUGINS)
mOldestActivePlugin = 0;
}
#ifdef NECKO
nsCRT::free(url);
#endif
}
NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType,
@ -1930,13 +1660,8 @@ NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType,
{
char* extension;
#ifdef NECKO
char* filename;
aURL->GetPath(&filename);
#else
const char* filename;
aURL->GetFile(&filename);
#endif
extension = PL_strrchr(filename, '.');
if(extension)
++extension;
@ -1945,9 +1670,7 @@ NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType,
if(IsPluginEnabledForExtension(extension, mimetype) != NS_OK)
return NS_ERROR_FAILURE;
#ifdef NECKO
nsCRT::free(filename);
#endif
}
else
mimetype = aMimeType;
@ -2411,23 +2134,15 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
if (aURL.Length() <= 0)
return NS_OK;
#ifndef NECKO
rv = NS_NewURL(&url, aURL);
#else
rv = NS_NewURI(&url, aURL);
#endif // NECKO
if (NS_OK == rv)
{
rv = listenerPeer->Initialize(url, aInstance, aListener);
if (NS_OK == rv) {
#ifdef NECKO
// XXX: Null LoadGroup?
rv = NS_OpenURI(listenerPeer, nsnull, url, nsnull);
#else
rv = NS_OpenURL(url, listenerPeer);
#endif
}
NS_RELEASE(url);
@ -2480,12 +2195,8 @@ nsresult nsPluginHostImpl::NewEmbededPluginStream(nsIURI* aURL,
rv = NS_ERROR_ILLEGAL_VALUE;
if (NS_OK == rv) {
#ifdef NECKO
// XXX: Null LoadGroup?
rv = NS_OpenURI(listener, nsnull, aURL, nsnull);
#else
rv = NS_OpenURL(aURL, listener);
#endif
}
//NS_RELEASE(aURL);

View File

@ -130,11 +130,7 @@ public:
GetPluginFactory(const char *aMimeType, nsIPlugin** aPlugin);
NS_IMETHOD
#ifdef NECKO
InstantiateEmbededPlugin(const char *aMimeType, nsIURI* aURL, nsIPluginInstanceOwner *aOwner);
#else
InstantiateEmbededPlugin(const char *aMimeType, nsIURI* aURL, nsIPluginInstanceOwner *aOwner);
#endif
NS_IMETHOD
InstantiateFullPagePlugin(const char *aMimeType, nsString& aURLSpec, nsIStreamListener *&aStreamListener, nsIPluginInstanceOwner *aOwner);

View File

@ -24,10 +24,8 @@
#include "nsIPluginInstance.h"
#include "nsIStreamListener.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIChannel.h"
#include "nsNeckoUtil.h"
#endif // NECKO
#include "nsIComponentManager.h"
#include "nsWidgetsCID.h"
#include "nsILinkHandler.h"
@ -62,23 +60,11 @@ public:
// nsISupports
NS_DECL_ISUPPORTS
#ifdef NECKO
// nsIStreamObserver methods:
NS_DECL_NSISTREAMOBSERVER
// nsIStreamListener methods:
NS_DECL_NSISTREAMLISTENER
#else
// nsIStreamListener
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopRequest(nsIURI* aURL, nsresult aStatus,
const PRUnichar* aMsg);
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
PRUint32 aCount);
#endif
PluginViewerImpl* mViewer;
nsIStreamListener* mNextStream;
@ -160,32 +146,18 @@ public:
nsIDeviceContext* aDeviceContext,
const nsRect& aBounds);
#ifdef NECKO
nsresult StartLoad(nsIChannel* channel, nsIStreamListener*& aResult);
#else
nsresult StartLoad(nsIURI* aURL, const char* aContentType,
nsIStreamListener*& aResult);
#endif
void ForceRefresh(void);
#ifdef NECKO
nsresult GetURI(nsIURI* *aURI);
#else
nsresult GetURL(nsIURI *&aURL);
#endif
nsresult GetDocument(nsIDocument* *aDocument);
nsIWidget* mWindow;
nsIDocument* mDocument;
nsIContentViewerContainer* mContainer;
#ifdef NECKO
nsIChannel* mChannel;
#else
nsIURI* mURL;
nsString mContentType;
#endif
pluginInstanceOwner *mOwner;
PRBool mEnableRendering;
};
@ -262,11 +234,7 @@ PluginViewerImpl::~PluginViewerImpl()
}
NS_IF_RELEASE(mDocument);
NS_IF_RELEASE(mContainer);
#ifdef NECKO
NS_IF_RELEASE(mChannel);
#else
NS_IF_RELEASE(mURL);
#endif
}
/*
@ -321,14 +289,8 @@ PluginViewerImpl::Init(nsNativeWidget aNativeParent,
}
nsresult
#ifdef NECKO
PluginViewerImpl::StartLoad(nsIChannel* channel, nsIStreamListener*& aResult)
#else
PluginViewerImpl::StartLoad(nsIURI* aURL, const char* aContentType,
nsIStreamListener*& aResult)
#endif
{
#ifdef NECKO
NS_IF_RELEASE(mChannel);
mChannel = channel;
NS_ADDREF(mChannel);
@ -340,15 +302,6 @@ PluginViewerImpl::StartLoad(nsIURI* aURL, const char* aContentType,
nsCRT::free(contentType);
#endif
#else
printf("PluginViewerImpl::StartLoad: content-type=%s\n", aContentType);
NS_IF_RELEASE(mURL);
mURL = aURL;
NS_IF_ADDREF(aURL);
mContentType = aContentType;
#endif
aResult = nsnull;
// Only instantiate the plugin if our container can host it
@ -387,7 +340,6 @@ PluginViewerImpl::CreatePlugin(nsIPluginHost* aHost, const nsRect& aBounds,
win->ws_info = nsnull; //XXX need to figure out what this is. MMP
#endif
#ifdef NECKO
nsIURI* uri;
rv = mChannel->GetURI(&uri);
if (NS_FAILED(rv)) return rv;
@ -403,14 +355,6 @@ PluginViewerImpl::CreatePlugin(nsIPluginHost* aHost, const nsRect& aBounds,
rv = mChannel->GetContentType(&ct);
if (NS_FAILED(rv)) return rv;
rv = aHost->InstantiateFullPagePlugin(ct, str, aResult, mOwner);
#else
PRUnichar* fullurl;
mURL->ToString(&fullurl);
char* ct = mContentType.ToNewCString();
nsAutoString str = fullurl;
rv = aHost->InstantiateFullPagePlugin(ct, str, aResult, mOwner);
delete fullurl;
#endif
delete[] ct;
}
@ -578,19 +522,10 @@ PluginViewerImpl::ForceRefresh()
mWindow->Invalidate(PR_TRUE);
}
#ifdef NECKO
nsresult PluginViewerImpl::GetURI(nsIURI* *aURI)
{
return mChannel->GetURI(aURI);
}
#else
nsresult PluginViewerImpl::GetURL(nsIURI *&aURL)
{
NS_IF_ADDREF(mURL);
aURL = mURL;
return NS_OK;
}
#endif
nsresult PluginViewerImpl::GetDocument(nsIDocument* *aDocument)
{
@ -617,13 +552,8 @@ PluginListener::~PluginListener()
NS_IMPL_ISUPPORTS(PluginListener, kIStreamListenerIID)
NS_IMETHODIMP
#ifdef NECKO
PluginListener::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
#else
PluginListener::OnStartRequest(nsIURI* aURL, const char *contentType)
#endif
{
#ifdef NECKO
nsresult rv;
char* contentType = nsnull;
@ -636,86 +566,29 @@ PluginListener::OnStartRequest(nsIURI* aURL, const char *contentType)
if (NS_FAILED(rv)) {
return rv;
}
#else
mViewer->StartLoad(aURL, contentType, mNextStream);
#endif
if (nsnull == mNextStream)
return NS_ERROR_FAILURE;
#ifdef NECKO
return mNextStream->OnStartRequest(channel, ctxt);
#else
return mNextStream->OnStartRequest(aURL, contentType);
#endif
}
#ifndef NECKO
NS_IMETHODIMP
PluginListener::OnProgress(nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->OnProgress(aURL, aProgress, aProgressMax);
}
NS_IMETHODIMP
PluginListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->OnStatus(aURL, aMsg);
}
#endif
NS_IMETHODIMP
#ifdef NECKO
PluginListener::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
nsresult status, const PRUnichar *errorMsg)
#else
PluginListener::OnStopRequest(nsIURI* aURL, nsresult aStatus,
const PRUnichar* aMsg)
#endif
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
#ifdef NECKO
return mNextStream->OnStopRequest(channel, ctxt, status, errorMsg);
#else
return mNextStream->OnStopRequest(aURL, aStatus, aMsg);
#endif
}
#ifndef NECKO
NS_IMETHODIMP
PluginListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->GetBindInfo(aURL, aInfo);
}
#endif
NS_IMETHODIMP
#ifdef NECKO
PluginListener::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count)
#else
PluginListener::OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
PRUint32 aCount)
#endif
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
#ifdef NECKO
return mNextStream->OnDataAvailable(channel, ctxt, inStr, sourceOffset, count);
#else
return mNextStream->OnDataAvailable(aURL, aStream, aCount);
#endif
}
//----------------------------------------------------------------------
@ -819,32 +692,17 @@ NS_IMETHODIMP pluginInstanceOwner :: GetURL(const char *aURL, const char *aTarge
if (NS_OK == rv)
{
#ifdef NECKO
nsIURI *uri;
rv = mViewer->GetURI(&uri);
#else
nsIURI *url;
rv = mViewer->GetURL(url);
#endif
if (NS_OK == rv)
{
// Create an absolute URL
#ifdef NECKO
char* absURIStr;
rv = NS_MakeAbsoluteURI(aURL, uri, &absURIStr);
NS_RELEASE(uri);
nsAutoString fullurl(absURIStr);
nsCRT::free(absURIStr);
#else
nsAutoString uniurl = nsAutoString(aURL);
const char* spec;
(void)url->GetSpec(&spec);
nsAutoString base = nsAutoString(spec);
nsAutoString fullurl;
rv = NS_MakeAbsoluteURL(url, base, uniurl, fullurl);
NS_RELEASE(url);
#endif
if (NS_OK == rv) {
nsAutoString unitarget = nsAutoString(aTarget);

View File

@ -31,9 +31,6 @@
#include "nsXPIDLString.h"
#include "nsIPref.h"
#ifndef NECKO
#include "nsINetService.h"
#else
#include "nsIBufferInputStream.h"
#include "nsIIOService.h"
#include "nsIURL.h"
@ -44,8 +41,6 @@
#include "nsIDocument.h"
#include "nsNeckoUtil.h"
#endif // NECKO
#include "nsIServiceManager.h"
#include "nsICookieStorage.h"
#include "nsICookieService.h"
@ -86,12 +81,7 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID);
static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID);
#ifndef NECKO
static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID);
static NS_DEFINE_CID(kNetServiceCID, NS_NETSERVICE_CID);
#else
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
static NS_DEFINE_IID(kIFileUtilitiesIID, NS_IFILEUTILITIES_IID);
static NS_DEFINE_IID(kIOutputStreamIID, NS_IOUTPUTSTREAM_IID);
@ -392,9 +382,7 @@ nsPluginStreamInfo::SetURL(const char* url)
class nsPluginCacheListener;
class nsPluginStreamListenerPeer : public nsIStreamListener
#ifdef NECKO
, public nsIProgressEventSink
#endif
{
public:
nsPluginStreamListenerPeer();
@ -402,7 +390,6 @@ public:
NS_DECL_ISUPPORTS
#ifdef NECKO
// nsIProgressEventSink methods:
NS_DECL_NSIPROGRESSEVENTSINK
@ -412,25 +399,6 @@ public:
// nsIStreamListener methods:
NS_DECL_NSISTREAMLISTENER
#else
//nsIStreamObserver interface
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg);
//nsIStreamListener interface
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, PRUint32 aLength);
#endif // Necko
//locals
// Called by GetURL and PostURL (via NewStream)
@ -443,9 +411,7 @@ public:
nsresult OnFileAvailable(const char* aFilename);
#ifdef NECKO
nsILoadGroup* GetLoadGroup();
#endif
private:
@ -490,27 +456,8 @@ public:
NS_DECL_ISUPPORTS
#ifdef NECKO
NS_DECL_NSISTREAMOBSERVER
NS_DECL_NSISTREAMLISTENER
#else
//nsIStreamObserver interface
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg);
//nsIStreamListener interface
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, PRUint32 aLength);
#endif // NECKO
private:
@ -564,7 +511,6 @@ nsPluginCacheListener::~nsPluginCacheListener()
NS_IMPL_ISUPPORTS(nsPluginCacheListener, kIStreamListenerIID);
#ifdef NECKO
NS_IMETHODIMP
nsPluginCacheListener::OnStartRequest(nsIChannel* channel, nsISupports* ctxt)
{
@ -584,90 +530,12 @@ nsPluginCacheListener::OnStartRequest(nsIChannel* channel, nsISupports* ctxt)
return rv;
}
#else
NS_IMETHODIMP
nsPluginCacheListener::OnStartRequest(nsIURI* aURL, const char *aContentType)
{
#ifdef USE_CACHE
nsString urlString;
char* cString;
char* fileName;
aURL->ToString(urlString);
cString = urlString.ToNewCString();
mCachedFile = new nsCacheObject(cString);
delete [] cString;
if(mCachedFile == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
// use the actual filename of the net-based file as the cache filename
aURL->GetFile(fileName);
mCachedFile->Filename(fileName);
nsCacheManager* cacheManager = nsCacheManager::GetInstance();
nsDiskModule* diskCache = cacheManager->GetDiskModule();
diskCache->AddObject(mCachedFile);
#else // USE_CACHE
char buf[400], tpath[300];
#ifdef XP_PC
::GetTempPath(sizeof(tpath), tpath);
PRInt32 len = PL_strlen(tpath);
if((len > 0) && (tpath[len-1] != '\\'))
{
tpath[len] = '\\';
tpath[len+1] = 0;
}
#elif defined (XP_UNIX) || defined(XP_BEOS)
PL_strcpy(tpath, "/tmp/");
#else
tpath[0] = 0;
#endif // XP_PC
const char* pathName;
char* fileName;
aURL->GetFile(&pathName);
// since GetFile actually returns us the full path, move to the last \ and skip it
fileName = PL_strrchr(pathName, '/');
if(fileName)
++fileName;
// if we don't get a filename for some reason, just make one up using the address of this
// object to ensure uniqueness of the filename per stream
if(!fileName)
PR_snprintf(buf, sizeof(buf), "%s%08X.ngl", tpath, this);
else
PR_snprintf(buf, sizeof(buf), "%s%s", tpath, fileName);
mStreamFile = fopen(buf, "wb");
//setbuf(mStreamFile, NULL);
mFileName = PL_strdup(buf);
#endif // USE_CACHE
return NS_OK;
}
#endif // NECKO
#ifndef NECKO
NS_IMETHODIMP
nsPluginCacheListener::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
{
return NS_OK;
}
#endif
NS_IMETHODIMP
#ifdef NECKO
nsPluginCacheListener::OnDataAvailable(nsIChannel* channel, nsISupports* ctxt,
nsIInputStream* aIStream,
PRUint32 sourceOffset,
PRUint32 aLength)
#else
nsPluginCacheListener::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, PRUint32 aLength)
#endif
{
PRUint32 readlen;
@ -692,12 +560,8 @@ nsPluginCacheListener::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, P
}
NS_IMETHODIMP
#ifdef NECKO
nsPluginCacheListener::OnStopRequest(nsIChannel* channel, nsISupports* aContext,
nsresult aStatus, const PRUnichar* aMsg)
#else
nsPluginCacheListener::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
#endif // NECKO
{
#ifdef USE_CACHE
if (nsnull != mCachedFile)
@ -733,22 +597,6 @@ nsPluginCacheListener::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUni
return NS_OK;
}
#ifndef NECKO
NS_IMETHODIMP
nsPluginCacheListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
{
// not used
return NS_OK;
}
NS_IMETHODIMP
nsPluginCacheListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
{
// not used
return NS_OK;
}
#endif // !NECKO
///////////////////////////////////////////////////////////////////////////////////////////////////////
nsPluginStreamListenerPeer::nsPluginStreamListenerPeer()
@ -776,16 +624,10 @@ nsPluginStreamListenerPeer::~nsPluginStreamListenerPeer()
#ifdef NS_DEBUG
if(mURL != nsnull)
{
#ifdef NECKO
char* spec;
#else
const char* spec;
#endif
(void)mURL->GetSpec(&spec);
printf("killing stream for %s\n", mURL ? spec : "(unknown URL)");
#ifdef NECKO
nsCRT::free(spec);
#endif
}
#endif
@ -837,16 +679,10 @@ nsresult nsPluginStreamListenerPeer::Initialize(nsIURI *aURL, nsIPluginInstance
nsIPluginStreamListener* aListener)
{
#ifdef NS_DEBUG
#ifdef NECKO
char* spec;
#else
const char* spec;
#endif
(void)aURL->GetSpec(&spec);
printf("created stream for %s\n", spec);
#ifdef NECKO
nsCRT::free(spec);
#endif
#endif
mURL = aURL;
@ -874,16 +710,10 @@ nsresult nsPluginStreamListenerPeer::InitializeEmbeded(nsIURI *aURL, nsIPluginIn
nsIPluginHost *aHost)
{
#ifdef NS_DEBUG
#ifdef NECKO
char* spec;
#else
const char* spec;
#endif
(void)aURL->GetSpec(&spec);
printf("created stream for %s\n", spec);
#ifdef NECKO
nsCRT::free(spec);
#endif
#endif
mURL = aURL;
@ -925,23 +755,17 @@ nsresult nsPluginStreamListenerPeer::InitializeFullPage(nsIPluginInstance *aInst
}
#ifdef NECKO
NS_IMETHODIMP
nsPluginStreamListenerPeer::OnStartRequest(nsIChannel* channel, nsISupports* aContext)
#else
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartRequest(nsIURI* aURL, const char *aContentType)
#endif
{
nsresult rv = NS_OK;
#ifdef NECKO
char* aContentType = nsnull;
rv = channel->GetContentType(&aContentType);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIURI> aURL;
rv = channel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(rv)) return rv;
#endif
if (nsnull != aContentType)
mPluginStreamInfo->SetContentType(aContentType);
@ -977,9 +801,7 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartRequest(nsIURI* aURL, const cha
}
}
#ifdef NECKO
nsCRT::free(aContentType);
#endif //NECKO
//
// Set up the stream listener...
@ -998,81 +820,42 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartRequest(nsIURI* aURL, const cha
}
#ifdef NECKO
NS_IMETHODIMP nsPluginStreamListenerPeer::OnProgress(nsIChannel* channel,
nsISupports* aContext,
PRUint32 aProgress,
PRUint32 aProgressMax)
#else
NS_IMETHODIMP nsPluginStreamListenerPeer::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
#endif
{
nsresult rv = NS_OK;
#ifndef NECKO
mPluginStreamInfo->SetLength(aProgressMax);
if(mOnStartRequest == PR_TRUE && mSetUpListener == PR_FALSE)
rv = SetUpStreamListener(aURL);
mGotProgress = PR_TRUE;
#endif
return rv;
}
#ifdef NECKO
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStatus(nsIChannel* channel,
nsISupports* aContext, const PRUnichar* aMsg)
#else
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
#endif
{
return NS_OK;
}
#ifndef NECKO
NS_IMETHODIMP nsPluginStreamListenerPeer::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
{
return NS_OK;
}
#endif
#ifdef NECKO
NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIChannel* channel,
nsISupports* aContext,
nsIInputStream *aIStream,
PRUint32 sourceOffset,
PRUint32 aLength)
#else
NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream,
PRUint32 aLength)
#endif
{
nsresult rv = NS_OK;
#ifdef NECKO
nsCOMPtr<nsIURI> aURL;
rv = channel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(rv)) return rv;
char* url;
#else
const char* url;
#endif
if(!mPStreamListener)
return NS_ERROR_FAILURE;
#ifdef NECKO
char* urlString;
#else
const char* urlString;
#endif
aURL->GetSpec(&urlString);
mPluginStreamInfo->SetURL(urlString);
#ifdef NECKO
nsCRT::free(urlString);
#endif
// if the plugin has requested an AsFileOnly stream, then don't call OnDataAvailable
if(mStreamType != nsPluginStreamType_AsFileOnly)
@ -1093,35 +876,23 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInput
return rv;
}
#ifdef NECKO
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIChannel* channel,
nsISupports* aContext,
nsresult aStatus,
const PRUnichar* aMsg)
#else
NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
#endif // NECKO
{
nsresult rv = NS_OK;
#ifdef NECKO
nsCOMPtr<nsIURI> aURL;
rv = channel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(rv)) return rv;
#endif // NECKO
// nsPluginReason reason = nsPluginReason_NoReason;
if(nsnull != mPStreamListener)
{
#ifdef NECKO
char* urlString;
#else
const char* urlString;
#endif
aURL->GetSpec(&urlString);
mPluginStreamInfo->SetURL(urlString);
#ifdef NECKO
nsCRT::free(urlString);
#endif
// tell the plugin that the stream has ended only if the cache is done
if(mCacheDone)
@ -1141,12 +912,8 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIURI* aURL, nsresult a
nsresult nsPluginStreamListenerPeer::SetUpCache(nsIURI* aURL)
{
nsPluginCacheListener* cacheListener = new nsPluginCacheListener(this);
#ifdef NECKO
// XXX: Null LoadGroup?
return NS_OpenURI(cacheListener, nsnull, aURL, nsnull);
#else
return NS_OpenURL(aURL, cacheListener);
#endif
}
nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIURI* aURL)
@ -1170,16 +937,10 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIURI* aURL)
mPluginStreamInfo->SetSeekable(PR_FALSE);
//mPluginStreamInfo->SetModified(??);
#ifdef NECKO
char* urlString;
aURL->GetSpec(&urlString);
mPluginStreamInfo->SetURL(urlString);
nsCRT::free(urlString);
#else
const char* urlString;
aURL->GetSpec(&urlString);
mPluginStreamInfo->SetURL(urlString);
#endif
rv = mPStreamListener->OnStartBinding((nsIPluginStreamInfo*)mPluginStreamInfo);
@ -1213,7 +974,6 @@ nsPluginStreamListenerPeer::OnFileAvailable(const char* aFilename)
return rv;
}
#ifdef NECKO
nsILoadGroup*
nsPluginStreamListenerPeer::GetLoadGroup()
{
@ -1226,7 +986,6 @@ nsPluginStreamListenerPeer::GetLoadGroup()
}
return loadGroup;
}
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////////
@ -1340,13 +1099,7 @@ nsresult nsPluginHostImpl::UserAgent(const char **retstring)
nsString ua;
nsINetService *service = nsnull;
#ifndef NECKO
res = nsServiceManager::GetService(kNetServiceCID,
kINetServiceIID,
(nsISupports **)&service);
#else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &res);
#endif // NECKO
if ((NS_OK == res) && (nsnull != service))
{
@ -1535,7 +1288,6 @@ printf("plugin manager2 notifystatuschange called\n");
NS_IMETHODIMP nsPluginHostImpl::FindProxyForURL(const char* url, char* *result)
{
nsresult res = NS_ERROR_NOT_IMPLEMENTED;
#ifdef NECKO
const PRInt32 bufLen = 80;
nsIURI *uriIn = nsnull;
@ -1607,7 +1359,6 @@ NS_IMETHODIMP nsPluginHostImpl::FindProxyForURL(const char* url, char* *result)
NS_RELEASE(uriIn);
#endif // NECKO
return res;
}
@ -1677,11 +1428,7 @@ NS_IMETHODIMP nsPluginHostImpl::Destroy(void)
/* Called by nsPluginInstanceOwner (nsObjectFrame.cpp - embeded case) */
NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbededPlugin(const char *aMimeType,
#ifdef NECKO
nsIURI* aURL,
#else
nsIURI* aURL,
#endif
nsIPluginInstanceOwner *aOwner)
{
nsresult rv;
@ -1766,11 +1513,7 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
//create a URL so that the instantiator can do file ext.
//based plugin lookups...
#ifndef NECKO
rv = NS_NewURL(&url, aURLSpec);
#else
rv = NS_NewURI(&url, aURLSpec);
#endif // NECKO
if (rv != NS_OK)
url = nsnull;
@ -1823,11 +1566,7 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
nsresult nsPluginHostImpl::FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstanceOwner *aOwner)
{
PRUint32 i;
#ifdef NECKO
char* url;
#else
const char* url;
#endif
if(!aURL)
return NS_ERROR_FAILURE;
@ -1852,25 +1591,18 @@ nsresult nsPluginHostImpl::FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstan
instance->SetWindow(window);
mActivePluginList[i].mStopped = PR_FALSE;
#ifdef NECKO
nsCRT::free(url);
#endif
return NS_OK;
}
}
#ifdef NECKO
nsCRT::free(url);
#endif
return NS_ERROR_FAILURE;
}
void nsPluginHostImpl::AddInstanceToActiveList(nsIPluginInstance* aInstance, nsIURI* aURL)
{
#ifdef NECKO
char* url;
#else
const char* url;
#endif
if(!aURL)
return;
@ -1906,9 +1638,7 @@ void nsPluginHostImpl::AddInstanceToActiveList(nsIPluginInstance* aInstance, nsI
if(mOldestActivePlugin == MAX_ACTIVE_PLUGINS)
mOldestActivePlugin = 0;
}
#ifdef NECKO
nsCRT::free(url);
#endif
}
NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType,
@ -1930,13 +1660,8 @@ NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType,
{
char* extension;
#ifdef NECKO
char* filename;
aURL->GetPath(&filename);
#else
const char* filename;
aURL->GetFile(&filename);
#endif
extension = PL_strrchr(filename, '.');
if(extension)
++extension;
@ -1945,9 +1670,7 @@ NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType,
if(IsPluginEnabledForExtension(extension, mimetype) != NS_OK)
return NS_ERROR_FAILURE;
#ifdef NECKO
nsCRT::free(filename);
#endif
}
else
mimetype = aMimeType;
@ -2411,23 +2134,15 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
if (aURL.Length() <= 0)
return NS_OK;
#ifndef NECKO
rv = NS_NewURL(&url, aURL);
#else
rv = NS_NewURI(&url, aURL);
#endif // NECKO
if (NS_OK == rv)
{
rv = listenerPeer->Initialize(url, aInstance, aListener);
if (NS_OK == rv) {
#ifdef NECKO
// XXX: Null LoadGroup?
rv = NS_OpenURI(listenerPeer, nsnull, url, nsnull);
#else
rv = NS_OpenURL(url, listenerPeer);
#endif
}
NS_RELEASE(url);
@ -2480,12 +2195,8 @@ nsresult nsPluginHostImpl::NewEmbededPluginStream(nsIURI* aURL,
rv = NS_ERROR_ILLEGAL_VALUE;
if (NS_OK == rv) {
#ifdef NECKO
// XXX: Null LoadGroup?
rv = NS_OpenURI(listener, nsnull, aURL, nsnull);
#else
rv = NS_OpenURL(aURL, listener);
#endif
}
//NS_RELEASE(aURL);

View File

@ -130,11 +130,7 @@ public:
GetPluginFactory(const char *aMimeType, nsIPlugin** aPlugin);
NS_IMETHOD
#ifdef NECKO
InstantiateEmbededPlugin(const char *aMimeType, nsIURI* aURL, nsIPluginInstanceOwner *aOwner);
#else
InstantiateEmbededPlugin(const char *aMimeType, nsIURI* aURL, nsIPluginInstanceOwner *aOwner);
#endif
NS_IMETHOD
InstantiateFullPagePlugin(const char *aMimeType, nsString& aURLSpec, nsIStreamListener *&aStreamListener, nsIPluginInstanceOwner *aOwner);

View File

@ -24,10 +24,8 @@
#include "nsIPluginInstance.h"
#include "nsIStreamListener.h"
#include "nsIURL.h"
#ifdef NECKO
#include "nsIChannel.h"
#include "nsNeckoUtil.h"
#endif // NECKO
#include "nsIComponentManager.h"
#include "nsWidgetsCID.h"
#include "nsILinkHandler.h"
@ -62,23 +60,11 @@ public:
// nsISupports
NS_DECL_ISUPPORTS
#ifdef NECKO
// nsIStreamObserver methods:
NS_DECL_NSISTREAMOBSERVER
// nsIStreamListener methods:
NS_DECL_NSISTREAMLISTENER
#else
// nsIStreamListener
NS_IMETHOD OnStartRequest(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopRequest(nsIURI* aURL, nsresult aStatus,
const PRUnichar* aMsg);
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
PRUint32 aCount);
#endif
PluginViewerImpl* mViewer;
nsIStreamListener* mNextStream;
@ -160,32 +146,18 @@ public:
nsIDeviceContext* aDeviceContext,
const nsRect& aBounds);
#ifdef NECKO
nsresult StartLoad(nsIChannel* channel, nsIStreamListener*& aResult);
#else
nsresult StartLoad(nsIURI* aURL, const char* aContentType,
nsIStreamListener*& aResult);
#endif
void ForceRefresh(void);
#ifdef NECKO
nsresult GetURI(nsIURI* *aURI);
#else
nsresult GetURL(nsIURI *&aURL);
#endif
nsresult GetDocument(nsIDocument* *aDocument);
nsIWidget* mWindow;
nsIDocument* mDocument;
nsIContentViewerContainer* mContainer;
#ifdef NECKO
nsIChannel* mChannel;
#else
nsIURI* mURL;
nsString mContentType;
#endif
pluginInstanceOwner *mOwner;
PRBool mEnableRendering;
};
@ -262,11 +234,7 @@ PluginViewerImpl::~PluginViewerImpl()
}
NS_IF_RELEASE(mDocument);
NS_IF_RELEASE(mContainer);
#ifdef NECKO
NS_IF_RELEASE(mChannel);
#else
NS_IF_RELEASE(mURL);
#endif
}
/*
@ -321,14 +289,8 @@ PluginViewerImpl::Init(nsNativeWidget aNativeParent,
}
nsresult
#ifdef NECKO
PluginViewerImpl::StartLoad(nsIChannel* channel, nsIStreamListener*& aResult)
#else
PluginViewerImpl::StartLoad(nsIURI* aURL, const char* aContentType,
nsIStreamListener*& aResult)
#endif
{
#ifdef NECKO
NS_IF_RELEASE(mChannel);
mChannel = channel;
NS_ADDREF(mChannel);
@ -340,15 +302,6 @@ PluginViewerImpl::StartLoad(nsIURI* aURL, const char* aContentType,
nsCRT::free(contentType);
#endif
#else
printf("PluginViewerImpl::StartLoad: content-type=%s\n", aContentType);
NS_IF_RELEASE(mURL);
mURL = aURL;
NS_IF_ADDREF(aURL);
mContentType = aContentType;
#endif
aResult = nsnull;
// Only instantiate the plugin if our container can host it
@ -387,7 +340,6 @@ PluginViewerImpl::CreatePlugin(nsIPluginHost* aHost, const nsRect& aBounds,
win->ws_info = nsnull; //XXX need to figure out what this is. MMP
#endif
#ifdef NECKO
nsIURI* uri;
rv = mChannel->GetURI(&uri);
if (NS_FAILED(rv)) return rv;
@ -403,14 +355,6 @@ PluginViewerImpl::CreatePlugin(nsIPluginHost* aHost, const nsRect& aBounds,
rv = mChannel->GetContentType(&ct);
if (NS_FAILED(rv)) return rv;
rv = aHost->InstantiateFullPagePlugin(ct, str, aResult, mOwner);
#else
PRUnichar* fullurl;
mURL->ToString(&fullurl);
char* ct = mContentType.ToNewCString();
nsAutoString str = fullurl;
rv = aHost->InstantiateFullPagePlugin(ct, str, aResult, mOwner);
delete fullurl;
#endif
delete[] ct;
}
@ -578,19 +522,10 @@ PluginViewerImpl::ForceRefresh()
mWindow->Invalidate(PR_TRUE);
}
#ifdef NECKO
nsresult PluginViewerImpl::GetURI(nsIURI* *aURI)
{
return mChannel->GetURI(aURI);
}
#else
nsresult PluginViewerImpl::GetURL(nsIURI *&aURL)
{
NS_IF_ADDREF(mURL);
aURL = mURL;
return NS_OK;
}
#endif
nsresult PluginViewerImpl::GetDocument(nsIDocument* *aDocument)
{
@ -617,13 +552,8 @@ PluginListener::~PluginListener()
NS_IMPL_ISUPPORTS(PluginListener, kIStreamListenerIID)
NS_IMETHODIMP
#ifdef NECKO
PluginListener::OnStartRequest(nsIChannel* channel, nsISupports *ctxt)
#else
PluginListener::OnStartRequest(nsIURI* aURL, const char *contentType)
#endif
{
#ifdef NECKO
nsresult rv;
char* contentType = nsnull;
@ -636,86 +566,29 @@ PluginListener::OnStartRequest(nsIURI* aURL, const char *contentType)
if (NS_FAILED(rv)) {
return rv;
}
#else
mViewer->StartLoad(aURL, contentType, mNextStream);
#endif
if (nsnull == mNextStream)
return NS_ERROR_FAILURE;
#ifdef NECKO
return mNextStream->OnStartRequest(channel, ctxt);
#else
return mNextStream->OnStartRequest(aURL, contentType);
#endif
}
#ifndef NECKO
NS_IMETHODIMP
PluginListener::OnProgress(nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->OnProgress(aURL, aProgress, aProgressMax);
}
NS_IMETHODIMP
PluginListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->OnStatus(aURL, aMsg);
}
#endif
NS_IMETHODIMP
#ifdef NECKO
PluginListener::OnStopRequest(nsIChannel* channel, nsISupports *ctxt,
nsresult status, const PRUnichar *errorMsg)
#else
PluginListener::OnStopRequest(nsIURI* aURL, nsresult aStatus,
const PRUnichar* aMsg)
#endif
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
#ifdef NECKO
return mNextStream->OnStopRequest(channel, ctxt, status, errorMsg);
#else
return mNextStream->OnStopRequest(aURL, aStatus, aMsg);
#endif
}
#ifndef NECKO
NS_IMETHODIMP
PluginListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->GetBindInfo(aURL, aInfo);
}
#endif
NS_IMETHODIMP
#ifdef NECKO
PluginListener::OnDataAvailable(nsIChannel* channel, nsISupports *ctxt,
nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count)
#else
PluginListener::OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
PRUint32 aCount)
#endif
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
#ifdef NECKO
return mNextStream->OnDataAvailable(channel, ctxt, inStr, sourceOffset, count);
#else
return mNextStream->OnDataAvailable(aURL, aStream, aCount);
#endif
}
//----------------------------------------------------------------------
@ -819,32 +692,17 @@ NS_IMETHODIMP pluginInstanceOwner :: GetURL(const char *aURL, const char *aTarge
if (NS_OK == rv)
{
#ifdef NECKO
nsIURI *uri;
rv = mViewer->GetURI(&uri);
#else
nsIURI *url;
rv = mViewer->GetURL(url);
#endif
if (NS_OK == rv)
{
// Create an absolute URL
#ifdef NECKO
char* absURIStr;
rv = NS_MakeAbsoluteURI(aURL, uri, &absURIStr);
NS_RELEASE(uri);
nsAutoString fullurl(absURIStr);
nsCRT::free(absURIStr);
#else
nsAutoString uniurl = nsAutoString(aURL);
const char* spec;
(void)url->GetSpec(&spec);
nsAutoString base = nsAutoString(spec);
nsAutoString fullurl;
rv = NS_MakeAbsoluteURL(url, base, uniurl, fullurl);
NS_RELEASE(url);
#endif
if (NS_OK == rv) {
nsAutoString unitarget = nsAutoString(aTarget);

View File

@ -67,11 +67,9 @@
#include "nsICacheObject.h"
#endif
#ifdef NECKO
// this test app handles cookies.
#include "nsICookieService.h"
static NS_DEFINE_CID(nsCookieServiceCID, NS_COOKIESERVICE_CID);
#endif // NECKO
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);

View File

@ -54,11 +54,9 @@
#include "nsICacheObject.h"
#endif
#ifdef NECKO
// this test app handles cookies.
#include "nsICookieService.h"
static NS_DEFINE_CID(nsCookieServiceCID, NS_COOKIESERVICE_CID);
#endif // NECKO
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);

View File

@ -50,11 +50,9 @@
#include "nsXPIDLString.h"
#ifdef NECKO
// this test app handles cookies.
#include "nsICookieService.h"
static NS_DEFINE_CID(nsCookieServiceCID, NS_COOKIESERVICE_CID);
#endif // NECKO
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);

Some files were not shown because too many files have changed in this diff Show More