Bug 1184283 - nsISupports pure virtual refcounting
--- a/xpcom/glue/nsISupportsImpl.h
+++ b/xpcom/glue/nsISupportsImpl.h
@@ -555,16 +555,25 @@ NS_INLINE_DECL_THREADSAFE_REFCOUNTING_ME
/**
* Like NS_INLINE_DECL_THREADSAFE_REFCOUNTING with AddRef & Release declared
* virtual.
*/
#define NS_INLINE_DECL_THREADSAFE_VIRTUAL_REFCOUNTING(_class, ...) \
NS_INLINE_DECL_THREADSAFE_REFCOUNTING_META(_class, NS_IMETHOD_, __VA_ARGS__)
/**
+ * Use this macro to declare pure virtual AddRef & Release methods, for
+ * implementation by derived classes.
+ */
+#define NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING \
+public: \
+ NS_IMETHOD_(MozExternalRefCountType) AddRef(void) = 0; \
+ NS_IMETHOD_(MozExternalRefCountType) Release(void) = 0;
+
+/**
* Use this macro to implement the AddRef method for a given <i>_class</i>
* @param _class The name of the class implementing the method
*/
#define NS_IMPL_ADDREF(_class) \
NS_IMETHODIMP_(MozExternalRefCountType) _class::AddRef(void) \
{ \
MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(_class) \
MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt"); \