/* static */ already_AddRefed<DOMSVGPathSegList> DOMSVGPathSegList::GetDOMWrapper(void *aList, nsSVGElement *aElement, bool aIsAnimValList) { nsRefPtr<DOMSVGPathSegList> wrapper = SVGPathSegListTearoffTable().GetTearoff(aList); if (!wrapper) { wrapper = new DOMSVGPathSegList(aElement, aIsAnimValList); SVGPathSegListTearoffTable().AddTearoff(aList, wrapper); } return wrapper.forget(); }
DOMSVGPathSegList::~DOMSVGPathSegList() { // There are now no longer any references to us held by script or list items. // Note we must use GetAnimValKey/GetBaseValKey here, NOT InternalList()! void *key = mIsAnimValList ? InternalAList().GetAnimValKey() : InternalAList().GetBaseValKey(); SVGPathSegListTearoffTable().RemoveTearoff(key); }
/* static */ DOMSVGPathSegList* DOMSVGPathSegList::GetDOMWrapperIfExists(void *aList) { return SVGPathSegListTearoffTable().GetTearoff(aList); }