diff --git a/layout/style/nsDOMCSSRGBColor.cpp b/layout/style/nsDOMCSSRGBColor.cpp index 11963f1fd082..ad936edf36fd 100644 --- a/layout/style/nsDOMCSSRGBColor.cpp +++ b/layout/style/nsDOMCSSRGBColor.cpp @@ -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 diff --git a/layout/style/nsDOMCSSRGBColor.h b/layout/style/nsDOMCSSRGBColor.h index bd2f8de27d4e..e78921c7dd24 100644 --- a/layout/style/nsDOMCSSRGBColor.h +++ b/layout/style/nsDOMCSSRGBColor.h @@ -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