support weak references in TestGtkEmbed's content listener (bug 191548). r=pavlov, sr=blizzard, a=asa.

This commit is contained in:
bryner%netscape.com 2003-02-06 20:59:30 +00:00
Родитель 124aa40bf5
Коммит 5a26c66ccf
3 изменённых файлов: 7 добавлений и 4 удалений

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

@ -36,8 +36,9 @@ EmbedContentListener::~EmbedContentListener()
{
}
NS_IMPL_ISUPPORTS1(EmbedContentListener,
nsIURIContentListener)
NS_IMPL_ISUPPORTS2(EmbedContentListener,
nsIURIContentListener,
nsISupportsWeakReference)
nsresult
EmbedContentListener::Init(EmbedPrivate *aOwner)

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

@ -23,10 +23,12 @@
#define __EmbedContentListener_h
#include <nsIURIContentListener.h>
#include <nsWeakReference.h>
class EmbedPrivate;
class EmbedContentListener : public nsIURIContentListener
class EmbedContentListener : public nsIURIContentListener,
public nsSupportsWeakReference
{
public:

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

@ -136,7 +136,7 @@ EmbedPrivate::Init(GtkMozEmbed *aOwningWidget)
// It is assumed that this will be destroyed when we go out of
// scope.
mContentListener = new EmbedContentListener();
mContentListenerGuard = mContentListener;
mContentListenerGuard = NS_STATIC_CAST(nsISupports*, NS_STATIC_CAST(nsIURIContentListener*, mContentListener));
mContentListener->Init(this);
// Create our key listener object and initialize it. It is assumed