Bug 1390692, part 1 - Convert nsAgg to use the new QI macro. r=peterv
This just does the same thing as the regular CC QI macro.
This gets rid of the last use of NS_IMPL_QUERY_CYCLE_COLLECTION, so
remove it.
MozReview-Commit-ID: 2P6ki8xXpuO
--- a/xpcom/base/nsAgg.h
+++ b/xpcom/base/nsAgg.h
@@ -242,27 +242,23 @@ class nsAggregatedCycleCollectionPartici
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_AGGREGATED_CYCLECOLLECTIONPARTICIPANT_IID)
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsAggregatedCycleCollectionParticipant,
NS_AGGREGATED_CYCLECOLLECTIONPARTICIPANT_IID)
-// for use with QI macros in nsISupportsUtils.h:
+// for use with QI macros in nsISupportsImpl.h:
#define NS_INTERFACE_MAP_BEGIN_AGGREGATED(_class) \
NS_IMPL_AGGREGATED_QUERY_HEAD(_class)
-#define NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION_AGGREGATED(_class) \
- NS_IMPL_QUERY_CYCLE_COLLECTION(_class)
-
#define NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION_AGGREGATED(_class) \
- NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION_AGGREGATED(_class) \
- NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION_ISUPPORTS(_class)
+ NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(_class)
#define NS_IMPL_AGGREGATED_QUERY_HEAD(_class) \
nsresult \
_class::AggregatedQueryInterface(REFNSIID aIID, void** aInstancePtr) \
{ \
NS_ASSERTION(aInstancePtr, \
"AggregatedQueryInterface requires a non-NULL result ptr!"); \
if ( !aInstancePtr ) \
--- a/xpcom/base/nsCycleCollectionParticipant.h
+++ b/xpcom/base/nsCycleCollectionParticipant.h
@@ -281,22 +281,16 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsXPCOMCyc
///////////////////////////////////////////////////////////////////////////////
// Helpers for implementing a QI to nsXPCOMCycleCollectionParticipant
///////////////////////////////////////////////////////////////////////////////
#define NS_CYCLE_COLLECTION_CLASSNAME(_class) \
_class::NS_CYCLE_COLLECTION_INNERCLASS
-#define NS_IMPL_QUERY_CYCLE_COLLECTION(_class) \
- if ( aIID.Equals(NS_GET_IID(nsXPCOMCycleCollectionParticipant)) ) { \
- *aInstancePtr = NS_CYCLE_COLLECTION_PARTICIPANT(_class); \
- return NS_OK; \
- } else
-
#define NS_IMPL_QUERY_CYCLE_COLLECTION_ISUPPORTS(_class) \
if ( aIID.Equals(NS_GET_IID(nsCycleCollectionISupports)) ) { \
*aInstancePtr = NS_CYCLE_COLLECTION_CLASSNAME(_class)::Upcast(this); \
return NS_OK; \
} else
// The IIDs for nsXPCOMCycleCollectionParticipant and nsCycleCollectionISupports
// are special in that they only differ in their last byte. This allows for the