Bug 917348 - Part 1: Make NS_IMPL_CYCLE_COLLECTING_AGGREGATED build on non-debug configurations; r=bsmedberg

--HG--
extra : rebase_source : 4984cf31e6855b721dabb27315b4255179aa586d
This commit is contained in:
Ehsan Akhgari 2013-09-17 12:05:13 -04:00
Родитель bc061b459a
Коммит 08499bf765
2 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -143,8 +143,7 @@ _class::Internal::AddRef(void) \
{ \
_class* agg = NS_CYCLE_COLLECTION_CLASSNAME(_class)::Downcast(this); \
MOZ_ASSERT(int32_t(agg->mRefCnt) >= 0, "illegal refcnt"); \
NS_CheckThreadSafe(agg->_mOwningThread.GetThread(), \
#_class " not thread-safe"); \
NS_ASSERT_OWNINGTHREAD_AGGREGATE(agg, _class); \
nsrefcnt count = agg->mRefCnt.incr(); \
NS_LOG_ADDREF(this, count, #_class, sizeof(*agg)); \
return count; \
@ -154,8 +153,7 @@ _class::Internal::Release(void) \
{ \
_class* agg = NS_CYCLE_COLLECTION_CLASSNAME(_class)::Downcast(this); \
MOZ_ASSERT(int32_t(agg->mRefCnt) > 0, "dup release"); \
NS_CheckThreadSafe(agg->_mOwningThread.GetThread(), \
#_class " not thread-safe"); \
NS_ASSERT_OWNINGTHREAD_AGGREGATE(agg, _class); \
nsrefcnt count = agg->mRefCnt.decr(this); \
NS_LOG_RELEASE(this, count, #_class); \
return count; \

Просмотреть файл

@ -61,11 +61,13 @@ private:
};
#define NS_DECL_OWNINGTHREAD nsAutoOwningThread _mOwningThread;
#define NS_ASSERT_OWNINGTHREAD(_class) \
NS_CheckThreadSafe(_mOwningThread.GetThread(), #_class " not thread-safe")
#define NS_ASSERT_OWNINGTHREAD_AGGREGATE(agg, _class) \
NS_CheckThreadSafe(agg->_mOwningThread.GetThread(), #_class " not thread-safe")
#define NS_ASSERT_OWNINGTHREAD(_class) NS_ASSERT_OWNINGTHREAD_AGGREGATE(this, _class)
#else // !DEBUG && !NIGHTLY_BUILD
#define NS_DECL_OWNINGTHREAD /* nothing */
#define NS_ASSERT_OWNINGTHREAD_AGGREGATE(agg, _class) ((void)0)
#define NS_ASSERT_OWNINGTHREAD(_class) ((void)0)
#endif // DEBUG || NIGHTLY_BUILD