Backed out changeset fe801c8a2090 (Bug 551298) due to Linux debug mochitest-5 orange

This commit is contained in:
Daniel Holbert 2010-04-01 09:40:30 -07:00
parent ef92ece024
commit 56db19649c
3 changed files with 23 additions and 34 deletions

View File

@ -98,7 +98,27 @@ enum gfxBreakPriority {
#include "nsAutoPtr.h"
#define THEBES_INLINE_DECL_REFCOUNTING(_class) \
NS_INLINE_DECL_REFCOUNTING(_class)
public: \
nsrefcnt AddRef(void) { \
NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt"); \
++mRefCnt; \
NS_LOG_ADDREF(this, mRefCnt, #_class, sizeof(*this)); \
return mRefCnt; \
} \
nsrefcnt Release(void) { \
NS_PRECONDITION(0 != mRefCnt, "dup release"); \
--mRefCnt; \
NS_LOG_RELEASE(this, mRefCnt, #_class); \
if (mRefCnt == 0) { \
mRefCnt = 1; /* stabilize */ \
NS_DELETEXPCOM(this); \
return 0; \
} \
return mRefCnt; \
} \
protected: \
nsAutoRefCnt mRefCnt; \
public:
#define THEBES_INLINE_DECL_THREADSAFE_REFCOUNTING(_class) \
public: \

View File

@ -303,35 +303,6 @@ public:
*/
#define NS_INIT_ISUPPORTS() ((void)0)
/**
* Use this macro to declare and implement the AddRef & Release methods for a
* given non-XPCOM <i>_class</i>.
*
* The implementations here should match NS_IMPL_ADDREF/NS_IMPL_RELEASE, minus
* the nsrefcnt return-value and the NS_ASSERT_OWNINGTHREAD() call.
*
* @param _class The name of the class implementing the method
*/
#define NS_INLINE_DECL_REFCOUNTING(_class) \
public: \
void AddRef(void) { \
NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt"); \
++mRefCnt; \
NS_LOG_ADDREF(this, mRefCnt, #_class, sizeof(*this)); \
} \
void Release(void) { \
NS_PRECONDITION(0 != mRefCnt, "dup release"); \
--mRefCnt; \
NS_LOG_RELEASE(this, mRefCnt, #_class); \
if (mRefCnt == 0) { \
mRefCnt = 1; /* stabilize */ \
NS_DELETEXPCOM(this); \
} \
} \
protected: \
nsAutoRefCnt mRefCnt; \
public:
/**
* Use this macro to implement the AddRef method for a given <i>_class</i>
* @param _class The name of the class implementing the method

View File

@ -108,12 +108,10 @@ extern "C++" {
// yet still denies you the ability to |AddRef()| an |nsCOMPtr|.
template <class T>
inline
void
nsrefcnt
ns_if_addref( T expr )
{
if (expr) {
expr->AddRef();
}
return expr ? expr->AddRef() : 0;
}
} /* extern "C++" */