From 30537acb3474e9c532cb427269e32dc080fd01cc Mon Sep 17 00:00:00 2001 From: "sfraser%netscape.com" Date: Tue, 9 May 2000 19:04:13 +0000 Subject: [PATCH] Make nsEventStateManger support nsIWeakReference, so that they are not held onto as XPCOM observers. r=saari git-svn-id: svn://10.0.0.236/trunk@68861 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/events/src/nsEventStateManager.cpp | 2 +- mozilla/content/events/src/nsEventStateManager.h | 4 +++- mozilla/layout/events/src/nsEventStateManager.cpp | 2 +- mozilla/layout/events/src/nsEventStateManager.h | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mozilla/content/events/src/nsEventStateManager.cpp b/mozilla/content/events/src/nsEventStateManager.cpp index af591cbf453..9d515635c58 100644 --- a/mozilla/content/events/src/nsEventStateManager.cpp +++ b/mozilla/content/events/src/nsEventStateManager.cpp @@ -229,7 +229,7 @@ nsEventStateManager::Observe(nsISupports *aSubject, const PRUnichar *aTopic, } -NS_IMPL_ISUPPORTS1(nsEventStateManager, nsIEventStateManager) +NS_IMPL_ISUPPORTS3(nsEventStateManager, nsIEventStateManager, nsIObserver, nsISupportsWeakReference) NS_IMETHODIMP nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext, diff --git a/mozilla/content/events/src/nsEventStateManager.h b/mozilla/content/events/src/nsEventStateManager.h index da3b26091c0..da5907b26aa 100644 --- a/mozilla/content/events/src/nsEventStateManager.h +++ b/mozilla/content/events/src/nsEventStateManager.h @@ -28,6 +28,7 @@ #include "nsIContent.h" #include "nsIPref.h" #include "nsIObserver.h" +#include "nsWeakReference.h" class nsIDocument; class nsIScrollableView; @@ -37,7 +38,8 @@ class nsISelfScrollingFrame; * Event listener manager */ -class nsEventStateManager : public nsIEventStateManager, +class nsEventStateManager : public nsSupportsWeakReference, + public nsIEventStateManager, public nsIObserver { diff --git a/mozilla/layout/events/src/nsEventStateManager.cpp b/mozilla/layout/events/src/nsEventStateManager.cpp index af591cbf453..9d515635c58 100644 --- a/mozilla/layout/events/src/nsEventStateManager.cpp +++ b/mozilla/layout/events/src/nsEventStateManager.cpp @@ -229,7 +229,7 @@ nsEventStateManager::Observe(nsISupports *aSubject, const PRUnichar *aTopic, } -NS_IMPL_ISUPPORTS1(nsEventStateManager, nsIEventStateManager) +NS_IMPL_ISUPPORTS3(nsEventStateManager, nsIEventStateManager, nsIObserver, nsISupportsWeakReference) NS_IMETHODIMP nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext, diff --git a/mozilla/layout/events/src/nsEventStateManager.h b/mozilla/layout/events/src/nsEventStateManager.h index da3b26091c0..da5907b26aa 100644 --- a/mozilla/layout/events/src/nsEventStateManager.h +++ b/mozilla/layout/events/src/nsEventStateManager.h @@ -28,6 +28,7 @@ #include "nsIContent.h" #include "nsIPref.h" #include "nsIObserver.h" +#include "nsWeakReference.h" class nsIDocument; class nsIScrollableView; @@ -37,7 +38,8 @@ class nsISelfScrollingFrame; * Event listener manager */ -class nsEventStateManager : public nsIEventStateManager, +class nsEventStateManager : public nsSupportsWeakReference, + public nsIEventStateManager, public nsIObserver {