bug 821593 - cycle collect and wrapper cache nsDOMCSSRGBColor r=bz

This commit is contained in:
Trevor Saunders 2012-12-14 01:40:52 -05:00
parent f66d567a5c
commit 3bce9597b9
2 changed files with 12 additions and 5 deletions

View File

@ -29,15 +29,17 @@ nsDOMCSSRGBColor::~nsDOMCSSRGBColor(void)
DOMCI_DATA(CSSRGBColor, nsDOMCSSRGBColor)
NS_INTERFACE_MAP_BEGIN(nsDOMCSSRGBColor)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMCSSRGBColor)
NS_INTERFACE_MAP_ENTRY(nsIDOMRGBColor)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSRGBAColor)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CSSRGBColor)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_END
NS_IMPL_ADDREF(nsDOMCSSRGBColor)
NS_IMPL_RELEASE(nsDOMCSSRGBColor)
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_4(nsDOMCSSRGBColor, mAlpha, mBlue, mGreen, mRed)
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMCSSRGBColor)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMCSSRGBColor)
NS_IMETHODIMP

View File

@ -11,10 +11,13 @@
#include "nsAutoPtr.h"
#include "nsISupports.h"
#include "nsIDOMNSRGBAColor.h"
#include "nsWrapperCache.h"
class nsROCSSPrimitiveValue;
class nsDOMCSSRGBColor : public nsIDOMNSRGBAColor {
class nsDOMCSSRGBColor : public nsIDOMNSRGBAColor,
public nsWrapperCache
{
public:
nsDOMCSSRGBColor(nsROCSSPrimitiveValue* aRed,
nsROCSSPrimitiveValue* aGreen,
@ -24,10 +27,12 @@ public:
virtual ~nsDOMCSSRGBColor(void);
NS_DECL_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_NSIDOMRGBCOLOR
NS_DECL_NSIDOMNSRGBACOLOR
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMCSSRGBColor)
bool HasAlpha() const { return mHasAlpha; }
// RGBColor webidl interface