зеркало из https://github.com/mozilla/pjs.git
Added more info to the list output
This commit is contained in:
Родитель
6494b9f964
Коммит
6de379d3e8
|
@ -1353,6 +1353,33 @@ StyleContextImpl::~StyleContextImpl()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LOG_ADDREF_RELEASE
|
||||||
|
extern "C" {
|
||||||
|
void __log_addref(void* p, int oldrc, int newrc);
|
||||||
|
void __log_release(void* p, int oldrc, int newrc);
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMPL_QUERY_INTERFACE(StyleContextImpl, kIStyleContextIID)
|
||||||
|
|
||||||
|
nsrefcnt StyleContextImpl::AddRef(void)
|
||||||
|
{
|
||||||
|
NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt");
|
||||||
|
__log_addref((void*) this, mRefCnt, mRefCnt + 1);
|
||||||
|
return ++mRefCnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsrefcnt StyleContextImpl::Release(void)
|
||||||
|
{
|
||||||
|
__log_release((void*) this, mRefCnt, mRefCnt - 1);
|
||||||
|
NS_PRECONDITION(0 != mRefCnt, "dup release");
|
||||||
|
if (--mRefCnt == 0) {
|
||||||
|
NS_DELETEXPCOM(this);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return mRefCnt;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
|
||||||
#ifdef DEBUG_REFS
|
#ifdef DEBUG_REFS
|
||||||
NS_IMPL_QUERY_INTERFACE(StyleContextImpl, kIStyleContextIID)
|
NS_IMPL_QUERY_INTERFACE(StyleContextImpl, kIStyleContextIID)
|
||||||
|
|
||||||
|
@ -1378,6 +1405,7 @@ nsrefcnt StyleContextImpl::Release(void)
|
||||||
#else
|
#else
|
||||||
NS_IMPL_ISUPPORTS(StyleContextImpl, kIStyleContextIID)
|
NS_IMPL_ISUPPORTS(StyleContextImpl, kIStyleContextIID)
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1935,6 +1963,7 @@ void StyleContextImpl::List(FILE* out, PRInt32 aIndent)
|
||||||
// Indent
|
// Indent
|
||||||
PRInt32 index;
|
PRInt32 index;
|
||||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||||
|
fprintf(out, "%p(%d) ", this, mRefCnt);
|
||||||
if (nsnull != mPseudoTag) {
|
if (nsnull != mPseudoTag) {
|
||||||
nsAutoString buffer;
|
nsAutoString buffer;
|
||||||
mPseudoTag->ToString(buffer);
|
mPseudoTag->ToString(buffer);
|
||||||
|
|
|
@ -1353,6 +1353,33 @@ StyleContextImpl::~StyleContextImpl()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LOG_ADDREF_RELEASE
|
||||||
|
extern "C" {
|
||||||
|
void __log_addref(void* p, int oldrc, int newrc);
|
||||||
|
void __log_release(void* p, int oldrc, int newrc);
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMPL_QUERY_INTERFACE(StyleContextImpl, kIStyleContextIID)
|
||||||
|
|
||||||
|
nsrefcnt StyleContextImpl::AddRef(void)
|
||||||
|
{
|
||||||
|
NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt");
|
||||||
|
__log_addref((void*) this, mRefCnt, mRefCnt + 1);
|
||||||
|
return ++mRefCnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsrefcnt StyleContextImpl::Release(void)
|
||||||
|
{
|
||||||
|
__log_release((void*) this, mRefCnt, mRefCnt - 1);
|
||||||
|
NS_PRECONDITION(0 != mRefCnt, "dup release");
|
||||||
|
if (--mRefCnt == 0) {
|
||||||
|
NS_DELETEXPCOM(this);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return mRefCnt;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
|
||||||
#ifdef DEBUG_REFS
|
#ifdef DEBUG_REFS
|
||||||
NS_IMPL_QUERY_INTERFACE(StyleContextImpl, kIStyleContextIID)
|
NS_IMPL_QUERY_INTERFACE(StyleContextImpl, kIStyleContextIID)
|
||||||
|
|
||||||
|
@ -1378,6 +1405,7 @@ nsrefcnt StyleContextImpl::Release(void)
|
||||||
#else
|
#else
|
||||||
NS_IMPL_ISUPPORTS(StyleContextImpl, kIStyleContextIID)
|
NS_IMPL_ISUPPORTS(StyleContextImpl, kIStyleContextIID)
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1935,6 +1963,7 @@ void StyleContextImpl::List(FILE* out, PRInt32 aIndent)
|
||||||
// Indent
|
// Indent
|
||||||
PRInt32 index;
|
PRInt32 index;
|
||||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||||
|
fprintf(out, "%p(%d) ", this, mRefCnt);
|
||||||
if (nsnull != mPseudoTag) {
|
if (nsnull != mPseudoTag) {
|
||||||
nsAutoString buffer;
|
nsAutoString buffer;
|
||||||
mPseudoTag->ToString(buffer);
|
mPseudoTag->ToString(buffer);
|
||||||
|
|
|
@ -1353,6 +1353,33 @@ StyleContextImpl::~StyleContextImpl()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LOG_ADDREF_RELEASE
|
||||||
|
extern "C" {
|
||||||
|
void __log_addref(void* p, int oldrc, int newrc);
|
||||||
|
void __log_release(void* p, int oldrc, int newrc);
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMPL_QUERY_INTERFACE(StyleContextImpl, kIStyleContextIID)
|
||||||
|
|
||||||
|
nsrefcnt StyleContextImpl::AddRef(void)
|
||||||
|
{
|
||||||
|
NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt");
|
||||||
|
__log_addref((void*) this, mRefCnt, mRefCnt + 1);
|
||||||
|
return ++mRefCnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsrefcnt StyleContextImpl::Release(void)
|
||||||
|
{
|
||||||
|
__log_release((void*) this, mRefCnt, mRefCnt - 1);
|
||||||
|
NS_PRECONDITION(0 != mRefCnt, "dup release");
|
||||||
|
if (--mRefCnt == 0) {
|
||||||
|
NS_DELETEXPCOM(this);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return mRefCnt;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
|
||||||
#ifdef DEBUG_REFS
|
#ifdef DEBUG_REFS
|
||||||
NS_IMPL_QUERY_INTERFACE(StyleContextImpl, kIStyleContextIID)
|
NS_IMPL_QUERY_INTERFACE(StyleContextImpl, kIStyleContextIID)
|
||||||
|
|
||||||
|
@ -1378,6 +1405,7 @@ nsrefcnt StyleContextImpl::Release(void)
|
||||||
#else
|
#else
|
||||||
NS_IMPL_ISUPPORTS(StyleContextImpl, kIStyleContextIID)
|
NS_IMPL_ISUPPORTS(StyleContextImpl, kIStyleContextIID)
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1935,6 +1963,7 @@ void StyleContextImpl::List(FILE* out, PRInt32 aIndent)
|
||||||
// Indent
|
// Indent
|
||||||
PRInt32 index;
|
PRInt32 index;
|
||||||
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
for (index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||||
|
fprintf(out, "%p(%d) ", this, mRefCnt);
|
||||||
if (nsnull != mPseudoTag) {
|
if (nsnull != mPseudoTag) {
|
||||||
nsAutoString buffer;
|
nsAutoString buffer;
|
||||||
mPseudoTag->ToString(buffer);
|
mPseudoTag->ToString(buffer);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче