From 5d82de9eb65b38d983959be20cce472b1f3589f7 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 17 Jan 2025 15:16:54 +0100 Subject: [PATCH] Issue #2678 - Define a new macro for CC isupports. The main purpose of defining this is to make conversion of places that use the non-CC variant easier. --- xpcom/glue/nsCycleCollectionParticipant.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/xpcom/glue/nsCycleCollectionParticipant.h b/xpcom/glue/nsCycleCollectionParticipant.h index 0e0e4b608a..0959a4a648 100644 --- a/xpcom/glue/nsCycleCollectionParticipant.h +++ b/xpcom/glue/nsCycleCollectionParticipant.h @@ -910,6 +910,20 @@ static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME; #define NS_CYCLE_COLLECTION_NOTE_EDGE_NAME CycleCollectionNoteEdgeName +/** + * Convenience macros for defining nISupports methods in a cycle collected class. + */ + +#define NS_IMPL_QUERY_INTERFACE_CYCLE_COLLECTION_INHERITED(aClass, aSuper, ...) \ + NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(aClass) \ + 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) + // *** Fast IID comparison helper functions *** /** * Equivalency of the high three words where two IIDs have the same