Bug 1304302 part 6 - Add cycle collecting support to pointer of StyleSheet. r=smaug

This is mostly copied from StyleSheetHandle which is being removed in
later patches. This is a temporary workaround to keep things working.
It should be removed soon when StyleSheet itself becomes a subclass
of nsISupports (which is expected to happen in bug 1292432).

MozReview-Commit-ID: Gqv0eRZgja5

--HG--
extra : source : 5d029c90a2e9187720bb21ef8329722a8fa3cae5
This commit is contained in:
Xidorn Quan 2016-09-26 22:03:25 +10:00
parent 708aff235a
commit 1b72d4bbf6

View File

@ -197,6 +197,24 @@ StyleSheet::List(FILE* aOut, int32_t aIndex) const
#undef FORWARD
#undef FORWARD_CONCRETE
inline void
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
RefPtr<StyleSheet>& aField,
const char* aName,
uint32_t aFlags = 0)
{
if (aField && aField->IsGecko()) {
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(aCallback, aName);
aCallback.NoteXPCOMChild(NS_ISUPPORTS_CAST(nsIDOMCSSStyleSheet*, aField->AsGecko()));
}
}
inline void
ImplCycleCollectionUnlink(RefPtr<StyleSheet>& aField)
{
aField = nullptr;
}
}
#endif // mozilla_StyleSheetInlines_h