From 87b8e4a5747d6d405b444743a56ef5bb2cf3b57a Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Fri, 5 Nov 1999 05:31:15 +0000 Subject: [PATCH] Bug 18058. Remove 'commandDispatcher' from interface; obsolete, and leaky. r=hyatt, a=chofmann --- content/xul/document/src/nsXULControllers.cpp | 21 +------------------ content/xul/document/src/nsXULDocument.cpp | 19 ++++++++++------- rdf/content/src/nsXULControllers.cpp | 21 +------------------ rdf/content/src/nsXULDocument.cpp | 19 ++++++++++------- 4 files changed, 24 insertions(+), 56 deletions(-) diff --git a/content/xul/document/src/nsXULControllers.cpp b/content/xul/document/src/nsXULControllers.cpp index 71431696a623..5ccdebde0c59 100644 --- a/content/xul/document/src/nsXULControllers.cpp +++ b/content/xul/document/src/nsXULControllers.cpp @@ -26,7 +26,6 @@ #include "nsISupportsArray.h" #include "nsIDOMElement.h" -#include "nsIDOMXULCommandDispatcher.h" #include "nsIXULCommandDispatcher.h" #include "nsIDOMFocusListener.h" #include "nsRDFCID.h" @@ -76,13 +75,12 @@ public: protected: nsISupportsArray* mControllers; - nsIDOMXULCommandDispatcher* mCommandDispatcher; }; //////////////////////////////////////////////////////////////////////// XULControllersImpl::XULControllersImpl(void) : - mControllers(nsnull), mCommandDispatcher(nsnull) + mControllers(nsnull) { NS_INIT_REFCNT(); } @@ -90,7 +88,6 @@ XULControllersImpl::XULControllersImpl(void) : XULControllersImpl::~XULControllersImpl(void) { NS_IF_RELEASE(mControllers); - NS_IF_RELEASE(mCommandDispatcher); } NS_IMPL_ADDREF(XULControllersImpl) @@ -118,22 +115,6 @@ XULControllersImpl::QueryInterface(REFNSIID iid, void** result) } - /* attribute nsIDOMXULCommandDispatcher commandDispatcher; */ - NS_IMETHODIMP XULControllersImpl::GetCommandDispatcher(nsIDOMXULCommandDispatcher * *aCommandDispatcher) - { - NS_IF_ADDREF(mCommandDispatcher); - *aCommandDispatcher = mCommandDispatcher; - return NS_OK; - } - - NS_IMETHODIMP XULControllersImpl::SetCommandDispatcher(nsIDOMXULCommandDispatcher * aCommandDispatcher) - { - NS_IF_RELEASE(mCommandDispatcher); - mCommandDispatcher = aCommandDispatcher; - NS_IF_ADDREF(mCommandDispatcher); - return NS_OK; - } - /* boolean SupportsCommand (in string command); */ NS_IMETHODIMP XULControllersImpl::GetControllerForCommand(const PRUnichar *command, nsIController** _retval) { diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index b9892f8ced4a..05fef4b7b675 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -4244,12 +4244,15 @@ nsXULDocument::AddChromeOverlays() if (NS_FAILED(rv)) return NS_ERROR_FAILURE; - nsCOMPtr uri; - rv = mCurrentPrototype->GetURI(getter_AddRefs(uri)); - if (NS_FAILED(rv)) return rv; - nsCOMPtr oe; - reg->GetOverlays(uri, getter_AddRefs(oe)); + + { + nsCOMPtr uri; + rv = mCurrentPrototype->GetURI(getter_AddRefs(uri)); + if (NS_FAILED(rv)) return rv; + + reg->GetOverlays(uri, getter_AddRefs(oe)); + } if (!oe) return NS_OK; @@ -4520,7 +4523,7 @@ nsXULDocument::ResumeWalk() nsTime finish = PR_Now(); nsInt64 diff64 = finish - mLoadStart; PRInt32 diff = PRInt32(diff64 / nsInt64(1000)); - printf("***** XUL document loaded in %ldmsec\n", diff); + printf("***** XUL document loaded in %dmsec\n", diff); } #endif @@ -4545,13 +4548,13 @@ nsXULDocument::ResumeWalk() nsTime finish = PR_Now(); nsInt64 diff64 = finish - mLoadStart; PRInt32 diff = PRInt32(diff64 / nsInt64(1000)); - printf("***** XUL document flowed in %ldmsec\n", diff); + printf("***** XUL document flowed in %dmsec\n", diff); } { nsInt64 now(PR_Now()); now /= nsInt64(1000); - printf("### ResumeWalk complete %ld\n", PRInt32(now)); + printf("### ResumeWalk complete %d\n", PRInt32(now)); } #endif diff --git a/rdf/content/src/nsXULControllers.cpp b/rdf/content/src/nsXULControllers.cpp index 71431696a623..5ccdebde0c59 100644 --- a/rdf/content/src/nsXULControllers.cpp +++ b/rdf/content/src/nsXULControllers.cpp @@ -26,7 +26,6 @@ #include "nsISupportsArray.h" #include "nsIDOMElement.h" -#include "nsIDOMXULCommandDispatcher.h" #include "nsIXULCommandDispatcher.h" #include "nsIDOMFocusListener.h" #include "nsRDFCID.h" @@ -76,13 +75,12 @@ public: protected: nsISupportsArray* mControllers; - nsIDOMXULCommandDispatcher* mCommandDispatcher; }; //////////////////////////////////////////////////////////////////////// XULControllersImpl::XULControllersImpl(void) : - mControllers(nsnull), mCommandDispatcher(nsnull) + mControllers(nsnull) { NS_INIT_REFCNT(); } @@ -90,7 +88,6 @@ XULControllersImpl::XULControllersImpl(void) : XULControllersImpl::~XULControllersImpl(void) { NS_IF_RELEASE(mControllers); - NS_IF_RELEASE(mCommandDispatcher); } NS_IMPL_ADDREF(XULControllersImpl) @@ -118,22 +115,6 @@ XULControllersImpl::QueryInterface(REFNSIID iid, void** result) } - /* attribute nsIDOMXULCommandDispatcher commandDispatcher; */ - NS_IMETHODIMP XULControllersImpl::GetCommandDispatcher(nsIDOMXULCommandDispatcher * *aCommandDispatcher) - { - NS_IF_ADDREF(mCommandDispatcher); - *aCommandDispatcher = mCommandDispatcher; - return NS_OK; - } - - NS_IMETHODIMP XULControllersImpl::SetCommandDispatcher(nsIDOMXULCommandDispatcher * aCommandDispatcher) - { - NS_IF_RELEASE(mCommandDispatcher); - mCommandDispatcher = aCommandDispatcher; - NS_IF_ADDREF(mCommandDispatcher); - return NS_OK; - } - /* boolean SupportsCommand (in string command); */ NS_IMETHODIMP XULControllersImpl::GetControllerForCommand(const PRUnichar *command, nsIController** _retval) { diff --git a/rdf/content/src/nsXULDocument.cpp b/rdf/content/src/nsXULDocument.cpp index b9892f8ced4a..05fef4b7b675 100644 --- a/rdf/content/src/nsXULDocument.cpp +++ b/rdf/content/src/nsXULDocument.cpp @@ -4244,12 +4244,15 @@ nsXULDocument::AddChromeOverlays() if (NS_FAILED(rv)) return NS_ERROR_FAILURE; - nsCOMPtr uri; - rv = mCurrentPrototype->GetURI(getter_AddRefs(uri)); - if (NS_FAILED(rv)) return rv; - nsCOMPtr oe; - reg->GetOverlays(uri, getter_AddRefs(oe)); + + { + nsCOMPtr uri; + rv = mCurrentPrototype->GetURI(getter_AddRefs(uri)); + if (NS_FAILED(rv)) return rv; + + reg->GetOverlays(uri, getter_AddRefs(oe)); + } if (!oe) return NS_OK; @@ -4520,7 +4523,7 @@ nsXULDocument::ResumeWalk() nsTime finish = PR_Now(); nsInt64 diff64 = finish - mLoadStart; PRInt32 diff = PRInt32(diff64 / nsInt64(1000)); - printf("***** XUL document loaded in %ldmsec\n", diff); + printf("***** XUL document loaded in %dmsec\n", diff); } #endif @@ -4545,13 +4548,13 @@ nsXULDocument::ResumeWalk() nsTime finish = PR_Now(); nsInt64 diff64 = finish - mLoadStart; PRInt32 diff = PRInt32(diff64 / nsInt64(1000)); - printf("***** XUL document flowed in %ldmsec\n", diff); + printf("***** XUL document flowed in %dmsec\n", diff); } { nsInt64 now(PR_Now()); now /= nsInt64(1000); - printf("### ResumeWalk complete %ld\n", PRInt32(now)); + printf("### ResumeWalk complete %d\n", PRInt32(now)); } #endif