Bug 1390692, part 1 - Convert nsAgg to use the new QI macro. r=peterv draft
authorAndrew McCreight <continuation@gmail.com>
Tue, 15 Aug 2017 17:02:36 -0700
changeset 647155 ef307399aaaa9b5c01589b34d962a50a35f97e9d
parent 646957 d25db0546c92afa72d61685c9310104ef28235bd
child 647156 10e2c43601245040d1626038ebede0f7edf24e8b
push id74306
push userbmo:continuation@gmail.com
push dateWed, 16 Aug 2017 01:54:09 +0000
reviewerspeterv
bugs1390692
milestone57.0a1
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
xpcom/base/nsAgg.h
xpcom/base/nsCycleCollectionParticipant.h
--- 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