Bug 393566, add cycle collection to XULPopupListener, r+sr=peterv, a=dbaron

This commit is contained in:
enndeakin@sympatico.ca 2007-09-04 08:26:35 -07:00
Родитель ab52583d91
Коммит 632db9c8e4
2 изменённых файлов: 9 добавлений и 7 удалений

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

@ -96,11 +96,11 @@ nsXULPopupListener::~nsXULPopupListener(void)
ClosePopup();
}
NS_IMPL_ADDREF(nsXULPopupListener)
NS_IMPL_RELEASE(nsXULPopupListener)
NS_IMPL_CYCLE_COLLECTION_2(nsXULPopupListener, mElement, mPopupContent);
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsXULPopupListener)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsXULPopupListener)
NS_INTERFACE_MAP_BEGIN(nsXULPopupListener)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsXULPopupListener)
NS_INTERFACE_MAP_ENTRY(nsIDOMMouseListener)
NS_INTERFACE_MAP_ENTRY(nsIDOMContextMenuListener)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEventListener, nsIDOMMouseListener)

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

@ -54,6 +54,7 @@
#include "nsIFrame.h"
#include "nsIDOMMouseListener.h"
#include "nsIDOMContextMenuListener.h"
#include "nsCycleCollectionParticipant.h"
class nsXULPopupListener : public nsIDOMMouseListener,
public nsIDOMContextMenuListener
@ -66,9 +67,10 @@ public:
nsXULPopupListener(nsIDOMElement *aElement, PRBool aIsContext);
virtual ~nsXULPopupListener(void);
public:
// nsISupports
NS_DECL_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULPopupListener,
nsIDOMMouseListener)
// nsIDOMMouseListener
NS_IMETHOD MouseDown(nsIDOMEvent* aMouseEvent);
@ -104,7 +106,7 @@ private:
nsresult FireFocusOnTargetContent(nsIDOMNode* aTargetNode);
// |mElement| is the node to which this listener is attached.
nsIDOMElement* mElement; // Weak ref. The element will go away first.
nsCOMPtr<nsIDOMElement> mElement;
// The popup that is getting shown on top of mElement.
nsCOMPtr<nsIContent> mPopupContent;