From 91c636798605e243ec9d7dde5f8a1316f023835a Mon Sep 17 00:00:00 2001 From: "rpotts%netscape.com" Date: Thu, 1 Oct 1998 21:43:02 +0000 Subject: [PATCH] Added GetDocumentURLGroup() methodnsIDocument.h --- content/base/public/nsIDocument.h | 6 ++++++ content/base/src/nsDocument.cpp | 9 +++++++++ layout/base/public/nsIDocument.h | 6 ++++++ layout/base/src/nsDocument.cpp | 9 +++++++++ 4 files changed, 30 insertions(+) diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index 0bd6789a0f13..32830e65b024 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -36,6 +36,7 @@ class nsIStreamObserver; class nsIStyleSet; class nsIStyleSheet; class nsIURL; +class nsIURLGroup; class nsIViewManager; class nsString; class nsIScriptContextOwner; @@ -88,6 +89,11 @@ public: */ virtual nsIURL* GetDocumentURL() const = 0; + /** + * Return the URLGroup for the document. May return null. + */ + virtual nsIURLGroup* GetDocumentURLGroup() const = 0; + /** * Return a standard name for the document's character set. This will * trigger a startDocumentLoad if necessary to answer the question. diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 3405b5ba1723..c4b899c90de9 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -20,6 +20,7 @@ #include "nsDocument.h" #include "nsIArena.h" #include "nsIURL.h" +#include "nsIURLGroup.h" #include "nsString.h" #include "nsIContent.h" #include "nsIStyleSet.h" @@ -146,6 +147,7 @@ nsDocument::nsDocument() mArena = nsnull; mDocumentTitle = nsnull; mDocumentURL = nsnull; + mDocumentURLGroup = nsnull; mCharacterSet = eCharSetID_IsoLatin1; mParentDocument = nsnull; mRootContent = nsnull; @@ -180,6 +182,7 @@ nsDocument::~nsDocument() mDocumentTitle = nsnull; } NS_IF_RELEASE(mDocumentURL); + NS_IF_RELEASE(mDocumentURLGroup); mParentDocument = nsnull; @@ -288,6 +291,12 @@ nsIURL* nsDocument::GetDocumentURL() const return mDocumentURL; } +nsIURLGroup* nsDocument::GetDocumentURLGroup() const +{ + NS_IF_ADDREF(mDocumentURLGroup); + return mDocumentURLGroup; +} + nsCharSetID nsDocument::GetDocumentCharacterSet() const { return mCharacterSet; diff --git a/layout/base/public/nsIDocument.h b/layout/base/public/nsIDocument.h index 0bd6789a0f13..32830e65b024 100644 --- a/layout/base/public/nsIDocument.h +++ b/layout/base/public/nsIDocument.h @@ -36,6 +36,7 @@ class nsIStreamObserver; class nsIStyleSet; class nsIStyleSheet; class nsIURL; +class nsIURLGroup; class nsIViewManager; class nsString; class nsIScriptContextOwner; @@ -88,6 +89,11 @@ public: */ virtual nsIURL* GetDocumentURL() const = 0; + /** + * Return the URLGroup for the document. May return null. + */ + virtual nsIURLGroup* GetDocumentURLGroup() const = 0; + /** * Return a standard name for the document's character set. This will * trigger a startDocumentLoad if necessary to answer the question. diff --git a/layout/base/src/nsDocument.cpp b/layout/base/src/nsDocument.cpp index 3405b5ba1723..c4b899c90de9 100644 --- a/layout/base/src/nsDocument.cpp +++ b/layout/base/src/nsDocument.cpp @@ -20,6 +20,7 @@ #include "nsDocument.h" #include "nsIArena.h" #include "nsIURL.h" +#include "nsIURLGroup.h" #include "nsString.h" #include "nsIContent.h" #include "nsIStyleSet.h" @@ -146,6 +147,7 @@ nsDocument::nsDocument() mArena = nsnull; mDocumentTitle = nsnull; mDocumentURL = nsnull; + mDocumentURLGroup = nsnull; mCharacterSet = eCharSetID_IsoLatin1; mParentDocument = nsnull; mRootContent = nsnull; @@ -180,6 +182,7 @@ nsDocument::~nsDocument() mDocumentTitle = nsnull; } NS_IF_RELEASE(mDocumentURL); + NS_IF_RELEASE(mDocumentURLGroup); mParentDocument = nsnull; @@ -288,6 +291,12 @@ nsIURL* nsDocument::GetDocumentURL() const return mDocumentURL; } +nsIURLGroup* nsDocument::GetDocumentURLGroup() const +{ + NS_IF_ADDREF(mDocumentURLGroup); + return mDocumentURLGroup; +} + nsCharSetID nsDocument::GetDocumentCharacterSet() const { return mCharacterSet;