mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Bug 727313 - avoid warnings, add case for skippable CC macros. r=smaug
This commit is contained in:
parent
e8f57a8f44
commit
c4adf5736e
@ -299,6 +299,10 @@ public:
|
|||||||
#define NS_CYCLE_COLLECTION_UPCAST(obj, clazz) \
|
#define NS_CYCLE_COLLECTION_UPCAST(obj, clazz) \
|
||||||
NS_CYCLE_COLLECTION_CLASSNAME(clazz)::Upcast(obj)
|
NS_CYCLE_COLLECTION_CLASSNAME(clazz)::Upcast(obj)
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Helpers for implementing CanSkip methods
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#define NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(_class) \
|
#define NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(_class) \
|
||||||
NS_IMETHODIMP_(bool) \
|
NS_IMETHODIMP_(bool) \
|
||||||
NS_CYCLE_COLLECTION_CLASSNAME(_class)::CanSkipReal(void *p, \
|
NS_CYCLE_COLLECTION_CLASSNAME(_class)::CanSkipReal(void *p, \
|
||||||
@ -310,6 +314,7 @@ public:
|
|||||||
_class *tmp = Downcast(s);
|
_class *tmp = Downcast(s);
|
||||||
|
|
||||||
#define NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END \
|
#define NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END \
|
||||||
|
(void)tmp; \
|
||||||
return false; \
|
return false; \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,6 +328,7 @@ public:
|
|||||||
_class *tmp = Downcast(s);
|
_class *tmp = Downcast(s);
|
||||||
|
|
||||||
#define NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END \
|
#define NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END \
|
||||||
|
(void)tmp; \
|
||||||
return false; \
|
return false; \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,6 +342,7 @@ public:
|
|||||||
_class *tmp = Downcast(s);
|
_class *tmp = Downcast(s);
|
||||||
|
|
||||||
#define NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END \
|
#define NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END \
|
||||||
|
(void)tmp; \
|
||||||
return false; \
|
return false; \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -614,6 +621,24 @@ NS_CYCLE_COLLECTION_PARTICIPANT_INSTANCE
|
|||||||
#define NS_DECL_CYCLE_COLLECTION_CLASS(_class) \
|
#define NS_DECL_CYCLE_COLLECTION_CLASS(_class) \
|
||||||
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(_class, _class)
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(_class, _class)
|
||||||
|
|
||||||
|
// Cycle collector helper for ambiguous classes that can sometimes be skipped.
|
||||||
|
#define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_CLASS_AMBIGUOUS(_class, _base) \
|
||||||
|
class NS_CYCLE_COLLECTION_INNERCLASS \
|
||||||
|
: public nsXPCOMCycleCollectionParticipant \
|
||||||
|
{ \
|
||||||
|
public: \
|
||||||
|
NS_CYCLE_COLLECTION_INNERCLASS () : nsXPCOMCycleCollectionParticipant(true) {} \
|
||||||
|
NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base) \
|
||||||
|
protected: \
|
||||||
|
NS_IMETHOD_(bool) CanSkipReal(void *p, bool aRemovingAllowed); \
|
||||||
|
NS_IMETHOD_(bool) CanSkipInCCReal(void *p); \
|
||||||
|
NS_IMETHOD_(bool) CanSkipThisReal(void *p); \
|
||||||
|
}; \
|
||||||
|
NS_CYCLE_COLLECTION_PARTICIPANT_INSTANCE
|
||||||
|
|
||||||
|
#define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_CLASS(_class) \
|
||||||
|
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_CLASS_AMBIGUOUS(_class, _class)
|
||||||
|
|
||||||
// Cycle collector helper for classes that don't want to unlink anything.
|
// Cycle collector helper for classes that don't want to unlink anything.
|
||||||
// Note: if this is used a lot it might make sense to have a base class that
|
// Note: if this is used a lot it might make sense to have a base class that
|
||||||
// doesn't do anything in Root/Unlink/Unroot.
|
// doesn't do anything in Root/Unlink/Unroot.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user