From b492488782e3efd7b556754ee7463fc223910294 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Wed, 10 Sep 2014 12:18:58 +0200 Subject: [PATCH] Bug 1064842 - Add ImplCycleCollectionTraverse/Unlink implementations for nsSMILTimedElement so that SVGAnimationElement can use the shorter NS_IMPL_CYCLE_COLLECTION_INHERITED macro. r=roc --- content/svg/content/src/SVGAnimationElement.cpp | 17 +++-------------- dom/smil/nsSMILTimedElement.h | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/content/svg/content/src/SVGAnimationElement.cpp b/content/svg/content/src/SVGAnimationElement.cpp index ea8405d3ee6..7f1ac2a6ed2 100644 --- a/content/svg/content/src/SVGAnimationElement.cpp +++ b/content/svg/content/src/SVGAnimationElement.cpp @@ -25,20 +25,9 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGAnimationElement) NS_INTERFACE_MAP_ENTRY(mozilla::dom::SVGTests) NS_INTERFACE_MAP_END_INHERITING(SVGAnimationElementBase) -// Cycle collection magic -- based on nsSVGUseElement -NS_IMPL_CYCLE_COLLECTION_CLASS(SVGAnimationElement) - -NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(SVGAnimationElement, - SVGAnimationElementBase) - tmp->mHrefTarget.Unlink(); - tmp->mTimedElement.Unlink(); -NS_IMPL_CYCLE_COLLECTION_UNLINK_END - -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(SVGAnimationElement, - SVGAnimationElementBase) - tmp->mHrefTarget.Traverse(&cb); - tmp->mTimedElement.Traverse(&cb); -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END +NS_IMPL_CYCLE_COLLECTION_INHERITED(SVGAnimationElement, + SVGAnimationElementBase, + mHrefTarget, mTimedElement) //---------------------------------------------------------------------- // Implementation diff --git a/dom/smil/nsSMILTimedElement.h b/dom/smil/nsSMILTimedElement.h index 5ac319f70fd..812995a1a66 100644 --- a/dom/smil/nsSMILTimedElement.h +++ b/dom/smil/nsSMILTimedElement.h @@ -661,4 +661,19 @@ protected: static const uint8_t sMaxUpdateIntervalRecursionDepth; }; +inline void +ImplCycleCollectionUnlink(nsSMILTimedElement& aField) +{ + aField.Unlink(); +} + +inline void +ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback, + nsSMILTimedElement& aField, + const char* aName, + uint32_t aFlags = 0) +{ + aField.Traverse(&aCallback); +} + #endif // NS_SMILTIMEDELEMENT_H_