Bug 1402499 - Add NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0 r=bz
authorKyle Machulis <kyle@nonpolynomial.com>
Thu, 28 Sep 2017 23:21:09 -0700
changeset 384087 5b86711934302fe448e18838fdd64fe843e244d8
parent 384086 cdfdf17a19eb426ebeae35b32e6e45d1027e0fb5
child 384088 91b6b53a5a72a273bd8c4bd64aa753b199716bb0
push id52495
push userkmachulis@mozilla.com
push dateMon, 02 Oct 2017 23:29:41 +0000
treeherderautoland@91b6b53a5a72 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1402499
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1402499 - Add NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0 r=bz Add macro for nsISupports inheriting classes that need cycle collection and only inherit from one parent, with no interface table needed. Takes care of map and addref/release calls. MozReview-Commit-ID: LtTwYH0DeEz
xpcom/base/nsCycleCollectionParticipant.h
--- a/xpcom/base/nsCycleCollectionParticipant.h
+++ b/xpcom/base/nsCycleCollectionParticipant.h
@@ -964,16 +964,21 @@ static NS_CYCLE_COLLECTION_INNERCLASS NS
   NS_INTERFACE_TABLE_INHERITED(aClass, __VA_ARGS__)                             \
   NS_INTERFACE_TABLE_TAIL_INHERITING(aSuper)
 
 #define NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(aClass, aSuper, ...)         \
   NS_IMPL_QUERY_INTERFACE_CYCLE_COLLECTION_INHERITED(aClass, aSuper, __VA_ARGS__) \
   NS_IMPL_ADDREF_INHERITED(aClass, aSuper)                                        \
   NS_IMPL_RELEASE_INHERITED(aClass, aSuper)
 
+#define NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED_0(aClass, aSuper)            \
+  NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(aClass)                                 \
+  NS_INTERFACE_MAP_END_INHERITING(aSuper)                                         \
+  NS_IMPL_ADDREF_INHERITED(aClass, aSuper)                                        \
+  NS_IMPL_RELEASE_INHERITED(aClass, aSuper)
 
 /**
  * Equivalency of the high three words where two IIDs have the same
  * top three words but not the same low word.
  */
 inline bool TopThreeWordsEquals(const nsID& aID,
                                 const nsID& aOther1,
                                 const nsID& aOther2)