mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Issue #2678 - Remove unnecessary second QI for nsCycleCollectionISupports.
Also moves NS_IMPL_QUERY_CYCLE_COLLECTION_ISUPPORTS to nsAgg.h, since it's only needed there, for clarity.
This commit is contained in:
parent
85f8f23a23
commit
9464d0ed6d
2 changed files with 17 additions and 23 deletions
|
|
@ -248,9 +248,24 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsAggregatedCycleCollectionParticipant,
|
|||
#define NS_INTERFACE_MAP_BEGIN_AGGREGATED(_class) \
|
||||
NS_IMPL_AGGREGATED_QUERY_HEAD(_class)
|
||||
|
||||
#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_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION_AGGREGATED(_class) \
|
||||
NS_IMPL_QUERY_CYCLE_COLLECTION(_class)
|
||||
|
||||
#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
|
||||
|
||||
#define NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION_ISUPPORTS(_class) \
|
||||
NS_IMPL_QUERY_CYCLE_COLLECTION_ISUPPORTS(_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)
|
||||
|
|
|
|||
|
|
@ -256,24 +256,12 @@ NS_DEFINE_STATIC_IID_ACCESSOR(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
|
||||
// optimization below where we first check the first three words of the IID and
|
||||
// if we find a match we check the last word to decide which case we have to
|
||||
// deal with.
|
||||
#define NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION(_class) \
|
||||
#define NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(_class) \
|
||||
if (TopThreeWordsEquals(aIID, NS_GET_IID(nsXPCOMCycleCollectionParticipant), \
|
||||
NS_GET_IID(nsCycleCollectionISupports)) && \
|
||||
/* The calls to LowWordEquals here are repeated inside the if branch. \
|
||||
|
|
@ -296,21 +284,12 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsXPCOMCycleCollectionParticipant,
|
|||
} \
|
||||
} else
|
||||
|
||||
#define NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION_ISUPPORTS(_class) \
|
||||
NS_IMPL_QUERY_CYCLE_COLLECTION_ISUPPORTS(_class)
|
||||
|
||||
#define NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(_class) \
|
||||
NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION(_class) \
|
||||
NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION_ISUPPORTS(_class)
|
||||
|
||||
#define NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(_class) \
|
||||
NS_INTERFACE_MAP_BEGIN(_class) \
|
||||
NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(_class)
|
||||
|
||||
#define NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(_class) \
|
||||
NS_INTERFACE_MAP_BEGIN(_class) \
|
||||
NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION(_class) \
|
||||
NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION_ISUPPORTS(_class)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(_class)
|
||||
|
||||
#define NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(_class) \
|
||||
if (rv == NS_OK) return rv; \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue