diff --git a/content/svg/content/src/nsSVGAngle.cpp b/content/svg/content/src/nsSVGAngle.cpp index b296eca06a0d..5f0d22d0509f 100644 --- a/content/svg/content/src/nsSVGAngle.cpp +++ b/content/svg/content/src/nsSVGAngle.cpp @@ -88,31 +88,37 @@ private: nsSVGAngle mVal; }; -NS_IMPL_ADDREF(nsSVGAngle::DOMBaseVal) -NS_IMPL_RELEASE(nsSVGAngle::DOMBaseVal) +NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGAngle::DOMBaseVal, mSVGElement) -NS_IMPL_ADDREF(nsSVGAngle::DOMAnimVal) -NS_IMPL_RELEASE(nsSVGAngle::DOMAnimVal) +NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGAngle::DOMAnimVal, mSVGElement) -NS_IMPL_ADDREF(nsSVGAngle::DOMAnimatedAngle) -NS_IMPL_RELEASE(nsSVGAngle::DOMAnimatedAngle) +NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGAngle::DOMAnimatedAngle, mSVGElement) + +NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGAngle::DOMBaseVal) +NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGAngle::DOMBaseVal) + +NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGAngle::DOMAnimVal) +NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGAngle::DOMAnimVal) + +NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGAngle::DOMAnimatedAngle) +NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGAngle::DOMAnimatedAngle) NS_IMPL_ADDREF(DOMSVGAngle) NS_IMPL_RELEASE(DOMSVGAngle) -NS_INTERFACE_MAP_BEGIN(nsSVGAngle::DOMBaseVal) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGAngle::DOMBaseVal) NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAngle) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAngle) NS_INTERFACE_MAP_END -NS_INTERFACE_MAP_BEGIN(nsSVGAngle::DOMAnimVal) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGAngle::DOMAnimVal) NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAngle) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAngle) NS_INTERFACE_MAP_END -NS_INTERFACE_MAP_BEGIN(nsSVGAngle::DOMAnimatedAngle) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGAngle::DOMAnimatedAngle) NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedAngle) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedAngle) diff --git a/content/svg/content/src/nsSVGAngle.h b/content/svg/content/src/nsSVGAngle.h index 5e738eba9201..5dbfeb9e605b 100644 --- a/content/svg/content/src/nsSVGAngle.h +++ b/content/svg/content/src/nsSVGAngle.h @@ -93,7 +93,8 @@ private: struct DOMBaseVal : public nsIDOMSVGAngle { - NS_DECL_ISUPPORTS + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_CLASS(DOMBaseVal) DOMBaseVal(nsSVGAngle* aVal, nsSVGElement *aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} @@ -132,7 +133,8 @@ private: struct DOMAnimVal : public nsIDOMSVGAngle { - NS_DECL_ISUPPORTS + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimVal) DOMAnimVal(nsSVGAngle* aVal, nsSVGElement *aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} @@ -168,7 +170,8 @@ private: struct DOMAnimatedAngle : public nsIDOMSVGAnimatedAngle { - NS_DECL_ISUPPORTS + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedAngle) DOMAnimatedAngle(nsSVGAngle* aVal, nsSVGElement *aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} diff --git a/content/svg/content/src/nsSVGBoolean.cpp b/content/svg/content/src/nsSVGBoolean.cpp index 79d07fbfe2db..402e696f0d13 100644 --- a/content/svg/content/src/nsSVGBoolean.cpp +++ b/content/svg/content/src/nsSVGBoolean.cpp @@ -36,10 +36,12 @@ #include "nsSVGBoolean.h" -NS_IMPL_ADDREF(nsSVGBoolean::DOMAnimatedBoolean) -NS_IMPL_RELEASE(nsSVGBoolean::DOMAnimatedBoolean) +NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGBoolean::DOMAnimatedBoolean, mSVGElement) -NS_INTERFACE_MAP_BEGIN(nsSVGBoolean::DOMAnimatedBoolean) +NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGBoolean::DOMAnimatedBoolean) +NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGBoolean::DOMAnimatedBoolean) + +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGBoolean::DOMAnimatedBoolean) NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedBoolean) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedBoolean) @@ -94,4 +96,3 @@ nsSVGBoolean::ToDOMAnimatedBoolean(nsIDOMSVGAnimatedBoolean **aResult, NS_ADDREF(*aResult); return NS_OK; } - diff --git a/content/svg/content/src/nsSVGBoolean.h b/content/svg/content/src/nsSVGBoolean.h index 20f5004ad988..1a105e0c5118 100644 --- a/content/svg/content/src/nsSVGBoolean.h +++ b/content/svg/content/src/nsSVGBoolean.h @@ -72,7 +72,8 @@ private: struct DOMAnimatedBoolean : public nsIDOMSVGAnimatedBoolean { - NS_DECL_ISUPPORTS + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedBoolean) DOMAnimatedBoolean(nsSVGBoolean* aVal, nsSVGElement *aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} diff --git a/content/svg/content/src/nsSVGElement.h b/content/svg/content/src/nsSVGElement.h index f7b7c40d9db8..04ac9df63479 100644 --- a/content/svg/content/src/nsSVGElement.h +++ b/content/svg/content/src/nsSVGElement.h @@ -363,4 +363,14 @@ NS_NewSVG##_elementName##Element(nsIContent **aResult, \ return rv; \ } +// No unlinking, we'd need to null out the value pointer (the object it +// points to is held by the element) and null-check it everywhere. +#define NS_SVG_VAL_IMPL_CYCLE_COLLECTION(_val, _element) \ +NS_IMPL_CYCLE_COLLECTION_CLASS(_val) \ +NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_val) \ + NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(_element, nsIContent) \ +NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END \ +NS_IMPL_CYCLE_COLLECTION_UNLINK_0(_val) + + #endif // __NS_SVGELEMENT_H__ diff --git a/content/svg/content/src/nsSVGEnum.cpp b/content/svg/content/src/nsSVGEnum.cpp index 2baecda7032d..4339a9f148a0 100644 --- a/content/svg/content/src/nsSVGEnum.cpp +++ b/content/svg/content/src/nsSVGEnum.cpp @@ -38,10 +38,12 @@ #include "nsIAtom.h" #include "nsSVGElement.h" -NS_IMPL_ADDREF(nsSVGEnum::DOMAnimatedEnum) -NS_IMPL_RELEASE(nsSVGEnum::DOMAnimatedEnum) +NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGEnum::DOMAnimatedEnum, mSVGElement) -NS_INTERFACE_MAP_BEGIN(nsSVGEnum::DOMAnimatedEnum) +NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGEnum::DOMAnimatedEnum) +NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGEnum::DOMAnimatedEnum) + +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGEnum::DOMAnimatedEnum) NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedEnumeration) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedEnumeration) diff --git a/content/svg/content/src/nsSVGEnum.h b/content/svg/content/src/nsSVGEnum.h index 814e6ed07209..c042b690ce82 100644 --- a/content/svg/content/src/nsSVGEnum.h +++ b/content/svg/content/src/nsSVGEnum.h @@ -83,7 +83,8 @@ private: struct DOMAnimatedEnum : public nsIDOMSVGAnimatedEnumeration { - NS_DECL_ISUPPORTS + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedEnum) DOMAnimatedEnum(nsSVGEnum* aVal, nsSVGElement *aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} diff --git a/content/svg/content/src/nsSVGInteger.cpp b/content/svg/content/src/nsSVGInteger.cpp index 0fc88f2fba58..b63d1ef53e4a 100755 --- a/content/svg/content/src/nsSVGInteger.cpp +++ b/content/svg/content/src/nsSVGInteger.cpp @@ -36,10 +36,13 @@ #include "nsSVGInteger.h" -NS_IMPL_ADDREF(nsSVGInteger::DOMAnimatedInteger) -NS_IMPL_RELEASE(nsSVGInteger::DOMAnimatedInteger) -NS_INTERFACE_MAP_BEGIN(nsSVGInteger::DOMAnimatedInteger) +NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGInteger::DOMAnimatedInteger, mSVGElement) + +NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGInteger::DOMAnimatedInteger) +NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGInteger::DOMAnimatedInteger) + +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGInteger::DOMAnimatedInteger) NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedInteger) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedInteger) @@ -96,4 +99,3 @@ nsSVGInteger::ToDOMAnimatedInteger(nsIDOMSVGAnimatedInteger **aResult, NS_ADDREF(*aResult); return NS_OK; } - diff --git a/content/svg/content/src/nsSVGInteger.h b/content/svg/content/src/nsSVGInteger.h index 3408300b11a5..0dff477205e3 100755 --- a/content/svg/content/src/nsSVGInteger.h +++ b/content/svg/content/src/nsSVGInteger.h @@ -72,7 +72,8 @@ private: struct DOMAnimatedInteger : public nsIDOMSVGAnimatedInteger { - NS_DECL_ISUPPORTS + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedInteger) DOMAnimatedInteger(nsSVGInteger* aVal, nsSVGElement *aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} diff --git a/content/svg/content/src/nsSVGLength2.cpp b/content/svg/content/src/nsSVGLength2.cpp index 136df56a3c01..b31cf5edb4e9 100644 --- a/content/svg/content/src/nsSVGLength2.cpp +++ b/content/svg/content/src/nsSVGLength2.cpp @@ -43,28 +43,34 @@ #include "nsIFrame.h" #include "nsSVGIntegrationUtils.h" -NS_IMPL_ADDREF(nsSVGLength2::DOMBaseVal) -NS_IMPL_RELEASE(nsSVGLength2::DOMBaseVal) +NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGLength2::DOMBaseVal, mSVGElement) -NS_IMPL_ADDREF(nsSVGLength2::DOMAnimVal) -NS_IMPL_RELEASE(nsSVGLength2::DOMAnimVal) +NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGLength2::DOMAnimVal, mSVGElement) -NS_IMPL_ADDREF(nsSVGLength2::DOMAnimatedLength) -NS_IMPL_RELEASE(nsSVGLength2::DOMAnimatedLength) +NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGLength2::DOMAnimatedLength, mSVGElement) -NS_INTERFACE_MAP_BEGIN(nsSVGLength2::DOMBaseVal) +NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGLength2::DOMBaseVal) +NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGLength2::DOMBaseVal) + +NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGLength2::DOMAnimVal) +NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGLength2::DOMAnimVal) + +NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGLength2::DOMAnimatedLength) +NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGLength2::DOMAnimatedLength) + +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGLength2::DOMBaseVal) NS_INTERFACE_MAP_ENTRY(nsIDOMSVGLength) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGLength) NS_INTERFACE_MAP_END -NS_INTERFACE_MAP_BEGIN(nsSVGLength2::DOMAnimVal) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGLength2::DOMAnimVal) NS_INTERFACE_MAP_ENTRY(nsIDOMSVGLength) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGLength) NS_INTERFACE_MAP_END -NS_INTERFACE_MAP_BEGIN(nsSVGLength2::DOMAnimatedLength) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGLength2::DOMAnimatedLength) NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedLength) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedLength) diff --git a/content/svg/content/src/nsSVGLength2.h b/content/svg/content/src/nsSVGLength2.h index 90b1c17ceaa9..824e72a04c99 100644 --- a/content/svg/content/src/nsSVGLength2.h +++ b/content/svg/content/src/nsSVGLength2.h @@ -123,7 +123,8 @@ private: struct DOMBaseVal : public nsIDOMSVGLength { - NS_DECL_ISUPPORTS + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_CLASS(DOMBaseVal) DOMBaseVal(nsSVGLength2* aVal, nsSVGElement *aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} @@ -162,7 +163,8 @@ private: struct DOMAnimVal : public nsIDOMSVGLength { - NS_DECL_ISUPPORTS + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimVal) DOMAnimVal(nsSVGLength2* aVal, nsSVGElement *aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} @@ -198,7 +200,8 @@ private: struct DOMAnimatedLength : public nsIDOMSVGAnimatedLength { - NS_DECL_ISUPPORTS + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedLength) DOMAnimatedLength(nsSVGLength2* aVal, nsSVGElement *aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} diff --git a/content/svg/content/src/nsSVGMarkerElement.cpp b/content/svg/content/src/nsSVGMarkerElement.cpp index e4a816beeeb0..54329c4c055d 100644 --- a/content/svg/content/src/nsSVGMarkerElement.cpp +++ b/content/svg/content/src/nsSVGMarkerElement.cpp @@ -78,10 +78,12 @@ NS_IMPL_NS_NEW_SVG_ELEMENT(Marker) //---------------------------------------------------------------------- // nsISupports methods -NS_IMPL_ADDREF(nsSVGOrientType::DOMAnimatedEnum) -NS_IMPL_RELEASE(nsSVGOrientType::DOMAnimatedEnum) +NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGOrientType::DOMAnimatedEnum, mSVGElement) -NS_INTERFACE_MAP_BEGIN(nsSVGOrientType::DOMAnimatedEnum) +NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGOrientType::DOMAnimatedEnum) +NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGOrientType::DOMAnimatedEnum) + +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGOrientType::DOMAnimatedEnum) NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedEnumeration) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedEnumeration) diff --git a/content/svg/content/src/nsSVGMarkerElement.h b/content/svg/content/src/nsSVGMarkerElement.h index de6afb1bf630..2d1572b15e1b 100644 --- a/content/svg/content/src/nsSVGMarkerElement.h +++ b/content/svg/content/src/nsSVGMarkerElement.h @@ -71,7 +71,8 @@ private: struct DOMAnimatedEnum : public nsIDOMSVGAnimatedEnumeration { - NS_DECL_ISUPPORTS + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedEnum) DOMAnimatedEnum(nsSVGOrientType* aVal, nsSVGElement *aSVGElement) diff --git a/content/svg/content/src/nsSVGNumber2.cpp b/content/svg/content/src/nsSVGNumber2.cpp index 56461ee93851..d64fa6be0b01 100644 --- a/content/svg/content/src/nsSVGNumber2.cpp +++ b/content/svg/content/src/nsSVGNumber2.cpp @@ -38,10 +38,12 @@ #include "nsTextFormatter.h" #include "prdtoa.h" -NS_IMPL_ADDREF(nsSVGNumber2::DOMAnimatedNumber) -NS_IMPL_RELEASE(nsSVGNumber2::DOMAnimatedNumber) +NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGNumber2::DOMAnimatedNumber, mSVGElement) -NS_INTERFACE_MAP_BEGIN(nsSVGNumber2::DOMAnimatedNumber) +NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGNumber2::DOMAnimatedNumber) +NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGNumber2::DOMAnimatedNumber) + +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGNumber2::DOMAnimatedNumber) NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedNumber) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedNumber) diff --git a/content/svg/content/src/nsSVGNumber2.h b/content/svg/content/src/nsSVGNumber2.h index 778b75f9ddb1..58aef6cad10e 100644 --- a/content/svg/content/src/nsSVGNumber2.h +++ b/content/svg/content/src/nsSVGNumber2.h @@ -73,7 +73,8 @@ private: struct DOMAnimatedNumber : public nsIDOMSVGAnimatedNumber { - NS_DECL_ISUPPORTS + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedNumber) DOMAnimatedNumber(nsSVGNumber2* aVal, nsSVGElement *aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} diff --git a/content/svg/content/src/nsSVGString.cpp b/content/svg/content/src/nsSVGString.cpp index d54f2c802243..dab6934a3e15 100644 --- a/content/svg/content/src/nsSVGString.cpp +++ b/content/svg/content/src/nsSVGString.cpp @@ -36,10 +36,12 @@ #include "nsSVGString.h" -NS_IMPL_ADDREF(nsSVGString::DOMAnimatedString) -NS_IMPL_RELEASE(nsSVGString::DOMAnimatedString) +NS_SVG_VAL_IMPL_CYCLE_COLLECTION(nsSVGString::DOMAnimatedString, mSVGElement) -NS_INTERFACE_MAP_BEGIN(nsSVGString::DOMAnimatedString) +NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGString::DOMAnimatedString) +NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGString::DOMAnimatedString) + +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGString::DOMAnimatedString) NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedString) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGAnimatedString) diff --git a/content/svg/content/src/nsSVGString.h b/content/svg/content/src/nsSVGString.h index 2e0e9e025993..483a205ab76f 100644 --- a/content/svg/content/src/nsSVGString.h +++ b/content/svg/content/src/nsSVGString.h @@ -70,7 +70,8 @@ private: struct DOMAnimatedString : public nsIDOMSVGAnimatedString { - NS_DECL_ISUPPORTS + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedString) DOMAnimatedString(nsSVGString* aVal, nsSVGElement *aSVGElement) : mVal(aVal), mSVGElement(aSVGElement) {} diff --git a/content/svg/content/src/nsSVGSwitchElement.cpp b/content/svg/content/src/nsSVGSwitchElement.cpp index b31d7d92fbbb..a2fb084b2ef4 100644 --- a/content/svg/content/src/nsSVGSwitchElement.cpp +++ b/content/svg/content/src/nsSVGSwitchElement.cpp @@ -52,10 +52,20 @@ NS_IMPL_NS_NEW_SVG_ELEMENT(Switch) //---------------------------------------------------------------------- // nsISupports methods +NS_IMPL_CYCLE_COLLECTION_CLASS(nsSVGSwitchElement) +NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsSVGSwitchElement, + nsSVGSwitchElementBase) + NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mActiveChild) +NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END +NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsSVGSwitchElement, + nsSVGSwitchElementBase) + NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mActiveChild) +NS_IMPL_CYCLE_COLLECTION_UNLINK_END + NS_IMPL_ADDREF_INHERITED(nsSVGSwitchElement,nsSVGSwitchElementBase) NS_IMPL_RELEASE_INHERITED(nsSVGSwitchElement,nsSVGSwitchElementBase) -NS_INTERFACE_TABLE_HEAD(nsSVGSwitchElement) +NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsSVGSwitchElement) NS_NODE_INTERFACE_TABLE4(nsSVGSwitchElement, nsIDOMNode, nsIDOMElement, nsIDOMSVGElement, nsIDOMSVGSwitchElement) NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGSwitchElement) diff --git a/content/svg/content/src/nsSVGSwitchElement.h b/content/svg/content/src/nsSVGSwitchElement.h index c43652e4c533..84cb08d13f60 100644 --- a/content/svg/content/src/nsSVGSwitchElement.h +++ b/content/svg/content/src/nsSVGSwitchElement.h @@ -58,6 +58,8 @@ public: // interfaces: NS_DECL_ISUPPORTS_INHERITED + NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsSVGSwitchElement, + nsSVGSwitchElementBase) NS_DECL_NSIDOMSVGSWITCHELEMENT // xxx I wish we could use virtual inheritance diff --git a/content/svg/content/test/Makefile.in b/content/svg/content/test/Makefile.in index 2f94248b4ef0..705f50067bf5 100644 --- a/content/svg/content/test/Makefile.in +++ b/content/svg/content/test/Makefile.in @@ -57,6 +57,7 @@ _TEST_FILES = \ scientific-helper.svg \ test_text.html \ text-helper.svg \ + test_valueLeaks.xhtml \ $(NULL) libs:: $(_TEST_FILES) diff --git a/content/svg/content/test/test_valueLeaks.xhtml b/content/svg/content/test/test_valueLeaks.xhtml new file mode 100644 index 000000000000..eeca6001068f --- /dev/null +++ b/content/svg/content/test/test_valueLeaks.xhtml @@ -0,0 +1,76 @@ + + + + Test for Bug 467671 + + + + + +Mozilla Bug 467671 +

+ +
+
+
+ +