Changed interfaces to take nsISupports for the container instead of nsIContentViewerContainer. nsXULDocument was for some reason holding on to this interface (as a weak reference) but was never using it. I have therefore gotten rid of this member variable. r=dp

This commit is contained in:
tbogard%aol.net 1999-11-15 22:14:37 +00:00
Родитель ff926654b9
Коммит 4fffbc4bf8
4 изменённых файлов: 16 добавлений и 30 удалений

Просмотреть файл

@ -216,7 +216,6 @@ nsXULDocument::nsXULDocument(void)
mScriptObject(nsnull), mScriptObject(nsnull),
mCharSetID("UTF-8"), mCharSetID("UTF-8"),
mDisplaySelection(PR_FALSE), mDisplaySelection(PR_FALSE),
mContentViewerContainer(nsnull),
mIsPopup(PR_FALSE), mIsPopup(PR_FALSE),
mForwardReferencesResolved(PR_FALSE), mForwardReferencesResolved(PR_FALSE),
mState(eState_Master) mState(eState_Master)
@ -516,7 +515,7 @@ NS_IMETHODIMP
nsXULDocument::StartDocumentLoad(const char* aCommand, nsXULDocument::StartDocumentLoad(const char* aCommand,
nsIChannel* aChannel, nsIChannel* aChannel,
nsILoadGroup* aLoadGroup, nsILoadGroup* aLoadGroup,
nsIContentViewerContainer* aContainer, nsISupports* aContainer,
nsIStreamListener **aDocListener) nsIStreamListener **aDocListener)
{ {
nsresult rv; nsresult rv;
@ -1886,12 +1885,11 @@ NS_IMETHODIMP
nsXULDocument::CreateFromPrototype(const char* aCommand, nsXULDocument::CreateFromPrototype(const char* aCommand,
nsIXULPrototypeDocument* aPrototype, nsIXULPrototypeDocument* aPrototype,
nsIPrincipal* aPrincipal, nsIPrincipal* aPrincipal,
nsIContentViewerContainer* aContainer) nsISupports* aContainer)
{ {
nsresult rv; nsresult rv;
mCurrentPrototype = aPrototype; mCurrentPrototype = aPrototype;
mContentViewerContainer = aContainer;
mDocumentPrincipal = aPrincipal; mDocumentPrincipal = aPrincipal;
rv = mCurrentPrototype->GetURI(getter_AddRefs(mDocumentURL)); rv = mCurrentPrototype->GetURI(getter_AddRefs(mDocumentURL));
@ -1920,7 +1918,7 @@ nsXULDocument::CreateFromPrototype(const char* aCommand,
NS_IMETHODIMP NS_IMETHODIMP
nsXULDocument::LoadFromStream(nsIInputStream& xulStream, nsXULDocument::LoadFromStream(nsIInputStream& xulStream,
nsIContentViewerContainer* aContainer, nsISupports* aContainer,
const char* aCommand) const char* aCommand)
{ {
nsresult rv; nsresult rv;
@ -3792,7 +3790,7 @@ nsXULDocument::CreateElement(PRInt32 aNameSpaceID,
nsresult nsresult
nsXULDocument::PrepareToLoad(nsIContentViewerContainer* aContainer, nsXULDocument::PrepareToLoad(nsISupports* aContainer,
const char* aCommand, const char* aCommand,
nsIChannel* aChannel, nsIChannel* aChannel,
nsILoadGroup* aLoadGroup, nsILoadGroup* aLoadGroup,
@ -3819,10 +3817,6 @@ nsXULDocument::PrepareToLoad(nsIContentViewerContainer* aContainer,
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
} }
// Set the content viewer container. Note that we'll only hold a
// weak reference to it.
mContentViewerContainer = aContainer;
mDocumentTitle.Truncate(); mDocumentTitle.Truncate();
// Get the document's principal // Get the document's principal

Просмотреть файл

@ -104,7 +104,7 @@ public:
NS_IMETHOD StartDocumentLoad(const char* aCommand, NS_IMETHOD StartDocumentLoad(const char* aCommand,
nsIChannel* aChannel, nsIChannel* aChannel,
nsILoadGroup* aLoadGroup, nsILoadGroup* aLoadGroup,
nsIContentViewerContainer* aContainer, nsISupports* aContainer,
nsIStreamListener **aDocListener); nsIStreamListener **aDocListener);
virtual const nsString* GetDocumentTitle() const; virtual const nsString* GetDocumentTitle() const;
@ -281,11 +281,11 @@ public:
NS_IMETHOD CreateFromPrototype(const char* aCommand, NS_IMETHOD CreateFromPrototype(const char* aCommand,
nsIXULPrototypeDocument* aPrototype, nsIXULPrototypeDocument* aPrototype,
nsIPrincipal* aPrincipal, nsIPrincipal* aPrincipal,
nsIContentViewerContainer* aContainer); nsISupports* aContainer);
// nsIStreamLoadableDocument interface // nsIStreamLoadableDocument interface
NS_IMETHOD LoadFromStream(nsIInputStream& xulStream, NS_IMETHOD LoadFromStream(nsIInputStream& xulStream,
nsIContentViewerContainer* aContainer, nsISupports* aContainer,
const char* aCommand ); const char* aCommand );
// nsIDOMEventCapturer interface // nsIDOMEventCapturer interface
@ -419,7 +419,7 @@ protected:
nsIAtom* aTag, nsIAtom* aTag,
nsIContent** aResult); nsIContent** aResult);
nsresult PrepareToLoad(nsIContentViewerContainer* aContainer, nsresult PrepareToLoad(nsISupports* aContainer,
const char* aCommand, const char* aCommand,
nsIChannel* aChannel, nsIChannel* aChannel,
nsILoadGroup* aLoadGroup, nsILoadGroup* aLoadGroup,
@ -512,7 +512,6 @@ protected:
nsCOMPtr<nsIRDFDataSource> mLocalStore; nsCOMPtr<nsIRDFDataSource> mLocalStore;
nsCOMPtr<nsILineBreaker> mLineBreaker; // [OWNER] nsCOMPtr<nsILineBreaker> mLineBreaker; // [OWNER]
nsCOMPtr<nsIWordBreaker> mWordBreaker; // [OWNER] nsCOMPtr<nsIWordBreaker> mWordBreaker; // [OWNER]
nsIContentViewerContainer* mContentViewerContainer; // [WEAK] it owns me! (indirectly)
nsString mCommand; nsString mCommand;
nsVoidArray mSubDocuments; // [OWNER] of subelements nsVoidArray mSubDocuments; // [OWNER] of subelements
PRBool mIsPopup; PRBool mIsPopup;

Просмотреть файл

@ -216,7 +216,6 @@ nsXULDocument::nsXULDocument(void)
mScriptObject(nsnull), mScriptObject(nsnull),
mCharSetID("UTF-8"), mCharSetID("UTF-8"),
mDisplaySelection(PR_FALSE), mDisplaySelection(PR_FALSE),
mContentViewerContainer(nsnull),
mIsPopup(PR_FALSE), mIsPopup(PR_FALSE),
mForwardReferencesResolved(PR_FALSE), mForwardReferencesResolved(PR_FALSE),
mState(eState_Master) mState(eState_Master)
@ -516,7 +515,7 @@ NS_IMETHODIMP
nsXULDocument::StartDocumentLoad(const char* aCommand, nsXULDocument::StartDocumentLoad(const char* aCommand,
nsIChannel* aChannel, nsIChannel* aChannel,
nsILoadGroup* aLoadGroup, nsILoadGroup* aLoadGroup,
nsIContentViewerContainer* aContainer, nsISupports* aContainer,
nsIStreamListener **aDocListener) nsIStreamListener **aDocListener)
{ {
nsresult rv; nsresult rv;
@ -1886,12 +1885,11 @@ NS_IMETHODIMP
nsXULDocument::CreateFromPrototype(const char* aCommand, nsXULDocument::CreateFromPrototype(const char* aCommand,
nsIXULPrototypeDocument* aPrototype, nsIXULPrototypeDocument* aPrototype,
nsIPrincipal* aPrincipal, nsIPrincipal* aPrincipal,
nsIContentViewerContainer* aContainer) nsISupports* aContainer)
{ {
nsresult rv; nsresult rv;
mCurrentPrototype = aPrototype; mCurrentPrototype = aPrototype;
mContentViewerContainer = aContainer;
mDocumentPrincipal = aPrincipal; mDocumentPrincipal = aPrincipal;
rv = mCurrentPrototype->GetURI(getter_AddRefs(mDocumentURL)); rv = mCurrentPrototype->GetURI(getter_AddRefs(mDocumentURL));
@ -1920,7 +1918,7 @@ nsXULDocument::CreateFromPrototype(const char* aCommand,
NS_IMETHODIMP NS_IMETHODIMP
nsXULDocument::LoadFromStream(nsIInputStream& xulStream, nsXULDocument::LoadFromStream(nsIInputStream& xulStream,
nsIContentViewerContainer* aContainer, nsISupports* aContainer,
const char* aCommand) const char* aCommand)
{ {
nsresult rv; nsresult rv;
@ -3792,7 +3790,7 @@ nsXULDocument::CreateElement(PRInt32 aNameSpaceID,
nsresult nsresult
nsXULDocument::PrepareToLoad(nsIContentViewerContainer* aContainer, nsXULDocument::PrepareToLoad(nsISupports* aContainer,
const char* aCommand, const char* aCommand,
nsIChannel* aChannel, nsIChannel* aChannel,
nsILoadGroup* aLoadGroup, nsILoadGroup* aLoadGroup,
@ -3819,10 +3817,6 @@ nsXULDocument::PrepareToLoad(nsIContentViewerContainer* aContainer,
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
} }
// Set the content viewer container. Note that we'll only hold a
// weak reference to it.
mContentViewerContainer = aContainer;
mDocumentTitle.Truncate(); mDocumentTitle.Truncate();
// Get the document's principal // Get the document's principal

Просмотреть файл

@ -104,7 +104,7 @@ public:
NS_IMETHOD StartDocumentLoad(const char* aCommand, NS_IMETHOD StartDocumentLoad(const char* aCommand,
nsIChannel* aChannel, nsIChannel* aChannel,
nsILoadGroup* aLoadGroup, nsILoadGroup* aLoadGroup,
nsIContentViewerContainer* aContainer, nsISupports* aContainer,
nsIStreamListener **aDocListener); nsIStreamListener **aDocListener);
virtual const nsString* GetDocumentTitle() const; virtual const nsString* GetDocumentTitle() const;
@ -281,11 +281,11 @@ public:
NS_IMETHOD CreateFromPrototype(const char* aCommand, NS_IMETHOD CreateFromPrototype(const char* aCommand,
nsIXULPrototypeDocument* aPrototype, nsIXULPrototypeDocument* aPrototype,
nsIPrincipal* aPrincipal, nsIPrincipal* aPrincipal,
nsIContentViewerContainer* aContainer); nsISupports* aContainer);
// nsIStreamLoadableDocument interface // nsIStreamLoadableDocument interface
NS_IMETHOD LoadFromStream(nsIInputStream& xulStream, NS_IMETHOD LoadFromStream(nsIInputStream& xulStream,
nsIContentViewerContainer* aContainer, nsISupports* aContainer,
const char* aCommand ); const char* aCommand );
// nsIDOMEventCapturer interface // nsIDOMEventCapturer interface
@ -419,7 +419,7 @@ protected:
nsIAtom* aTag, nsIAtom* aTag,
nsIContent** aResult); nsIContent** aResult);
nsresult PrepareToLoad(nsIContentViewerContainer* aContainer, nsresult PrepareToLoad(nsISupports* aContainer,
const char* aCommand, const char* aCommand,
nsIChannel* aChannel, nsIChannel* aChannel,
nsILoadGroup* aLoadGroup, nsILoadGroup* aLoadGroup,
@ -512,7 +512,6 @@ protected:
nsCOMPtr<nsIRDFDataSource> mLocalStore; nsCOMPtr<nsIRDFDataSource> mLocalStore;
nsCOMPtr<nsILineBreaker> mLineBreaker; // [OWNER] nsCOMPtr<nsILineBreaker> mLineBreaker; // [OWNER]
nsCOMPtr<nsIWordBreaker> mWordBreaker; // [OWNER] nsCOMPtr<nsIWordBreaker> mWordBreaker; // [OWNER]
nsIContentViewerContainer* mContentViewerContainer; // [WEAK] it owns me! (indirectly)
nsString mCommand; nsString mCommand;
nsVoidArray mSubDocuments; // [OWNER] of subelements nsVoidArray mSubDocuments; // [OWNER] of subelements
PRBool mIsPopup; PRBool mIsPopup;