Bug 1064842 - Add ImplCycleCollectionTraverse/Unlink implementations for nsSMILTimedElement so that SVGAnimationElement can use the shorter NS_IMPL_CYCLE_COLLECTION_INHERITED macro. r=roc

This commit is contained in:
Markus Stange 2014-09-10 12:18:58 +02:00
parent f765e8e0ff
commit 75b8bea4c8
2 changed files with 18 additions and 14 deletions

View File

@ -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

View File

@ -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_