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

This commit is contained in:
warren%netscape.com 1999-06-23 03:29:44 +00:00
parent 8c614c3f56
commit 1f76168d21
379 changed files with 7353 additions and 2355 deletions

View File

@ -65,7 +65,7 @@ public:
// nsIChromeRegistry methods:
NS_IMETHOD InitRegistry();
NS_IMETHOD ConvertChromeURL(nsIURL* aChromeURL);
NS_IMETHOD ConvertChromeURL(nsIURI* aChromeURL);
// nsIRDFDataSource methods
NS_IMETHOD Init(const char* uri) ; // Called to init the data source.
@ -223,7 +223,7 @@ nsChromeRegistry::QueryInterface(REFNSIID aIID, void** aResult)
// nsIChromeRegistry methods:
NS_IMETHODIMP
nsChromeRegistry::ConvertChromeURL(nsIURL* aChromeURL)
nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL)
{
nsresult rv = NS_OK;

View File

@ -36,7 +36,7 @@ class nsIStreamObserver;
class nsIStyleSet;
class nsIStyleSheet;
class nsIStyleRule;
class nsIURL;
class nsIURI;
class nsIURLGroup;
class nsIViewManager;
class nsString;
@ -85,7 +85,7 @@ public:
// returns the arena associated with this document.
virtual nsIArena* GetArena() = 0;
NS_IMETHOD StartDocumentLoad(nsIURL *aUrl,
NS_IMETHOD StartDocumentLoad(nsIURI *aUrl,
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener,
const char* aCommand) = 0;
@ -98,7 +98,7 @@ public:
/**
* Return the URL for the document. May return null.
*/
virtual nsIURL* GetDocumentURL() const = 0;
virtual nsIURI* GetDocumentURL() const = 0;
/**
* Return the URLGroup for the document. May return null.
@ -108,7 +108,7 @@ public:
/**
* Return the base URL for realtive URLs in the document. May return null (or the document URL).
*/
NS_IMETHOD GetBaseURL(nsIURL*& aURL) const = 0;
NS_IMETHOD GetBaseURL(nsIURI*& aURL) const = 0;
/**
* Return the content (mime) type of this document.

View File

@ -21,7 +21,7 @@
#include "nsISupports.h"
class nsIScriptable;
class nsIScriptEnvironment;
class nsIURL;
class nsIURI;
#define NS_IDOCUMENT_CONTAINER_IID \
{ 0x8efd4470, 0x944d, 0x11d1, \
@ -35,7 +35,7 @@ public:
* @param url the URL to display
* @param connection the connection to use.
*/
virtual void Display(nsIURL* aURL) = 0;
virtual void Display(nsIURI* aURL) = 0;
/**
* Returns a script environment for the specified language and version.

View File

@ -22,7 +22,7 @@
#include "nsISupports.h"
class nsIAtom;
class nsString;
class nsIURL;
class nsIURI;
class nsIStyleRule;
class nsISupportsArray;
class nsIPresContext;
@ -39,7 +39,7 @@ public:
static const nsIID& GetIID() { static nsIID iid = NS_ISTYLE_SHEET_IID; return iid; }
// basic style sheet data
NS_IMETHOD GetURL(nsIURL*& aURL) const = 0;
NS_IMETHOD GetURL(nsIURI*& aURL) const = 0;
NS_IMETHOD GetTitle(nsString& aTitle) const = 0;
NS_IMETHOD GetType(nsString& aType) const = 0;
NS_IMETHOD GetMediumCount(PRInt32& aCount) const = 0;

View File

@ -21,7 +21,9 @@
#include "nsDocument.h"
#include "nsIArena.h"
#include "nsIURL.h"
#ifndef NECKO
#include "nsIURLGroup.h"
#endif
#include "nsString.h"
#include "nsIContent.h"
#include "nsIDocumentObserver.h"
@ -629,7 +631,9 @@ nsDocument::nsDocument()
mArena = nsnull;
mDocumentTitle = nsnull;
mDocumentURL = nsnull;
#ifndef NECKO
mDocumentURLGroup = nsnull;
#endif
mCharacterSet = "ISO-8859-1";
mParentDocument = nsnull;
mRootContent = nsnull;
@ -673,7 +677,9 @@ nsDocument::~nsDocument()
mDocumentTitle = nsnull;
}
NS_IF_RELEASE(mDocumentURL);
#ifndef NECKO
NS_IF_RELEASE(mDocumentURLGroup);
#endif
mParentDocument = nsnull;
@ -828,7 +834,7 @@ nsIArena* nsDocument::GetArena()
}
nsresult
nsDocument::Reset(nsIURL *aURL)
nsDocument::Reset(nsIURI *aURL)
{
nsresult rv = NS_OK;
@ -837,7 +843,9 @@ nsDocument::Reset(nsIURL *aURL)
mDocumentTitle = nsnull;
}
NS_IF_RELEASE(mDocumentURL);
#ifndef NECKO
NS_IF_RELEASE(mDocumentURLGroup);
#endif
// Delete references to sub-documents
PRInt32 index = mSubDocuments.Count();
@ -886,7 +894,9 @@ nsDocument::Reset(nsIURL *aURL)
if (nsnull != aURL) {
NS_ADDREF(aURL);
#ifndef NECKO
rv = aURL->GetURLGroup(&mDocumentURLGroup);
#endif
}
if (NS_OK == rv) {
@ -897,7 +907,7 @@ nsDocument::Reset(nsIURL *aURL)
}
nsresult
nsDocument::StartDocumentLoad(nsIURL *aURL,
nsDocument::StartDocumentLoad(nsIURI *aURL,
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener,
const char* aCommand)
@ -910,7 +920,7 @@ const nsString* nsDocument::GetDocumentTitle() const
return mDocumentTitle;
}
nsIURL* nsDocument::GetDocumentURL() const
nsIURI* nsDocument::GetDocumentURL() const
{
NS_IF_ADDREF(mDocumentURL);
return mDocumentURL;
@ -923,14 +933,20 @@ nsDocument::GetContentType(nsString& aContentType) const
return NS_ERROR_NOT_IMPLEMENTED;
}
#ifndef NECKO
nsIURLGroup* nsDocument::GetDocumentURLGroup() const
{
NS_IF_ADDREF(mDocumentURLGroup);
return mDocumentURLGroup;
}
#endif
NS_IMETHODIMP
nsDocument::GetBaseURL(nsIURL*& aURL) const
#ifdef NECKO
nsDocument::GetBaseURI(nsIURI* &aURL) const
#else
nsDocument::GetBaseURL(nsIURI*& aURL) const
#endif
{
aURL = mDocumentURL;
NS_IF_ADDREF(mDocumentURL);

View File

@ -110,7 +110,7 @@ public:
virtual nsIArena* GetArena();
NS_IMETHOD StartDocumentLoad(nsIURL *aUrl,
NS_IMETHOD StartDocumentLoad(nsIURI *aUrl,
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener,
const char* aCommand);
@ -123,22 +123,28 @@ public:
/**
* Return the URL for the document. May return null.
*/
virtual nsIURL* GetDocumentURL() const;
virtual nsIURI* GetDocumentURL() const;
/**
* Return the content (mime) type of this document.
*/
NS_IMETHOD GetContentType(nsString& aContentType) const;
#ifndef NECKO
/**
* Return the URLGroup for the document. May return null.
*/
virtual nsIURLGroup* GetDocumentURLGroup() const;
#endif
/**
* Return the base URL for realtive URLs in the document. May return null (or the document URL).
*/
NS_IMETHOD GetBaseURL(nsIURL*& aURL) const;
#ifdef NECKO
NS_IMETHOD GetBaseURI(nsIURI*& aURL) const;
#else
NS_IMETHOD GetBaseURL(nsIURI*& aURL) const;
#endif
/**
* Return a standard name for the document's character set. This will
@ -414,7 +420,7 @@ protected:
nsIContent* FindContent(const nsIContent* aStartNode,
const nsIContent* aTest1,
const nsIContent* aTest2) const;
virtual nsresult Reset(nsIURL* aURL);
virtual nsresult Reset(nsIURI* aURL);
// this enum is temporary; there should be no knowledge of HTML in
// nsDocument. That will be fixed when content sink stream factories
@ -437,8 +443,10 @@ protected:
nsIArena* mArena;
nsString* mDocumentTitle;
nsIURL* mDocumentURL;
nsIURI* mDocumentURL;
#ifndef NECKO
nsIURLGroup* mDocumentURLGroup;
#endif
nsString mCharacterSet;
nsIDocument* mParentDocument;
nsVoidArray mSubDocuments;

View File

@ -39,7 +39,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsFrame.h"
@ -1201,7 +1201,7 @@ nsGenericElement::Release()
void
nsGenericElement::TriggerLink(nsIPresContext& aPresContext,
nsLinkVerb aVerb,
nsIURL* aBaseURL,
nsIURI* aBaseURL,
const nsString& aURLSpec,
const nsString& aTargetSpec,
PRBool aClick)

View File

@ -48,7 +48,7 @@ class nsIDOMScriptObjectFactory;
class nsDOMCSSDeclaration;
class nsIDOMCSSStyleDeclaration;
class nsDOMAttributeMap;
class nsIURL;
class nsIURI;
// Class that holds the child list of a content element and also
@ -180,7 +180,7 @@ public:
void TriggerLink(nsIPresContext& aPresContext,
nsLinkVerb aVerb,
nsIURL* aBaseURL,
nsIURI* aBaseURL,
const nsString& aURLSpec,
const nsString& aTargetSpec,
PRBool aClick);

View File

@ -27,7 +27,7 @@ class nsIStyleContext;
class nsIPresContext;
class nsXIFConverter;
class nsIHTMLAttributes;
class nsIURL;
class nsIURI;
// IID for the nsIHTMLContent class
#define NS_IHTMLCONTENT_IID \
@ -72,7 +72,7 @@ public:
* but certain content carries a local base for backward
* compatibility.
*/
NS_IMETHOD GetBaseURL(nsIURL*& aBaseURL) const = 0;
NS_IMETHOD GetBaseURL(nsIURI*& aBaseURL) const = 0;
/**
* Get the base target for any links within this piece

View File

@ -45,7 +45,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsIURLGroup.h"
@ -106,7 +106,7 @@ public:
virtual nsresult StylePropertyChanged(const nsString& aPropertyName,
PRInt32 aHint);
virtual nsresult GetParent(nsISupports **aParent);
virtual nsresult GetBaseURL(nsIURL** aURL);
virtual nsresult GetBaseURL(nsIURI** aURL);
protected:
nsIHTMLContent *mContent;
@ -201,7 +201,7 @@ nsDOMCSSAttributeDeclaration::GetParent(nsISupports **aParent)
}
nsresult
nsDOMCSSAttributeDeclaration::GetBaseURL(nsIURL** aURL)
nsDOMCSSAttributeDeclaration::GetBaseURL(nsIURI** aURL)
{
NS_ASSERTION(nsnull != aURL, "null pointer");
@ -539,7 +539,7 @@ nsGenericHTMLElement::SetAttribute(PRInt32 aNameSpaceID,
return result;
}
nsIURL* docURL = nsnull;
nsIURI* docURL = nsnull;
if (nsnull != mDocument) {
mDocument->GetBaseURL(docURL);
}
@ -968,7 +968,7 @@ nsGenericHTMLElement::GetInlineStyleRules(nsISupportsArray* aRules)
}
nsresult
nsGenericHTMLElement::GetBaseURL(nsIURL*& aBaseURL) const
nsGenericHTMLElement::GetBaseURL(nsIURI*& aBaseURL) const
{
return GetBaseURL(mAttributes, mDocument, &aBaseURL);
}
@ -976,11 +976,11 @@ nsGenericHTMLElement::GetBaseURL(nsIURL*& aBaseURL) const
nsresult
nsGenericHTMLElement::GetBaseURL(nsIHTMLAttributes* aAttributes,
nsIDocument* aDocument,
nsIURL** aBaseURL)
nsIURI** aBaseURL)
{
nsresult result = NS_OK;
nsIURL* docBaseURL = nsnull;
nsIURI* docBaseURL = nsnull;
if (nsnull != aDocument) {
result = aDocument->GetBaseURL(docBaseURL);
}
@ -994,7 +994,7 @@ nsGenericHTMLElement::GetBaseURL(nsIHTMLAttributes* aAttributes,
nsAutoString baseHref;
value.GetStringValue(baseHref);
nsIURL* url = nsnull;
nsIURI* url = nsnull;
nsIURLGroup* urlGroup = nsnull;
docBaseURL->GetURLGroup(&urlGroup);
if (urlGroup) {
@ -1017,7 +1017,7 @@ nsGenericHTMLElement::GetBaseURL(nsIHTMLAttributes* aAttributes,
NS_RELEASE(baseUri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
#endif // NECKO
}
*aBaseURL = url;
@ -1956,7 +1956,7 @@ nsGenericHTMLElement::MapBackgroundAttributesInto(nsIHTMLAttributes* aAttributes
nsCOMPtr<nsIDocument> doc;
rv = shell->GetDocument(getter_AddRefs(doc));
if (NS_SUCCEEDED(rv) && doc) {
nsCOMPtr<nsIURL> docURL;
nsCOMPtr<nsIURI> docURL;
nsGenericHTMLElement::GetBaseURL(aAttributes, doc,
getter_AddRefs(docURL));
#ifndef NECKO

View File

@ -45,7 +45,7 @@ class nsIDOMScriptObjectFactory;
class nsChildContentList;
class nsDOMCSSDeclaration;
class nsIDOMCSSStyleDeclaration;
class nsIURL;
class nsIURI;
class nsIFormControlFrame;
class nsGenericHTMLElement : public nsGenericElement {
@ -112,7 +112,7 @@ public:
nsresult HasClass(nsIAtom* aClass) const;
nsresult GetContentStyleRules(nsISupportsArray* aRules);
nsresult GetInlineStyleRules(nsISupportsArray* aRules);
nsresult GetBaseURL(nsIURL*& aBaseURL) const;
nsresult GetBaseURL(nsIURI*& aBaseURL) const;
nsresult GetBaseTarget(nsString& aBaseTarget) const;
nsresult ToHTMLString(nsString& aResult) const;
nsresult ToHTML(FILE* out) const;
@ -248,7 +248,7 @@ public:
static nsresult GetBaseURL(nsIHTMLAttributes* aAttributes,
nsIDocument* aDocument,
nsIURL** aResult);
nsIURI** aResult);
nsIHTMLAttributes* mAttributes;
};
@ -440,7 +440,7 @@ public:
NS_IMETHOD GetInlineStyleRules(nsISupportsArray* aRules) { \
return _g.GetInlineStyleRules(aRules); \
} \
NS_IMETHOD GetBaseURL(nsIURL*& aBaseURL) const { \
NS_IMETHOD GetBaseURL(nsIURI*& aBaseURL) const { \
return _g.GetBaseURL(aBaseURL); \
} \
NS_IMETHOD GetBaseTarget(nsString& aBaseTarget) const { \
@ -486,7 +486,7 @@ public:
} \
NS_IMETHOD GetContentStyleRules(nsISupportsArray* aRules); \
NS_IMETHOD GetInlineStyleRules(nsISupportsArray* aRules); \
NS_IMETHOD GetBaseURL(nsIURL*& aBaseURL) const { \
NS_IMETHOD GetBaseURL(nsIURI*& aBaseURL) const { \
return _g.GetBaseURL(aBaseURL); \
} \
NS_IMETHOD GetBaseTarget(nsString& aBaseTarget) const { \

View File

@ -305,7 +305,7 @@ nsHTMLAnchorElement::HandleDOMEvent(nsIPresContext& aPresContext,
{
if (nsEventStatus_eConsumeNoDefault != aEventStatus) {
nsAutoString target;
nsIURL* baseURL = nsnull;
nsIURI* baseURL = nsnull;
GetBaseURL(baseURL);
GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::target, target);
if (target.Length() == 0) {
@ -332,7 +332,7 @@ nsHTMLAnchorElement::HandleDOMEvent(nsIPresContext& aPresContext,
}
nsAutoString target;
nsIURL* baseURL = nsnull;
nsIURI* baseURL = nsnull;
GetBaseURL(baseURL);
GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::target, target);
if (target.Length() == 0) {

View File

@ -397,7 +397,7 @@ nsHTMLButtonElement::HandleDOMEvent(nsIPresContext& aPresContext,
if (activeLink == this) {
if (nsEventStatus_eConsumeNoDefault != aEventStatus) {
nsAutoString href, target, disabled;
nsIURL* baseURL = nsnull;
nsIURI* baseURL = nsnull;
GetBaseURL(baseURL);
GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::href, href);
GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::target, target);

View File

@ -39,7 +39,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
@ -528,7 +528,7 @@ nsHTMLImageElement::SetSrc(const nsString& aSrc)
}
nsAutoString url, empty;
nsIURL* baseURL;
nsIURI* baseURL;
empty.Truncate();
result = mOwnerDocument->GetBaseURL(baseURL);

View File

@ -27,7 +27,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
@ -155,7 +155,7 @@ public:
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
nsresult Init(nsIDocument* aDoc,
nsIURL* aURL,
nsIURI* aURL,
nsIWebShell* aContainer);
// nsISupports
@ -194,8 +194,8 @@ public:
nsIDocument* mDocument;
nsIHTMLDocument* mHTMLDocument;
nsIURL* mDocumentURL;
nsIURL* mDocumentBaseURL;
nsIURI* mDocumentURL;
nsIURI* mDocumentBaseURL;
nsIWebShell* mWebShell;
nsIParser* mParser;
@ -1361,7 +1361,7 @@ SinkContext::FlushText(PRBool* aDidFlush)
nsresult
NS_NewHTMLContentSink(nsIHTMLContentSink** aResult,
nsIDocument* aDoc,
nsIURL* aURL,
nsIURI* aURL,
nsIWebShell* aWebShell)
{
NS_PRECONDITION(nsnull != aResult, "null ptr");
@ -1449,7 +1449,7 @@ NS_IMPL_ISUPPORTS(HTMLContentSink, kIHTMLContentSinkIID)
nsresult
HTMLContentSink::Init(nsIDocument* aDoc,
nsIURL* aURL,
nsIURI* aURL,
nsIWebShell* aContainer)
{
NS_PRECONDITION(nsnull != aDoc, "null ptr");
@ -2468,7 +2468,7 @@ HTMLContentSink::ProcessStyleLink(nsIHTMLContent* aElement,
SplitMimeType(aType, mimeType, params);
if ((0 == mimeType.Length()) || mimeType.EqualsIgnoreCase("text/css")) {
nsIURL* url = nsnull;
nsIURI* url = nsnull;
nsIURLGroup* urlGroup = nsnull;
mDocumentBaseURL->GetURLGroup(&urlGroup);
if (urlGroup) {
@ -2484,7 +2484,7 @@ HTMLContentSink::ProcessStyleLink(nsIHTMLContent* aElement,
nsIURI *uri = nsnull, *baseUri = nsnull;
result = mDocumentBaseURL->QueryInterface(nsIURL::GetIID(), (void**)&baseUri);
result = mDocumentBaseURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
if (NS_FAILED(result)) return result;
const char *uriStr = aHref.GetBuffer();
@ -2492,7 +2492,7 @@ HTMLContentSink::ProcessStyleLink(nsIHTMLContent* aElement,
NS_RELEASE(baseUri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
}
@ -2821,7 +2821,7 @@ HTMLContentSink::EvaluateScript(nsString& aScript,
}
nsAutoString ret;
nsIURL* docURL = mDocument->GetDocumentURL();
nsIURI* docURL = mDocument->GetDocumentURL();
const char* url;
if (docURL) {
(void)docURL->GetSpec(&url);
@ -2910,7 +2910,7 @@ HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode& aNode)
// If there is a SRC attribute...
if (src.Length() > 0) {
// Use the SRC attribute value to load the URL
nsIURL* url = nsnull;
nsIURI* url = nsnull;
nsIURLGroup* urlGroup = nsnull;
mDocumentBaseURL->GetURLGroup(&urlGroup);
if (urlGroup) {
@ -2926,7 +2926,7 @@ HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode& aNode)
nsIURI *uri = nsnull, *baseUri = nsnull;
rv = mDocumentBaseURL->QueryInterface(nsIURL::GetIID(), (void**)&baseUri);
rv = mDocumentBaseURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
if (NS_FAILED(rv)) return rv;
const char *uriStr = src.GetBuffer();
@ -2934,7 +2934,7 @@ HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode& aNode)
NS_RELEASE(baseUri);
if (NS_FAILED(rv)) return rv;
rv = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
}
@ -3078,7 +3078,7 @@ HTMLContentSink::ProcessSTYLETag(const nsIParserNode& aNode)
// src with immediate style data doesn't add up
// XXX what does nav do?
// Use the SRC attribute value to load the URL
nsIURL* url = nsnull;
nsIURI* url = nsnull;
nsIURLGroup* urlGroup = nsnull;
mDocumentBaseURL->GetURLGroup(&urlGroup);
if (urlGroup) {
@ -3094,7 +3094,7 @@ HTMLContentSink::ProcessSTYLETag(const nsIParserNode& aNode)
nsIURI *uri = nsnull, *baseUri = nsnull;
rv = mDocumentBaseURL->QueryInterface(nsIURL::GetIID(), (void**)&baseUri);
rv = mDocumentBaseURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
if (NS_FAILED(rv)) return rv;
const char *uriStr = src.GetBuffer();
@ -3102,7 +3102,7 @@ HTMLContentSink::ProcessSTYLETag(const nsIParserNode& aNode)
NS_RELEASE(baseUri);
if (NS_FAILED(rv)) return rv;
rv = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
}

View File

@ -39,7 +39,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#endif // NECKO
#include "nsIURLGroup.h"
#include "nsIContentViewerContainer.h"
@ -244,7 +244,7 @@ nsrefcnt nsHTMLDocument::Release()
}
nsresult
nsHTMLDocument::Reset(nsIURL *aURL)
nsHTMLDocument::Reset(nsIURI *aURL)
{
nsresult result = nsDocument::Reset(aURL);
if (NS_FAILED(result)) {
@ -298,7 +298,7 @@ nsHTMLDocument::GetContentType(nsString& aContentType) const
}
NS_IMETHODIMP
nsHTMLDocument::StartDocumentLoad(nsIURL *aURL,
nsHTMLDocument::StartDocumentLoad(nsIURI *aURL,
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener,
const char* aCommand)
@ -551,7 +551,7 @@ nsHTMLDocument::InternalInsertStyleSheetAt(nsIStyleSheet* aSheet, PRInt32 aIndex
NS_IMETHODIMP
nsHTMLDocument::GetBaseURL(nsIURL*& aURL) const
nsHTMLDocument::GetBaseURL(nsIURI*& aURL) const
{
if (nsnull != mBaseURL) {
NS_ADDREF(mBaseURL);
@ -585,7 +585,7 @@ nsHTMLDocument:: SetBaseURL(const nsString& aURLSpec)
nsIURI *uri = nsnull, *baseUri = nsnull;
result = mDocumentURL->QueryInterface(nsIURL::GetIID(), (void**)&baseUri);
result = mDocumentURL->QueryInterface(nsIURI::GetIID(), (void**)&baseUri);
if (NS_FAILED(result)) return result;
const char *uriStr = aURLSpec.GetBuffer();
@ -593,7 +593,7 @@ nsHTMLDocument:: SetBaseURL(const nsString& aURLSpec)
NS_RELEASE(baseUri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&mBaseURL);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&mBaseURL);
NS_RELEASE(uri);
#endif // NECKO
}
@ -1244,7 +1244,7 @@ nsHTMLDocument::SetCookie(const nsString& aCookie)
nsresult
nsHTMLDocument::GetSourceDocumentURL(JSContext* cx,
nsIURL** sourceURL)
nsIURI** sourceURL)
{
// XXX Tom said this reminded him of the "Six Degrees of
// Kevin Bacon" game. We try to get from here to there using
@ -1282,7 +1282,7 @@ nsHTMLDocument::GetSourceDocumentURL(JSContext* cx,
result = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)sourceURL);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)sourceURL);
NS_RELEASE(uri);
#endif // NECKO
}
@ -1297,7 +1297,7 @@ nsHTMLDocument::GetSourceDocumentURL(JSContext* cx,
// XXX TBI: accepting arguments to the open method.
nsresult
nsHTMLDocument::OpenCommon(nsIURL* aSourceURL)
nsHTMLDocument::OpenCommon(nsIURI* aSourceURL)
{
nsresult result = NS_OK;
// The open occurred after the document finished loading.
@ -1352,7 +1352,7 @@ NS_IMETHODIMP
nsHTMLDocument::Open()
{
nsresult result = NS_OK;
nsIURL* sourceURL;
nsIURI* sourceURL;
// XXX For the non-script Open case, we have to make
// up a URL.
@ -1366,7 +1366,7 @@ nsHTMLDocument::Open()
result = service->NewURI("about:blank", nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&sourceURL);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&sourceURL);
NS_RELEASE(uri);
#endif // NECKO
@ -1382,7 +1382,7 @@ NS_IMETHODIMP
nsHTMLDocument::Open(JSContext *cx, jsval *argv, PRUint32 argc)
{
nsresult result = NS_OK;
nsIURL* sourceURL;
nsIURI* sourceURL;
// XXX The URL of the newly created document will match
// that of the source document. Is this right?
@ -1399,7 +1399,7 @@ nsHTMLDocument::Open(JSContext *cx, jsval *argv, PRUint32 argc)
result = service->NewURI("about:blank", nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&sourceURL);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&sourceURL);
NS_RELEASE(uri);
#endif // NECKO
}

View File

@ -54,7 +54,7 @@ public:
NS_IMETHOD GetContentType(nsString& aContentType) const;
NS_IMETHOD StartDocumentLoad(nsIURL* aUrl,
NS_IMETHOD StartDocumentLoad(nsIURI* aUrl,
nsIContentViewerContainer* aContainer,
nsIStreamListener** aDocListener,
const char* aCommand);
@ -72,7 +72,7 @@ public:
NS_IMETHOD GetInlineStyleSheet(nsIHTMLCSSStyleSheet** aStyleSheet);
NS_IMETHOD GetCSSLoader(nsICSSLoader*& aLoader);
NS_IMETHOD GetBaseURL(nsIURL*& aURL) const;
NS_IMETHOD GetBaseURL(nsIURI*& aURL) const;
NS_IMETHOD SetBaseURL(const nsString& aURLSpec);
NS_IMETHOD GetBaseTarget(nsString& aTarget) const;
NS_IMETHOD SetBaseTarget(const nsString& aTarget);
@ -172,23 +172,23 @@ protected:
static PRBool MatchLayers(nsIContent *aContent, nsString* aData);
static PRBool MatchNameAttribute(nsIContent* aContent, nsString* aData);
nsresult GetSourceDocumentURL(JSContext* cx, nsIURL** sourceURL);
nsresult GetSourceDocumentURL(JSContext* cx, nsIURI** sourceURL);
PRBool GetBodyContent();
nsresult GetBodyElement(nsIDOMHTMLBodyElement** aBody);
virtual nsresult Reset(nsIURL *aURL);
virtual nsresult Reset(nsIURI *aURL);
nsresult WriteCommon(const nsString& aText,
PRBool aNewlineTerminate);
nsresult ScriptWriteCommon(JSContext *cx,
jsval *argv,
PRUint32 argc,
PRBool aNewlineTerminate);
nsresult OpenCommon(nsIURL* aUrl);
nsresult OpenCommon(nsIURI* aUrl);
nsIHTMLStyleSheet* mAttrStyleSheet;
nsIHTMLCSSStyleSheet* mStyleAttrStyleSheet;
nsIURL* mBaseURL;
nsIURI* mBaseURL;
nsString* mBaseTarget;
nsDTDMode mDTDMode;
nsVoidArray mImageMaps;

View File

@ -54,14 +54,14 @@ public:
nsImageDocument();
virtual ~nsImageDocument();
NS_IMETHOD StartDocumentLoad(nsIURL* aURL,
NS_IMETHOD StartDocumentLoad(nsIURI* aURL,
nsIContentViewerContainer* aContainer,
nsIStreamListener** aDocListener,
const char* aCommand);
nsresult CreateSyntheticDocument();
nsresult StartImageLoad(nsIURL* aURL, nsIStreamListener*& aListener);
nsresult StartImageLoad(nsIURI* aURL, nsIStreamListener*& aListener);
void StartLayout();
@ -77,13 +77,13 @@ public:
virtual ~ImageListener();
NS_DECL_ISUPPORTS
NS_IMETHOD OnStartBinding(nsIURL* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURL* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURL* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopBinding(nsIURL* aURL, nsresult aStatus,
NS_IMETHOD OnStartBinding(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult aStatus,
const PRUnichar* aMsg);
NS_IMETHOD GetBindInfo(nsIURL* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnDataAvailable(nsIURL* aURL, nsIInputStream* aStream,
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
PRUint32 aCount);
nsImageDocument* mDocument;
@ -106,7 +106,7 @@ ImageListener::~ImageListener()
NS_IMPL_ISUPPORTS(ImageListener, kIStreamListenerIID)
NS_IMETHODIMP
ImageListener::OnStartBinding(nsIURL* aURL, const char *aContentType)
ImageListener::OnStartBinding(nsIURI* aURL, const char *aContentType)
{
mDocument->StartImageLoad(aURL, mNextStream);
if (nsnull == mNextStream) {
@ -116,7 +116,7 @@ ImageListener::OnStartBinding(nsIURL* aURL, const char *aContentType)
}
NS_IMETHODIMP
ImageListener::OnProgress(nsIURL* aURL, PRUint32 aProgress,
ImageListener::OnProgress(nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax)
{
if (nsnull == mNextStream) {
@ -126,7 +126,7 @@ ImageListener::OnProgress(nsIURL* aURL, PRUint32 aProgress,
}
NS_IMETHODIMP
ImageListener::OnStatus(nsIURL* aURL, const PRUnichar* aMsg)
ImageListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
@ -135,7 +135,7 @@ ImageListener::OnStatus(nsIURL* aURL, const PRUnichar* aMsg)
}
NS_IMETHODIMP
ImageListener::OnStopBinding(nsIURL* aURL, nsresult aStatus,
ImageListener::OnStopBinding(nsIURI* aURL, nsresult aStatus,
const PRUnichar* aMsg)
{
if (nsnull == mNextStream) {
@ -145,7 +145,7 @@ ImageListener::OnStopBinding(nsIURL* aURL, nsresult aStatus,
}
NS_IMETHODIMP
ImageListener::GetBindInfo(nsIURL* aURL, nsStreamBindingInfo* aInfo)
ImageListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
@ -154,7 +154,7 @@ ImageListener::GetBindInfo(nsIURL* aURL, nsStreamBindingInfo* aInfo)
}
NS_IMETHODIMP
ImageListener::OnDataAvailable(nsIURL* aURL, nsIInputStream* aStream,
ImageListener::OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
PRUint32 aCount)
{
if (nsnull == mNextStream) {
@ -184,7 +184,7 @@ nsImageDocument::~nsImageDocument()
}
NS_IMETHODIMP
nsImageDocument::StartDocumentLoad(nsIURL* aURL,
nsImageDocument::StartDocumentLoad(nsIURI* aURL,
nsIContentViewerContainer* aContainer,
nsIStreamListener** aDocListener,
const char* aCommand)
@ -209,7 +209,7 @@ nsImageDocument::StartDocumentLoad(nsIURL* aURL,
}
nsresult
nsImageDocument::StartImageLoad(nsIURL* aURL, nsIStreamListener*& aListener)
nsImageDocument::StartImageLoad(nsIURI* aURL, nsIStreamListener*& aListener)
{
nsresult rv = NS_OK;
aListener = nsnull;

View File

@ -165,7 +165,7 @@ void nsMarkupDocument::StyleSheetsToXIF(nsXIFConverter& aConverter)
if (sheet != nsnull)
{
nsIURL* sheetURL = nsnull;
nsIURI* sheetURL = nsnull;
sheet->GetURL(sheetURL);
if (nsnull == sheetURL) {

View File

@ -23,7 +23,7 @@
class nsIAtom;
class nsString;
class nsIURL;
class nsIURI;
class nsICSSParser;
class nsICSSStyleSheet;
class nsIPresContext;
@ -73,7 +73,7 @@ public:
// - if aCompleted is PR_FALSE, the sheet is still loading and
// will be inserted in the document when complete
NS_IMETHOD LoadStyleLink(nsIContent* aElement,
nsIURL* aURL,
nsIURI* aURL,
const nsString& aTitle,
const nsString& aMedia,
PRInt32 aDefaultNameSpaceID,
@ -83,7 +83,7 @@ public:
// Load a child style sheet (@import)
NS_IMETHOD LoadChildSheet(nsICSSStyleSheet* aParentSheet,
nsIURL* aURL,
nsIURI* aURL,
const nsString& aMedia,
PRInt32 aDefaultNameSpaceID,
PRInt32 aSheetIndex) = 0;
@ -93,7 +93,7 @@ public:
// - if aCompleted is PR_TRUE, the sheet is fully loaded
// - if aCompleted is PR_FALSE, the sheet is still loading and
// aCAllback will be called when the sheet is complete
NS_IMETHOD LoadAgentSheet(nsIURL* aURL,
NS_IMETHOD LoadAgentSheet(nsIURI* aURL,
nsICSSStyleSheet*& aSheet,
PRBool& aCompleted,
nsCSSLoaderCallbackFunc aCallback,

View File

@ -23,7 +23,7 @@
class nsIStyleRule;
class nsICSSStyleSheet;
class nsIUnicharInputStream;
class nsIURL;
class nsIURI;
class nsString;
class nsICSSDeclaration;
class nsICSSLoader;
@ -50,18 +50,18 @@ public:
NS_IMETHOD SetChildLoader(nsICSSLoader* aChildLoader) = 0;
NS_IMETHOD Parse(nsIUnicharInputStream* aInput,
nsIURL* aInputURL,
nsIURI* aInputURL,
nsICSSStyleSheet*& aResult) = 0;
// Parse declarations assuming that the outer curly braces have
// already been accounted for. aBaseURL is the base url to use for
// relative links in the declaration.
NS_IMETHOD ParseDeclarations(const nsString& aDeclaration,
nsIURL* aBaseURL,
nsIURI* aBaseURL,
nsIStyleRule*& aResult) = 0;
NS_IMETHOD ParseAndAppendDeclaration(const nsString& aBuffer,
nsIURL* aBaseURL,
nsIURI* aBaseURL,
nsICSSDeclaration* aDeclaration,
PRInt32* aHint) = 0;

View File

@ -33,7 +33,7 @@ class nsICSSStyleSheet : public nsIStyleSheet {
public:
static const nsIID& GetIID() { static nsIID iid = NS_ICSS_STYLE_SHEET_IID; return iid; }
NS_IMETHOD ContainsStyleSheet(nsIURL* aURL) const = 0;
NS_IMETHOD ContainsStyleSheet(nsIURI* aURL) const = 0;
NS_IMETHOD AppendStyleSheet(nsICSSStyleSheet* aSheet) = 0;
NS_IMETHOD InsertStyleSheetAt(nsICSSStyleSheet* aSheet, PRInt32 aIndex) = 0;
@ -47,7 +47,7 @@ public:
NS_IMETHOD StyleSheetCount(PRInt32& aCount) const = 0;
NS_IMETHOD GetStyleSheetAt(PRInt32 aIndex, nsICSSStyleSheet*& aSheet) const = 0;
NS_IMETHOD Init(nsIURL* aURL) = 0;
NS_IMETHOD Init(nsIURI* aURL) = 0;
NS_IMETHOD SetTitle(const nsString& aTitle) = 0;
NS_IMETHOD AppendMedium(nsIAtom* aMedium) = 0;
NS_IMETHOD ClearMedia(void) = 0;
@ -66,7 +66,7 @@ public:
// XXX for backwards compatibility and convenience
extern NS_HTML nsresult
NS_NewCSSStyleSheet(nsICSSStyleSheet** aInstancePtrResult, nsIURL* aURL);
NS_NewCSSStyleSheet(nsICSSStyleSheet** aInstancePtrResult, nsIURI* aURL);
extern NS_HTML nsresult
NS_NewCSSStyleSheet(nsICSSStyleSheet** aInstancePtrResult);

View File

@ -34,7 +34,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
@ -54,7 +54,7 @@ class CSSLoaderImpl;
class URLKey: public nsHashKey {
public:
URLKey(nsIURL* aURL)
URLKey(nsIURI* aURL)
: nsHashKey(),
mURL(aURL)
{
@ -98,7 +98,7 @@ public:
return new URLKey(*this);
}
nsIURL* mURL;
nsIURI* mURL;
PRUint32 mHashValue;
};
@ -140,20 +140,20 @@ public:
};
struct SheetLoadData {
SheetLoadData(CSSLoaderImpl* aLoader, nsIURL* aURL,
SheetLoadData(CSSLoaderImpl* aLoader, nsIURI* aURL,
const nsString& aTitle, const nsString& aMedia,
PRInt32 aDefaultNameSpaceID,
nsIContent* aOwner, PRInt32 aDocIndex,
nsIParser* aParserToUnblock, PRBool aIsInline);
SheetLoadData(CSSLoaderImpl* aLoader, nsIURL* aURL, const nsString& aMedia,
SheetLoadData(CSSLoaderImpl* aLoader, nsIURI* aURL, const nsString& aMedia,
PRInt32 aDefaultNameSpaceID,
nsICSSStyleSheet* aParentSheet, PRInt32 aSheetIndex);
SheetLoadData(CSSLoaderImpl* aLoader, nsIURL* aURL, nsCSSLoaderCallbackFunc aCallback,
SheetLoadData(CSSLoaderImpl* aLoader, nsIURI* aURL, nsCSSLoaderCallbackFunc aCallback,
void* aData);
~SheetLoadData(void);
CSSLoaderImpl* mLoader;
nsIURL* mURL;
nsIURI* mURL;
nsString mTitle;
nsString mMedia;
PRInt32 mDefaultNameSpaceID;
@ -228,7 +228,7 @@ public:
PRBool& aCompleted);
NS_IMETHOD LoadStyleLink(nsIContent* aElement,
nsIURL* aURL,
nsIURI* aURL,
const nsString& aTitle,
const nsString& aMedia,
PRInt32 aDefaultNameSpaceID,
@ -237,12 +237,12 @@ public:
PRBool& aCompleted);
NS_IMETHOD LoadChildSheet(nsICSSStyleSheet* aParentSheet,
nsIURL* aURL,
nsIURI* aURL,
const nsString& aMedia,
PRInt32 aDefaultNameSpaceID,
PRInt32 aIndex);
NS_IMETHOD LoadAgentSheet(nsIURL* aURL,
NS_IMETHOD LoadAgentSheet(nsIURI* aURL,
nsICSSStyleSheet*& aSheet,
PRBool& aCompleted,
nsCSSLoaderCallbackFunc aCallback,
@ -296,7 +296,7 @@ public:
nsHashtable mSheetMapTable; // map to insertion index arrays
};
SheetLoadData::SheetLoadData(CSSLoaderImpl* aLoader, nsIURL* aURL,
SheetLoadData::SheetLoadData(CSSLoaderImpl* aLoader, nsIURI* aURL,
const nsString& aTitle, const nsString& aMedia,
PRInt32 aDefaultNameSpaceID,
nsIContent* aOwner, PRInt32 aDocIndex,
@ -325,7 +325,7 @@ SheetLoadData::SheetLoadData(CSSLoaderImpl* aLoader, nsIURL* aURL,
NS_IF_ADDREF(mParserToUnblock);
}
SheetLoadData::SheetLoadData(CSSLoaderImpl* aLoader, nsIURL* aURL,
SheetLoadData::SheetLoadData(CSSLoaderImpl* aLoader, nsIURI* aURL,
const nsString& aMedia,
PRInt32 aDefaultNameSpaceID,
nsICSSStyleSheet* aParentSheet, PRInt32 aSheetIndex)
@ -352,7 +352,7 @@ SheetLoadData::SheetLoadData(CSSLoaderImpl* aLoader, nsIURL* aURL,
NS_ADDREF(mParentSheet);
}
SheetLoadData::SheetLoadData(CSSLoaderImpl* aLoader, nsIURL* aURL,
SheetLoadData::SheetLoadData(CSSLoaderImpl* aLoader, nsIURI* aURL,
nsCSSLoaderCallbackFunc aCallback, void* aData)
: mLoader(aLoader),
mURL(aURL),
@ -988,9 +988,9 @@ CSSLoaderImpl::InsertChildSheet(nsICSSStyleSheet* aSheet, nsICSSStyleSheet* aPar
return NS_ERROR_OUT_OF_MEMORY;
}
static nsIURL* CloneURL(nsIURL* aURL)
static nsIURI* CloneURL(nsIURI* aURL)
{
nsIURL* result = nsnull;
nsIURI* result = nsnull;
PRUnichar* urlStr;
aURL->ToString(&urlStr);
@ -1020,7 +1020,7 @@ static nsIURL* CloneURL(nsIURL* aURL)
NS_RELEASE(baseUrl);
if (NS_FAILED(rv)) return nsnull;
rv = uri->QueryInterface(nsIURL::GetIID(), (void**)&result);
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&result);
NS_RELEASE(uri);
#endif // NECKO
}
@ -1042,7 +1042,7 @@ CSSLoaderImpl::LoadSheet(URLKey& aKey, SheetLoadData* aData)
}
else { // not loading, go load it
nsIUnicharStreamLoader* loader;
nsIURL* urlClone = CloneURL(aKey.mURL); // don't give the key to netlib, it munges it
nsIURI* urlClone = CloneURL(aKey.mURL); // don't give the key to netlib, it munges it
if (urlClone) {
result = NS_NewUnicharStreamLoader(&loader, urlClone, DoneLoadingStyle, aData);
NS_RELEASE(urlClone);
@ -1086,7 +1086,7 @@ CSSLoaderImpl::LoadInlineStyle(nsIContent* aElement,
// XXX need to add code to cancel any pending sheets for element
nsresult result = NS_ERROR_NULL_POINTER;
if (aIn) {
nsIURL* docURL;
nsIURI* docURL;
mDocument->GetBaseURL(docURL);
SheetLoadData* data = new SheetLoadData(this, docURL, aTitle, aMedia, aDefaultNameSpaceID,
aElement,
@ -1106,7 +1106,7 @@ CSSLoaderImpl::LoadInlineStyle(nsIContent* aElement,
NS_IMETHODIMP
CSSLoaderImpl::LoadStyleLink(nsIContent* aElement,
nsIURL* aURL,
nsIURI* aURL,
const nsString& aTitle,
const nsString& aMedia,
PRInt32 aDefaultNameSpaceID,
@ -1169,7 +1169,7 @@ CSSLoaderImpl::LoadStyleLink(nsIContent* aElement,
NS_IMETHODIMP
CSSLoaderImpl::LoadChildSheet(nsICSSStyleSheet* aParentSheet,
nsIURL* aURL,
nsIURI* aURL,
const nsString& aMedia,
PRInt32 aDefaultNameSpaceID,
PRInt32 aIndex)
@ -1222,7 +1222,7 @@ CSSLoaderImpl::LoadChildSheet(nsICSSStyleSheet* aParentSheet,
}
NS_IMETHODIMP
CSSLoaderImpl::LoadAgentSheet(nsIURL* aURL,
CSSLoaderImpl::LoadAgentSheet(nsIURI* aURL,
nsICSSStyleSheet*& aSheet,
PRBool& aCompleted,
nsCSSLoaderCallbackFunc aCallback,
@ -1232,7 +1232,7 @@ CSSLoaderImpl::LoadAgentSheet(nsIURL* aURL,
if (aURL) {
// Get an input stream from the url
nsIInputStream* in;
nsIURL* urlClone = CloneURL(aURL); // dont give key URL to netlib, it gets munged
nsIURI* urlClone = CloneURL(aURL); // dont give key URL to netlib, it gets munged
if (urlClone) {
result = NS_OpenURL(urlClone, &in);
NS_RELEASE(urlClone);

View File

@ -33,7 +33,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
@ -132,15 +132,15 @@ public:
NS_IMETHOD SetChildLoader(nsICSSLoader* aChildLoader);
NS_IMETHOD Parse(nsIUnicharInputStream* aInput,
nsIURL* aInputURL,
nsIURI* aInputURL,
nsICSSStyleSheet*& aResult);
NS_IMETHOD ParseDeclarations(const nsString& aDeclaration,
nsIURL* aBaseURL,
nsIURI* aBaseURL,
nsIStyleRule*& aResult);
NS_IMETHOD ParseAndAppendDeclaration(const nsString& aBuffer,
nsIURL* aBaseURL,
nsIURI* aBaseURL,
nsICSSDeclaration* aDeclaration,
PRInt32* aHint);
@ -253,7 +253,7 @@ protected:
PRBool mHavePushBack;
nsCSSScanner* mScanner;
nsIURL* mURL;
nsIURI* mURL;
nsICSSStyleSheet* mSheet;
PRInt32 mChildSheetCount;
nsICSSLoader* mChildLoader; // not ref counted, it owns us
@ -376,7 +376,7 @@ CSSParserImpl::SetChildLoader(nsICSSLoader* aChildLoader)
NS_IMETHODIMP
CSSParserImpl::Parse(nsIUnicharInputStream* aInput,
nsIURL* aInputURL,
nsIURI* aInputURL,
nsICSSStyleSheet*& aResult)
{
NS_ASSERTION(nsnull != aInputURL, "need base URL");
@ -455,7 +455,7 @@ CSSParserImpl::Parse(nsIUnicharInputStream* aInput,
NS_IMETHODIMP
CSSParserImpl::ParseDeclarations(const nsString& aDeclaration,
nsIURL* aBaseURL,
nsIURI* aBaseURL,
nsIStyleRule*& aResult)
{
NS_ASSERTION(nsnull != aBaseURL, "need base URL");
@ -507,7 +507,7 @@ CSSParserImpl::ParseDeclarations(const nsString& aDeclaration,
NS_IMETHODIMP
CSSParserImpl::ParseAndAppendDeclaration(const nsString& aBuffer,
nsIURL* aBaseURL,
nsIURI* aBaseURL,
nsICSSDeclaration* aDeclaration,
PRInt32* aHint)
{
@ -825,7 +825,7 @@ PRBool CSSParserImpl::ProcessImport(PRInt32& aErrorCode, const nsString& aURLSpe
if (mChildLoader) {
// XXX probably need a way to encode unicode junk for the part of
// the url that follows a "?"
nsIURL* url;
nsIURI* url;
nsIURLGroup* urlGroup = nsnull;
mURL->GetURLGroup(&urlGroup);
if (urlGroup) {
@ -849,7 +849,7 @@ PRBool CSSParserImpl::ProcessImport(PRInt32& aErrorCode, const nsString& aURLSpe
NS_RELEASE(baseUri);
if (NS_FAILED(rv)) return PR_FALSE;
rv = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
}

View File

@ -536,7 +536,7 @@ public:
virtual nsresult StylePropertyChanged(const nsString& aPropertyName,
PRInt32 aHint);
virtual nsresult GetParent(nsISupports **aParent);
virtual nsresult GetBaseURL(nsIURL** aURL);
virtual nsresult GetBaseURL(nsIURI** aURL);
protected:
nsICSSStyleRule *mRule;
@ -608,7 +608,7 @@ DOMCSSDeclarationImpl::GetParent(nsISupports **aParent)
}
nsresult
DOMCSSDeclarationImpl::GetBaseURL(nsIURL** aURL)
DOMCSSDeclarationImpl::GetBaseURL(nsIURI** aURL)
{
NS_ASSERTION(nsnull != aURL, "null pointer");

View File

@ -23,7 +23,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
@ -75,7 +75,7 @@ NS_DEF_PTR(nsIHTMLContent);
NS_DEF_PTR(nsIContent);
NS_DEF_PTR(nsIStyleRule);
NS_DEF_PTR(nsICSSStyleRule);
NS_DEF_PTR(nsIURL);
NS_DEF_PTR(nsIURI);
NS_DEF_PTR(nsISupportsArray);
NS_DEF_PTR(nsICSSStyleSheet);
@ -376,7 +376,7 @@ public:
nsVoidArray mSheets;
nsIURL* mURL;
nsIURI* mURL;
nsISupportsArray* mOrderedRules;
nsHashtable* mMediumCascadeTable;
@ -429,8 +429,8 @@ public:
NS_IMETHOD_(nsrefcnt) Release();
// basic style sheet data
NS_IMETHOD Init(nsIURL* aURL);
NS_IMETHOD GetURL(nsIURL*& aURL) const;
NS_IMETHOD Init(nsIURI* aURL);
NS_IMETHOD GetURL(nsIURI*& aURL) const;
NS_IMETHOD GetTitle(nsString& aTitle) const;
NS_IMETHOD SetTitle(const nsString& aTitle);
NS_IMETHOD GetType(nsString& aType) const;
@ -464,7 +464,7 @@ public:
NS_IMETHOD HasStateDependentStyle(nsIPresContext* aPresContext,
nsIContent* aContent);
NS_IMETHOD ContainsStyleSheet(nsIURL* aURL) const;
NS_IMETHOD ContainsStyleSheet(nsIURI* aURL) const;
NS_IMETHOD AppendStyleSheet(nsICSSStyleSheet* aSheet);
NS_IMETHOD InsertStyleSheetAt(nsICSSStyleSheet* aSheet, PRInt32 aIndex);
@ -1456,7 +1456,7 @@ static PRBool SelectorMatches(nsIPresContext* aPresContext,
nsresult attrState = aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::href, href);
if (NS_CONTENT_ATTR_HAS_VALUE == attrState) {
nsIURL* docURL = nsnull;
nsIURI* docURL = nsnull;
nsIHTMLContent* htmlContent;
if (NS_SUCCEEDED(aContent->QueryInterface(kIHTMLContentIID, (void**)&htmlContent))) {
htmlContent->GetBaseURL(docURL);
@ -1852,7 +1852,7 @@ CSSStyleSheetImpl::HasStateDependentStyle(nsIPresContext* aPresContext,
NS_IMETHODIMP
CSSStyleSheetImpl::Init(nsIURL* aURL)
CSSStyleSheetImpl::Init(nsIURI* aURL)
{
NS_PRECONDITION(aURL, "null ptr");
if (! aURL)
@ -1877,10 +1877,10 @@ CSSStyleSheetImpl::Init(nsIURL* aURL)
}
NS_IMETHODIMP
CSSStyleSheetImpl::GetURL(nsIURL*& aURL) const
CSSStyleSheetImpl::GetURL(nsIURI*& aURL) const
{
const nsIURL* url = ((mInner) ? mInner->mURL : nsnull);
aURL = (nsIURL*)url;
const nsIURI* url = ((mInner) ? mInner->mURL : nsnull);
aURL = (nsIURI*)url;
NS_IF_ADDREF(aURL);
return NS_OK;
}
@ -2034,7 +2034,7 @@ CSSStyleSheetImpl::SetOwningNode(nsIDOMNode* aOwningNode)
}
NS_IMETHODIMP
CSSStyleSheetImpl::ContainsStyleSheet(nsIURL* aURL) const
CSSStyleSheetImpl::ContainsStyleSheet(nsIURI* aURL) const
{
NS_PRECONDITION(nsnull != aURL, "null arg");
@ -2884,7 +2884,7 @@ CSSStyleSheetImpl::SetScriptObject(void* aScriptObject)
// XXX for backwards compatibility and convenience
NS_HTML nsresult
NS_NewCSSStyleSheet(nsICSSStyleSheet** aInstancePtrResult, nsIURL* aURL)
NS_NewCSSStyleSheet(nsICSSStyleSheet** aInstancePtrResult, nsIURI* aURL)
{
nsICSSStyleSheet* sheet;
nsresult rv;

View File

@ -213,7 +213,7 @@ nsDOMCSSDeclaration::SetProperty(const nsString& aPropertyName,
result = NS_NewCSSParser(&css);
if (NS_OK == result) {
PRInt32 hint;
nsIURL* baseURL = nsnull;
nsIURI* baseURL = nsnull;
GetBaseURL(&baseURL);
result = css->ParseAndAppendDeclaration(declString, baseURL, decl, &hint);
NS_IF_RELEASE(baseURL);

View File

@ -24,7 +24,7 @@
#include "nsIScriptObjectOwner.h"
class nsICSSDeclaration;
class nsIURL;
class nsIURI;
class nsDOMCSSDeclaration : public nsIDOMCSS2Properties,
public nsIScriptObjectOwner
@ -48,7 +48,7 @@ public:
virtual nsresult StylePropertyChanged(const nsString& aPropertyName,
PRInt32 aHint) = 0;
virtual nsresult GetParent(nsISupports **aParent) = 0;
virtual nsresult GetBaseURL(nsIURL** aURL) = 0; // get URL that style URLs are realtive to
virtual nsresult GetBaseURL(nsIURI** aURL) = 0; // get URL that style URLs are realtive to
protected:
virtual ~nsDOMCSSDeclaration();

View File

@ -271,9 +271,9 @@ public:
NS_IMETHOD_(nsrefcnt) Release();
// basic style sheet data
NS_IMETHOD Init(nsIURL* aURL, nsIDocument* aDocument);
NS_IMETHOD Reset(nsIURL* aURL);
NS_IMETHOD GetURL(nsIURL*& aURL) const;
NS_IMETHOD Init(nsIURI* aURL, nsIDocument* aDocument);
NS_IMETHOD Reset(nsIURI* aURL);
NS_IMETHOD GetURL(nsIURI*& aURL) const;
NS_IMETHOD GetTitle(nsString& aTitle) const;
NS_IMETHOD GetType(nsString& aType) const;
NS_IMETHOD GetMediumCount(PRInt32& aCount) const;
@ -318,7 +318,7 @@ protected:
PRUint32 mInHeap : 1;
PRUint32 mRefCnt : 31;
nsIURL* mURL;
nsIURI* mURL;
nsIDocument* mDocument;
CSSFirstLineRule* mFirstLineRule;
@ -501,7 +501,7 @@ PRInt32 HTMLCSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
}
NS_IMETHODIMP
HTMLCSSStyleSheetImpl::Init(nsIURL* aURL, nsIDocument* aDocument)
HTMLCSSStyleSheetImpl::Init(nsIURI* aURL, nsIDocument* aDocument)
{
NS_PRECONDITION(aURL && aDocument, "null ptr");
if (! aURL || ! aDocument)
@ -527,7 +527,7 @@ HTMLCSSStyleSheetImpl::HasStateDependentStyle(nsIPresContext* aPresContext,
NS_IMETHODIMP
HTMLCSSStyleSheetImpl::Reset(nsIURL* aURL)
HTMLCSSStyleSheetImpl::Reset(nsIURI* aURL)
{
NS_IF_RELEASE(mURL);
mURL = aURL;
@ -544,7 +544,7 @@ HTMLCSSStyleSheetImpl::Reset(nsIURL* aURL)
}
NS_IMETHODIMP
HTMLCSSStyleSheetImpl::GetURL(nsIURL*& aURL) const
HTMLCSSStyleSheetImpl::GetURL(nsIURI*& aURL) const
{
NS_IF_ADDREF(mURL);
aURL = mURL;
@ -641,7 +641,7 @@ void HTMLCSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const
// XXX For backwards compatibility and convenience
NS_HTML nsresult
NS_NewHTMLCSSStyleSheet(nsIHTMLCSSStyleSheet** aInstancePtrResult, nsIURL* aURL,
NS_NewHTMLCSSStyleSheet(nsIHTMLCSSStyleSheet** aInstancePtrResult, nsIURI* aURL,
nsIDocument* aDocument)
{
nsresult rv;

View File

@ -23,7 +23,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
@ -341,7 +341,7 @@ public:
NS_IMETHOD_(nsrefcnt) Release();
// nsIStyleSheet api
NS_IMETHOD GetURL(nsIURL*& aURL) const;
NS_IMETHOD GetURL(nsIURI*& aURL) const;
NS_IMETHOD GetTitle(nsString& aTitle) const;
NS_IMETHOD GetType(nsString& aType) const;
NS_IMETHOD GetMediumCount(PRInt32& aCount) const;
@ -372,8 +372,8 @@ public:
nsIContent* aContent);
// nsIHTMLStyleSheet api
NS_IMETHOD Init(nsIURL* aURL, nsIDocument* aDocument);
NS_IMETHOD Reset(nsIURL* aURL);
NS_IMETHOD Init(nsIURI* aURL, nsIDocument* aDocument);
NS_IMETHOD Reset(nsIURI* aURL);
NS_IMETHOD SetLinkColor(nscolor aColor);
NS_IMETHOD SetActiveLinkColor(nscolor aColor);
NS_IMETHOD SetVisitedLinkColor(nscolor aColor);
@ -415,7 +415,7 @@ protected:
PRUint32 mInHeap : 1;
PRUint32 mRefCnt : 31;
nsIURL* mURL;
nsIURI* mURL;
nsIDocument* mDocument;
HTMLAnchorRule* mLinkRule;
HTMLAnchorRule* mVisitedRule;
@ -579,7 +579,7 @@ PRInt32 HTMLStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
}
}
else {
nsIURL* docURL = nsnull;
nsIURI* docURL = nsnull;
nsIHTMLContent* htmlContent;
if (NS_SUCCEEDED(styledContent->QueryInterface(kIHTMLContentIID, (void**)&htmlContent))) {
@ -723,7 +723,7 @@ PRInt32 HTMLStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
// nsIStyleSheet api
NS_IMETHODIMP
HTMLStyleSheetImpl::GetURL(nsIURL*& aURL) const
HTMLStyleSheetImpl::GetURL(nsIURI*& aURL) const
{
NS_IF_ADDREF(mURL);
aURL = mURL;
@ -801,7 +801,7 @@ HTMLStyleSheetImpl::SetOwningDocument(nsIDocument* aDocument)
return NS_OK;
}
NS_IMETHODIMP HTMLStyleSheetImpl::Init(nsIURL* aURL, nsIDocument* aDocument)
NS_IMETHODIMP HTMLStyleSheetImpl::Init(nsIURI* aURL, nsIDocument* aDocument)
{
NS_PRECONDITION(aURL && aDocument, "null ptr");
if (! aURL || ! aDocument)
@ -816,7 +816,7 @@ NS_IMETHODIMP HTMLStyleSheetImpl::Init(nsIURL* aURL, nsIDocument* aDocument)
return NS_OK;
}
NS_IMETHODIMP HTMLStyleSheetImpl::Reset(nsIURL* aURL)
NS_IMETHODIMP HTMLStyleSheetImpl::Reset(nsIURI* aURL)
{
NS_IF_RELEASE(mURL);
mURL = aURL;
@ -1120,7 +1120,7 @@ void HTMLStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const
// XXX For convenience and backwards compatibility
NS_HTML nsresult
NS_NewHTMLStyleSheet(nsIHTMLStyleSheet** aInstancePtrResult, nsIURL* aURL,
NS_NewHTMLStyleSheet(nsIHTMLStyleSheet** aInstancePtrResult, nsIURI* aURL,
nsIDocument* aDocument)
{
nsresult rv;

View File

@ -23,7 +23,7 @@
//#include "nsString.h"
class nsIAtom;
class nsIURL;
class nsIURI;
// IID for the nsICSSImportRule interface {33824a60-1a09-11d3-805a-006008159b5a}
#define NS_ICSS_IMPORT_RULE_IID \

View File

@ -23,7 +23,7 @@
//#include "nsString.h"
class nsIAtom;
class nsIURL;
class nsIURI;
// IID for the nsICSSNameSpaceRule interface {2469c930-1a09-11d3-805a-006008159b5a}
#define NS_ICSS_NAMESPACE_RULE_IID \

View File

@ -29,13 +29,13 @@ class nsIHTMLCSSStyleSheet : public nsIStyleSheet {
public:
static const nsIID& GetIID() { static nsIID iid = NS_IHTML_CSS_STYLE_SHEET_IID; return iid; }
NS_IMETHOD Init(nsIURL* aURL, nsIDocument* aDocument) = 0;
NS_IMETHOD Reset(nsIURL* aURL) = 0;
NS_IMETHOD Init(nsIURI* aURL, nsIDocument* aDocument) = 0;
NS_IMETHOD Reset(nsIURI* aURL) = 0;
};
// XXX for convenience and backward compatibility
extern NS_HTML nsresult
NS_NewHTMLCSSStyleSheet(nsIHTMLCSSStyleSheet** aInstancePtrResult, nsIURL* aURL,
NS_NewHTMLCSSStyleSheet(nsIHTMLCSSStyleSheet** aInstancePtrResult, nsIURI* aURL,
nsIDocument* aDocument);
extern NS_HTML nsresult

View File

@ -136,7 +136,7 @@ nsXMLElement::HandleDOMEvent(nsIPresContext& aPresContext,
{
if (nsEventStatus_eConsumeNoDefault != aEventStatus) {
nsAutoString show, href, target;
nsIURL* baseURL = nsnull;
nsIURI* baseURL = nsnull;
nsLinkVerb verb = eLinkVerb_Replace;
target.Truncate();
GetAttribute(kNameSpaceID_None, kHrefAtom, href);
@ -166,7 +166,7 @@ nsXMLElement::HandleDOMEvent(nsIPresContext& aPresContext,
case NS_MOUSE_ENTER:
{
nsAutoString href, target;
nsIURL* baseURL = nsnull;
nsIURI* baseURL = nsnull;
GetAttribute(kNameSpaceID_None, kHrefAtom, href);
if (nsnull != mInner.mDocument) {
baseURL = mInner.mDocument->GetDocumentURL();

View File

@ -24,7 +24,7 @@
#include "nsISupports.h"
class nsIDocument;
class nsIURL;
class nsIURI;
class nsIWebShell;
#define NS_IXMLCONTENT_SINK_IID \
@ -116,7 +116,7 @@ public:
extern nsresult NS_NewXMLContentSink(nsIXMLContentSink** aInstancePtrResult,
nsIDocument* aDoc,
nsIURL* aURL,
nsIURI* aURL,
nsIWebShell* aWebShell);
#endif // nsIXMLContentSink_h___

View File

@ -28,7 +28,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
@ -103,7 +103,7 @@ static void SetTextStringOnTextNode(const nsString& aTextString, nsIContent* aTe
nsresult
NS_NewXMLContentSink(nsIXMLContentSink** aResult,
nsIDocument* aDoc,
nsIURL* aURL,
nsIURI* aURL,
nsIWebShell* aWebShell)
{
NS_PRECONDITION(nsnull != aResult, "null ptr");
@ -184,7 +184,7 @@ nsXMLContentSink::~nsXMLContentSink()
nsresult
nsXMLContentSink::Init(nsIDocument* aDoc,
nsIURL* aURL,
nsIURI* aURL,
nsIWebShell* aContainer)
{
NS_PRECONDITION(nsnull != aDoc, "null ptr");
@ -998,11 +998,11 @@ GetQuotedAttributeValue(nsString& aSource,
#ifdef XSL
nsresult
nsXMLContentSink::CreateStyleSheetURL(nsIURL** aUrl,
nsXMLContentSink::CreateStyleSheetURL(nsIURI** aUrl,
const nsAutoString& aHref)
{
nsAutoString absURL;
nsIURL* docURL = mDocument->GetDocumentURL();
nsIURI* docURL = mDocument->GetDocumentURL();
nsIURLGroup* urlGroup;
nsresult result = NS_OK;
@ -1034,7 +1034,7 @@ nsXMLContentSink::CreateStyleSheetURL(nsIURL** aUrl,
result = service->NewURI(absUrlStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)aUrl);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)aUrl);
NS_RELEASE(uri);
#endif // NECKO
}
@ -1046,7 +1046,7 @@ nsXMLContentSink::CreateStyleSheetURL(nsIURL** aUrl,
// Create an XML parser and an XSL content sink and start parsing
// the XSL stylesheet located at the given URL.
nsresult
nsXMLContentSink::LoadXSLStyleSheet(const nsIURL* aUrl)
nsXMLContentSink::LoadXSLStyleSheet(const nsIURI* aUrl)
{
nsresult rv = NS_OK;
@ -1141,7 +1141,7 @@ nsXMLContentSink::ProcessStyleLink(nsIContent* aElement,
SplitMimeType(aType, mimeType, params);
if ((0 == mimeType.Length()) || mimeType.EqualsIgnoreCase("text/css")) {
nsIURL* url = nsnull;
nsIURI* url = nsnull;
nsIURLGroup* urlGroup = nsnull;
mDocumentBaseURL->GetURLGroup(&urlGroup);
if (urlGroup) {
@ -1164,7 +1164,7 @@ nsXMLContentSink::ProcessStyleLink(nsIContent* aElement,
NS_RELEASE(baseUri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
if (NS_FAILED(result)) return result;
#endif // NECKO
@ -1264,7 +1264,7 @@ nsXMLContentSink::AddProcessingInstruction(const nsIParserNode& aNode)
NS_IMETHODIMP
nsXMLContentSink::AddProcessingInstruction(const nsIParserNode& aNode)
{
nsIURL* url = nsnull;
nsIURI* url = nsnull;
FlushText();
// XXX For now, we don't add the PI to the content model.
@ -1632,7 +1632,7 @@ nsXMLContentSink::EvaluateScript(nsString& aScript, PRUint32 aLineNo)
return rv;
}
nsIURL* docURL = mDocument->GetDocumentURL();
nsIURI* docURL = mDocument->GetDocumentURL();
const char* url;
if (docURL) {
(void)docURL->GetSpec(&url);
@ -1761,9 +1761,9 @@ nsXMLContentSink::ProcessStartSCRIPTTag(const nsIParserNode& aNode)
// If there is a SRC attribute...
if (src.Length() > 0) {
// Use the SRC attribute value to load the URL
nsIURL* url = nsnull;
nsIURI* url = nsnull;
nsAutoString absURL;
nsIURL* docURL = mDocument->GetDocumentURL();
nsIURI* docURL = mDocument->GetDocumentURL();
nsIURLGroup* urlGroup;
rv = docURL->GetURLGroup(&urlGroup);
@ -1784,7 +1784,7 @@ nsXMLContentSink::ProcessStartSCRIPTTag(const nsIParserNode& aNode)
rv = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(rv)) return rv;
rv = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
if (NS_FAILED(rv)) return rv;
#endif // NECKO

View File

@ -26,7 +26,7 @@
class nsIDocument;
class nsIScriptObjectOwner;
class nsIURL;
class nsIURI;
class nsIWebShell;
class nsIContent;
class nsVoidArray;
@ -57,7 +57,7 @@ public:
virtual ~nsXMLContentSink();
nsresult Init(nsIDocument* aDoc,
nsIURL* aURL,
nsIURI* aURL,
nsIWebShell* aContainer);
// nsISupports
@ -119,8 +119,8 @@ protected:
const nsString& aTitle, const nsString& aType,
const nsString& aMedia);
#else
nsresult CreateStyleSheetURL(nsIURL** aUrl, const nsAutoString& aHref);
nsresult LoadXSLStyleSheet(const nsIURL* aUrl);
nsresult CreateStyleSheetURL(nsIURI** aUrl, const nsAutoString& aHref);
nsresult LoadXSLStyleSheet(const nsIURI* aUrl);
#endif
nsresult AddText(const nsString& aString);
@ -128,8 +128,8 @@ protected:
nsresult CreateSourceText(const nsParserError* aError, nsString& aSourceString);
nsIDocument* mDocument;
nsIURL* mDocumentURL;
nsIURL* mDocumentBaseURL; // can be set via HTTP headers
nsIURI* mDocumentURL;
nsIURI* mDocumentBaseURL; // can be set via HTTP headers
nsIWebShell* mWebShell;
nsIParser* mParser;

View File

@ -142,7 +142,7 @@ nsrefcnt nsXMLDocument::Release()
}
nsresult
nsXMLDocument::Reset(nsIURL* aURL)
nsXMLDocument::Reset(nsIURI* aURL)
{
nsresult result = nsDocument::Reset(aURL);
if (NS_FAILED(result)) {
@ -180,7 +180,7 @@ nsXMLDocument::GetContentType(nsString& aContentType) const
}
NS_IMETHODIMP
nsXMLDocument::StartDocumentLoad(nsIURL *aUrl,
nsXMLDocument::StartDocumentLoad(nsIURI *aUrl,
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener,
const char* aCommand)

View File

@ -44,7 +44,7 @@ public:
NS_IMETHOD GetContentType(nsString& aContentType) const;
NS_IMETHOD StartDocumentLoad(nsIURL *aUrl,
NS_IMETHOD StartDocumentLoad(nsIURI *aUrl,
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener,
const char* aCommand);
@ -73,7 +73,7 @@ public:
protected:
virtual void InternalAddStyleSheet(nsIStyleSheet* aSheet); // subclass hook for sheet ordering
virtual void InternalInsertStyleSheetAt(nsIStyleSheet* aSheet, PRInt32 aIndex);
virtual nsresult Reset(nsIURL* aUrl);
virtual nsresult Reset(nsIURI* aUrl);
// For HTML elements in our content model
nsIHTMLStyleSheet* mAttrStyleSheet;

View File

@ -25,7 +25,7 @@ static NS_DEFINE_IID(kIXMLContentSinkIID, NS_IXMLCONTENT_SINK_IID);
nsresult
NS_NewXSLContentSink(nsIXMLContentSink** aResult,
nsIDocument* aDoc,
nsIURL* aURL,
nsIURI* aURL,
nsIWebShell* aWebShell)
{
NS_PRECONDITION(nsnull != aResult, "null ptr");
@ -58,7 +58,7 @@ nsXSLContentSink::~nsXSLContentSink()
/*
nsresult
nsXSLContentSink::Init(nsIDocument* aDoc,
nsIURL* aURL,
nsIURI* aURL,
nsIWebShell* aContainer)
{
// We'll use nsXMLContentSink::Init() for now...

View File

@ -572,7 +572,7 @@ nsresult nsXULAttributes::UpdateClassList(const nsString& aValue)
return NS_OK;
}
nsresult nsXULAttributes::UpdateStyleRule(nsIURL* aDocURL, const nsString& aValue)
nsresult nsXULAttributes::UpdateStyleRule(nsIURI* aDocURL, const nsString& aValue)
{
if (aValue == "")
{

View File

@ -35,7 +35,7 @@
#include "nsIAtom.h"
#include "nsVoidArray.h"
class nsIURL;
class nsIURI;
struct nsClassList {
nsClassList(nsIAtom* aAtom)
@ -152,7 +152,7 @@ public:
nsresult HasClass(nsIAtom* aClass) const;
nsresult UpdateClassList(const nsString& aValue);
nsresult UpdateStyleRule(nsIURL* aDocURL, const nsString& aValue);
nsresult UpdateStyleRule(nsIURI* aDocURL, const nsString& aValue);
nsresult GetInlineStyleRule(nsIStyleRule*& aRule);
private:

View File

@ -1810,7 +1810,7 @@ RDFElementImpl::SetAttribute(PRInt32 aNameSpaceID,
// know about the StyleRule change.
if (mDocument && (aNameSpaceID == kNameSpaceID_None) && aName == kStyleAtom) {
nsIURL* docURL = nsnull;
nsIURI* docURL = nsnull;
if (nsnull != mDocument) {
mDocument->GetBaseURL(docURL);
}
@ -2091,7 +2091,7 @@ RDFElementImpl::UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNot
if (mDocument && (aNameSpaceID == kNameSpaceID_None) && aName == kStyleAtom) {
nsIURL* docURL = nsnull;
nsIURI* docURL = nsnull;
if (nsnull != mDocument) {
mDocument->GetBaseURL(docURL);
}
@ -2521,7 +2521,7 @@ RDFElementImpl::GetRefResource(nsIRDFResource** aResource)
nsresult rv;
// ...now resolve it to an absolute URI.
nsCOMPtr<nsIURL> base = dont_AddRef(mDocument->GetDocumentURL());
nsCOMPtr<nsIURI> base = dont_AddRef(mDocument->GetDocumentURL());
nsAutoString uri(attr->mValue);
rv = rdf_MakeAbsoluteURI(base, uri);

View File

@ -85,7 +85,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsIURLGroup.h"
@ -420,7 +420,7 @@ public:
NS_IMETHOD GetContentType(nsString& aContentType) const;
NS_IMETHOD StartDocumentLoad(nsIURL *aUrl,
NS_IMETHOD StartDocumentLoad(nsIURI *aUrl,
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener,
const char* aCommand);
@ -431,11 +431,11 @@ public:
virtual const nsString* GetDocumentTitle() const;
virtual nsIURL* GetDocumentURL() const;
virtual nsIURI* GetDocumentURL() const;
virtual nsIURLGroup* GetDocumentURLGroup() const;
NS_IMETHOD GetBaseURL(nsIURL*& aURL) const;
NS_IMETHOD GetBaseURL(nsIURI*& aURL) const;
NS_IMETHOD GetDocumentCharacterSet(nsString& oCharSetID);
@ -711,16 +711,16 @@ public:
nsresult
ParseTagString(const nsString& aTagName, nsIAtom*& aName, PRInt32& aNameSpaceID);
NS_IMETHOD PrepareStyleSheets(nsIURL* anURL);
NS_IMETHOD PrepareStyleSheets(nsIURI* anURL);
void SetDocumentURLAndGroup(nsIURL* anURL);
void SetDocumentURLAndGroup(nsIURI* anURL);
void SetIsPopup(PRBool isPopup) { mIsPopup = isPopup; };
protected:
nsresult PrepareToLoad( nsCOMPtr<nsIParser>* created_parser,
nsIContentViewerContainer* aContainer,
const char* aCommand,
nsIURL* aOptionalURL = 0 );
nsIURI* aOptionalURL = 0 );
protected:
// pseudo constants
@ -739,7 +739,7 @@ protected:
const nsIContent* aTest2) const;
nsresult
LoadCSSStyleSheet(nsIURL* url);
LoadCSSStyleSheet(nsIURI* url);
nsresult
AddNamedDataSource(const char* uri);
@ -753,7 +753,7 @@ protected:
nsCOMPtr<nsIArena> mArena;
nsVoidArray mObservers;
nsAutoString mDocumentTitle;
nsCOMPtr<nsIURL> mDocumentURL; // [OWNER] ??? compare with loader
nsCOMPtr<nsIURI> mDocumentURL; // [OWNER] ??? compare with loader
nsCOMPtr<nsIURLGroup> mDocumentURLGroup; // [OWNER] leads to loader
nsCOMPtr<nsIContent> mRootContent; // [OWNER]
nsIDocument* mParentDocument; // [WEAK]
@ -1031,7 +1031,7 @@ XULDocumentImpl::GetContentType(nsString& aContentType) const
static
nsresult
generate_RDF_seed( nsString* result, nsIURL* aOptionalURL )
generate_RDF_seed( nsString* result, nsIURI* aOptionalURL )
{
nsresult status = NS_OK;
@ -1056,9 +1056,9 @@ nsresult
XULDocumentImpl::PrepareToLoad( nsCOMPtr<nsIParser>* created_parser,
nsIContentViewerContainer* aContainer,
const char* aCommand,
nsIURL* aOptionalURL )
nsIURI* aOptionalURL )
{
nsCOMPtr<nsIURL> syntheticURL;
nsCOMPtr<nsIURI> syntheticURL;
if ( aOptionalURL )
syntheticURL = dont_QueryInterface(aOptionalURL);
else
@ -1077,7 +1077,7 @@ XULDocumentImpl::PrepareToLoad( nsCOMPtr<nsIParser>* created_parser,
rv = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(rv)) return rv;
rv = uri->QueryInterface(nsIURL::GetIID(), (void**)&syntheticURL);
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&syntheticURL);
NS_RELEASE(uri);
if (NS_FAILED(rv)) return rv;
#endif // NECKO
@ -1247,7 +1247,7 @@ XULDocumentImpl::PrepareToLoad( nsCOMPtr<nsIParser>* created_parser,
}
NS_IMETHODIMP
XULDocumentImpl::PrepareStyleSheets(nsIURL* anURL)
XULDocumentImpl::PrepareStyleSheets(nsIURI* anURL)
{
nsresult rv;
@ -1300,14 +1300,14 @@ XULDocumentImpl::PrepareStyleSheets(nsIURL* anURL)
}
void
XULDocumentImpl::SetDocumentURLAndGroup(nsIURL* anURL)
XULDocumentImpl::SetDocumentURLAndGroup(nsIURI* anURL)
{
mDocumentURL = dont_QueryInterface(anURL);
anURL->GetURLGroup(getter_AddRefs(mDocumentURLGroup));
}
NS_IMETHODIMP
XULDocumentImpl::StartDocumentLoad(nsIURL *aURL,
XULDocumentImpl::StartDocumentLoad(nsIURI *aURL,
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener,
const char* aCommand)
@ -1358,10 +1358,10 @@ XULDocumentImpl::GetDocumentTitle() const
return &mDocumentTitle;
}
nsIURL*
nsIURI*
XULDocumentImpl::GetDocumentURL() const
{
nsIURL* result = mDocumentURL;
nsIURI* result = mDocumentURL;
NS_IF_ADDREF(result);
return result;
}
@ -1375,7 +1375,7 @@ XULDocumentImpl::GetDocumentURLGroup() const
}
NS_IMETHODIMP
XULDocumentImpl::GetBaseURL(nsIURL*& aURL) const
XULDocumentImpl::GetBaseURL(nsIURI*& aURL) const
{
aURL = mDocumentURL;
NS_IF_ADDREF(aURL);
@ -3788,7 +3788,7 @@ XULDocumentImpl::FindContent(const nsIContent* aStartNode,
nsresult
XULDocumentImpl::LoadCSSStyleSheet(nsIURL* url)
XULDocumentImpl::LoadCSSStyleSheet(nsIURI* url)
{
nsresult rv;
nsIInputStream* iin;

View File

@ -67,7 +67,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#endif // NECKO
//XXX for nsIPostData; this is wrong; we shouldn't see the nsIDocument type
@ -280,40 +280,40 @@ public:
// nsIDocumentLoaderObserver
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
PRInt32 aStatus,
nsIDocumentLoaderObserver * );
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, const char* aContentType,
nsIURI* aURL, const char* aContentType,
nsIContentViewer* aViewer);
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRUint32 aProgress,
nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax);
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, nsString& aMsg);
nsIURI* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRInt32 aStatus);
nsIURI* aURL, PRInt32 aStatus);
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
const char *aContentType,
const char *aCommand );
// NS_IMETHOD OnConnectionsComplete();
// nsIRefreshURL interface methods...
NS_IMETHOD RefreshURL(nsIURL* aURL, PRInt32 millis, PRBool repeat);
NS_IMETHOD RefreshURL(nsIURI* aURL, PRInt32 millis, PRBool repeat);
NS_IMETHOD RefreshURL(const char* aURL, PRInt32 millis, PRBool repeat);
NS_IMETHOD CancelRefreshURLTimers(void);
#if 0
// nsIStreamObserver
NS_IMETHOD OnStartBinding(nsIURL* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURL* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURL* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopBinding(nsIURL* aURL, nsresult aStatus, const PRUnichar* aMsg);
NS_IMETHOD OnStartBinding(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg);
#endif /* 0 */
@ -381,7 +381,7 @@ public:
protected:
void InitFrameData(PRBool aCompleteInitScrolling);
nsresult CheckForTrailingSlash(nsIURL* aURL);
nsresult CheckForTrailingSlash(nsIURI* aURL);
nsIEventQueue* mThreadEventQueue;
nsIScriptGlobalObject *mScriptGlobal;
@ -840,7 +840,7 @@ nsWebShell::GetContentViewer(nsIContentViewer** aResult)
NS_IMETHODIMP
nsWebShell::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
const char *aContentType,
const char *aCommand ) {
// If we have a doc loader observer, let it respond to this.
@ -1664,10 +1664,10 @@ nsWebShell::DoLoadURL(const nsString& aUrlSpec,
docViewer->GetDocument(*getter_AddRefs(doc));
// Get the URL for the document
nsCOMPtr<nsIURL> docURL = nsDontAddRef<nsIURL>(doc->GetDocumentURL());
nsCOMPtr<nsIURI> docURL = nsDontAddRef<nsIURI>(doc->GetDocumentURL());
// See if they're the same
nsCOMPtr<nsIURL> url;
nsCOMPtr<nsIURI> url;
#ifndef NECKO
NS_NewURL(getter_AddRefs(url), aUrlSpec);
#else
@ -1680,7 +1680,7 @@ nsWebShell::DoLoadURL(const nsString& aUrlSpec,
rv = service->NewURI(uriSpec, nsnull, &uri);
if (NS_FAILED(rv)) return rv;
rv = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
if (NS_FAILED(rv)) return rv;
#endif // NECKO
@ -2558,7 +2558,7 @@ nsWebShell::ReleaseScriptContext(nsIScriptContext *aContext)
NS_IMETHODIMP
nsWebShell::OnStartDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
const char* aCommand)
{
#if DEBUG_nisheeth
@ -2604,7 +2604,7 @@ nsWebShell::OnStartDocumentLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
PRInt32 aStatus,
nsIDocumentLoaderObserver * aWebShell)
{
@ -2687,7 +2687,7 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
nsWebShell::OnStartURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
const char* aContentType,
nsIContentViewer* aViewer)
{
@ -2716,7 +2716,7 @@ nsWebShell::OnStartURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
PRUint32 aProgress,
PRUint32 aProgressMax)
{
@ -2733,7 +2733,7 @@ nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
nsString& aMsg)
{
/*
@ -2749,7 +2749,7 @@ nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
nsWebShell::OnEndURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
PRInt32 aStatus)
{
#if 0
@ -2817,7 +2817,7 @@ void refreshData::Notify(nsITimer *aTimer)
NS_IMETHODIMP
nsWebShell::RefreshURL(nsIURL* aURL, PRInt32 millis, PRBool repeat)
nsWebShell::RefreshURL(nsIURI* aURL, PRInt32 millis, PRBool repeat)
{
nsresult rv = NS_OK;
@ -2918,7 +2918,7 @@ nsWebShell::CancelRefreshURLTimers(void)
* 2) The load of aURL is in progress and this function is being called
* from one of the functions in nsIStreamListener implemented by nsWebShell.
*/
nsresult nsWebShell::CheckForTrailingSlash(nsIURL* aURL)
nsresult nsWebShell::CheckForTrailingSlash(nsIURI* aURL)
{
#if OLD_HISTORY
@ -2965,7 +2965,7 @@ nsresult nsWebShell::CheckForTrailingSlash(nsIURL* aURL)
#if 0
NS_IMETHODIMP
nsWebShell::OnStartBinding(nsIURL* aURL, const char *aContentType)
nsWebShell::OnStartBinding(nsIURI* aURL, const char *aContentType)
{
nsresult rv = NS_OK;
@ -2977,7 +2977,7 @@ nsWebShell::OnStartBinding(nsIURL* aURL, const char *aContentType)
NS_IMETHODIMP
nsWebShell::OnProgress(nsIURL* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
nsWebShell::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
{
nsresult rv = NS_OK;
@ -2999,7 +2999,7 @@ nsWebShell::OnProgress(nsIURL* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
NS_IMETHODIMP
nsWebShell::OnStatus(nsIURL* aURL, const PRUnichar* aMsg)
nsWebShell::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
{
nsresult rv = NS_OK;
@ -3021,7 +3021,7 @@ nsWebShell::OnStatus(nsIURL* aURL, const PRUnichar* aMsg)
NS_IMETHODIMP
nsWebShell::OnStopBinding(nsIURL* aURL, nsresult aStatus, const PRUnichar* aMsg)
nsWebShell::OnStopBinding(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
{
nsresult rv = NS_OK;

View File

@ -53,7 +53,9 @@
#include "nsIPref.h"
#include "nsCRT.h"
#include "nsRect.h"
#ifndef NECKO
#include "nsINetSupport.h"
#endif
#include "nsIContentViewer.h"
#include "nsScreen.h"
#include "nsHistory.h"
@ -62,7 +64,7 @@
#include "nsINetService.h"
#else
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
@ -98,8 +100,8 @@ static NS_DEFINE_IID(kIDOMEventTargetIID, NS_IDOMEVENTTARGET_IID);
static NS_DEFINE_IID(kIBrowserWindowIID, NS_IBROWSER_WINDOW_IID);
static NS_DEFINE_IID(kIScriptContextOwnerIID, NS_ISCRIPTCONTEXTOWNER_IID);
static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID);
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
#ifndef NECKO
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID);
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
#endif // NECKO
@ -998,11 +1000,15 @@ GlobalWindowImpl::Alert(JSContext *cx, jsval *argv, PRUint32 argc)
nsIWebShellContainer *rootContainer;
ret = rootWebShell->GetContainer(rootContainer);
if (nsnull != rootContainer) {
#ifdef NECKO
NS_ASSERTION(0, "fix me");
#else
nsINetSupport *support;
if (NS_OK == (ret = rootContainer->QueryInterface(kINetSupportIID, (void**)&support))) {
support->Alert(str);
NS_RELEASE(support);
}
#endif
NS_RELEASE(rootContainer);
}
NS_RELEASE(rootWebShell);
@ -1032,11 +1038,15 @@ GlobalWindowImpl::Confirm(JSContext *cx, jsval *argv, PRUint32 argc, PRBool* aRe
nsIWebShellContainer *rootContainer;
ret = rootWebShell->GetContainer(rootContainer);
if (nsnull != rootContainer) {
#ifdef NECKO
NS_ASSERTION(0, "fix me");
#else
nsINetSupport *support;
if (NS_OK == (ret = rootContainer->QueryInterface(kINetSupportIID, (void**)&support))) {
*aReturn = support->Confirm(str);
NS_RELEASE(support);
}
#endif
NS_RELEASE(rootContainer);
}
NS_RELEASE(rootWebShell);
@ -1070,6 +1080,9 @@ GlobalWindowImpl::Prompt(JSContext *cx, jsval *argv, PRUint32 argc, nsString& aR
nsIWebShellContainer *rootContainer;
ret = rootWebShell->GetContainer(rootContainer);
if (nsnull != rootContainer) {
#ifdef NECKO
NS_ASSERTION(0, "fix me");
#else
nsINetSupport *support;
if (NS_OK == (ret = rootContainer->QueryInterface(kINetSupportIID, (void**)&support))) {
if (!support->Prompt(str, initial, aReturn)) {
@ -1080,6 +1093,7 @@ GlobalWindowImpl::Prompt(JSContext *cx, jsval *argv, PRUint32 argc, nsString& aR
}
NS_RELEASE(support);
}
#endif
NS_RELEASE(rootContainer);
}
NS_RELEASE(rootWebShell);
@ -1787,7 +1801,7 @@ GlobalWindowImpl::OpenInternal(JSContext *cx,
}
nsAutoString mURL, mEmpty;
nsIURL* mDocURL = 0;
nsIURI* mDocURL = 0;
nsIDocument* mDoc;
mURL.SetString(JS_GetStringChars(mJSStrURL));

View File

@ -314,7 +314,7 @@ protected:
nsIDOMPluginArray* mPlugins;
};
class nsIURL;
class nsIURI;
class LocationImpl : public nsIScriptObjectOwner, public nsIDOMLocation {
@ -351,7 +351,7 @@ public:
NS_IMETHOD ToString(nsString& aReturn);
protected:
nsresult SetURL(nsIURL* aURL);
nsresult SetURL(nsIURI* aURL);
nsIWebShell *mWebShell;
void *mScriptObject;

View File

@ -183,11 +183,7 @@ nsJSSecurityManager::GetSitePolicy(const char *org)
PRInt32
nsJSSecurityManager::CheckForPrivilege(JSContext *cx, char *prop_name, int priv_code)
{
int i;
char *markp;
char *tmp_prop_name;
char prop_val_buf[128];
int prop_val_len = sizeof(prop_val_buf);
JSBool priv = JS_TRUE;
if(prop_name == NULL) {

View File

@ -21,7 +21,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
@ -103,12 +103,19 @@ LocationImpl::SetWebShell(nsIWebShell *aWebShell)
}
nsresult
LocationImpl::SetURL(nsIURL* aURL)
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
return mWebShell->LoadURL(s.GetUnicode(), nsnull, PR_TRUE);
}
else {
@ -120,9 +127,8 @@ NS_IMETHODIMP
LocationImpl::GetHash(nsString& aHash)
{
nsAutoString href;
nsIURL *url;
nsIURI *url;
nsresult result = NS_OK;
const char *ref;
result = GetHref(href);
if (NS_OK == result) {
@ -137,15 +143,23 @@ LocationImpl::GetHash(nsString& aHash)
result = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK == result) {
#ifdef NECKO
char *ref;
#else
const char *ref;
#endif
result = url->GetRef(&ref);
if (result == NS_OK && (nsnull != ref) && ('\0' != *ref)) {
aHash.SetString("#");
aHash.Append(ref);
#ifdef NECKO
nsCRT::free(ref);
#endif
}
else {
aHash.SetLength(0);
@ -161,7 +175,7 @@ NS_IMETHODIMP
LocationImpl::SetHash(const nsString& aHash)
{
nsAutoString href;
nsIURL *url;
nsIURI *url;
nsresult result = NS_OK;
result = GetHref(href);
@ -177,7 +191,7 @@ LocationImpl::SetHash(const nsString& aHash)
result = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK == result) {
@ -196,7 +210,7 @@ NS_IMETHODIMP
LocationImpl::GetHost(nsString& aHost)
{
nsAutoString href;
nsIURL *url;
nsIURI *url;
nsresult result = NS_OK;
result = GetHref(href);
@ -212,16 +226,28 @@ LocationImpl::GetHost(nsString& aHost)
result = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#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);
#endif
#ifdef NECKO
PRInt32 port;
(void)url->GetPort(&port);
#else
PRUint32 port;
(void)url->GetHostPort(&port);
#endif
if (-1 != port) {
aHost.Append(":");
aHost.Append(port, 10);
@ -238,7 +264,7 @@ NS_IMETHODIMP
LocationImpl::SetHost(const nsString& aHost)
{
nsAutoString href;
nsIURL *url;
nsIURI *url;
nsresult result = NS_OK;
result = GetHref(href);
@ -254,7 +280,7 @@ LocationImpl::SetHost(const nsString& aHost)
result = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK == result) {
@ -273,7 +299,7 @@ NS_IMETHODIMP
LocationImpl::GetHostname(nsString& aHostname)
{
nsAutoString href;
nsIURL *url;
nsIURI *url;
nsresult result = NS_OK;
result = GetHref(href);
@ -289,14 +315,22 @@ LocationImpl::GetHostname(nsString& aHostname)
result = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK == result) {
#ifdef NECKO
char* host;
#else
const char* host;
#endif
result = url->GetHost(&host);
if (result == NS_OK)
if (result == NS_OK) {
aHostname.SetString(host);
#ifdef NECKO
nsCRT::free(host);
#endif
}
NS_IF_RELEASE(url);
}
}
@ -308,7 +342,7 @@ NS_IMETHODIMP
LocationImpl::SetHostname(const nsString& aHostname)
{
nsAutoString href;
nsIURL *url;
nsIURI *url;
nsresult result = NS_OK;
result = GetHref(href);
@ -324,7 +358,7 @@ LocationImpl::SetHostname(const nsString& aHostname)
result = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK == result) {
@ -359,7 +393,7 @@ NS_IMETHODIMP
LocationImpl::SetHref(const nsString& aHref)
{
nsAutoString oldHref, newHref;
nsIURL *oldUrl, *newUrl;
nsIURI *oldUrl, *newUrl;
nsresult result = NS_OK;
result = GetHref(oldHref);
@ -375,7 +409,7 @@ LocationImpl::SetHref(const nsString& aHref)
result = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&oldUrl);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&oldUrl);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK == result) {
@ -393,14 +427,23 @@ LocationImpl::SetHref(const nsString& aHref)
result = service->NewURI(uriStr, baseUri, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&newUrl);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&newUrl);
NS_RELEASE(baseUri);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK == result) {
#ifdef NECKO
char* spec;
#else
const char* spec;
#endif
result = newUrl->GetSpec(&spec);
newHref.SetString(spec);
if (NS_SUCCEEDED(result)) {
newHref.SetString(spec);
#ifdef NECKO
nsCRT::free(spec);
#endif
}
NS_RELEASE(newUrl);
}
NS_RELEASE(oldUrl);
@ -418,7 +461,7 @@ NS_IMETHODIMP
LocationImpl::GetPathname(nsString& aPathname)
{
nsAutoString href;
nsIURL *url;
nsIURI *url;
nsresult result = NS_OK;
result = GetHref(href);
@ -434,14 +477,23 @@ LocationImpl::GetPathname(nsString& aPathname)
result = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK == result) {
#ifdef NECKO
char* file;
result = url->GetPath(&file);
#else
const char* file;
result = url->GetFile(&file);
if (result == NS_OK)
#endif
if (result == NS_OK) {
aPathname.SetString(file);
#ifdef NECKO
nsCRT::free(file);
#endif
}
NS_IF_RELEASE(url);
}
}
@ -453,7 +505,7 @@ NS_IMETHODIMP
LocationImpl::SetPathname(const nsString& aPathname)
{
nsAutoString href;
nsIURL *url;
nsIURI *url;
nsresult result = NS_OK;
result = GetHref(href);
@ -469,12 +521,16 @@ LocationImpl::SetPathname(const nsString& aPathname)
result = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK == result) {
char *buf = aPathname.ToNewCString();
#ifdef NECKO
url->SetPath(buf);
#else
url->SetFile(buf);
#endif
SetURL(url);
delete[] buf;
NS_IF_RELEASE(url);
@ -488,7 +544,7 @@ NS_IMETHODIMP
LocationImpl::GetPort(nsString& aPort)
{
nsAutoString href;
nsIURL *url;
nsIURI *url;
nsresult result = NS_OK;
result = GetHref(href);
@ -504,13 +560,18 @@ LocationImpl::GetPort(nsString& aPort)
result = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#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);
}
@ -525,7 +586,7 @@ NS_IMETHODIMP
LocationImpl::SetPort(const nsString& aPort)
{
nsAutoString href;
nsIURL *url;
nsIURI *url;
nsresult result = NS_OK;
result = GetHref(href);
@ -541,7 +602,7 @@ LocationImpl::SetPort(const nsString& aPort)
result = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK == result) {
@ -556,7 +617,11 @@ LocationImpl::SetPort(const nsString& aPort)
port = atol(buf);
}
}
#ifdef NECKO
url->SetPort(port);
#else
url->SetHostPort(port);
#endif
SetURL(url);
delete[] buf;
NS_IF_RELEASE(url);
@ -570,7 +635,7 @@ NS_IMETHODIMP
LocationImpl::GetProtocol(nsString& aProtocol)
{
nsAutoString href;
nsIURL *url;
nsIURI *url;
nsresult result = NS_OK;
result = GetHref(href);
@ -586,15 +651,23 @@ LocationImpl::GetProtocol(nsString& aProtocol)
result = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#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_IF_RELEASE(url);
}
@ -607,7 +680,7 @@ NS_IMETHODIMP
LocationImpl::SetProtocol(const nsString& aProtocol)
{
nsAutoString href;
nsIURL *url;
nsIURI *url;
nsresult result = NS_OK;
result = GetHref(href);
@ -623,12 +696,16 @@ LocationImpl::SetProtocol(const nsString& aProtocol)
result = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK == result) {
char *buf = aProtocol.ToNewCString();
#ifdef NECKO
url->SetScheme(buf);
#else
url->SetProtocol(buf);
#endif
SetURL(url);
delete[] buf;
NS_IF_RELEASE(url);
@ -642,7 +719,7 @@ NS_IMETHODIMP
LocationImpl::GetSearch(nsString& aSearch)
{
nsAutoString href;
nsIURL *url;
nsIURI *url;
nsresult result = NS_OK;
result = GetHref(href);
@ -658,15 +735,23 @@ LocationImpl::GetSearch(nsString& aSearch)
result = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK == result) {
#ifdef NECKO
char *search;
result = url->GetQuery(&search);
#else
const char *search;
result = url->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);
@ -682,7 +767,7 @@ NS_IMETHODIMP
LocationImpl::SetSearch(const nsString& aSearch)
{
nsAutoString href;
nsIURL *url;
nsIURI *url;
nsresult result = NS_OK;
result = GetHref(href);
@ -698,12 +783,16 @@ LocationImpl::SetSearch(const nsString& aSearch)
result = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(result)) return result;
result = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
result = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK == result) {
char *buf = aSearch.ToNewCString();
#ifdef NECKO
url->SetQuery(buf);
#else
url->SetSearch(buf);
#endif
SetURL(url);
delete[] buf;
NS_IF_RELEASE(url);
@ -719,7 +808,11 @@ LocationImpl::Reload(JSContext *cx, jsval *argv, PRUint32 argc)
nsresult result = NS_OK;
if (nsnull != mWebShell) {
#ifdef NECKO
result = mWebShell->Reload(PR_FALSE, PR_FALSE);
#else
result = mWebShell->Reload(nsURLReload);
#endif
}
return result;

View File

@ -36,7 +36,7 @@ MimeTypeArrayImpl::MimeTypeArrayImpl(nsIDOMNavigator* navigator)
MimeTypeArrayImpl::~MimeTypeArrayImpl()
{
if (mMimeTypeArray != nsnull) {
for (int i = 0; i < mMimeTypeCount; i++) {
for (PRUint32 i = 0; i < mMimeTypeCount; i++) {
NS_IF_RELEASE(mMimeTypeArray[i]);
}
delete[] mMimeTypeArray;

View File

@ -46,7 +46,7 @@ PluginArrayImpl::~PluginArrayImpl()
nsServiceManager::ReleaseService(kPluginManagerCID, mPluginHost);
if (mPluginArray != nsnull) {
for (int i = 0; i < mPluginCount; i++) {
for (PRUint32 i = 0; i < mPluginCount; i++) {
NS_IF_RELEASE(mPluginArray[i]);
}
delete[] mPluginArray;
@ -135,7 +135,7 @@ NS_IMETHODIMP PluginArrayImpl::NamedItem(const nsString& aName, nsIDOMPlugin** a
*aReturn = nsnull;
for (int i = 0; i < mPluginCount; i++) {
for (PRUint32 i = 0; i < mPluginCount; i++) {
nsString pluginName;
nsIDOMPlugin* plugin = mPluginArray[i];
if (plugin->GetName(pluginName) == NS_OK) {
@ -164,7 +164,7 @@ nsresult PluginArrayImpl::GetPlugins()
rv = mPluginHost->GetPlugins(mPluginCount, mPluginArray);
if (rv == NS_OK) {
// need to wrap each of these with a PluginElementImpl, which is scriptable.
for (int i = 0; i < mPluginCount; i++) {
for (PRUint32 i = 0; i < mPluginCount; i++) {
nsIDOMPlugin* wrapper = new PluginElementImpl(mPluginArray[i]);
NS_IF_ADDREF(wrapper);
mPluginArray[i] = wrapper;
@ -193,7 +193,7 @@ PluginElementImpl::~PluginElementImpl()
NS_IF_RELEASE(mPlugin);
if (mMimeTypeArray != nsnull) {
for (int i = 0; i < mMimeTypeCount; i++)
for (PRUint32 i = 0; i < mMimeTypeCount; i++)
NS_IF_RELEASE(mMimeTypeArray[i]);
delete[] mMimeTypeArray;
}
@ -290,7 +290,7 @@ NS_IMETHODIMP PluginElementImpl::NamedItem(const nsString& aName, nsIDOMMimeType
if (rv != NS_OK)
return rv;
}
for (int i = 0; i < mMimeTypeCount; i++) {
for (PRUint32 i = 0; i < mMimeTypeCount; i++) {
nsString type;
nsIDOMMimeType* mimeType = mMimeTypeArray[i];
if (mimeType->GetType(type) == NS_OK) {
@ -311,7 +311,7 @@ nsresult PluginElementImpl::GetMimeTypes()
mMimeTypeArray = new nsIDOMMimeType*[mMimeTypeCount];
if (mMimeTypeArray == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
for (int i = 0; i < mMimeTypeCount; i++) {
for (PRUint32 i = 0; i < mMimeTypeCount; i++) {
nsIDOMMimeType* mimeType = nsnull;
rv = mPlugin->Item(i, &mimeType);
if (rv != NS_OK)

View File

@ -38,6 +38,8 @@
#include "nsIScriptContext.h"
#include "nsString.h"
#ifndef NECKO // out for now, until we can revive the javascript: protocol
#define MK_OUT_OF_MEMORY -207
#define MK_MALFORMED_URL_ERROR -209
@ -135,12 +137,12 @@ evaluate_script(URL_Struct* urls, const char *what, JSConData *con_data)
if (supports &&
(NS_OK == supports->QueryInterface(kIConnectionInfoIID, (void**)&con_info))) {
nsIURL *url;
nsIURI *url;
nsISupports *viewer = nsnull;
nsIScriptContextOwner *context_owner;
// Get the container (which hopefully supports nsIScriptContextOwner)
// from the nsIURL...
// from the nsIURI...
con_info->GetURL(&url);
NS_RELEASE(con_info);
@ -426,9 +428,14 @@ net_CleanupMocha(void)
return;
}
#endif // !NECKO
PR_IMPLEMENT(void)
NET_InitJavaScriptProtocol(void)
{
#ifdef NECKO
NS_WARNING(0, "Brendan said he would implement the javascript: protocol.");
#else
static NET_ProtoImpl mocha_proto_impl;
mocha_proto_impl.init = net_MochaLoad;
@ -437,4 +444,5 @@ NET_InitJavaScriptProtocol(void)
mocha_proto_impl.cleanup = net_CleanupMocha;
NET_RegisterProtocolImplementation(&mocha_proto_impl, MOCHA_TYPE_URL);
#endif
}

View File

@ -54,7 +54,7 @@
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
@ -544,7 +544,7 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell)
if (NS_SUCCEEDED(result) && service)
{
nsCOMPtr<nsIURL> url;
nsCOMPtr<nsIURI> url;
#ifndef NECKO
result = NS_NewURL(getter_AddRefs(url), nsString(EDITOR_BUNDLE_URL));
#else

View File

@ -754,7 +754,7 @@ nsEditorShell::CreateWindowWithURL(const char* urlStr)
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsIURL> url = nsnull;
nsCOMPtr<nsIURI> url = nsnull;
nsCOMPtr<nsIWebShellWindow> newWindow;
rv = NS_NewURL(getter_AddRefs(url), urlStr);
@ -848,7 +848,7 @@ static NS_DEFINE_IID(kCFileWidgetCID, NS_FILEWIDGET_CID);
getter_AddRefs(toolkitCore));
if (NS_SUCCEEDED(result) && toolkitCore)
{
// at some point we need to be passing nsFileSpecs around. When nsIUrl is fileSpec-
// at some point we need to be passing nsFileSpecs around. When nsIURI is fileSpec-
// savvy, we should use that.
result = toolkitCore->ShowWindowWithArgs("chrome://editor/content", nsnull, fileURLString/*fileURL.GetAsString()*/);
}
@ -2301,13 +2301,13 @@ nsEditorShell::StopLogging()
// nsIDocumentLoaderObserver methods
NS_IMETHODIMP
nsEditorShell::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURL* aURL, const char* aCommand)
nsEditorShell::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand)
{
return NS_OK;
}
NS_IMETHODIMP
nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURL *aUrl, PRInt32 aStatus,
nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver)
{
return PrepareDocumentForEditing();
@ -2315,7 +2315,7 @@ nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURL *aUrl, PRInt3
NS_IMETHODIMP
nsEditorShell::OnStartURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, const char* aContentType,
nsIURI* aURL, const char* aContentType,
nsIContentViewer* aViewer)
{
@ -2324,7 +2324,7 @@ nsEditorShell::OnStartURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
nsEditorShell::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRUint32 aProgress,
nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax)
{
return NS_OK;
@ -2332,21 +2332,21 @@ nsEditorShell::OnProgressURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
nsEditorShell::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, nsString& aMsg)
nsIURI* aURL, nsString& aMsg)
{
return NS_OK;
}
NS_IMETHODIMP
nsEditorShell::OnEndURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRInt32 aStatus)
nsIURI* aURL, PRInt32 aStatus)
{
return NS_OK;
}
NS_IMETHODIMP
nsEditorShell::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURL *aURL,
nsIURI *aURL,
const char *aContentType,
const char *aCommand )
{

View File

@ -41,7 +41,7 @@ class nsIScriptContext;
class nsIDOMWindow;
class nsIDOMElement;
class nsIDOMNode;
class nsIURL;
class nsIURI;
class nsIWebShellWindow;
class nsIPresShell;
class nsIHTMLEditor;
@ -183,17 +183,17 @@ class nsEditorShell : public nsIEditorShell,
// nsIDocumentLoaderObserver
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURL* aURL, const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURL *aUrl, PRInt32 aStatus,
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, nsIURL* aURL, const char* aContentType,
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aContentType,
nsIContentViewer* aViewer);
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIURL* aURL, PRUint32 aProgress,
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax);
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIURL* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURL* aURL, PRInt32 aStatus);
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus);
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURL *aURL,
nsIURI *aURL,
const char *aContentType,
const char *aCommand );
protected:

View File

@ -754,7 +754,7 @@ nsEditorShell::CreateWindowWithURL(const char* urlStr)
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsIURL> url = nsnull;
nsCOMPtr<nsIURI> url = nsnull;
nsCOMPtr<nsIWebShellWindow> newWindow;
rv = NS_NewURL(getter_AddRefs(url), urlStr);
@ -848,7 +848,7 @@ static NS_DEFINE_IID(kCFileWidgetCID, NS_FILEWIDGET_CID);
getter_AddRefs(toolkitCore));
if (NS_SUCCEEDED(result) && toolkitCore)
{
// at some point we need to be passing nsFileSpecs around. When nsIUrl is fileSpec-
// at some point we need to be passing nsFileSpecs around. When nsIURI is fileSpec-
// savvy, we should use that.
result = toolkitCore->ShowWindowWithArgs("chrome://editor/content", nsnull, fileURLString/*fileURL.GetAsString()*/);
}
@ -2301,13 +2301,13 @@ nsEditorShell::StopLogging()
// nsIDocumentLoaderObserver methods
NS_IMETHODIMP
nsEditorShell::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURL* aURL, const char* aCommand)
nsEditorShell::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand)
{
return NS_OK;
}
NS_IMETHODIMP
nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURL *aUrl, PRInt32 aStatus,
nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver)
{
return PrepareDocumentForEditing();
@ -2315,7 +2315,7 @@ nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURL *aUrl, PRInt3
NS_IMETHODIMP
nsEditorShell::OnStartURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, const char* aContentType,
nsIURI* aURL, const char* aContentType,
nsIContentViewer* aViewer)
{
@ -2324,7 +2324,7 @@ nsEditorShell::OnStartURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
nsEditorShell::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRUint32 aProgress,
nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax)
{
return NS_OK;
@ -2332,21 +2332,21 @@ nsEditorShell::OnProgressURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
nsEditorShell::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, nsString& aMsg)
nsIURI* aURL, nsString& aMsg)
{
return NS_OK;
}
NS_IMETHODIMP
nsEditorShell::OnEndURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRInt32 aStatus)
nsIURI* aURL, PRInt32 aStatus)
{
return NS_OK;
}
NS_IMETHODIMP
nsEditorShell::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURL *aURL,
nsIURI *aURL,
const char *aContentType,
const char *aCommand )
{

View File

@ -41,7 +41,7 @@ class nsIScriptContext;
class nsIDOMWindow;
class nsIDOMElement;
class nsIDOMNode;
class nsIURL;
class nsIURI;
class nsIWebShellWindow;
class nsIPresShell;
class nsIHTMLEditor;
@ -183,17 +183,17 @@ class nsEditorShell : public nsIEditorShell,
// nsIDocumentLoaderObserver
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURL* aURL, const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURL *aUrl, PRInt32 aStatus,
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, nsIURL* aURL, const char* aContentType,
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aContentType,
nsIContentViewer* aViewer);
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIURL* aURL, PRUint32 aProgress,
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax);
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIURL* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURL* aURL, PRInt32 aStatus);
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus);
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURL *aURL,
nsIURI *aURL,
const char *aContentType,
const char *aCommand );
protected:

View File

@ -54,7 +54,7 @@
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
@ -544,7 +544,7 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell)
if (NS_SUCCEEDED(result) && service)
{
nsCOMPtr<nsIURL> url;
nsCOMPtr<nsIURI> url;
#ifndef NECKO
result = NS_NewURL(getter_AddRefs(url), nsString(EDITOR_BUNDLE_URL));
#else

View File

@ -168,7 +168,7 @@ XP_MakeHTMLDialog2(XPDialogInfo *dialogInfo) {
char* button = NULL;
nsAutoString * nsCookie = new nsAutoString("");
nsIURL* url;
nsIURI* url;
char* separator;
#ifndef NECKO

View File

@ -157,7 +157,7 @@ cookie_Localize(char* genericString) {
printf("cannot get net service\n");
return v.ToNewCString();
}
nsIURL *url = nsnull;
nsIURI *url = nsnull;
ret = pNetService->CreateURL(&url, nsString(TEST_URL), nsnull, nsnull,
nsnull);
if (NS_FAILED(ret)) {

View File

@ -20,7 +20,7 @@
#define nsICookieService_h__
#include "nsISupports.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsString.h"
// {AB397772-12D3-11d3-8AD1-00105A1B8860}

View File

@ -38,7 +38,7 @@ public:
NS_IMETHOD ProcessPICSLabel(char *label) = 0;
NS_IMETHOD GetWebShell(PRUint32 key, nsIWebShellServices*& aResult) = 0;
NS_IMETHOD SetNotified(nsIWebShellServices* aResult, nsIURL* aURL, PRBool notified) = 0;
NS_IMETHOD SetNotified(nsIWebShellServices* aResult, nsIURI* aURL, PRBool notified) = 0;
};
extern NS_EXPORT nsresult NS_NewPICS(nsIPICS** aPICS);

View File

@ -26,7 +26,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
@ -120,7 +120,7 @@ typedef struct {
} ClosureData;
typedef struct {
nsIURL* url;
nsIURI* url;
PRBool notified;
} PICS_URLData;
@ -140,31 +140,31 @@ public:
NS_IMETHOD GetWebShell(PRUint32 key, nsIWebShellServices*& aResult);
NS_IMETHOD SetNotified(nsIWebShellServices* aResult, nsIURL* aURL, PRBool notified);
NS_IMETHOD SetNotified(nsIWebShellServices* aResult, nsIURI* aURL, PRBool notified);
nsPICS();
virtual ~nsPICS(void);
// nsIDocumentLoaderObserver
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver);
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, const char* aContentType,
nsIURI* aURL, const char* aContentType,
nsIContentViewer* aViewer);
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRUint32 aProgress,
nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax);
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, nsString& aMsg);
nsIURI* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL, PRInt32 aStatus);
nsIURI* aURL, PRInt32 aStatus);
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
const char *aContentType,
const char *aCommand );
// NS_IMETHOD OnConnectionsComplete();
@ -237,7 +237,7 @@ private:
void CheckForGenericRatings(char *url_address, PICS_RatingsStruct **rs,
PICS_PassFailReturnVal *status);
nsresult GetRootURL(nsIURL* aURL);
nsresult GetRootURL(nsIURI* aURL);
};
@ -643,7 +643,7 @@ nsPICS::GetWebShell(PRUint32 key, nsIWebShellServices*& aResult)
}
NS_IMETHODIMP
nsPICS::SetNotified(nsIWebShellServices* ws, nsIURL* aURL, PRBool notified)
nsPICS::SetNotified(nsIWebShellServices* ws, nsIURI* aURL, PRBool notified)
{
nsVoidArray* currentURLList;
if(ws == nsnull)
@ -744,7 +744,7 @@ nsPICS::ParsePICSLabel(char * label)
NS_IMETHODIMP
nsPICS::OnStartDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
const char* aCommand)
{
nsresult rv = NS_ERROR_FAILURE;
@ -759,7 +759,7 @@ nsPICS::OnStartDocumentLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
nsPICS::OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver)
{
@ -788,7 +788,7 @@ nsPICS::OnEndDocumentLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
nsPICS::OnStartURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
const char* aContentType,
nsIContentViewer* aViewer)
{
@ -819,7 +819,7 @@ nsPICS::OnStartURLLoad(nsIDocumentLoader* loader,
if (nsnull != aURL) {
urlData = PR_NEWZAP(PICS_URLData);
urlData->url = (nsIURL*)PR_Malloc(sizeof(aURL));
urlData->url = (nsIURI*)PR_Malloc(sizeof(aURL));
urlData->url = aURL;
urlData->notified = PR_FALSE;
@ -857,7 +857,7 @@ nsPICS::OnStartURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
nsPICS::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
PRUint32 aProgress,
PRUint32 aProgressMax)
{
@ -868,7 +868,7 @@ nsPICS::OnProgressURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
nsPICS::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
nsString& aMsg)
{
if(!mPICSRatingsEnabled)
@ -878,7 +878,7 @@ nsPICS::OnStatusURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
PRInt32 aStatus)
{
nsIContentViewerContainer *cont;
@ -886,7 +886,7 @@ nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
const char* uProtocol;
const char* uHost;
const char* uFile;
nsIURL* rootURL;
nsIURI* rootURL;
nsIWebShellServices *ws;
nsVoidArray* currentURLList;
@ -965,7 +965,7 @@ nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
rv = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(rv)) return rv;
rv = uri->QueryInterface(nsIURL::GetIID(), (void**)&rootURL);
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&rootURL);
NS_RELEASE(uri);
if (NS_FAILED(rv)) return rv;
#endif // NECKO
@ -985,7 +985,7 @@ nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
nsPICS::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURL* aURL,
nsIURI* aURL,
const char *aContentType,
const char *aCommand ) {
// If we have a doc loader observer, let it respond to this.
@ -1434,15 +1434,15 @@ nsPICS::PreferenceChanged(const char* aPrefName)
//#define UA_CSS_URL "resource:/res/ua.css"
#define UA_CSS_URL "http://www.w3.org/"
nsresult
nsPICS::GetRootURL(nsIURL* aURL)
nsPICS::GetRootURL(nsIURI* aURL)
{
static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID);
static NS_DEFINE_IID(kCParserCID, NS_PARSER_IID);
nsresult rv;
nsIParser *mParser;
nsIContentSink* sink;
nsIStreamListener* lsnr = nsnull;
nsIContentSink* sink;
nsIStreamListener* lsnr = nsnull;
rv = nsComponentManager::CreateInstance(kCParserCID,
@ -1455,11 +1455,18 @@ nsPICS::GetRootURL(nsIURL* aURL)
NS_NewHTMLNullSink(&sink);
if (sink) {
mParser->SetContentSink(sink);
mParser->SetContentSink(sink);
if (NS_FAILED(rv = mParser->QueryInterface(kIStreamListenerIID, (void**) &lsnr)))
return rv;
mParser->Parse(aURL);
return rv;
mParser->Parse(aURL);
#ifdef NECKO
NS_WITH_SERVICE(nsIIOService, serv, kIOServiceCID, &rv);
if (NS_SUCCEEDED(rv)) {
rv = serv->NewChannelFromURI("load", aURL, getter);
}
#else
rv = NS_OpenURL(aURL, lsnr);
#endif
}
NS_RELEASE(sink);
}

View File

@ -25,7 +25,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
@ -150,7 +150,7 @@ NS_IMETHODIMP nsPICSElementObserver::Notify(PRUint32 aDocumentID,
nsIWebShellServices* ws;
// nsString theURL(aSpec);
// char* url = aSpec.ToNewCString();
nsIURL* uaURL = nsnull;
nsIURI* uaURL = nsnull;
// rv = NS_NewURL(&uaURL, nsString(aSpec));
if(numOfAttributes >= 2) {
@ -173,7 +173,7 @@ NS_IMETHODIMP nsPICSElementObserver::Notify(PRUint32 aDocumentID,
rv = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(rv)) return rv;
rv = uri->QueryInterface(nsIURL::GetIID(), (void**)&uaURL);
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&uaURL);
NS_RELEASE(uri);
if (NS_FAILED(rv)) return rv;
#endif // NECKO

View File

@ -166,7 +166,7 @@ XP_MakeHTMLDialog2(XPDialogInfo *dialogInfo) {
char* button = NULL;
nsAutoString * nsCookie = new nsAutoString("");
nsIURL* url;
nsIURI* url;
char* separator;
nsresult res;

View File

@ -27,7 +27,7 @@
#include "nsINetService.h"
#else
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIChannel.h"
#endif // NECKO
@ -362,7 +362,7 @@ Wallet_Localize(char* genericString) {
printf("cannot get net service\n");
return v.ToNewCString();
}
nsIURL *url = nsnull;
nsIURI *url = nsnull;
#ifndef NECKO
ret = pNetService->CreateURL(&url, nsString(TEST_URL), nsnull, nsnull,
@ -378,7 +378,7 @@ Wallet_Localize(char* genericString) {
return v.ToNewCString();
}
ret = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
ret = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
nsServiceManager::ReleaseService(kIOServiceCID, pNetService);
#endif // NECKO
@ -1180,7 +1180,7 @@ wallet_FetchFromNetCenter(char* from, char* to) {
nsIInputStream* *aNewStream = &newStream;
nsresult rv;
#ifndef NECKO
nsIURL * url;
nsIURI * url;
if (!NS_FAILED(NS_NewURL(&url, from))) {
NS_WITH_SERVICE(nsINetService, inet, kNetServiceCID, &rv);
if (NS_FAILED(rv)) return;
@ -1577,10 +1577,10 @@ wallet_InitializeURLList() {
*/
void
wallet_InitializeCurrentURL(nsIDocument * doc) {
static nsIURL * lastUrl = NULL;
static nsIURI * lastUrl = NULL;
/* get url */
nsIURL* url;
nsIURI* url;
url = doc->GetDocumentURL();
if (lastUrl == url) {
NS_RELEASE(url);

View File

@ -29,7 +29,9 @@ class nsIImageRequestObserver;
class nsIImageRequest;
class nsIDeviceContext;
class nsIStreamListener;
#ifndef NECKO
class nsIURLGroup;
#endif
/** For important images, like backdrops. */
#define nsImageLoadFlags_kHighPriority 0x01
@ -59,7 +61,11 @@ public:
* Initialize an image group with a device context. All images
* in this group will be decoded for the specified device context.
*/
#ifdef NECKO
virtual nsresult Init(nsIDeviceContext *aDeviceContext) = 0;
#else
virtual nsresult Init(nsIDeviceContext *aDeviceContext, nsIURLGroup* aURLGroup) = 0;
#endif
/**
* Add an observers to be informed of image group notifications.

View File

@ -70,8 +70,7 @@ nsBlender::Blend(PRInt32 aSX, PRInt32 aSY, PRInt32 aWidth, PRInt32 aHeight,nsDra
{
nsresult result = NS_ERROR_FAILURE;
nsPoint srcloc, maskloc;
PRInt32 dlinespan, slinespan, mlinespan, numbytes, numlines, level;
PRUint8 *s1, *d1, *m1, *mask = NULL, *ssl = NULL;
PRUint8 *mask = NULL, *ssl = NULL;
PRBool srcissurf = PR_FALSE;
PRBool secondsrcissurf = PR_FALSE;
PRBool dstissurf = PR_FALSE;
@ -124,8 +123,7 @@ NS_IMETHODIMP nsBlender::Blend(PRInt32 aSX, PRInt32 aSY, PRInt32 aWidth, PRInt32
{
nsresult result = NS_ERROR_FAILURE;
nsPoint srcloc, maskloc;
PRInt32 dlinespan, slinespan, mlinespan, numbytes, numlines, level;
PRUint8 *s1, *d1, *m1, *mask = NULL, *ssl = NULL;
PRUint8 *mask = NULL, *ssl = NULL;
PRBool srcissurf = PR_FALSE;
PRBool secondsrcissurf = PR_FALSE;
PRBool dstissurf = PR_FALSE;

View File

@ -29,7 +29,9 @@
#include "il_util.h"
#include "nsIDeviceContext.h"
#include "nsIStreamListener.h"
#ifndef NECKO
#include "nsIURLGroup.h"
#endif
static NS_DEFINE_IID(kIImageGroupIID, NS_IIMAGEGROUP_IID);
@ -40,7 +42,11 @@ public:
ImageGroupImpl(nsIImageManager *aManager);
virtual ~ImageGroupImpl();
#ifdef NECKO
nsresult Init(nsIDeviceContext *aDeviceContext);
#else
nsresult Init(nsIDeviceContext *aDeviceContext, nsIURLGroup* aURLGroup);
#endif
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
@ -74,7 +80,9 @@ public:
nsIDeviceContext *mDeviceContext;
ilINetContext* mNetContext;
nsIStreamListener** mListenerRequest;
#ifndef NECKO
nsIURLGroup* mURLGroup;
#endif
};
ImageGroupImpl::ImageGroupImpl(nsIImageManager *aManager)
@ -107,7 +115,9 @@ ImageGroupImpl::~ImageGroupImpl()
NS_IF_RELEASE(mManager);
NS_IF_RELEASE(mNetContext);
#ifndef NECKO
NS_IF_RELEASE(mURLGroup);
#endif
}
NS_IMPL_ISUPPORTS(ImageGroupImpl, kIImageGroupIID)
@ -162,7 +172,11 @@ ReconnectHack(void* arg, nsIStreamListener* aListener)
}
nsresult
#ifdef NECKO
ImageGroupImpl::Init(nsIDeviceContext *aDeviceContext)
#else
ImageGroupImpl::Init(nsIDeviceContext *aDeviceContext, nsIURLGroup* aURLGroup)
#endif
{
ilIImageRenderer *renderer;
nsresult result;
@ -183,7 +197,11 @@ ImageGroupImpl::Init(nsIDeviceContext *aDeviceContext, nsIURLGroup* aURLGroup)
#endif // NECKO
// Create an async net context
#ifdef NECKO
result = NS_NewImageNetContext(&mNetContext, ReconnectHack, this);
#else
result = NS_NewImageNetContext(&mNetContext, mURLGroup, ReconnectHack, this);
#endif
if (NS_OK != result) {
return result;
}

View File

@ -23,19 +23,26 @@
#include "nscore.h"
class nsIStreamListener;
#ifndef NECKO
class nsIURLGroup;
#endif
typedef PRBool (*nsReconnectCB)(void* arg, nsIStreamListener* aListener);
extern "C" NS_GFX_(nsresult)
NS_NewImageNetContext(ilINetContext **aInstancePtrResult,
#ifndef NECKO
nsIURLGroup* aURLGroup,
#endif
nsReconnectCB aReconnectCallback,
void* aReconnectArg);
extern "C" NS_GFX_(nsresult)
NS_NewImageURL(ilIURL **aInstancePtrResult,
const char *aURL,
nsIURLGroup* aURLGroup);
const char *aURL
#ifndef NECKO
, nsIURLGroup* aURLGroup
#endif
);
extern "C" NS_GFX_(nsresult) NS_NewImageRenderer(ilIImageRenderer **aInstancePtrResult);

View File

@ -24,7 +24,9 @@
#include "nsIStreamListener.h"
#include "nsIInputStream.h"
#include "nsIURL.h"
#ifndef NECKO
#include "nsIURLGroup.h"
#endif
#include "nsITimer.h"
#include "nsVoidArray.h"
#include "nsString.h"
@ -37,6 +39,8 @@
#include "nsINetService.h"
#else
#include "nsIIOService.h"
#include "nsIBufferInputStream.h"
#include "nsNeckoUtil.h"
#endif // NECKO
#ifndef NECKO
@ -54,7 +58,9 @@ class ImageConsumer;
class ImageNetContextImpl : public ilINetContext {
public:
ImageNetContextImpl(NET_ReloadMethod aReloadPolicy,
#ifndef NECKO
nsIURLGroup* aURLGroup,
#endif
nsReconnectCB aReconnectCallback,
void* aReconnectArg);
virtual ~ImageNetContextImpl();
@ -90,7 +96,9 @@ public:
nsVoidArray *mRequests;
NET_ReloadMethod mReloadPolicy;
#ifndef NECKO
nsIURLGroup* mURLGroup;
#endif
nsReconnectCB mReconnectCallback;
void* mReconnectArg;
};
@ -102,12 +110,22 @@ public:
ImageConsumer(ilIURL *aURL, ImageNetContextImpl *aContext);
NS_IMETHOD GetBindInfo(nsIURL* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnProgress(nsIURL* aURL, PRUint32 Progress, PRUint32 ProgressMax);
NS_IMETHOD OnStatus(nsIURL* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStartBinding(nsIURL* aURL, const char *aContentType);
NS_IMETHOD OnDataAvailable(nsIURL* aURL, nsIInputStream *pIStream, PRUint32 length);
NS_IMETHOD OnStopBinding(nsIURL* aURL, nsresult status, const PRUnichar* aMsg);
#ifdef NECKO
// nsIStreamObserver methods:
NS_IMETHOD OnStartBinding(nsISupports *ctxt);
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
// nsIStreamListener methods:
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
#else
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 Progress, PRUint32 ProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStartBinding(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUint32 length);
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg);
#endif
void Interrupt();
@ -118,7 +136,11 @@ protected:
ilIURL *mURL;
PRBool mInterrupted;
ImageNetContextImpl *mContext;
#ifdef NECKO
nsIBufferInputStream *mStream;
#else
nsIInputStream *mStream;
#endif
nsITimer *mTimer;
PRBool mFirstRead;
char *mBuffer;
@ -143,26 +165,32 @@ ImageConsumer::ImageConsumer(ilIURL *aURL, ImageNetContextImpl *aContext)
NS_DEFINE_IID(kIStreamNotificationIID, NS_ISTREAMLISTENER_IID);
NS_IMPL_ISUPPORTS(ImageConsumer,kIStreamNotificationIID);
#ifndef NECKO
NS_IMETHODIMP
ImageConsumer::GetBindInfo(nsIURL* aURL, nsStreamBindingInfo* aInfo)
ImageConsumer::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
{
return 0;
}
NS_IMETHODIMP
ImageConsumer::OnProgress(nsIURL* aURL, PRUint32 Progress, PRUint32 ProgressMax)
ImageConsumer::OnProgress(nsIURI* aURL, PRUint32 Progress, PRUint32 ProgressMax)
{
return 0;
}
NS_IMETHODIMP
ImageConsumer::OnStatus(nsIURL* aURL, const PRUnichar* aMsg)
ImageConsumer::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
{
return 0;
}
#endif
NS_IMETHODIMP
ImageConsumer::OnStartBinding(nsIURL* aURL, const char *aContentType)
#ifdef NECKO
ImageConsumer::OnStartBinding(nsISupports* aContext)
#else
ImageConsumer::OnStartBinding(nsIURI* aURL, const char *aContentType)
#endif
{
if (mInterrupted) {
mStatus = MK_INTERRUPTED;
@ -191,7 +219,12 @@ ImageConsumer::OnStartBinding(nsIURL* aURL, const char *aContentType)
NS_IMETHODIMP
ImageConsumer::OnDataAvailable(nsIURL* aURL, nsIInputStream *pIStream, PRUint32 length)
#ifdef NECKO
ImageConsumer::OnDataAvailable(nsISupports* aContext, nsIBufferInputStream *pIStream,
PRUint32 offset, PRUint32 length)
#else
ImageConsumer::OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUint32 length)
#endif
{
PRUint32 max_read;
PRUint32 bytes_read = 0, str_length;
@ -220,7 +253,7 @@ ImageConsumer::OnDataAvailable(nsIURL* aURL, nsIInputStream *pIStream, PRUint32
break;
err = pIStream->Read(mBuffer,
max_read, &nb);
max_read, &nb);
if (err != NS_OK) {
break;
}
@ -273,7 +306,7 @@ ImageConsumer::OnDataAvailable(nsIURL* aURL, nsIInputStream *pIStream, PRUint32
void
ImageConsumer::KeepPumpingStream(nsITimer *aTimer, void *aClosure)
{
nsIURL* url = nsnull;
nsIURI* url = nsnull;
ImageConsumer *consumer = (ImageConsumer *)aClosure;
nsAutoString status;
@ -286,7 +319,11 @@ ImageConsumer::KeepPumpingStream(nsITimer *aTimer, void *aClosure)
}
NS_IMETHODIMP
ImageConsumer::OnStopBinding(nsIURL* aURL, nsresult status, const PRUnichar* aMsg)
#ifdef NECKO
ImageConsumer::OnStopBinding(nsISupports* aContext, nsresult status, const PRUnichar* aMsg)
#else
ImageConsumer::OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg)
#endif
{
if (mTimer != nsnull) {
NS_RELEASE(mTimer);
@ -302,7 +339,11 @@ ImageConsumer::OnStopBinding(nsIURL* aURL, nsresult status, const PRUnichar* aMs
PRUint32 str_length;
nsresult err = mStream->GetLength(&str_length);
if (err == NS_OK) {
#ifdef NECKO
err = OnDataAvailable(aContext, mStream, 0, str_length); // XXX fix offset
#else
err = OnDataAvailable(aURL, mStream, str_length);
#endif
// If we still have the stream, there's still data to be
// pumped, so we set a timer to call us back again.
if ((err == NS_OK) && (mStream != nsnull)) {
@ -358,14 +399,18 @@ ImageConsumer::~ImageConsumer()
}
ImageNetContextImpl::ImageNetContextImpl(NET_ReloadMethod aReloadPolicy,
#ifndef NECKO
nsIURLGroup* aURLGroup,
#endif
nsReconnectCB aReconnectCallback,
void* aReconnectArg)
{
NS_INIT_REFCNT();
mRequests = nsnull;
#ifndef NECKO
mURLGroup = aURLGroup;
NS_IF_ADDREF(mURLGroup);
#endif
mReloadPolicy = aReloadPolicy;
mReconnectCallback = aReconnectCallback;
mReconnectArg = aReconnectArg;
@ -382,7 +427,9 @@ ImageNetContextImpl::~ImageNetContextImpl()
}
delete mRequests;
}
#ifndef NECKO
NS_IF_RELEASE(mURLGroup);
#endif
}
NS_IMPL_ISUPPORTS(ImageNetContextImpl, kIImageNetContextIID)
@ -392,7 +439,12 @@ ImageNetContextImpl::Clone()
{
ilINetContext *cx;
if (NS_NewImageNetContext(&cx, mURLGroup, mReconnectCallback, mReconnectArg) == NS_OK) {
#ifdef NECKO
if (NS_NewImageNetContext(&cx, mReconnectCallback, mReconnectArg) == NS_OK)
#else
if (NS_NewImageNetContext(&cx, mURLGroup, mReconnectCallback, mReconnectArg) == NS_OK)
#endif
{
return cx;
}
else {
@ -436,7 +488,12 @@ ImageNetContextImpl::CreateURL(const char *aURL,
{
ilIURL *url;
if (NS_NewImageURL(&url, aURL, mURLGroup) == NS_OK) {
#ifdef NECKO
if (NS_NewImageURL(&url, aURL) == NS_OK)
#else
if (NS_NewImageURL(&url, aURL, mURLGroup) == NS_OK)
#endif
{
return url;
}
else {
@ -480,7 +537,7 @@ ImageNetContextImpl::GetURL (ilIURL * aURL,
NET_ReloadMethod aLoadMethod,
ilINetReader *aReader)
{
nsIURL *nsurl;
nsIURI *nsurl;
NS_PRECONDITION(nsnull != aURL, "null URL");
NS_PRECONDITION(nsnull != aReader, "null reader");
if (aURL == nsnull || aReader == nsnull) {
@ -509,7 +566,11 @@ ImageNetContextImpl::GetURL (ilIURL * aURL,
mRequests->AppendElement((void *)ic);
}
else {
#ifdef NECKO
nsresult rv = NS_OpenURI(nsurl, ic);
#else
nsresult rv = NS_OpenURL(nsurl, ic);
#endif
if (rv == NS_OK) {
mRequests->AppendElement((void *)ic);
}
@ -536,7 +597,9 @@ ImageNetContextImpl::RequestDone(ImageConsumer *aConsumer)
extern "C" NS_GFX_(nsresult)
NS_NewImageNetContext(ilINetContext **aInstancePtrResult,
#ifndef NECKO
nsIURLGroup* aURLGroup,
#endif
nsReconnectCB aReconnectCallback,
void* aReconnectArg)
{
@ -546,7 +609,9 @@ NS_NewImageNetContext(ilINetContext **aInstancePtrResult,
}
ilINetContext *cx = new ImageNetContextImpl(NET_NORMAL_RELOAD,
#ifndef NECKO
aURLGroup,
#endif
aReconnectCallback,
aReconnectArg);
if (cx == nsnull) {

View File

@ -31,7 +31,7 @@
#include "nsINetService.h"
#else
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIChannel.h"
#endif // NECKO
@ -128,7 +128,12 @@ ImageNetContextSyncImpl::CreateURL(const char* aURL,
{
ilIURL *url;
if (NS_NewImageURL(&url, aURL, nsnull) == NS_OK) {
#ifdef NECKO
if (NS_NewImageURL(&url, aURL) == NS_OK)
#else
if (NS_NewImageURL(&url, aURL, nsnull) == NS_OK)
#endif
{
return url;
}
@ -180,8 +185,8 @@ ImageNetContextSyncImpl::GetURL(ilIURL* aURL,
PRInt32 status = 0;
// Get a nsIURL interface
nsIURL* url = nsnull;
// Get a nsIURI interface
nsIURI* url = nsnull;
aURL->QueryInterface(kIURLIID, (void **)&url);
// Get a network service interface which we'll use to create a stream

View File

@ -28,7 +28,8 @@
#else
#include "nsIServiceManager.h"
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsNeckoUtil.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsString.h"
@ -44,7 +45,11 @@ public:
NS_DECL_ISUPPORTS
#ifdef NECKO
nsresult Init(const char *aURL);
#else
nsresult Init(const char *aURL, nsIURLGroup* aURLGroup);
#endif
virtual void SetReader(ilINetReader *aReader);
@ -52,7 +57,11 @@ public:
virtual int GetContentLength();
#ifdef NECKO
virtual char* GetAddress();
#else
virtual const char* GetAddress();
#endif
virtual time_t GetExpires();
@ -63,7 +72,11 @@ public:
virtual void SetOwnerId(int aOwnderId);
private:
nsIURL *mURL;
#ifdef NECKO
nsIURI *mURL;
#else
nsIURI *mURL;
#endif
ilINetReader *mReader;
};
@ -74,25 +87,25 @@ ImageURLImpl::ImageURLImpl(void)
}
nsresult
#ifdef NECKO
ImageURLImpl::Init(const char *aURL)
#else
ImageURLImpl::Init(const char *aURL, nsIURLGroup* aURLGroup)
#endif
{
nsresult rv;
#ifndef NECKO
if (nsnull != aURLGroup) {
rv = aURLGroup->CreateURL(&mURL, nsnull, aURL, nsnull);
} else {
#ifndef NECKO
rv = NS_NewURL(&mURL, aURL);
}
else
#endif
{
#ifdef NECKO
rv = NS_NewURI(&mURL, aURL);
#else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
nsIURI *uri = nsnull;
rv = service->NewURI(aURL, nsnull, &uri);
if (NS_FAILED(rv)) return rv;
rv = uri->QueryInterface(nsIURL::GetIID(), (void**)&mURL);
NS_RELEASE(uri);
#endif // NECKO
rv = NS_NewURL(&mURL, aURL);
#endif
}
return rv;
}
@ -114,11 +127,13 @@ ImageURLImpl::QueryInterface(const nsIID& aIID,
static NS_DEFINE_IID(kClassIID, kIImageURLIID);
static NS_DEFINE_IID(kURLIID, NS_IURL_IID);
// xxx I think this is wrong -- this class isn't aggregated with nsIURI!
if (aIID.Equals(kURLIID)) {
*aInstancePtr = (void*) mURL;
NS_ADDREF(mURL);
return NS_OK;
}
if (aIID.Equals(kClassIID)) {
*aInstancePtr = (void*) this;
NS_ADDREF_THIS();
@ -167,11 +182,19 @@ 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;
}
@ -189,6 +212,9 @@ ImageURLImpl::GetExpires()
void
ImageURLImpl::SetBackgroundLoad(PRBool aBgload)
{
#ifdef NECKO
// XXX help!
#else
nsILoadAttribs* loadAttributes;
if (nsnull != mURL) {
@ -202,6 +228,7 @@ ImageURLImpl::SetBackgroundLoad(PRBool aBgload)
NS_RELEASE(loadAttributes);
}
}
#endif
}
int
@ -216,8 +243,11 @@ ImageURLImpl::SetOwnerId(int aOwnerId)
}
extern "C" NS_GFX_(nsresult)
NS_NewImageURL(ilIURL **aInstancePtrResult, const char *aURL,
nsIURLGroup* aURLGroup)
NS_NewImageURL(ilIURL **aInstancePtrResult, const char *aURL
#ifndef NECKO
, nsIURLGroup* aURLGroup
#endif
)
{
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
if (nsnull == aInstancePtrResult) {
@ -228,7 +258,11 @@ 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, aURLGroup);
#endif
if (rv != NS_OK) {
delete url;
return rv;

View File

@ -26,7 +26,9 @@ LLIBS= \
$(DIST)\lib\xpcom.lib \
$(LIBNSPR) \
$(DIST)\lib\plc3.lib \
!ifndef NECKO
$(DIST)\lib\netlib.lib \
!endif
$(NULL)
LIBNAME = .\$(OBJDIR)\DebugRobot

View File

@ -24,7 +24,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIServiceManager.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIIOService.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
@ -132,13 +132,25 @@ public:
NS_DECL_ISUPPORTS
NS_IMETHOD OnProgress(nsIURL* aURL, PRUint32 Progress, PRUint32 ProgressMax) { return NS_OK; }
NS_IMETHOD OnStatus(nsIURL* aURL, const PRUnichar* aMsg) { return NS_OK; }
NS_IMETHOD OnStartBinding(nsIURL* aURL, const char *aContentType) { return NS_OK; }
NS_IMETHOD OnStopBinding(nsIURL* aURL, nsresult status, const PRUnichar* aMsg);
#ifdef NECKO
// nsIStreamObserver methods:
NS_IMETHOD OnStartBinding(nsISupports *ctxt) { return NS_OK; }
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
NS_IMETHOD OnStartRequest(nsISupports *ctxt) { return NS_OK; }
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg) { return NS_OK; }
#else
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 Progress, PRUint32 ProgressMax) { return NS_OK; }
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg) { return NS_OK; }
NS_IMETHOD OnStartBinding(nsIURI* aURL, const char *aContentType) { return NS_OK; }
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg);
#endif
};
NS_IMETHODIMP CStreamListener::OnStopBinding(nsIURL* aURL, nsresult status, const PRUnichar* aMsg)
#ifdef NECKO
NS_IMETHODIMP CStreamListener::OnStopBinding(nsISupports* aContext, nsresult status, const PRUnichar* aMsg)
#else
NS_IMETHODIMP CStreamListener::OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg)
#endif
{
fputs("done.\n",stdout);
g_bReadyForNextUrl = PR_TRUE;
@ -147,7 +159,7 @@ NS_IMETHODIMP CStreamListener::OnStopBinding(nsIURL* aURL, nsresult status, cons
nsresult CStreamListener::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
return NS_OK;
return NS_ERROR_NOT_IMPLEMENTED; // never called
}
NS_IMPL_ADDREF(CStreamListener)
@ -197,7 +209,7 @@ extern "C" NS_EXPORT int DebugRobot(
g_workList->RemoveElementAt(n - 1);
// Create url
nsIURL* url;
nsIURI* url;
nsresult rv;
#ifndef NECKO
rv = NS_NewURL(&url, *urlName);
@ -210,7 +222,7 @@ extern "C" NS_EXPORT int DebugRobot(
rv = service->NewURI(uriStr, nsnull, &uri);
if (NS_FAILED(rv)) return rv;
rv = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO
if (NS_OK != rv) {
@ -263,23 +275,44 @@ extern "C" NS_EXPORT int DebugRobot(
parser->Parse(url, pl,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;
if (ww) {
ww->SetObserver(pl);
#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
char* spec;
(void)url->GetSpec(&spec);
(*yieldProc)(spec);
nsCRT::free(spec);
#else
const char* spec;
(void)url->GetSpec(&spec);
(*yieldProc)(spec);
#endif
}
}
}

View File

@ -19,7 +19,7 @@
#define nsIRobotSink_h___
#include "nsIHTMLContentSink.h"
class nsIURL;
class nsIURI;
class nsIRobotSinkObserver;
/* 61256800-cfd8-11d1-9328-00805f8add32 */
@ -29,7 +29,7 @@ class nsIRobotSinkObserver;
class nsIRobotSink : public nsIHTMLContentSink {
public:
NS_IMETHOD Init(nsIURL* aDocumentURL) = 0;
NS_IMETHOD Init(nsIURI* aDocumentURL) = 0;
NS_IMETHOD AddObserver(nsIRobotSinkObserver* aObserver) = 0;
NS_IMETHOD RemoveObserver(nsIRobotSinkObserver* aObserver) = 0;

View File

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

View File

@ -475,7 +475,7 @@ int nsExpatTokenizer::LoadExternalDTD(const XML_Char * base,
}
// XXX try to compose this using base url
nsIURL * url = nsnull;
nsIURI * url = nsnull;
nsString * s = new nsString((PRUnichar *)systemId);
res = netService->CreateURL(&url, *s);
if (NS_FAILED(res)) {

View File

@ -50,7 +50,7 @@ enum eAutoDetectResult {
class nsIParser;
class CToken;
class nsIDTDDebug;
class nsIURL;
class nsIURI;
class nsString;
class nsITagHandler;
class nsIContentSink;

View File

@ -46,7 +46,7 @@ class nsIContentSink;
class nsIStreamObserver;
class nsIParserFilter;
class nsString;
class nsIURL;
class nsIURI;
enum eParseMode {
@ -165,7 +165,7 @@ class nsIParser : public nsISupports {
******************************************************************************************/
virtual PRBool EnableParser(PRBool aState) = 0;
virtual PRBool IsParserEnabled() = 0;
virtual nsresult Parse(nsIURL* aURL,nsIStreamObserver* aListener = nsnull,PRBool aEnableVerify=PR_FALSE, void* aKey=0) = 0;
virtual nsresult Parse(nsIURI* aURL,nsIStreamObserver* aListener = nsnull,PRBool aEnableVerify=PR_FALSE, void* aKey=0) = 0;
virtual nsresult Parse(nsIInputStream& aStream, PRBool aEnableVerify=PR_FALSE, void* aKey=0) = 0;
virtual nsresult Parse(nsString& aSourceBuffer,void* aKey,const nsString& aContentType,PRBool aEnableVerify,PRBool aLastCall) = 0;

View File

@ -244,7 +244,15 @@ nsresult nsParser::QueryInterface(const nsIID& aIID, void** aInstancePtr)
else if(aIID.Equals(kIParserIID)) { //do IParser base class...
*aInstancePtr = (nsIParser*)(this);
}
else if(aIID.Equals(kIStreamListenerIID)) { //do IStreamListener base class...
#ifdef NECKO
else if(aIID.Equals(nsIProgressEventSink::GetIID())) {
*aInstancePtr = (nsIStreamListener*)(this);
}
#endif
else if(aIID.Equals(nsIStreamObserver::GetIID())) {
*aInstancePtr = (nsIStreamObserver*)(this);
}
else if(aIID.Equals(nsIStreamListener::GetIID())) {
*aInstancePtr = (nsIStreamListener*)(this);
}
else if(aIID.Equals(kClassIID)) { //do this class...
@ -624,7 +632,7 @@ nsParser::IsParserEnabled()
* @param aFilename -- const char* containing file to be parsed.
* @return error code -- 0 if ok, non-zero if error.
*/
nsresult nsParser::Parse(nsIURL* aURL,nsIStreamObserver* aListener,PRBool aVerifyEnabled, void* aKey) {
nsresult nsParser::Parse(nsIURI* aURL,nsIStreamObserver* aListener,PRBool aVerifyEnabled, void* aKey) {
NS_PRECONDITION(0!=aURL,kNullURL);
nsresult result=kBadURL;
@ -955,7 +963,7 @@ nsITokenizer* nsParser::GetTokenizer(void) {
* @param
* @return error code -- 0 if ok, non-zero if error.
*/
nsresult nsParser::GetBindInfo(nsIURL* aURL, nsStreamBindingInfo* aInfo){
nsresult nsParser::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo){
nsresult result=0;
return result;
}
@ -972,7 +980,7 @@ nsresult
#ifdef NECKO
nsParser::OnProgress(nsISupports* aContext, PRUint32 aProgress, PRUint32 aProgressMax)
#else
nsParser::OnProgress(nsIURL* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
nsParser::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
#endif
{
nsresult result=0;
@ -999,7 +1007,7 @@ nsresult
#ifdef NECKO
nsParser::OnStatus(nsISupports* aContext, const PRUnichar* aMsg)
#else
nsParser::OnStatus(nsIURL* aURL, const PRUnichar* aMsg)
nsParser::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
#endif
{
nsresult result=0;
@ -1029,7 +1037,7 @@ nsParser::OnStatus(nsIURL* aURL, const PRUnichar* aMsg)
#ifdef NECKO
nsresult nsParser::OnStartBinding(nsISupports* aContext)
#else
nsresult nsParser::OnStartBinding(nsIURL* aURL, const char *aSourceType)
nsresult nsParser::OnStartBinding(nsIURI* aURL, const char *aSourceType)
#endif
{
NS_PRECONDITION((eNone==mParserContext->mStreamListenerState),kBadListenerInit);
@ -1091,7 +1099,7 @@ nsParser::OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *err
#ifdef NECKO
nsresult nsParser::OnDataAvailable(nsISupports* aContext, nsIBufferInputStream *pIStream, PRUint32 sourceOffset, PRUint32 aLength)
#else
nsresult nsParser::OnDataAvailable(nsIURL* aURL, nsIInputStream *pIStream, PRUint32 aLength)
nsresult nsParser::OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUint32 aLength)
#endif
{
/* if (nsnull != mListener) {
@ -1164,7 +1172,7 @@ nsresult nsParser::OnDataAvailable(nsIURL* aURL, nsIInputStream *pIStream, PRUin
#ifdef NECKO
nsresult nsParser::OnStopBinding(nsISupports* aContext, nsresult status, const PRUnichar* aMsg)
#else
nsresult nsParser::OnStopBinding(nsIURL* aURL, nsresult status, const PRUnichar* aMsg)
nsresult nsParser::OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg)
#endif
{
mParserContext->mStreamListenerState=eOnStop;

View File

@ -173,7 +173,7 @@ friend class CTokenHandler;
* @param aListener is a listener to forward notifications to
* @return TRUE if all went well -- FALSE otherwise
*/
virtual nsresult Parse(nsIURL* aURL,nsIStreamObserver* aListener,PRBool aEnableVerify=PR_FALSE,void* aKey=0);
virtual nsresult Parse(nsIURI* aURL,nsIStreamObserver* aListener,PRBool aEnableVerify=PR_FALSE,void* aKey=0);
/**
* Cause parser to parse input from given stream
@ -251,12 +251,12 @@ friend class CTokenHandler;
// nsIStreamListener methods:
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
#else
NS_IMETHOD GetBindInfo(nsIURL* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnProgress(nsIURL* aURL, PRUint32 Progress, PRUint32 ProgressMax);
NS_IMETHOD OnStatus(nsIURL* aURL, const PRUnichar* aMmsg);
NS_IMETHOD OnStartBinding(nsIURL* aURL, const char *aContentType);
NS_IMETHOD OnDataAvailable(nsIURL* aURL, nsIInputStream *pIStream, PRUint32 length);
NS_IMETHOD OnStopBinding(nsIURL* aURL, nsresult status, const PRUnichar* aMsg);
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 OnStartBinding(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUint32 length);
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg);
#endif
void PushContext(CParserContext& aContext);

View File

@ -52,12 +52,12 @@ public:
NS_DECL_ISUPPORTS
NS_IMETHOD GetBindInfo(nsIURL* aURL);
NS_IMETHOD OnProgress(nsIURL* aURL, PRInt32 Progress, PRInt32 ProgressMax);
NS_IMETHOD OnStatus(nsIURL* aURL, const nsString& aMsg);
NS_IMETHOD OnStartBinding(nsIURL* aURL, const char *aContentType);
NS_IMETHOD OnDataAvailable(nsIURL* aURL, nsIInputStream *pIStream, PRInt32 length);
NS_IMETHOD OnStopBinding(nsIURL* aURL, PRInt32 status, const nsString& aMsg);
NS_IMETHOD GetBindInfo(nsIURI* aURL);
NS_IMETHOD OnProgress(nsIURI* aURL, PRInt32 Progress, PRInt32 ProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const nsString& aMsg);
NS_IMETHOD OnStartBinding(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRInt32 length);
NS_IMETHOD OnStopBinding(nsIURI* aURL, PRInt32 status, const nsString& aMsg);
PRBool IsDone() const { return mDone; }
PRBool HaveError() const { return mError; }
@ -88,31 +88,31 @@ StreamToFile::~StreamToFile()
}
NS_IMETHODIMP
StreamToFile::GetBindInfo(nsIURL* aURL)
StreamToFile::GetBindInfo(nsIURI* aURL)
{
return 0;
}
NS_IMETHODIMP
StreamToFile::OnProgress(nsIURL* aURL, PRInt32 Progress, PRInt32 ProgressMax)
StreamToFile::OnProgress(nsIURI* aURL, PRInt32 Progress, PRInt32 ProgressMax)
{
return 0;
}
NS_IMETHODIMP
StreamToFile::OnStatus(nsIURL* aURL, const nsString& aMsg)
StreamToFile::OnStatus(nsIURI* aURL, const nsString& aMsg)
{
return 0;
}
NS_IMETHODIMP
StreamToFile::OnStartBinding(nsIURL* aURL, const char *aContentType)
StreamToFile::OnStartBinding(nsIURI* aURL, const char *aContentType)
{
return 0;
}
NS_IMETHODIMP
StreamToFile::OnDataAvailable(nsIURL* aURL, nsIInputStream *pIStream,
StreamToFile::OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream,
PRInt32 length)
{
PRUint32 len;
@ -130,7 +130,7 @@ StreamToFile::OnDataAvailable(nsIURL* aURL, nsIInputStream *pIStream,
NS_IMETHODIMP
StreamToFile::OnStopBinding(nsIURL* aURL, PRInt32 status, const nsString& aMsg)
StreamToFile::OnStopBinding(nsIURI* aURL, PRInt32 status, const nsString& aMsg)
{
mDone = PR_TRUE;
if (0 != status) {
@ -228,7 +228,7 @@ PageGrabber::Grab(const nsString& aURL)
printf(" to %s\n", cname);
// Create the URL object...
nsIURL* url = NULL;
nsIURI* url = NULL;
nsresult rv;
#ifndef NECKO

View File

@ -56,7 +56,7 @@ class nsIStringBundleService : public nsISupports
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISTRINGBUNDLESERVICE_IID)
NS_IMETHOD CreateBundle(nsIURL* aURL, nsILocale* aLocale,
NS_IMETHOD CreateBundle(nsIURI* aURL, nsILocale* aLocale,
nsIStringBundle** aResult) = 0; /* deprecated */
NS_IMETHOD CreateBundle(const char* aURLSpec, nsILocale* aLocale,
nsIStringBundle** aResult) = 0;

View File

@ -66,7 +66,7 @@ public:
nsStringBundle(const char* aURLSpec, nsILocale* aLocale, nsresult* aResult);
// deprecated
nsStringBundle(nsIURL* aURL, nsILocale* aLocale, nsresult* aResult);
nsStringBundle(nsIURI* aURL, nsILocale* aLocale, nsresult* aResult);
virtual ~nsStringBundle();
NS_DECL_ISUPPORTS
@ -116,7 +116,7 @@ nsStringBundle::nsStringBundle(const char* aURLSpec, nsILocale* aLocale, nsresul
}
// deprecated
nsStringBundle::nsStringBundle(nsIURL* aURL, nsILocale* aLocale,
nsStringBundle::nsStringBundle(nsIURI* aURL, nsILocale* aLocale,
nsresult* aResult)
{
NS_INIT_REFCNT();
@ -313,7 +313,7 @@ nsStringBundle::OpenInputStream(const nsString2 aURLStr, nsIInputStream*& in)
kINetServiceIID, (nsISupports**) &pNetService);
/* get the url
*/
nsIURL *url = nsnull;
nsIURI *url = nsnull;
ret = pNetService->CreateURL(&url, aURLStr, nsnull, nsnull,
nsnull);
@ -410,7 +410,7 @@ public:
nsIStringBundle** aResult);
// deprecate
NS_IMETHOD CreateBundle(nsIURL* aURL, nsILocale* aLocale,
NS_IMETHOD CreateBundle(nsIURI* aURL, nsILocale* aLocale,
nsIStringBundle** aResult);
};
@ -449,7 +449,7 @@ nsStringBundleService::CreateBundle(const char* aURLSpec, nsILocale* aLocale,
/* deprecated */
NS_IMETHODIMP
nsStringBundleService::CreateBundle(nsIURL* aURL, nsILocale* aLocale,
nsStringBundleService::CreateBundle(nsIURI* aURL, nsILocale* aLocale,
nsIStringBundle** aResult)
{
nsresult ret = NS_OK;

View File

@ -27,7 +27,7 @@
#include "nsINetService.h"
#else
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
#endif
@ -177,7 +177,7 @@ main(int argc, char *argv[])
}
nsILocale* locale = get_applocale();
nsIURL *url = nsnull;
nsIURI *url = nsnull;
#ifndef NECKO
nsINetService* pNetService = nsnull;
@ -203,7 +203,7 @@ main(int argc, char *argv[])
return 1;
}
ret = uri->QueryInterface(nsIURL::GetIID(), (void**)&url);
ret = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
NS_RELEASE(uri);
#endif // NECKO

View File

@ -42,7 +42,7 @@ nsURLProperties::nsURLProperties(nsString& aUrl)
{
mDelegate = nsnull;
nsresult res = NS_OK;
nsIURL* url = nsnull;
nsIURI* url = nsnull;
nsIInputStream* in = nsnull;
#ifndef NECKO

View File

@ -27,7 +27,9 @@
#include "nsIRenderingContext.h"
#include "nsEventStateManager.h"
#include "nsIURL.h"
#ifndef NECKO
#include "nsIURLGroup.h"
#endif
#include "nsIDocument.h"
#include "nsIStyleContext.h"
#include "nsLayoutAtoms.h"
@ -338,7 +340,7 @@ nsPresContext::SetWidgetRenderingMode(nsWidgetRendering aMode)
NS_IMETHODIMP
nsPresContext::GetBaseURL(nsIURL** aResult)
nsPresContext::GetBaseURL(nsIURI** aResult)
{
NS_PRECONDITION(nsnull != aResult, "null ptr");
if (nsnull == aResult) {
@ -699,6 +701,7 @@ nsPresContext::GetImageGroup(nsIImageGroup** aResult)
return rv;
}
#ifndef NECKO
// Initialize the image group
nsCOMPtr<nsIURLGroup> urlGroup;
rv = mBaseURL->GetURLGroup(getter_AddRefs(urlGroup));
@ -707,6 +710,7 @@ nsPresContext::GetImageGroup(nsIImageGroup** aResult)
if (NS_OK != rv) {
return rv;
}
#endif
}
*aResult = mImageGroup;

View File

@ -40,7 +40,7 @@ class nsIStyleContext;
class nsIAtom;
class nsString;
class nsIEventStateManager;
class nsIURL;
class nsIURI;
#define NS_IPRESCONTEXT_IID \
{ 0x0a5d12e0, 0x944e, 0x11d1, \
@ -103,7 +103,7 @@ public:
/**
* Get base url for presentation
*/
NS_IMETHOD GetBaseURL(nsIURL** aURLResult) = 0;
NS_IMETHOD GetBaseURL(nsIURI** aURLResult) = 0;
/**
* Get medium of presentation

View File

@ -36,7 +36,7 @@ class nsIStreamObserver;
class nsIStyleSet;
class nsIStyleSheet;
class nsIStyleRule;
class nsIURL;
class nsIURI;
class nsIURLGroup;
class nsIViewManager;
class nsString;
@ -85,7 +85,7 @@ public:
// returns the arena associated with this document.
virtual nsIArena* GetArena() = 0;
NS_IMETHOD StartDocumentLoad(nsIURL *aUrl,
NS_IMETHOD StartDocumentLoad(nsIURI *aUrl,
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener,
const char* aCommand) = 0;
@ -98,7 +98,7 @@ public:
/**
* Return the URL for the document. May return null.
*/
virtual nsIURL* GetDocumentURL() const = 0;
virtual nsIURI* GetDocumentURL() const = 0;
/**
* Return the URLGroup for the document. May return null.
@ -108,7 +108,7 @@ public:
/**
* Return the base URL for realtive URLs in the document. May return null (or the document URL).
*/
NS_IMETHOD GetBaseURL(nsIURL*& aURL) const = 0;
NS_IMETHOD GetBaseURL(nsIURI*& aURL) const = 0;
/**
* Return the content (mime) type of this document.

View File

@ -21,7 +21,7 @@
#include "nsISupports.h"
class nsIScriptable;
class nsIScriptEnvironment;
class nsIURL;
class nsIURI;
#define NS_IDOCUMENT_CONTAINER_IID \
{ 0x8efd4470, 0x944d, 0x11d1, \
@ -35,7 +35,7 @@ public:
* @param url the URL to display
* @param connection the connection to use.
*/
virtual void Display(nsIURL* aURL) = 0;
virtual void Display(nsIURI* aURL) = 0;
/**
* Returns a script environment for the specified language and version.

View File

@ -20,7 +20,7 @@
#define nsIFrameUtil_h___
#include "nsIXMLContent.h"
class nsIURL;
class nsIURI;
/* a6cf90d4-15b3-11d2-932e-00805f8add32 */
#define NS_IFRAME_UTIL_IID \

View File

@ -40,7 +40,7 @@ class nsIStyleContext;
class nsIAtom;
class nsString;
class nsIEventStateManager;
class nsIURL;
class nsIURI;
#define NS_IPRESCONTEXT_IID \
{ 0x0a5d12e0, 0x944e, 0x11d1, \
@ -103,7 +103,7 @@ public:
/**
* Get base url for presentation
*/
NS_IMETHOD GetBaseURL(nsIURL** aURLResult) = 0;
NS_IMETHOD GetBaseURL(nsIURI** aURLResult) = 0;
/**
* Get medium of presentation

View File

@ -22,7 +22,7 @@
#include "nsISupports.h"
class nsIAtom;
class nsString;
class nsIURL;
class nsIURI;
class nsIStyleRule;
class nsISupportsArray;
class nsIPresContext;
@ -39,7 +39,7 @@ public:
static const nsIID& GetIID() { static nsIID iid = NS_ISTYLE_SHEET_IID; return iid; }
// basic style sheet data
NS_IMETHOD GetURL(nsIURL*& aURL) const = 0;
NS_IMETHOD GetURL(nsIURI*& aURL) const = 0;
NS_IMETHOD GetTitle(nsString& aTitle) const = 0;
NS_IMETHOD GetType(nsString& aType) const = 0;
NS_IMETHOD GetMediumCount(PRInt32& aCount) const = 0;

View File

@ -40,7 +40,7 @@ class nsIStyleContext;
class nsIAtom;
class nsString;
class nsIEventStateManager;
class nsIURL;
class nsIURI;
#define NS_IPRESCONTEXT_IID \
{ 0x0a5d12e0, 0x944e, 0x11d1, \
@ -103,7 +103,7 @@ public:
/**
* Get base url for presentation
*/
NS_IMETHOD GetBaseURL(nsIURL** aURLResult) = 0;
NS_IMETHOD GetBaseURL(nsIURI** aURLResult) = 0;
/**
* Get medium of presentation

View File

@ -21,7 +21,9 @@
#include "nsDocument.h"
#include "nsIArena.h"
#include "nsIURL.h"
#ifndef NECKO
#include "nsIURLGroup.h"
#endif
#include "nsString.h"
#include "nsIContent.h"
#include "nsIDocumentObserver.h"
@ -629,7 +631,9 @@ nsDocument::nsDocument()
mArena = nsnull;
mDocumentTitle = nsnull;
mDocumentURL = nsnull;
#ifndef NECKO
mDocumentURLGroup = nsnull;
#endif
mCharacterSet = "ISO-8859-1";
mParentDocument = nsnull;
mRootContent = nsnull;
@ -673,7 +677,9 @@ nsDocument::~nsDocument()
mDocumentTitle = nsnull;
}
NS_IF_RELEASE(mDocumentURL);
#ifndef NECKO
NS_IF_RELEASE(mDocumentURLGroup);
#endif
mParentDocument = nsnull;
@ -828,7 +834,7 @@ nsIArena* nsDocument::GetArena()
}
nsresult
nsDocument::Reset(nsIURL *aURL)
nsDocument::Reset(nsIURI *aURL)
{
nsresult rv = NS_OK;
@ -837,7 +843,9 @@ nsDocument::Reset(nsIURL *aURL)
mDocumentTitle = nsnull;
}
NS_IF_RELEASE(mDocumentURL);
#ifndef NECKO
NS_IF_RELEASE(mDocumentURLGroup);
#endif
// Delete references to sub-documents
PRInt32 index = mSubDocuments.Count();
@ -886,7 +894,9 @@ nsDocument::Reset(nsIURL *aURL)
if (nsnull != aURL) {
NS_ADDREF(aURL);
#ifndef NECKO
rv = aURL->GetURLGroup(&mDocumentURLGroup);
#endif
}
if (NS_OK == rv) {
@ -897,7 +907,7 @@ nsDocument::Reset(nsIURL *aURL)
}
nsresult
nsDocument::StartDocumentLoad(nsIURL *aURL,
nsDocument::StartDocumentLoad(nsIURI *aURL,
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener,
const char* aCommand)
@ -910,7 +920,7 @@ const nsString* nsDocument::GetDocumentTitle() const
return mDocumentTitle;
}
nsIURL* nsDocument::GetDocumentURL() const
nsIURI* nsDocument::GetDocumentURL() const
{
NS_IF_ADDREF(mDocumentURL);
return mDocumentURL;
@ -923,14 +933,20 @@ nsDocument::GetContentType(nsString& aContentType) const
return NS_ERROR_NOT_IMPLEMENTED;
}
#ifndef NECKO
nsIURLGroup* nsDocument::GetDocumentURLGroup() const
{
NS_IF_ADDREF(mDocumentURLGroup);
return mDocumentURLGroup;
}
#endif
NS_IMETHODIMP
nsDocument::GetBaseURL(nsIURL*& aURL) const
#ifdef NECKO
nsDocument::GetBaseURI(nsIURI* &aURL) const
#else
nsDocument::GetBaseURL(nsIURI*& aURL) const
#endif
{
aURL = mDocumentURL;
NS_IF_ADDREF(mDocumentURL);

View File

@ -110,7 +110,7 @@ public:
virtual nsIArena* GetArena();
NS_IMETHOD StartDocumentLoad(nsIURL *aUrl,
NS_IMETHOD StartDocumentLoad(nsIURI *aUrl,
nsIContentViewerContainer* aContainer,
nsIStreamListener **aDocListener,
const char* aCommand);
@ -123,22 +123,28 @@ public:
/**
* Return the URL for the document. May return null.
*/
virtual nsIURL* GetDocumentURL() const;
virtual nsIURI* GetDocumentURL() const;
/**
* Return the content (mime) type of this document.
*/
NS_IMETHOD GetContentType(nsString& aContentType) const;
#ifndef NECKO
/**
* Return the URLGroup for the document. May return null.
*/
virtual nsIURLGroup* GetDocumentURLGroup() const;
#endif
/**
* Return the base URL for realtive URLs in the document. May return null (or the document URL).
*/
NS_IMETHOD GetBaseURL(nsIURL*& aURL) const;
#ifdef NECKO
NS_IMETHOD GetBaseURI(nsIURI*& aURL) const;
#else
NS_IMETHOD GetBaseURL(nsIURI*& aURL) const;
#endif
/**
* Return a standard name for the document's character set. This will
@ -414,7 +420,7 @@ protected:
nsIContent* FindContent(const nsIContent* aStartNode,
const nsIContent* aTest1,
const nsIContent* aTest2) const;
virtual nsresult Reset(nsIURL* aURL);
virtual nsresult Reset(nsIURI* aURL);
// this enum is temporary; there should be no knowledge of HTML in
// nsDocument. That will be fixed when content sink stream factories
@ -437,8 +443,10 @@ protected:
nsIArena* mArena;
nsString* mDocumentTitle;
nsIURL* mDocumentURL;
nsIURI* mDocumentURL;
#ifndef NECKO
nsIURLGroup* mDocumentURLGroup;
#endif
nsString mCharacterSet;
nsIDocument* mParentDocument;
nsVoidArray mSubDocuments;

View File

@ -39,7 +39,7 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsFrame.h"
@ -1201,7 +1201,7 @@ nsGenericElement::Release()
void
nsGenericElement::TriggerLink(nsIPresContext& aPresContext,
nsLinkVerb aVerb,
nsIURL* aBaseURL,
nsIURI* aBaseURL,
const nsString& aURLSpec,
const nsString& aTargetSpec,
PRBool aClick)

View File

@ -48,7 +48,7 @@ class nsIDOMScriptObjectFactory;
class nsDOMCSSDeclaration;
class nsIDOMCSSStyleDeclaration;
class nsDOMAttributeMap;
class nsIURL;
class nsIURI;
// Class that holds the child list of a content element and also
@ -180,7 +180,7 @@ public:
void TriggerLink(nsIPresContext& aPresContext,
nsLinkVerb aVerb,
nsIURL* aBaseURL,
nsIURI* aBaseURL,
const nsString& aURLSpec,
const nsString& aTargetSpec,
PRBool aClick);

View File

@ -26,8 +26,10 @@
#include "nsIURL.h"
#ifdef NECKO
#include "nsIIOService.h"
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsIChannel.h"
#include "nsNeckoUtil.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO
#include "nsIComponentManager.h"
@ -64,15 +66,25 @@ public:
// nsISupports
NS_DECL_ISUPPORTS
#ifdef NECKO
// nsIStreamObserver methods:
NS_IMETHOD OnStartBinding(nsISupports *ctxt);
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
NS_IMETHOD OnStartRequest(nsISupports *ctxt) { return NS_ERROR_NOT_IMPLEMENTED; }
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg) { return NS_ERROR_NOT_IMPLEMENTED; }
// nsIStreamListener methods:
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
#else
// nsIStreamListener
NS_IMETHOD OnStartBinding(nsIURL* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURL* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURL* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopBinding(nsIURL* aURL, nsresult aStatus,
NS_IMETHOD OnStartBinding(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult aStatus,
const PRUnichar* aMsg);
NS_IMETHOD GetBindInfo(nsIURL* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnDataAvailable(nsIURL* aURL, nsIInputStream* aStream,
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream* aStream,
PRUint32 aCount);
#endif
PluginViewerImpl* mViewer;
nsIStreamListener* mNextStream;
@ -153,20 +165,32 @@ public:
nsIDeviceContext* aDeviceContext,
const nsRect& aBounds);
nsresult StartLoad(nsIURL* aURL, const char* aContentType,
#ifdef NECKO
nsresult StartLoad(nsIChannel* channel, nsIStreamListener*& aResult);
#else
nsresult StartLoad(nsIURI* aURL, const char* aContentType,
nsIStreamListener*& aResult);
#endif
void ForceRefresh(void);
nsresult GetURL(nsIURL *&aURL);
#ifdef NECKO
nsresult GetURI(nsIURI* *aURI);
#else
nsresult GetURL(nsIURI *&aURL);
#endif
nsresult GetDocument(nsIDocument* *aDocument);
nsIWidget* mWindow;
nsIDocument* mDocument;
nsIContentViewerContainer* mContainer;
nsIURL* mURL;
#ifdef NECKO
nsIChannel* mChannel;
#else
nsIURI* mURL;
nsString mContentType;
#endif
pluginInstanceOwner *mOwner;
PRBool mEnableRendering;
};
@ -230,7 +254,11 @@ PluginViewerImpl::~PluginViewerImpl()
}
NS_IF_RELEASE(mDocument);
NS_IF_RELEASE(mContainer);
#ifdef NECKO
NS_IF_RELEASE(mChannel);
#else
NS_IF_RELEASE(mURL);
#endif
}
/*
@ -285,15 +313,33 @@ PluginViewerImpl::Init(nsNativeWidget aNativeParent,
}
nsresult
PluginViewerImpl::StartLoad(nsIURL* aURL, const char* aContentType,
#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);
#ifdef DEBUG
char* contentType;
mChannel->GetContentType(&contentType);
printf("PluginViewerImpl::StartLoad: content-type=%s\n", contentType);
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;
@ -333,13 +379,30 @@ 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;
char* spec;
rv = uri->GetSpec(&spec);
NS_RELEASE(uri);
if (NS_FAILED(rv)) return rv;
nsAutoString str(spec);
nsCRT::free(spec);
char* ct;
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;
}
@ -507,12 +570,19 @@ PluginViewerImpl::ForceRefresh()
mWindow->Invalidate(PR_TRUE);
}
nsresult PluginViewerImpl::GetURL(nsIURL *&aURL)
#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)
{
@ -540,17 +610,43 @@ PluginListener::~PluginListener()
NS_IMPL_ISUPPORTS(PluginListener, kIStreamListenerIID)
NS_IMETHODIMP
PluginListener::OnStartBinding(nsIURL* aURL, const char *aContentType)
#ifdef NECKO
PluginListener::OnStartBinding(nsISupports *ctxt)
#else
PluginListener::OnStartBinding(nsIURI* aURL, const char *contentType)
#endif
{
mViewer->StartLoad(aURL, aContentType, mNextStream);
#ifdef NECKO
nsresult rv;
nsIChannel* channel;
char* contentType = nsnull;
rv = ctxt->QueryInterface(nsIChannel::GetIID(), (void**)&channel);
if (NS_FAILED(rv)) return rv;
rv = channel->GetContentType(&contentType);
if (NS_FAILED(rv)) {
NS_RELEASE(channel);
return rv;
}
rv = mViewer->StartLoad(channel, mNextStream);
NS_RELEASE(channel);
if (NS_FAILED(rv)) return rv;
#else
mViewer->StartLoad(aURL, contentType, mNextStream);
#endif
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->OnStartBinding(aURL, aContentType);
#ifdef NECKO
return mNextStream->OnStartBinding(ctxt);
#else
return mNextStream->OnStartBinding(aURL, contentType);
#endif
}
#ifndef NECKO
NS_IMETHODIMP
PluginListener::OnProgress(nsIURL* aURL, PRUint32 aProgress,
PluginListener::OnProgress(nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax)
{
if (nsnull == mNextStream) {
@ -560,41 +656,60 @@ PluginListener::OnProgress(nsIURL* aURL, PRUint32 aProgress,
}
NS_IMETHODIMP
PluginListener::OnStatus(nsIURL* aURL, const PRUnichar* aMsg)
PluginListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->OnStatus(aURL, aMsg);
}
#endif
NS_IMETHODIMP
PluginListener::OnStopBinding(nsIURL* aURL, nsresult aStatus,
#ifdef NECKO
PluginListener::OnStopBinding(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg)
#else
PluginListener::OnStopBinding(nsIURI* aURL, nsresult aStatus,
const PRUnichar* aMsg)
#endif
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
#ifdef NECKO
return mNextStream->OnStopBinding(ctxt, status, errorMsg);
#else
return mNextStream->OnStopBinding(aURL, aStatus, aMsg);
#endif
}
#ifndef NECKO
NS_IMETHODIMP
PluginListener::GetBindInfo(nsIURL* aURL, nsStreamBindingInfo* aInfo)
PluginListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
{
if (nsnull == mNextStream) {
return NS_ERROR_FAILURE;
}
return mNextStream->GetBindInfo(aURL, aInfo);
}
#endif
NS_IMETHODIMP
PluginListener::OnDataAvailable(nsIURL* aURL, nsIInputStream* aStream,
#ifdef NECKO
PluginListener::OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *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(ctxt, inStr, sourceOffset, count);
#else
return mNextStream->OnDataAvailable(aURL, aStream, aCount);
#endif
}
//----------------------------------------------------------------------
@ -698,44 +813,37 @@ NS_IMETHODIMP pluginInstanceOwner :: GetURL(const char *aURL, const char *aTarge
if (NS_OK == rv)
{
nsIURL *url;
#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);
nsAutoString unitarget = nsAutoString(aTarget);
const char* spec;
(void)url->GetSpec(&spec);
nsAutoString base = nsAutoString(spec);
nsAutoString fullurl;
// Create an absolute URL
#ifndef NECKO
rv = NS_MakeAbsoluteURL(url, base, uniurl, fullurl);
#else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
nsIURI *baseUri = nsnull;
const char *uriStr = uniurl.GetBuffer();
rv = service->NewURI(uriStr, nsnull, &baseUri);
if (NS_FAILED(rv)) return rv;
char *absUrl = nsnull;
const char *urlSpec = base.GetBuffer();
rv = service->MakeAbsolute(urlSpec, baseUri, &absUrl);
NS_RELEASE(baseUri);
if (NS_FAILED(rv)) return rv;
fullurl = absUrl;
delete [] absUrl;
#endif // NECKO
if (NS_OK == rv)
rv = lh->OnLinkClick(nsnull, eLinkVerb_Replace, fullurl.GetUnicode(), unitarget.GetUnicode(), nsnull);
NS_RELEASE(url);
#endif
if (NS_OK == rv) {
nsAutoString unitarget = nsAutoString(aTarget);
rv = lh->OnLinkClick(nsnull, eLinkVerb_Replace, fullurl.GetUnicode(), unitarget.GetUnicode(), nsnull);
}
}
NS_RELEASE(lh);

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