Cleanup moz-decl-counter usage and fix NS_LOG_ADDREF usage

This commit is contained in:
kipp%netscape.com 1999-10-08 20:41:19 +00:00
Родитель 5632139141
Коммит b0dcc883f8
265 изменённых файлов: 1185 добавлений и 3102 удалений

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

@ -36,7 +36,7 @@ nsCodebasePrincipal::AddRef(void)
{
NS_PRECONDITION(PRInt32(mJSPrincipals.refcount) >= 0, "illegal refcnt");
++mJSPrincipals.refcount;
NS_LOG_ADDREF(this, mJSPrincipals.refcount, "nsCodebasePrincipal");
NS_LOG_ADDREF(this, mJSPrincipals.refcount, "nsCodebasePrincipal", sizeof(*this));
return mJSPrincipals.refcount;
}

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

@ -205,7 +205,6 @@ protected:
PRUint32 mContentID;
};
nsresult NS_NewCommentNode(nsIContent** aInstancePtrResult);
nsresult
NS_NewCommentNode(nsIContent** aInstancePtrResult)
{

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

@ -503,78 +503,12 @@ nsDOMImplementation::SetScriptObject(void *aScriptObject)
// =
// ==================================================================
#if 0
NS_LAYOUT nsresult
NS_NewPostData(PRBool aIsFile, char* aData,
nsIPostData** aInstancePtrResult)
{
nsresult rv = NS_OK;
MOZ_DECL_CTOR_COUNTER(nsDocumentChildNodes);
if (nsnull == aInstancePtrResult) {
return NS_ERROR_NULL_POINTER;
}
*aInstancePtrResult = new nsPostData(aIsFile, aData);
if (nsnull != *aInstancePtrResult) {
NS_ADDREF(*aInstancePtrResult);
} else {
rv = NS_ERROR_OUT_OF_MEMORY;
}
return rv;
}
#endif
#if 0 // nuking postdata
nsPostData::nsPostData(PRBool aIsFile, char* aData)
{
NS_INIT_REFCNT();
mData = nsnull;
mDataLen = 0;
mIsFile = aIsFile;
if (aData) {
mDataLen = PL_strlen(aData);
mData = aData;
}
}
nsPostData::~nsPostData()
{
if (nsnull != mData) {
delete [] mData;
mData = nsnull;
}
}
/*
* Implementation of ISupports methods...
*/
NS_IMPL_ISUPPORTS(nsPostData,kIPostDataIID);
PRBool nsPostData::IsFile()
{
return mIsFile;
}
const char* nsPostData::GetData()
{
return mData;
}
PRInt32 nsPostData::GetDataLength()
{
return mDataLen;
}
#endif // nuking postdata.
// ==================================================================
// =
// ==================================================================
nsDocumentChildNodes::nsDocumentChildNodes(nsIDocument* aDocument)
{
MOZ_COUNT_CTOR(nsDocumentChildNodes);
// We don't reference count our document reference (to avoid circular
// references). We'll be told when the document goes away.
mDocument = aDocument;
@ -582,6 +516,7 @@ nsDocumentChildNodes::nsDocumentChildNodes(nsIDocument* aDocument)
nsDocumentChildNodes::~nsDocumentChildNodes()
{
MOZ_COUNT_DTOR(nsDocumentChildNodes);
}
NS_IMETHODIMP

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

@ -299,13 +299,17 @@ public:
void **aResult);
};
MOZ_DECL_CTOR_COUNTER(nsDocumentEncoderFactory);
nsDocumentEncoderFactory::nsDocumentEncoderFactory()
{
MOZ_COUNT_CTOR(nsDocumentEncoderFactory);
mRefCnt = 0;
}
nsDocumentEncoderFactory::~nsDocumentEncoderFactory()
{
MOZ_COUNT_DTOR(nsDocumentEncoderFactory);
NS_ASSERTION(mRefCnt == 0, "non-zero refcnt at destruction");
}

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

@ -23,7 +23,7 @@
nsGenericDOMNodeList::nsGenericDOMNodeList()
{
mRefCnt = 0;
NS_INIT_REFCNT();
mScriptObject = nsnull;
}

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

@ -38,14 +38,20 @@ static PRInt32 gNameSpaceTableRefs;
static nsHashtable* gURIToIDTable;
static nsVoidArray* gURIArray;
MOZ_DECL_CTOR_COUNTER(NameSpaceURIKey);
class NameSpaceURIKey : public nsHashKey {
public:
NameSpaceURIKey(const nsString* aString)
: mString(aString)
{ }
{
MOZ_COUNT_CTOR(NameSpaceURIKey);
}
virtual ~NameSpaceURIKey(void)
{ }
{
MOZ_COUNT_DTOR(NameSpaceURIKey);
}
virtual PRUint32 HashValue(void) const
{
@ -191,7 +197,6 @@ public:
PRInt32 mID;
};
NameSpaceImpl::NameSpaceImpl(nsINameSpaceManager* aManager,
NameSpaceImpl* aParent,
nsIAtom* aPrefix,
@ -384,7 +389,6 @@ protected:
};
NameSpaceManagerImpl::NameSpaceManagerImpl()
{
NS_INIT_REFCNT();

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

@ -267,7 +267,7 @@ PRBool GetNodeBracketPoints(nsIContent* aNode,
/******************************************************
* constructor/destructor
******************************************************/
nsRange::nsRange() :
mIsPositioned(PR_FALSE),
mStartOffset(0),
@ -287,7 +287,7 @@ nsRange::~nsRange()
}
/******************************************************
* XPCOM cruft
* nsISupports
******************************************************/
NS_IMPL_ADDREF(nsRange)

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

@ -15,6 +15,8 @@
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsRange_h___
#define nsRange_h___
/*
* nsRange.h: interface of the nsRange object.
@ -207,3 +209,5 @@ PRBool GetNodeBracketPoints(nsIContent* aNode,
nsCOMPtr<nsIDOMNode>* outParent,
PRInt32* outStartOffset,
PRInt32* outEndOffset);
#endif /* nsRange_h___ */

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

@ -26,8 +26,6 @@
#include "nsIFrame.h"
//#define DEBUG_REFS
static NS_DEFINE_IID(kIStyleContextIID, NS_ISTYLECONTEXT_IID);
#define DELETE_ARRAY_IF(array) if (array) { delete[] array; array = nsnull; }
@ -1372,26 +1370,16 @@ protected:
StyleContentImpl mContent;
StyleUserInterfaceImpl mUserInterface;
#ifdef DEBUG_REFS
PRInt32 mInstance;
#endif
};
static PRInt32 gLastDataCode;
#ifdef DEBUG_REFS
static PRInt32 gInstanceCount;
static PRInt32 gInstrument = 6;
#endif
static PRBool HashStyleRule(nsISupports* aRule, void* aData)
{
*((PRUint32*)aData) ^= PRUint32(aRule);
return PR_TRUE;
}
MOZ_DECL_CTOR_COUNTER(StyleContextImpl);
StyleContextImpl::StyleContextImpl(nsIStyleContext* aParent,
nsIAtom* aPseudoTag,
nsISupportsArray* aRules,
@ -1413,8 +1401,6 @@ StyleContextImpl::StyleContextImpl(nsIStyleContext* aParent,
mContent(),
mUserInterface()
{
MOZ_COUNT_CTOR(StyleContextImpl);
NS_INIT_REFCNT();
NS_IF_ADDREF(mPseudoTag);
NS_IF_ADDREF(mRules);
@ -1430,17 +1416,10 @@ StyleContextImpl::StyleContextImpl(nsIStyleContext* aParent,
if (nsnull != mRules) {
mRules->EnumerateForwards(HashStyleRule, &mRuleHash);
}
#ifdef DEBUG_REFS
mInstance = ++gInstanceCount;
fprintf(stdout, "%d of %d + StyleContext\n", mInstance, gInstanceCount);
#endif
}
StyleContextImpl::~StyleContextImpl()
{
MOZ_COUNT_DTOR(StyleContextImpl);
NS_ASSERTION((nsnull == mChild) && (nsnull == mEmptyChild), "destructing context with children");
if (mParent) {
@ -1451,76 +1430,9 @@ StyleContextImpl::~StyleContextImpl()
NS_IF_RELEASE(mPseudoTag);
NS_IF_RELEASE(mRules);
#ifdef DEBUG_REFS
fprintf(stdout, "%d of %d - StyleContext\n", mInstance, gInstanceCount);
--gInstanceCount;
#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);
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "StyleContextImpl");
return mRefCnt;
}
nsrefcnt StyleContextImpl::Release(void)
{
NS_PRECONDITION(0 != mRefCnt, "dup release");
__log_release((void*) this, mRefCnt, mRefCnt - 1);
--mRefCnt;
NS_LOG_RELEASE(this, mRefCnt, "StyleContextImpl");
if (mRefCnt == 0) {
NS_DELETEXPCOM(this);
return 0;
}
return mRefCnt;
}
#else
#ifdef DEBUG_REFS
NS_IMPL_QUERY_INTERFACE(StyleContextImpl, kIStyleContextIID)
nsrefcnt StyleContextImpl::AddRef(void)
{
if ((gInstrument == -1) || (mInstance == gInstrument)) {
fprintf(stdout, "%d AddRef StyleContext %d\n", mRefCnt + 1, mInstance);
}
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "StyleContextImpl");
return mRefCnt;
}
nsrefcnt StyleContextImpl::Release(void)
{
if ((gInstrument == -1) || (mInstance == gInstrument)) {
fprintf(stdout, "%d Release StyleContext %d\n", mRefCnt - 1, mInstance);
}
--mRefCnt;
NS_LOG_RELEASE(this, mRefCnt, "StyleContextImpl");
if (mRefCnt == 0) {
delete this;
return 0;
}
return mRefCnt;
}
#else
NS_IMPL_ISUPPORTS(StyleContextImpl, kIStyleContextIID)
#endif
#endif
nsIStyleContext* StyleContextImpl::GetParent(void) const
{

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

@ -200,8 +200,6 @@ protected:
#endif
};
MOZ_DECL_CTOR_COUNTER(StyleSetImpl);
StyleSetImpl::StyleSetImpl()
: mOverrideSheets(nsnull),
mDocSheets(nsnull),
@ -210,13 +208,11 @@ StyleSetImpl::StyleSetImpl()
mRecycler(nsnull),
mFrameConstructor(nsnull)
{
MOZ_COUNT_CTOR(StyleSetImpl);
NS_INIT_REFCNT();
}
StyleSetImpl::~StyleSetImpl()
{
MOZ_COUNT_DTOR(StyleSetImpl);
NS_IF_RELEASE(mOverrideSheets);
NS_IF_RELEASE(mDocSheets);
NS_IF_RELEASE(mBackstopSheets);

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

@ -74,7 +74,6 @@ protected:
PRUint32 mContentID;
};
nsresult NS_NewTextNode(nsIContent** aInstancePtrResult);
nsresult
NS_NewTextNode(nsIContent** aInstancePtrResult)
{

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

@ -31,7 +31,6 @@ nsPrivateTextRange::nsPrivateTextRange(PRUint16 aRangeStart, PRUint16 aRangeEnd,
nsPrivateTextRange::~nsPrivateTextRange(void)
{
}
NS_IMPL_ADDREF(nsPrivateTextRange)

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

@ -16,21 +16,18 @@
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
#include "nslayout.h"
#include "nsGenericDOMHTMLCollection.h"
MOZ_DECL_CTOR_COUNTER(nsGenericDOMHTMLCollection);
nsGenericDOMHTMLCollection::nsGenericDOMHTMLCollection()
{
MOZ_COUNT_CTOR(nsGenericDOMHTMLCollection);
mRefCnt = 0;
mScriptObject = nsnull;
}
nsGenericDOMHTMLCollection::~nsGenericDOMHTMLCollection()
{
MOZ_COUNT_DTOR(nsGenericDOMHTMLCollection);
}
nsresult

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

@ -1067,7 +1067,9 @@ nsGenericHTMLElement::GetInlineStyleRules(nsISupportsArray* aRules)
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::style, value)) {
if (eHTMLUnit_ISupports == value.GetUnit()) {
nsISupports* supports = value.GetISupportsValue();
result = supports->QueryInterface(kIStyleRuleIID, (void**)&rule);
if (supports) {
result = supports->QueryInterface(kIStyleRuleIID, (void**)&rule);
}
NS_RELEASE(supports);
}
}
@ -1334,16 +1336,19 @@ nsGenericHTMLElement::AttributeToString(nsIAtom* aAttribute,
if (nsHTMLAtoms::style == aAttribute) {
if (eHTMLUnit_ISupports == aValue.GetUnit()) {
nsIStyleRule* rule = (nsIStyleRule*) aValue.GetISupportsValue();
nsICSSStyleRule* cssRule;
if (NS_OK == rule->QueryInterface(kICSSStyleRuleIID, (void**)&cssRule)) {
nsICSSDeclaration* decl = cssRule->GetDeclaration();
if (nsnull != decl) {
decl->ToString(aResult);
if (rule) {
nsICSSStyleRule* cssRule;
if (NS_OK == rule->QueryInterface(kICSSStyleRuleIID, (void**)&cssRule)) {
nsICSSDeclaration* decl = cssRule->GetDeclaration();
if (nsnull != decl) {
decl->ToString(aResult);
}
NS_RELEASE(cssRule);
}
NS_RELEASE(cssRule);
}
else {
aResult = "Unknown rule type";
else {
aResult = "Unknown rule type";
}
NS_RELEASE(rule);
}
return NS_CONTENT_ATTR_HAS_VALUE;
}

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

@ -126,18 +126,15 @@ NS_NewHTMLAnchorElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLAnchorElement);
nsHTMLAnchorElement::nsHTMLAnchorElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLAnchorElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLAnchorElement::~nsHTMLAnchorElement()
{
MOZ_COUNT_DTOR(nsHTMLAnchorElement);
}
NS_IMPL_ADDREF(nsHTMLAnchorElement)

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

@ -125,11 +125,9 @@ NS_NewHTMLAppletElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLAppletElement);
nsHTMLAppletElement::nsHTMLAppletElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLAppletElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mReflectedApplet = PR_FALSE;
@ -137,7 +135,6 @@ nsHTMLAppletElement::nsHTMLAppletElement(nsIAtom* aTag)
nsHTMLAppletElement::~nsHTMLAppletElement()
{
MOZ_COUNT_DTOR(nsHTMLAppletElement);
}
NS_IMPL_ADDREF(nsHTMLAppletElement)

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

@ -106,18 +106,15 @@ NS_NewHTMLAreaElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLAreaElement);
nsHTMLAreaElement::nsHTMLAreaElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLAreaElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLAreaElement::~nsHTMLAreaElement()
{
MOZ_COUNT_DTOR(nsHTMLAreaElement);
}
NS_IMPL_ADDREF(nsHTMLAreaElement)

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

@ -85,18 +85,15 @@ NS_NewHTMLBRElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLBRElement);
nsHTMLBRElement::nsHTMLBRElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLBRElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLBRElement::~nsHTMLBRElement()
{
MOZ_COUNT_DTOR(nsHTMLBRElement);
}
NS_IMPL_ADDREF(nsHTMLBRElement)

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

@ -86,18 +86,15 @@ NS_NewHTMLBaseElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLBaseElement);
nsHTMLBaseElement::nsHTMLBaseElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLBaseElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLBaseElement::~nsHTMLBaseElement()
{
MOZ_COUNT_DTOR(nsHTMLBaseElement);
}
NS_IMPL_ADDREF(nsHTMLBaseElement)

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

@ -88,18 +88,15 @@ NS_NewHTMLBaseFontElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLBaseFontElement);
nsHTMLBaseFontElement::nsHTMLBaseFontElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLBaseFontElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLBaseFontElement::~nsHTMLBaseFontElement()
{
MOZ_COUNT_DTOR(nsHTMLBaseFontElement);
}
NS_IMPL_ADDREF(nsHTMLBaseFontElement)

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

@ -116,19 +116,16 @@ public:
BodyFixupRule* mInlineStyleRule;
};
MOZ_DECL_CTOR_COUNTER(nsBodyInner);
nsBodyInner::nsBodyInner()
: nsGenericHTMLContainerElement(),
mContentStyleRule(nsnull),
mInlineStyleRule(nsnull)
{
MOZ_COUNT_CTOR(nsBodyInner);
}
nsBodyInner::~nsBodyInner()
{
MOZ_COUNT_DTOR(nsBodyInner);
if (nsnull != mContentStyleRule) {
mContentStyleRule->mPart = nsnull;
mContentStyleRule->mSheet = nsnull;
@ -215,11 +212,9 @@ friend class BodyFixupRule;
//----------------------------------------------------------------------
MOZ_DECL_CTOR_COUNTER(BodyRule);
BodyRule::BodyRule(nsHTMLBodyElement* aPart, nsIHTMLStyleSheet* aSheet)
{
MOZ_COUNT_CTOR(BodyRule);
NS_INIT_REFCNT();
mPart = aPart;
mSheet = aSheet;
@ -227,7 +222,6 @@ BodyRule::BodyRule(nsHTMLBodyElement* aPart, nsIHTMLStyleSheet* aSheet)
BodyRule::~BodyRule()
{
MOZ_COUNT_DTOR(BodyRule);
}
NS_IMPL_ISUPPORTS(BodyRule, kIStyleRuleIID);
@ -395,19 +389,16 @@ BodyRule::List(FILE* out, PRInt32 aIndent) const
//----------------------------------------------------------------------
MOZ_DECL_CTOR_COUNTER(BodyFixupRule);
BodyFixupRule::BodyFixupRule(nsHTMLBodyElement* aPart, nsIHTMLCSSStyleSheet* aSheet)
: mPart(aPart),
mSheet(aSheet)
{
MOZ_COUNT_CTOR(BodyFixupRule);
NS_INIT_REFCNT();
}
BodyFixupRule::~BodyFixupRule()
{
MOZ_COUNT_DTOR(BodyFixupRule);
}
NS_IMPL_ADDREF(BodyFixupRule);
@ -570,18 +561,15 @@ NS_NewHTMLBodyElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLBodyElement);
nsHTMLBodyElement::nsHTMLBodyElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLBodyElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLBodyElement::~nsHTMLBodyElement()
{
MOZ_COUNT_DTOR(nsHTMLBodyElement);
}
NS_IMPL_ADDREF(nsHTMLBodyElement)

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

@ -129,11 +129,9 @@ NS_NewHTMLButtonElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLButtonElement);
nsHTMLButtonElement::nsHTMLButtonElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLButtonElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mForm = nsnull;
@ -142,7 +140,6 @@ nsHTMLButtonElement::nsHTMLButtonElement(nsIAtom* aTag)
nsHTMLButtonElement::~nsHTMLButtonElement()
{
MOZ_COUNT_DTOR(nsHTMLButtonElement);
if (nsnull != mForm) {
// prevent mForm from decrementing its ref count on us
mForm->RemoveElement(this, PR_FALSE);
@ -152,13 +149,7 @@ nsHTMLButtonElement::~nsHTMLButtonElement()
// nsISupports
NS_IMETHODIMP_(nsrefcnt)
nsHTMLButtonElement::AddRef(void)
{
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "nsHTMLButtonElement");
return mRefCnt;
}
NS_IMPL_ADDREF(nsHTMLButtonElement);
nsresult
nsHTMLButtonElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)

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

@ -85,18 +85,15 @@ NS_NewHTMLDListElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLDListElement);
nsHTMLDListElement::nsHTMLDListElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLDListElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLDListElement::~nsHTMLDListElement()
{
MOZ_COUNT_DTOR(nsHTMLDListElement);
}
NS_IMPL_ADDREF(nsHTMLDListElement)

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

@ -86,18 +86,15 @@ NS_NewHTMLDelElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLDelElement);
nsHTMLDelElement::nsHTMLDelElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLDelElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLDelElement::~nsHTMLDelElement()
{
MOZ_COUNT_DTOR(nsHTMLDelElement);
}
NS_IMPL_ADDREF(nsHTMLDelElement)

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

@ -89,18 +89,15 @@ NS_NewHTMLDirectoryElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLDirectoryElement);
nsHTMLDirectoryElement::nsHTMLDirectoryElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLDirectoryElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLDirectoryElement::~nsHTMLDirectoryElement()
{
MOZ_COUNT_DTOR(nsHTMLDirectoryElement);
}
NS_IMPL_ADDREF(nsHTMLDirectoryElement)

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

@ -87,22 +87,18 @@ NS_NewHTMLDivElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLDivElement);
nsHTMLDivElement::nsHTMLDivElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLDivElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLDivElement::~nsHTMLDivElement()
{
MOZ_COUNT_DTOR(nsHTMLDivElement);
}
NS_IMPL_ADDREF(nsHTMLDivElement)
NS_IMPL_RELEASE(nsHTMLDivElement)
nsresult

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

@ -84,18 +84,15 @@ NS_NewHTMLEmbedElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLEmbedElement);
nsHTMLEmbedElement::nsHTMLEmbedElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLEmbedElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLEmbedElement::~nsHTMLEmbedElement()
{
MOZ_COUNT_DTOR(nsHTMLEmbedElement);
}
NS_IMPL_ADDREF(nsHTMLEmbedElement)

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

@ -99,11 +99,9 @@ NS_NewHTMLFieldSetElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLFieldSetElement);
nsHTMLFieldSetElement::nsHTMLFieldSetElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLFieldSetElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mForm = nsnull;
@ -111,7 +109,6 @@ nsHTMLFieldSetElement::nsHTMLFieldSetElement(nsIAtom* aTag)
nsHTMLFieldSetElement::~nsHTMLFieldSetElement()
{
MOZ_COUNT_DTOR(nsHTMLFieldSetElement);
if (nsnull != mForm) {
// prevent mForm from decrementing its ref count on us
mForm->RemoveElement(this, PR_FALSE);

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

@ -92,18 +92,15 @@ NS_NewHTMLFontElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLFontElement);
nsHTMLFontElement::nsHTMLFontElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLFontElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLFontElement::~nsHTMLFontElement()
{
MOZ_COUNT_DTOR(nsHTMLFontElement);
}
NS_IMPL_ADDREF(nsHTMLFontElement)

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

@ -174,11 +174,9 @@ NS_NewHTMLFormElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLFormElement);
nsHTMLFormElement::nsHTMLFormElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLFormElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mControls = new nsFormControlList();
@ -188,7 +186,6 @@ nsHTMLFormElement::nsHTMLFormElement(nsIAtom* aTag)
nsHTMLFormElement::~nsHTMLFormElement()
{
MOZ_COUNT_DTOR(nsHTMLFormElement);
// set the controls to have no form
PRUint32 numControls;
@ -239,19 +236,11 @@ nsHTMLFormElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return NS_NOINTERFACE;
}
NS_IMETHODIMP_(nsrefcnt)
nsHTMLFormElement::AddRef(void)
{
//nsTraceRefcnt::AddRef((nsIForm*)this, mRefCnt+1, __FILE__, __LINE__);
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "nsHTMLFormElement");
return mRefCnt;
}
NS_IMPL_ADDREF(nsHTMLFormElement);
NS_IMETHODIMP_(nsrefcnt)
nsHTMLFormElement::Release()
{
//nsTraceRefcnt::Release((nsIForm*)this, mRefCnt-1, __FILE__, __LINE__);
--mRefCnt;
NS_LOG_RELEASE(this, mRefCnt, "nsHTMLFormElement");
PRUint32 numChildren;
@ -639,18 +628,15 @@ nsHTMLFormElement::Item(PRUint32 aIndex, nsIDOMElement** aReturn)
// nsFormControlList implementation, this could go away if there were a lightweight collection implementation somewhere
MOZ_DECL_CTOR_COUNTER(nsFormControlList);
nsFormControlList::nsFormControlList()
{
MOZ_COUNT_CTOR(nsFormControlList);
NS_INIT_REFCNT();
mScriptObject = nsnull;
}
nsFormControlList::~nsFormControlList()
{
MOZ_COUNT_DTOR(nsFormControlList);
Clear();
}

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

@ -98,18 +98,15 @@ NS_NewHTMLFrameElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLFrameElement);
nsHTMLFrameElement::nsHTMLFrameElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLFrameElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLFrameElement::~nsHTMLFrameElement()
{
MOZ_COUNT_DTOR(nsHTMLFrameElement);
}
NS_IMPL_ADDREF(nsHTMLFrameElement)

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

@ -86,18 +86,15 @@ NS_NewHTMLFrameSetElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLFrameSetElement);
nsHTMLFrameSetElement::nsHTMLFrameSetElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLFrameSetElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLFrameSetElement::~nsHTMLFrameSetElement()
{
MOZ_COUNT_DTOR(nsHTMLFrameSetElement);
}
NS_IMPL_ADDREF(nsHTMLFrameSetElement)

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

@ -91,18 +91,15 @@ NS_NewHTMLHRElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLHRElement);
nsHTMLHRElement::nsHTMLHRElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLHRElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLHRElement::~nsHTMLHRElement()
{
MOZ_COUNT_DTOR(nsHTMLHRElement);
}
NS_IMPL_ADDREF(nsHTMLHRElement)

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

@ -84,18 +84,15 @@ NS_NewHTMLHeadElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLHeadElement);
nsHTMLHeadElement::nsHTMLHeadElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLHeadElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLHeadElement::~nsHTMLHeadElement()
{
MOZ_COUNT_DTOR(nsHTMLHeadElement);
}
NS_IMPL_ADDREF(nsHTMLHeadElement)

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

@ -85,18 +85,15 @@ NS_NewHTMLHeadingElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLHeadingElement);
nsHTMLHeadingElement::nsHTMLHeadingElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLHeadingElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLHeadingElement::~nsHTMLHeadingElement()
{
MOZ_COUNT_DTOR(nsHTMLHeadingElement);
}
NS_IMPL_ADDREF(nsHTMLHeadingElement)

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

@ -89,17 +89,14 @@ NS_NewHTMLHtmlElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLHtmlElement);
nsHTMLHtmlElement::nsHTMLHtmlElement()
{
MOZ_COUNT_CTOR(nsHTMLHtmlElement);
NS_INIT_REFCNT();
}
nsHTMLHtmlElement::~nsHTMLHtmlElement()
{
MOZ_COUNT_DTOR(nsHTMLHtmlElement);
}
NS_IMPL_ADDREF(nsHTMLHtmlElement)

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

@ -110,18 +110,15 @@ NS_NewHTMLIFrameElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLIFrameElement);
nsHTMLIFrameElement::nsHTMLIFrameElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLIFrameElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLIFrameElement::~nsHTMLIFrameElement()
{
MOZ_COUNT_DTOR(nsHTMLIFrameElement);
}
NS_IMPL_ADDREF(nsHTMLIFrameElement)

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

@ -147,11 +147,9 @@ NS_NewHTMLImageElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLImageElement);
nsHTMLImageElement::nsHTMLImageElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLImageElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mOwnerDocument = nsnull;
@ -159,7 +157,6 @@ nsHTMLImageElement::nsHTMLImageElement(nsIAtom* aTag)
nsHTMLImageElement::~nsHTMLImageElement()
{
MOZ_COUNT_DTOR(nsHTMLImageElement);
NS_IF_RELEASE(mOwnerDocument);
}

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

@ -162,11 +162,9 @@ NS_NewHTMLInputElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLInputElement);
nsHTMLInputElement::nsHTMLInputElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLInputElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mType = NS_FORM_INPUT_TEXT; // default value
@ -177,7 +175,6 @@ nsHTMLInputElement::nsHTMLInputElement(nsIAtom* aTag)
nsHTMLInputElement::~nsHTMLInputElement()
{
MOZ_COUNT_DTOR(nsHTMLInputElement);
if (nsnull != mForm) {
// prevent mForm from decrementing its ref count on us
mForm->RemoveElement(this, PR_FALSE);
@ -187,15 +184,6 @@ nsHTMLInputElement::~nsHTMLInputElement()
// nsISupports
NS_IMETHODIMP_(nsrefcnt)
nsHTMLInputElement::AddRef(void)
{
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "nsHTMLInputElement");
return mRefCnt;
}
NS_IMETHODIMP
nsHTMLInputElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
@ -218,6 +206,8 @@ nsHTMLInputElement::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return NS_NOINTERFACE;
}
NS_IMPL_ADDREF(nsHTMLInputElement);
NS_IMETHODIMP_(nsrefcnt)
nsHTMLInputElement::Release()
{

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

@ -86,18 +86,15 @@ NS_NewHTMLInsElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLInsElement);
nsHTMLInsElement::nsHTMLInsElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLInsElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLInsElement::~nsHTMLInsElement()
{
MOZ_COUNT_DTOR(nsHTMLInsElement);
}
NS_IMPL_ADDREF(nsHTMLInsElement)

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

@ -85,18 +85,15 @@ NS_NewHTMLIsIndexElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLIsIndexElement);
nsHTMLIsIndexElement::nsHTMLIsIndexElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLIsIndexElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLIsIndexElement::~nsHTMLIsIndexElement()
{
MOZ_COUNT_DTOR(nsHTMLIsIndexElement);
}
NS_IMPL_ADDREF(nsHTMLIsIndexElement)

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

@ -87,18 +87,15 @@ NS_NewHTMLLIElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLLIElement);
nsHTMLLIElement::nsHTMLLIElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLLIElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLLIElement::~nsHTMLLIElement()
{
MOZ_COUNT_DTOR(nsHTMLLIElement);
}
NS_IMPL_ADDREF(nsHTMLLIElement)

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

@ -103,11 +103,9 @@ NS_NewHTMLLabelElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLLabelElement);
nsHTMLLabelElement::nsHTMLLabelElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLLabelElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mForm = nsnull;
@ -115,7 +113,6 @@ nsHTMLLabelElement::nsHTMLLabelElement(nsIAtom* aTag)
nsHTMLLabelElement::~nsHTMLLabelElement()
{
MOZ_COUNT_DTOR(nsHTMLLabelElement);
if (nsnull != mForm) {
// prevent mForm from decrementing its ref count on us
mForm->RemoveElement(this, PR_FALSE);

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

@ -93,11 +93,9 @@ NS_NewHTMLLegendElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLLegendElement);
nsHTMLLegendElement::nsHTMLLegendElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLLegendElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mForm = nsnull;
@ -105,7 +103,6 @@ nsHTMLLegendElement::nsHTMLLegendElement(nsIAtom* aTag)
nsHTMLLegendElement::~nsHTMLLegendElement()
{
MOZ_COUNT_DTOR(nsHTMLLegendElement);
if (mForm) {
NS_RELEASE(mForm);
}

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

@ -111,11 +111,9 @@ NS_NewHTMLLinkElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLLinkElement);
nsHTMLLinkElement::nsHTMLLinkElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLLinkElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mStyleSheet = nsnull;
@ -123,7 +121,6 @@ nsHTMLLinkElement::nsHTMLLinkElement(nsIAtom* aTag)
nsHTMLLinkElement::~nsHTMLLinkElement()
{
MOZ_COUNT_DTOR(nsHTMLLinkElement);
NS_IF_RELEASE(mStyleSheet);
}

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

@ -199,11 +199,9 @@ NS_NewHTMLMapElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLMapElement);
nsHTMLMapElement::nsHTMLMapElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLMapElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mAreas = nsnull;
@ -211,7 +209,6 @@ nsHTMLMapElement::nsHTMLMapElement(nsIAtom* aTag)
nsHTMLMapElement::~nsHTMLMapElement()
{
MOZ_COUNT_DTOR(nsHTMLMapElement);
if (nsnull != mAreas) {
mAreas->ParentDestroyed();
NS_RELEASE(mAreas);

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

@ -89,18 +89,15 @@ NS_NewHTMLMenuElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLMenuElement);
nsHTMLMenuElement::nsHTMLMenuElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLMenuElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLMenuElement::~nsHTMLMenuElement()
{
MOZ_COUNT_DTOR(nsHTMLMenuElement);
}
NS_IMPL_ADDREF(nsHTMLMenuElement)

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

@ -90,11 +90,9 @@ NS_NewHTMLMetaElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLMetaElement);
nsHTMLMetaElement::nsHTMLMetaElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLMetaElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
@ -102,7 +100,6 @@ nsHTMLMetaElement::nsHTMLMetaElement(nsIAtom* aTag)
nsHTMLMetaElement::~nsHTMLMetaElement()
{
MOZ_COUNT_DTOR(nsHTMLMetaElement);
}
NS_IMPL_ADDREF(nsHTMLMetaElement)

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

@ -86,18 +86,15 @@ NS_NewHTMLModElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLModElement);
nsHTMLModElement::nsHTMLModElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLModElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLModElement::~nsHTMLModElement()
{
MOZ_COUNT_DTOR(nsHTMLModElement);
}
NS_IMPL_ADDREF(nsHTMLModElement)

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

@ -89,18 +89,15 @@ NS_NewHTMLOListElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLOListElement);
nsHTMLOListElement::nsHTMLOListElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLOListElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLOListElement::~nsHTMLOListElement()
{
MOZ_COUNT_DTOR(nsHTMLOListElement);
}
NS_IMPL_ADDREF(nsHTMLOListElement)

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

@ -117,18 +117,15 @@ NS_NewHTMLObjectElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLObjectElement);
nsHTMLObjectElement::nsHTMLObjectElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLObjectElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLObjectElement::~nsHTMLObjectElement()
{
MOZ_COUNT_DTOR(nsHTMLObjectElement);
}
NS_IMPL_ADDREF(nsHTMLObjectElement)

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

@ -86,18 +86,15 @@ NS_NewHTMLOptGroupElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLOptGroupElement);
nsHTMLOptGroupElement::nsHTMLOptGroupElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLOptGroupElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLOptGroupElement::~nsHTMLOptGroupElement()
{
MOZ_COUNT_DTOR(nsHTMLOptGroupElement);
}
NS_IMPL_ADDREF(nsHTMLOptGroupElement)

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

@ -136,18 +136,15 @@ NS_NewHTMLOptionElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLOptionElement);
nsHTMLOptionElement::nsHTMLOptionElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLOptionElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLOptionElement::~nsHTMLOptionElement()
{
MOZ_COUNT_DTOR(nsHTMLOptionElement);
}
// ISupports

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

@ -91,17 +91,14 @@ NS_NewHTMLParagraphElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLParagraphElement);
nsHTMLParagraphElement::nsHTMLParagraphElement()
{
MOZ_COUNT_CTOR(nsHTMLParagraphElement);
NS_INIT_REFCNT();
}
nsHTMLParagraphElement::~nsHTMLParagraphElement()
{
MOZ_COUNT_DTOR(nsHTMLParagraphElement);
}
NS_IMPL_ADDREF(nsHTMLParagraphElement)

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

@ -90,18 +90,15 @@ NS_NewHTMLParamElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLParamElement);
nsHTMLParamElement::nsHTMLParamElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLParamElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLParamElement::~nsHTMLParamElement()
{
MOZ_COUNT_DTOR(nsHTMLParamElement);
}
NS_IMPL_ADDREF(nsHTMLParamElement)

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

@ -87,18 +87,15 @@ NS_NewHTMLPreElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLPreElement);
nsHTMLPreElement::nsHTMLPreElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLPreElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLPreElement::~nsHTMLPreElement()
{
MOZ_COUNT_DTOR(nsHTMLPreElement);
}
NS_IMPL_ADDREF(nsHTMLPreElement)

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

@ -84,18 +84,15 @@ NS_NewHTMLQuoteElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLQuoteElement);
nsHTMLQuoteElement::nsHTMLQuoteElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLQuoteElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLQuoteElement::~nsHTMLQuoteElement()
{
MOZ_COUNT_DTOR(nsHTMLQuoteElement);
}
NS_IMPL_ADDREF(nsHTMLQuoteElement)

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

@ -97,18 +97,15 @@ NS_NewHTMLScriptElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLScriptElement);
nsHTMLScriptElement::nsHTMLScriptElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLScriptElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLScriptElement::~nsHTMLScriptElement()
{
MOZ_COUNT_DTOR(nsHTMLScriptElement);
}
NS_IMPL_ADDREF(nsHTMLScriptElement)

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

@ -203,11 +203,9 @@ NS_NewHTMLSelectElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLSelectElement);
nsHTMLSelectElement::nsHTMLSelectElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLSelectElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mOptions = nsnull;
@ -216,7 +214,6 @@ nsHTMLSelectElement::nsHTMLSelectElement(nsIAtom* aTag)
nsHTMLSelectElement::~nsHTMLSelectElement()
{
MOZ_COUNT_DTOR(nsHTMLSelectElement);
if (nsnull != mForm) {
// prevent mForm from decrementing its ref count on us
mForm->RemoveElement(this, PR_FALSE);
@ -876,11 +873,9 @@ nsOptionList::GetOptions()
mDirty = PR_FALSE;
}
MOZ_DECL_CTOR_COUNTER(nsOptionList);
nsOptionList::nsOptionList(nsHTMLSelectElement* aSelect)
{
MOZ_COUNT_CTOR(nsOptionList);
mDirty = PR_TRUE;
// Do not maintain a reference counted reference. When
// the select goes away, it will let us know.
@ -889,7 +884,6 @@ nsOptionList::nsOptionList(nsHTMLSelectElement* aSelect)
nsOptionList::~nsOptionList()
{
MOZ_COUNT_DTOR(nsOptionList);
DropReference();
}

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

@ -117,18 +117,15 @@ NS_NewHTMLObjectElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLObjectElement);
nsHTMLObjectElement::nsHTMLObjectElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLObjectElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLObjectElement::~nsHTMLObjectElement()
{
MOZ_COUNT_DTOR(nsHTMLObjectElement);
}
NS_IMPL_ADDREF(nsHTMLObjectElement)

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

@ -83,18 +83,15 @@ NS_NewHTMLSpacerElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLSpacerElement);
nsHTMLSpacerElement::nsHTMLSpacerElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLSpacerElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLSpacerElement::~nsHTMLSpacerElement()
{
MOZ_COUNT_DTOR(nsHTMLSpacerElement);
}
NS_IMPL_ADDREF(nsHTMLSpacerElement)

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

@ -78,18 +78,15 @@ NS_NewHTMLSpanElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLSpanElement);
nsHTMLSpanElement::nsHTMLSpanElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLSpanElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLSpanElement::~nsHTMLSpanElement()
{
MOZ_COUNT_DTOR(nsHTMLSpanElement);
}
NS_IMPL_ADDREF(nsHTMLSpanElement)

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

@ -101,11 +101,9 @@ NS_NewHTMLStyleElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLStyleElement);
nsHTMLStyleElement::nsHTMLStyleElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLStyleElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mStyleSheet = nsnull;
@ -113,7 +111,6 @@ nsHTMLStyleElement::nsHTMLStyleElement(nsIAtom* aTag)
nsHTMLStyleElement::~nsHTMLStyleElement()
{
MOZ_COUNT_DTOR(nsHTMLStyleElement);
NS_IF_RELEASE(mStyleSheet);
}

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

@ -85,18 +85,15 @@ NS_NewHTMLTableCaptionElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLTableCaptionElement);
nsHTMLTableCaptionElement::nsHTMLTableCaptionElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLTableCaptionElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLTableCaptionElement::~nsHTMLTableCaptionElement()
{
MOZ_COUNT_DTOR(nsHTMLTableCaptionElement);
}
NS_IMPL_ADDREF(nsHTMLTableCaptionElement)

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

@ -131,11 +131,9 @@ NS_NewHTMLTableCellElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLTableCellElement);
nsHTMLTableCellElement::nsHTMLTableCellElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLTableCellElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mColIndex=0;
@ -143,7 +141,6 @@ nsHTMLTableCellElement::nsHTMLTableCellElement(nsIAtom* aTag)
nsHTMLTableCellElement::~nsHTMLTableCellElement()
{
MOZ_COUNT_DTOR(nsHTMLTableCellElement);
}
NS_IMPL_ADDREF(nsHTMLTableCellElement)

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

@ -101,18 +101,15 @@ NS_NewHTMLTableColElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLTableColElement);
nsHTMLTableColElement::nsHTMLTableColElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLTableColElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLTableColElement::~nsHTMLTableColElement()
{
MOZ_COUNT_DTOR(nsHTMLTableColElement);
}
NS_IMPL_ADDREF(nsHTMLTableColElement)

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

@ -95,18 +95,15 @@ NS_NewHTMLTableColGroupElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTa
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLTableColGroupElement);
nsHTMLTableColGroupElement::nsHTMLTableColGroupElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLTableColGroupElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLTableColGroupElement::~nsHTMLTableColGroupElement()
{
MOZ_COUNT_DTOR(nsHTMLTableColGroupElement);
}
NS_IMPL_ADDREF(nsHTMLTableColGroupElement)

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

@ -149,18 +149,15 @@ protected:
nsHTMLTableElement * mParent;
};
MOZ_DECL_CTOR_COUNTER(TableRowsCollection);
TableRowsCollection::TableRowsCollection(nsHTMLTableElement *aParent)
: nsGenericDOMHTMLCollection()
{
MOZ_COUNT_CTOR(TableRowsCollection);
mParent = aParent;
}
TableRowsCollection::~TableRowsCollection()
{
MOZ_COUNT_DTOR(TableRowsCollection);
// we do NOT have a ref-counted reference to mParent, so do NOT release it!
// this is to avoid circular references. The instantiator who provided mParent
// is responsible for managing our reference for us.
@ -335,11 +332,9 @@ NS_NewHTMLTableElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLTableElement);
nsHTMLTableElement::nsHTMLTableElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLTableElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mTBodies=nsnull;
@ -348,7 +343,6 @@ nsHTMLTableElement::nsHTMLTableElement(nsIAtom* aTag)
nsHTMLTableElement::~nsHTMLTableElement()
{
MOZ_COUNT_DTOR(nsHTMLTableElement);
if (nsnull!=mTBodies)
{
mTBodies->ParentDestroyed();

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

@ -60,18 +60,15 @@ public:
NS_IMETHOD Item(PRUint32 aIndex, nsIDOMNode** aReturn);
};
MOZ_DECL_CTOR_COUNTER(nsTableCellCollection);
nsTableCellCollection::nsTableCellCollection(nsIContent* aParent,
nsIAtom* aTag)
: GenericElementCollection(aParent, aTag)
{
MOZ_COUNT_CTOR(nsTableCellCollection);
}
nsTableCellCollection::~nsTableCellCollection()
{
MOZ_COUNT_DTOR(nsTableCellCollection);
}
NS_IMETHODIMP
@ -239,11 +236,9 @@ NS_NewHTMLTableRowElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLTableRowElement);
nsHTMLTableRowElement::nsHTMLTableRowElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLTableRowElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mCells = nsnull;
@ -251,7 +246,6 @@ nsHTMLTableRowElement::nsHTMLTableRowElement(nsIAtom* aTag)
nsHTMLTableRowElement::~nsHTMLTableRowElement()
{
MOZ_COUNT_DTOR(nsHTMLTableRowElement);
if (nsnull != mCells) {
mCells->ParentDestroyed();
NS_RELEASE(mCells);

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

@ -100,11 +100,9 @@ NS_NewHTMLTableSectionElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLTableSectionElement);
nsHTMLTableSectionElement::nsHTMLTableSectionElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLTableSectionElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mRows = nsnull;
@ -112,7 +110,6 @@ nsHTMLTableSectionElement::nsHTMLTableSectionElement(nsIAtom* aTag)
nsHTMLTableSectionElement::~nsHTMLTableSectionElement()
{
MOZ_COUNT_DTOR(nsHTMLTableSectionElement);
if (nsnull!=mRows) {
mRows->ParentDestroyed();
NS_RELEASE(mRows);

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

@ -129,11 +129,9 @@ NS_NewHTMLTextAreaElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLTextAreaElement);
nsHTMLTextAreaElement::nsHTMLTextAreaElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLTextAreaElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
mForm = nsnull;
@ -141,7 +139,6 @@ nsHTMLTextAreaElement::nsHTMLTextAreaElement(nsIAtom* aTag)
nsHTMLTextAreaElement::~nsHTMLTextAreaElement()
{
MOZ_COUNT_DTOR(nsHTMLTextAreaElement);
if (nsnull != mForm) {
// prevent mForm from decrementing its ref count on us
mForm->RemoveElement(this, PR_FALSE);

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

@ -90,18 +90,15 @@ NS_NewHTMLTitleElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLTitleElement);
nsHTMLTitleElement::nsHTMLTitleElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLTitleElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLTitleElement::~nsHTMLTitleElement()
{
MOZ_COUNT_DTOR(nsHTMLTitleElement);
}
NS_IMPL_ADDREF(nsHTMLTitleElement)

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

@ -90,18 +90,15 @@ NS_NewHTMLUListElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLUListElement);
nsHTMLUListElement::nsHTMLUListElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLUListElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLUListElement::~nsHTMLUListElement()
{
MOZ_COUNT_DTOR(nsHTMLUListElement);
}
NS_IMPL_ADDREF(nsHTMLUListElement)

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

@ -82,18 +82,15 @@ NS_NewHTMLWBRElement(nsIHTMLContent** aInstancePtrResult, nsIAtom* aTag)
return it->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsHTMLWBRElement);
nsHTMLWBRElement::nsHTMLWBRElement(nsIAtom* aTag)
{
MOZ_COUNT_CTOR(nsHTMLWBRElement);
NS_INIT_REFCNT();
mInner.Init(this, aTag);
}
nsHTMLWBRElement::~nsHTMLWBRElement()
{
MOZ_COUNT_DTOR(nsHTMLWBRElement);
}
NS_IMPL_ADDREF(nsHTMLWBRElement)

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

@ -955,8 +955,11 @@ nsHTMLElementFactory::CreateInstanceByTag(const nsString& aTag,
//----------------------------------------------------------------------
MOZ_DECL_CTOR_COUNTER(SinkContext);
SinkContext::SinkContext(HTMLContentSink* aSink)
{
MOZ_COUNT_CTOR(SinkContext);
mSink = aSink;
mPreAppend = PR_FALSE;
mStack = nsnull;
@ -969,6 +972,7 @@ SinkContext::SinkContext(HTMLContentSink* aSink)
SinkContext::~SinkContext()
{
MOZ_COUNT_DTOR(SinkContext);
if (nsnull != mStack) {
for (PRInt32 i = 0; i < mStackPos; i++) {
NS_RELEASE(mStack[i].mContent);
@ -1631,6 +1635,7 @@ NS_NewHTMLContentSink(nsIHTMLContentSink** aResult,
return it->QueryInterface(kIHTMLContentSinkIID, (void **)aResult);
}
// Note: operator new zeros our memory
HTMLContentSink::HTMLContentSink()
{
#ifdef NS_DEBUG
@ -1639,12 +1644,6 @@ HTMLContentSink::HTMLContentSink()
}
#endif
mNotAtRef = PR_TRUE;
mParser = nsnull;
mDocumentBaseURL = nsnull;
mBody = nsnull;
mFrameset = nsnull;
mStyleSheetCount = 0;
mCSSLoader = nsnull;
mContentIDCounter = NS_CONTENT_ID_COUNTER_BASE;
}

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

@ -685,11 +685,9 @@ NS_IMETHODIMP nsHTMLDocument::SetTitle(const nsString& aTitle)
nsISupports* container;
if (NS_OK == cx->GetContainer(&container)) {
if (nsnull != container) {
nsIWebShell* ws = nsnull;
container->QueryInterface(kIWebShellIID, (void**) &ws);
if (nsnull != ws) {
ws->SetTitle(aTitle.GetUnicode());
NS_RELEASE(ws);
nsCOMPtr<nsIWebShell> webShell = do_QueryInterface(container);
if (webShell) {
webShell->SetTitle(aTitle.GetUnicode());
}
NS_RELEASE(container);
}
@ -1102,12 +1100,11 @@ NS_IMETHODIMP
nsHTMLDocument::CreateElement(const nsString& aTagName,
nsIDOMElement** aReturn)
{
nsIHTMLContent* content;
nsresult rv = NS_CreateHTMLElement(&content, aTagName);
if (NS_OK != rv) {
return rv;
nsCOMPtr<nsIHTMLContent> content;
nsresult rv = NS_CreateHTMLElement(getter_AddRefs(content), aTagName);
if (NS_SUCCEEDED(rv)) {
rv = content->QueryInterface(kIDOMElementIID, (void**)aReturn);
}
rv = content->QueryInterface(kIDOMElementIID, (void**)aReturn);
return rv;
}

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

@ -50,12 +50,15 @@ static NS_DEFINE_IID(kIStyleSheetLinkingElementIID, NS_ISTYLESHEETLINKINGELEMENT
class CSSLoaderImpl;
MOZ_DECL_CTOR_COUNTER(URLKey);
class URLKey: public nsHashKey {
public:
URLKey(nsIURI* aURL)
: nsHashKey(),
mURL(aURL)
{
MOZ_COUNT_CTOR(URLKey);
NS_ADDREF(mURL);
mHashValue = 0;
@ -72,11 +75,13 @@ public:
mURL(aKey.mURL),
mHashValue(aKey.mHashValue)
{
MOZ_COUNT_CTOR(URLKey);
NS_ADDREF(mURL);
}
virtual ~URLKey(void)
{
MOZ_COUNT_DTOR(URLKey);
NS_RELEASE(mURL);
}
@ -102,22 +107,27 @@ public:
PRUint32 mHashValue;
};
MOZ_DECL_CTOR_COUNTER(SupportsKey);
class SupportsKey: public nsHashKey {
public:
SupportsKey(nsISupports* aSupports)
: nsHashKey(),
mSupports(aSupports)
{ // note: does not hold reference on supports pointer
MOZ_COUNT_CTOR(SupportsKey);
}
SupportsKey(const SupportsKey& aKey)
: nsHashKey(),
mSupports(aKey.mSupports)
{
MOZ_COUNT_CTOR(SupportsKey);
}
virtual ~SupportsKey(void)
{
MOZ_COUNT_DTOR(SupportsKey);
}
virtual PRUint32 HashValue(void) const
@ -178,6 +188,8 @@ struct SheetLoadData {
void* mCallbackData;
};
MOZ_DECL_CTOR_COUNTER(PendingSheetData);
struct PendingSheetData {
PendingSheetData(nsICSSStyleSheet* aSheet, PRInt32 aDocIndex,
nsIContent* aElement)
@ -186,12 +198,14 @@ struct PendingSheetData {
mOwningElement(aElement),
mNotify(PR_FALSE)
{
MOZ_COUNT_CTOR(PendingSheetData);
NS_ADDREF(mSheet);
NS_IF_ADDREF(mOwningElement);
}
~PendingSheetData(void)
{
MOZ_COUNT_DTOR(PendingSheetData);
NS_RELEASE(mSheet);
NS_IF_RELEASE(mOwningElement);
}
@ -303,6 +317,8 @@ public:
#endif
};
MOZ_DECL_CTOR_COUNTER(SheetLoadData);
SheetLoadData::SheetLoadData(CSSLoaderImpl* aLoader, nsIURI* aURL,
const nsString& aTitle, const nsString& aMedia,
PRInt32 aDefaultNameSpaceID,
@ -327,6 +343,7 @@ SheetLoadData::SheetLoadData(CSSLoaderImpl* aLoader, nsIURI* aURL,
mCallback(nsnull),
mCallbackData(nsnull)
{
MOZ_COUNT_CTOR(SheetLoadData);
NS_ADDREF(mLoader);
NS_ADDREF(mURL);
NS_IF_ADDREF(mOwningElement);
@ -356,6 +373,7 @@ SheetLoadData::SheetLoadData(CSSLoaderImpl* aLoader, nsIURI* aURL,
mCallback(nsnull),
mCallbackData(nsnull)
{
MOZ_COUNT_CTOR(SheetLoadData);
NS_ADDREF(mLoader);
NS_ADDREF(mURL);
NS_ADDREF(mParentSheet);
@ -382,6 +400,7 @@ SheetLoadData::SheetLoadData(CSSLoaderImpl* aLoader, nsIURI* aURL,
mCallback(aCallback),
mCallbackData(nsnull)
{
MOZ_COUNT_CTOR(SheetLoadData);
NS_ADDREF(mLoader);
NS_ADDREF(mURL);
}
@ -389,6 +408,7 @@ SheetLoadData::SheetLoadData(CSSLoaderImpl* aLoader, nsIURI* aURL,
SheetLoadData::~SheetLoadData(void)
{
MOZ_COUNT_DTOR(SheetLoadData);
NS_RELEASE(mLoader);
NS_RELEASE(mURL);
NS_IF_RELEASE(mOwningElement);

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

@ -55,6 +55,8 @@ static NS_DEFINE_IID(kICSSParserIID, NS_ICSS_PARSER_IID);
static NS_DEFINE_IID(kICSSStyleSheetIID, NS_ICSS_STYLE_SHEET_IID);
static NS_DEFINE_IID(kIStyleSheetIID, NS_ISTYLE_SHEET_IID);
MOZ_DECL_CTOR_COUNTER(SelectorList);
// e.g. "P B, H1 B { ... }" has a selector list with two elements,
// each of which has two selectors.
struct SelectorList {
@ -77,10 +79,12 @@ SelectorList::SelectorList(void)
: mSelectors(nsnull),
mNext(nsnull)
{
MOZ_COUNT_CTOR(SelectorList);
}
SelectorList::~SelectorList()
{
MOZ_COUNT_DTOR(SelectorList);
nsCSSSelector* sel = mSelectors;
while (nsnull != sel) {
nsCSSSelector* dead = sel;

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

@ -16,14 +16,10 @@
* Reserved.
*/
#include "nsCSSRule.h"
#include "nsCRT.h"
#include "nsIArena.h"
#include "nsICSSStyleSheet.h"
//#define DEBUG_REFS
void* nsCSSRule::operator new(size_t size)
{
nsCSSRule* rv = (nsCSSRule*) ::operator new(size);
@ -58,74 +54,25 @@ void nsCSSRule::operator delete(void* ptr)
}
}
#ifdef DEBUG_REFS
static PRInt32 gInstanceCount;
static const PRInt32 kInstrument = 1075;
#endif
nsCSSRule::nsCSSRule(void)
: mSheet(nsnull)
{
NS_INIT_REFCNT();
#ifdef DEBUG_REFS
mInstance = gInstanceCount++;
fprintf(stdout, "%d of %d + CSSRule\n", mInstance, gInstanceCount);
#endif
}
nsCSSRule::nsCSSRule(const nsCSSRule& aCopy)
: mSheet(aCopy.mSheet)
{
NS_INIT_REFCNT();
#ifdef DEBUG_REFS
mInstance = gInstanceCount++;
fprintf(stdout, "%d of %d + CSSRule\n", mInstance, gInstanceCount);
#endif
}
nsCSSRule::~nsCSSRule(void)
{
#ifdef DEBUG_REFS
--gInstanceCount;
fprintf(stdout, "%d of %d - CSSStyleRule\n", mInstance, gInstanceCount);
#endif
}
#ifdef DEBUG_REFS
nsrefcnt
nsCSSRule::AddRef(void)
{
if (mInstance == kInstrument) {
fprintf(stdout, "%d AddRef CSSRule\n", mRefCnt + 1);
}
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "nsCSSRule");
return mRefCnt;
}
nsrefcnt
nsCSSRule::Release(void)
{
if (mInstance == kInstrument) {
fprintf(stdout, "%d Release CSSRule\n", mRefCnt - 1);
}
--mRefCnt;
NS_LOG_RELEASE(this, mRefCnt, "nsCSSRule");
if (mRefCnt == 0) {
NS_DELETEXPCOM(this);
return 0;
}
return mRefCnt;
}
#else
NS_IMPL_ADDREF(nsCSSRule)
NS_IMPL_RELEASE(nsCSSRule)
#endif
NS_IMETHODIMP
nsCSSRule::GetStyleSheet(nsIStyleSheet*& aSheet) const

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

@ -40,14 +40,14 @@ static const PRUint8 START_IDENT = 0x10;
static const PRUint8 IS_IDENT = 0x20;
static const PRUint8 IS_WHITESPACE = 0x40;
static PRUint8* gLexTable;
static PRBool gLexTableSetup = PR_FALSE;
static PRUint8 gLexTable[256];
static void BuildLexTable()
{
PRUint8* lt = new PRUint8[256];
nsCRT::zero(lt, 256);
gLexTable = lt;
gLexTableSetup = PR_TRUE;
PRUint8* lt = gLexTable;
int i;
lt[CSS_ESCAPE] = START_IDENT;
lt['-'] |= IS_IDENT;
@ -137,10 +137,12 @@ nsCSSToken::AppendToString(nsString& aBuffer)
}
}
MOZ_DECL_CTOR_COUNTER(nsCSSScanner);
nsCSSScanner::nsCSSScanner()
{
if (nsnull == gLexTable) {
MOZ_COUNT_CTOR(nsCSSScanner);
if (!gLexTableSetup) {
// XXX need a monitor
BuildLexTable();
}
@ -155,6 +157,7 @@ nsCSSScanner::nsCSSScanner()
nsCSSScanner::~nsCSSScanner()
{
MOZ_COUNT_DTOR(nsCSSScanner);
Close();
if (nsnull != mBuffer) {
delete [] mBuffer;

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

@ -79,10 +79,13 @@ static NS_DEFINE_IID(kCSSUserInterfaceSID, NS_CSS_USER_INTERFACE_SID);
#define NS_IF_DELETE(ptr) \
if (nsnull != ptr) { delete ptr; ptr = nsnull; }
MOZ_DECL_CTOR_COUNTER(nsAtomList);
nsAtomList::nsAtomList(nsIAtom* aAtom)
: mAtom(aAtom),
mNext(nsnull)
{
MOZ_COUNT_CTOR(nsAtomList);
NS_IF_ADDREF(mAtom);
}
@ -90,6 +93,7 @@ nsAtomList::nsAtomList(const nsString& aAtomValue)
: mAtom(nsnull),
mNext(nsnull)
{
MOZ_COUNT_CTOR(nsAtomList);
mAtom = NS_NewAtom(aAtomValue);
}
@ -97,12 +101,14 @@ nsAtomList::nsAtomList(const nsAtomList& aCopy)
: mAtom(aCopy.mAtom),
mNext(nsnull)
{
MOZ_COUNT_CTOR(nsAtomList);
NS_IF_ADDREF(mAtom);
NS_IF_COPY(mNext, aCopy.mNext, nsAtomList);
}
nsAtomList::~nsAtomList(void)
{
MOZ_COUNT_DTOR(nsAtomList);
NS_IF_RELEASE(mAtom);
NS_IF_DELETE(mNext);
}
@ -123,6 +129,8 @@ PRBool nsAtomList::Equals(const nsAtomList* aOther) const
return PR_FALSE;
}
MOZ_DECL_CTOR_COUNTER(nsAttrSelector);
nsAttrSelector::nsAttrSelector(PRInt32 aNameSpace, const nsString& aAttr)
: mNameSpace(aNameSpace),
mAttr(nsnull),
@ -131,6 +139,7 @@ nsAttrSelector::nsAttrSelector(PRInt32 aNameSpace, const nsString& aAttr)
mValue(),
mNext(nsnull)
{
MOZ_COUNT_CTOR(nsAttrSelector);
mAttr = NS_NewAtom(aAttr);
}
@ -143,6 +152,7 @@ nsAttrSelector::nsAttrSelector(PRInt32 aNameSpace, const nsString& aAttr, PRUint
mValue(aValue),
mNext(nsnull)
{
MOZ_COUNT_CTOR(nsAttrSelector);
mAttr = NS_NewAtom(aAttr);
}
@ -154,12 +164,14 @@ nsAttrSelector::nsAttrSelector(const nsAttrSelector& aCopy)
mValue(aCopy.mValue),
mNext(nsnull)
{
MOZ_COUNT_CTOR(nsAttrSelector);
NS_IF_ADDREF(mAttr);
NS_IF_COPY(mNext, aCopy.mNext, nsAttrSelector);
}
nsAttrSelector::~nsAttrSelector(void)
{
MOZ_COUNT_DTOR(nsAttrSelector);
NS_IF_RELEASE(mAttr);
NS_IF_DELETE(mNext);
}
@ -184,6 +196,8 @@ PRBool nsAttrSelector::Equals(const nsAttrSelector* aOther) const
return PR_FALSE;
}
MOZ_DECL_CTOR_COUNTER(nsCSSSelector);
nsCSSSelector::nsCSSSelector(void)
: mNameSpace(kNameSpaceID_Unknown), mTag(nsnull),
mID(nsnull),
@ -193,6 +207,7 @@ nsCSSSelector::nsCSSSelector(void)
mOperator(0),
mNext(nsnull)
{
MOZ_COUNT_CTOR(nsCSSSelector);
}
nsCSSSelector::nsCSSSelector(const nsCSSSelector& aCopy)
@ -204,6 +219,7 @@ nsCSSSelector::nsCSSSelector(const nsCSSSelector& aCopy)
mOperator(aCopy.mOperator),
mNext(nsnull)
{
MOZ_COUNT_CTOR(nsCSSSelector);
NS_IF_ADDREF(mTag);
NS_IF_ADDREF(mID);
NS_IF_COPY(mClassList, aCopy.mClassList, nsAtomList);
@ -213,6 +229,7 @@ nsCSSSelector::nsCSSSelector(const nsCSSSelector& aCopy)
nsCSSSelector::~nsCSSSelector(void)
{
MOZ_COUNT_DTOR(nsCSSSelector);
Reset();
}
@ -548,8 +565,12 @@ protected:
nsICSSStyleRule *mRule;
};
MOZ_DECL_CTOR_COUNTER(DOMCSSDeclarationImpl);
DOMCSSDeclarationImpl::DOMCSSDeclarationImpl(nsICSSStyleRule *aRule)
{
MOZ_COUNT_CTOR(DOMCSSDeclarationImpl);
// This reference is not reference-counted. The rule
// object tells us when its about to go away.
mRule = aRule;
@ -557,6 +578,7 @@ DOMCSSDeclarationImpl::DOMCSSDeclarationImpl(nsICSSStyleRule *aRule)
DOMCSSDeclarationImpl::~DOMCSSDeclarationImpl(void)
{
MOZ_COUNT_DTOR(DOMCSSDeclarationImpl);
}
void
@ -732,7 +754,6 @@ protected:
void* mScriptObject;
};
CSSStyleRuleImpl::CSSStyleRuleImpl(const nsCSSSelector& aSelector)
: nsCSSRule(),
mSelector(aSelector), mSelectorText(), mDeclaration(nsnull),

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

@ -60,7 +60,6 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#include "nsITextContent.h"
#include "prlog.h"
//#define DEBUG_REFS
//#define DEBUG_RULES
#define DEBUG_CASCADE
@ -1063,11 +1062,6 @@ void CSSStyleSheetImpl::operator delete(void* ptr)
}
}
#ifdef DEBUG_REFS
static PRInt32 gInstanceCount;
#endif
MOZ_DECL_CTOR_COUNTER(CSSStyleSheetImpl);
CSSStyleSheetImpl::CSSStyleSheetImpl()
: nsICSSStyleSheet(),
mTitle(),
@ -1083,15 +1077,9 @@ CSSStyleSheetImpl::CSSStyleSheetImpl()
mDirty(PR_FALSE),
mScriptObject(nsnull)
{
MOZ_COUNT_CTOR(CSSStyleSheetImpl);
NS_INIT_REFCNT();
mInner = new CSSStyleSheetInner(this);
#ifdef DEBUG_REFS
++gInstanceCount;
fprintf(stdout, "%d + CSSStyleSheet size: %d\n", gInstanceCount, sizeof(*this));
#endif
}
CSSStyleSheetImpl::CSSStyleSheetImpl(const CSSStyleSheetImpl& aCopy)
@ -1110,7 +1098,6 @@ CSSStyleSheetImpl::CSSStyleSheetImpl(const CSSStyleSheetImpl& aCopy)
mScriptObject(nsnull),
mInner(aCopy.mInner)
{
MOZ_COUNT_CTOR(CSSStyleSheetImpl);
NS_INIT_REFCNT();
mInner->AddSheet(this);
@ -1141,20 +1128,10 @@ CSSStyleSheetImpl::CSSStyleSheetImpl(const CSSStyleSheetImpl& aCopy)
}
while (otherChild && ourSlot);
}
#ifdef DEBUG_REFS
++gInstanceCount;
fprintf(stdout, "%d + CSSStyleSheet size: %d\n", gInstanceCount, sizeof(*this));
#endif
}
CSSStyleSheetImpl::~CSSStyleSheetImpl()
{
MOZ_COUNT_DTOR(CSSStyleSheetImpl);
#ifdef DEBUG_REFS
--gInstanceCount;
fprintf(stdout, "%d - CSSStyleSheet\n", gInstanceCount);
#endif
NS_IF_RELEASE(mMedia);
if (mFirstChild) {
CSSStyleSheetImpl* child = mFirstChild;

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

@ -29,16 +29,17 @@
#include "nsVoidArray.h"
#include "nsISizeOfHandler.h"
//#define DEBUG_REFS
static NS_DEFINE_IID(kIHTMLAttributesIID, NS_IHTML_ATTRIBUTES_IID);
MOZ_DECL_CTOR_COUNTER(HTMLAttribute);
struct HTMLAttribute {
HTMLAttribute(void)
: mAttribute(nsnull),
mValue(),
mNext(nsnull)
{
MOZ_COUNT_CTOR(HTMLAttribute);
}
HTMLAttribute(nsIAtom* aAttribute, const nsString& aValue)
@ -46,6 +47,7 @@ struct HTMLAttribute {
mValue(aValue),
mNext(nsnull)
{
MOZ_COUNT_CTOR(HTMLAttribute);
NS_IF_ADDREF(mAttribute);
}
@ -54,6 +56,7 @@ struct HTMLAttribute {
mValue(aValue),
mNext(nsnull)
{
MOZ_COUNT_CTOR(HTMLAttribute);
NS_IF_ADDREF(mAttribute);
}
@ -62,11 +65,13 @@ struct HTMLAttribute {
mValue(aCopy.mValue),
mNext(nsnull)
{
MOZ_COUNT_CTOR(HTMLAttribute);
NS_IF_ADDREF(mAttribute);
}
~HTMLAttribute(void)
{
MOZ_COUNT_DTOR(HTMLAttribute);
NS_IF_RELEASE(mAttribute);
}
@ -222,25 +227,33 @@ struct HTMLAttribute {
// ----------------
MOZ_DECL_CTOR_COUNTER(nsClassList);
struct nsClassList {
nsClassList(nsIAtom* aAtom)
: mAtom(aAtom), // take ref
mNext(nsnull)
{
MOZ_COUNT_CTOR(nsClassList);
}
nsClassList(const nsClassList& aCopy)
: mAtom(aCopy.mAtom),
mNext(nsnull)
{
MOZ_COUNT_CTOR(nsClassList);
NS_IF_ADDREF(mAtom);
if (aCopy.mNext) {
mNext = new nsClassList(*(aCopy.mNext));
}
}
~nsClassList(void)
{
MOZ_COUNT_DTOR(nsClassList);
Reset();
}
void Reset(void)
{
NS_IF_RELEASE(mAtom);
@ -828,19 +841,8 @@ protected:
nsClassList mFirstClass;
nsIAtom* mNameBuffer[kNameBufferSize];
#ifdef DEBUG_REFS
PRInt32 mInstance;
#endif
};
#ifdef DEBUG_REFS
static PRInt32 gInstanceCount = 0;
static PRInt32 gInstrument = 4;
#endif
void* HTMLAttributesImpl::operator new(size_t size)
{
HTMLAttributesImpl* rv = (HTMLAttributesImpl*) ::operator new(size);
@ -875,7 +877,6 @@ void HTMLAttributesImpl::operator delete(void* ptr)
}
}
HTMLAttributesImpl::HTMLAttributesImpl(void)
: mAttrNames(mNameBuffer),
mAttrCount(0),
@ -886,11 +887,6 @@ HTMLAttributesImpl::HTMLAttributesImpl(void)
mFirstClass(nsnull)
{
NS_INIT_REFCNT();
#ifdef DEBUG_REFS
mInstance = ++gInstanceCount;
fprintf(stdout, "%d of %d + HTMLAttributes\n", mInstance, gInstanceCount);
#endif
}
HTMLAttributesImpl::HTMLAttributesImpl(const HTMLAttributesImpl& aCopy)
@ -929,51 +925,15 @@ HTMLAttributesImpl::HTMLAttributesImpl(const HTMLAttributesImpl& aCopy)
}
NS_IF_ADDREF(mID);
#ifdef DEBUG_REFS
mInstance = ++gInstanceCount;
fprintf(stdout, "%d of %d + HTMLAttributes\n", mInstance, gInstanceCount);
#endif
}
HTMLAttributesImpl::~HTMLAttributesImpl(void)
{
Reset();
#ifdef DEBUG_REFS
fprintf(stdout, "%d of %d - HTMLAttributes\n", mInstance, gInstanceCount);
--gInstanceCount;
#endif
}
#ifdef DEBUG_REFS
nsrefcnt HTMLAttributesImpl::AddRef(void)
{
if ((gInstrument == -1) || (mInstance == gInstrument)) {
fprintf(stdout, "%d AddRef HTMLAttributes %d\n", mRefCnt + 1, mInstance);
}
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "HTMLAttributesImpl");
return mRefCnt;
}
nsrefcnt HTMLAttributesImpl::Release(void)
{
if ((gInstrument == -1) || (mInstance == gInstrument)) {
fprintf(stdout, "%d Release HTMLAttributes %d\n", mRefCnt - 1, mInstance);
}
--mRefCnt;
NS_LOG_RELEASE(this, mRefCnt, "HTMLAttributesImpl");
if (mRefCnt == 0) {
delete this;
return 0;
}
return mRefCnt;
}
#else
NS_IMPL_ADDREF(HTMLAttributesImpl)
NS_IMPL_RELEASE(HTMLAttributesImpl)
#endif
NS_IMPL_QUERY_INTERFACE(HTMLAttributesImpl, kIHTMLAttributesIID);

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

@ -369,8 +369,6 @@ void HTMLCSSStyleSheetImpl::operator delete(void* ptr)
}
}
MOZ_DECL_CTOR_COUNTER(HTMLCSSStyleSheetImpl);
HTMLCSSStyleSheetImpl::HTMLCSSStyleSheetImpl()
: nsIHTMLCSSStyleSheet(),
mURL(nsnull),
@ -378,15 +376,11 @@ HTMLCSSStyleSheetImpl::HTMLCSSStyleSheetImpl()
mFirstLineRule(nsnull),
mFirstLetterRule(nsnull)
{
MOZ_COUNT_CTOR(HTMLCSSStyleSheetImpl);
NS_INIT_REFCNT();
}
HTMLCSSStyleSheetImpl::~HTMLCSSStyleSheetImpl()
{
MOZ_COUNT_DTOR(HTMLCSSStyleSheetImpl);
NS_RELEASE(mURL);
if (nsnull != mFirstLineRule) {
mFirstLineRule->mSheet = nsnull;

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

@ -318,15 +318,19 @@ public:
} mHash;
};
MOZ_DECL_CTOR_COUNTER(AttributeKey);
AttributeKey::AttributeKey(nsIHTMLMappedAttributes* aAttributes)
: mAttributes(aAttributes)
{
MOZ_COUNT_CTOR(AttributeKey);
NS_ADDREF(mAttributes);
mHash.mInitializer = 0;
}
AttributeKey::~AttributeKey(void)
{
MOZ_COUNT_DTOR(AttributeKey);
NS_RELEASE(mAttributes);
}
@ -504,8 +508,6 @@ void HTMLStyleSheetImpl::operator delete(void* ptr)
}
}
HTMLStyleSheetImpl::HTMLStyleSheetImpl(void)
: nsIHTMLStyleSheet(),
mURL(nsnull),

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

@ -90,11 +90,8 @@ NS_NewXMLCDATASection(nsIContent** aInstancePtrResult)
return it->QueryInterface(kIContentIID, (void **) aInstancePtrResult);
}
MOZ_DECL_CTOR_COUNTER(nsXMLCDATASection);
nsXMLCDATASection::nsXMLCDATASection()
{
MOZ_COUNT_CTOR(nsXMLCDATASection);
NS_INIT_REFCNT();
mInner.Init(this);
mContentID = 0;
@ -102,7 +99,6 @@ nsXMLCDATASection::nsXMLCDATASection()
nsXMLCDATASection::~nsXMLCDATASection()
{
MOZ_COUNT_DTOR(nsXMLCDATASection);
}
NS_IMPL_ADDREF(nsXMLCDATASection)

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

@ -76,7 +76,7 @@ nsXMLElement::~nsXMLElement()
NS_IMETHODIMP
nsXMLElement::QueryInterface(REFNSIID aIID,
void** aInstancePtr)
void** aInstancePtr)
{
NS_IMPL_CONTENT_QUERY_INTERFACE(aIID, aInstancePtr, this, nsIXMLContent)
if (aIID.Equals(kIXMLContentIID)) {

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

@ -607,12 +607,9 @@ nsresult nsWebShell::DestroyPluginHost(void)
//----------------------------------------------------------------------
MOZ_DECL_CTOR_COUNTER(nsWebShell);
// Note: operator new zeros our memory
nsWebShell::nsWebShell()
{
MOZ_COUNT_CTOR(nsWebShell);
#ifdef DETECT_WEBSHELL_LEAKS
// We're counting the number of |nsWebShells| to help find leaks
++gNumberOfWebShells;
@ -647,7 +644,6 @@ nsWebShell::nsWebShell()
nsWebShell::~nsWebShell()
{
MOZ_COUNT_DTOR(nsWebShell);
if (nsnull != mHistoryService) {
nsServiceManager::ReleaseService(kGlobalHistoryCID, mHistoryService);
mHistoryService = nsnull;

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

@ -27,19 +27,15 @@ static NS_DEFINE_IID(kITransactionIID, NS_ITRANSACTION_IID);
NS_IMPL_ADDREF(EditTxn)
NS_IMPL_RELEASE(EditTxn)
MOZ_DECL_CTOR_COUNTER(EditTxn);
// note that aEditor is not refcounted
EditTxn::EditTxn()
: mTransactionID(-1)
{
MOZ_COUNT_CTOR(EditTxn);
NS_INIT_REFCNT();
}
EditTxn::~EditTxn()
{
MOZ_COUNT_DTOR(EditTxn);
}
NS_IMETHODIMP EditTxn::Do(void)

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

@ -27,19 +27,15 @@ static NS_DEFINE_IID(kITransactionIID, NS_ITRANSACTION_IID);
NS_IMPL_ADDREF(EditTxn)
NS_IMPL_RELEASE(EditTxn)
MOZ_DECL_CTOR_COUNTER(EditTxn);
// note that aEditor is not refcounted
EditTxn::EditTxn()
: mTransactionID(-1)
{
MOZ_COUNT_CTOR(EditTxn);
NS_INIT_REFCNT();
}
EditTxn::~EditTxn()
{
MOZ_COUNT_DTOR(EditTxn);
}
NS_IMETHODIMP EditTxn::Do(void)

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

@ -39,11 +39,8 @@
#define REALLY_NOISY_FONTS
#endif
MOZ_DECL_CTOR_COUNTER(nsFontMetricsGTK);
nsFontMetricsGTK::nsFontMetricsGTK()
{
MOZ_COUNT_CTOR(nsFontMetricsGTK);
NS_INIT_REFCNT();
mDeviceContext = nsnull;
mFont = nsnull;
@ -68,8 +65,6 @@ nsFontMetricsGTK::nsFontMetricsGTK()
nsFontMetricsGTK::~nsFontMetricsGTK()
{
MOZ_COUNT_DTOR(nsFontMetricsGTK);
if (nsnull != mFont) {
delete mFont;
mFont = nsnull;
@ -99,35 +94,7 @@ nsFontMetricsGTK::~nsFontMetricsGTK()
}
#undef LOG_REFCNTS
#ifdef LOG_REFCNTS
extern "C" {
void __log_addref(void* p, int oldrc, int newrc);
void __log_release(void* p, int oldrc, int newrc);
}
nsrefcnt nsFontMetricsGTK::AddRef(void)
{
NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt");
__log_addref((void*) this, mRefCnt, mRefCnt + 1);
return ++mRefCnt;
}
nsrefcnt nsFontMetricsGTK::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;
}
NS_IMPL_QUERY_INTERFACE1(nsFontMetricsGTK, nsIFontMetrics)
#else
NS_IMPL_ISUPPORTS1(nsFontMetricsGTK, nsIFontMetrics)
#endif
#ifdef FONT_SWITCHING

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

@ -40,11 +40,8 @@ static NS_DEFINE_CID(kRegionCID, NS_REGION_CID);
gdk.height = ns.height; \
PR_END_MACRO
MOZ_DECL_CTOR_COUNTER(nsRenderingContextGTK);
nsRenderingContextGTK::nsRenderingContextGTK()
{
MOZ_COUNT_CTOR(nsRenderingContextGTK);
NS_INIT_REFCNT();
mFontMetrics = nsnull;
@ -65,8 +62,6 @@ nsRenderingContextGTK::nsRenderingContextGTK()
nsRenderingContextGTK::~nsRenderingContextGTK()
{
MOZ_COUNT_DTOR(nsRenderingContextGTK);
// Destroy the State Machine
if (mStateCache)
{

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

@ -48,12 +48,8 @@ protected:
NS_IMPL_ISUPPORTS1(DeviceContextImpl, nsIDeviceContext)
MOZ_DECL_CTOR_COUNTER(DeviceContextImpl);
DeviceContextImpl :: DeviceContextImpl()
{
MOZ_COUNT_CTOR(DeviceContextImpl);
NS_INIT_REFCNT();
mFontCache = nsnull;
mDevUnitsToAppUnits = 1.0f;
@ -79,8 +75,6 @@ static PRBool DeleteValue(nsHashKey* aKey, void* aValue, void* closure)
DeviceContextImpl :: ~DeviceContextImpl()
{
MOZ_COUNT_DTOR(DeviceContextImpl);
if (nsnull != mFontCache)
{
delete mFontCache;

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

@ -42,36 +42,7 @@
#define JS_CLASS_MAP_SIZE 256
#define NATIVE_CLASS_MAP_SIZE 256
#if 0
extern "C" {
void __log_addref(void* p, int oldrc, int newrc);
void __log_release(void* p, int oldrc, int newrc);
};
NS_IMETHODIMP_(nsrefcnt) nsXPConnect::AddRef(void)
{
NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt");
__log_addref(this, mRefCnt, mRefCnt + 1);
++mRefCnt;
return mRefCnt;
}
NS_IMETHODIMP_(nsrefcnt) nsXPConnect::Release(void)
{
NS_PRECONDITION(0 != mRefCnt, "dup release");
__log_release(this, mRefCnt, mRefCnt - 1);
--mRefCnt;
if (mRefCnt == 0) {
NS_DELETEXPCOM(this);
return 0;
}
return mRefCnt;
}
NS_IMPL_QUERY_INTERFACE1(nsXPConnect, nsIXPConnect)
#else
NS_IMPL_ISUPPORTS1(nsXPConnect, nsIXPConnect)
#endif
const char XPC_COMPONENTS_STR[] = "Components";

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

@ -182,7 +182,7 @@ XPCJSStackFrame::AddRef(void)
if(mStack)
mStack->AddRef();
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "XPCJSStackFrame");
NS_LOG_ADDREF(this, mRefCnt, "XPCJSStackFrame", sizeof(*this));
return mRefCnt;
}

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

@ -72,7 +72,7 @@ nsXPCWrappedJS::AddRef(void)
{
NS_PRECONDITION(mRoot, "bad root");
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "nsXPCWrappedJS");
NS_LOG_ADDREF(this, mRefCnt, "nsXPCWrappedJS", sizeof(*this));
if(1 == mRefCnt && mRoot && mRoot != this)
NS_ADDREF(mRoot);
@ -311,7 +311,7 @@ nsXPCWrappedJSMethods::AddRef(void)
{
NS_PRECONDITION(mWrapper, "bad state");
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "nsXPCWrappedJSMethods");
NS_LOG_ADDREF(this, mRefCnt, "nsXPCWrappedJSMethods", sizeof(*this));
if(2 == mRefCnt)
NS_ADDREF(mWrapper);
return mRefCnt;

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

@ -46,7 +46,7 @@ nsXPCWrappedNative::AddRef(void)
NS_PRECONDITION(mRoot, "bad root");
XPCContext* xpcc;
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "nsXPCWrappedNative");
NS_LOG_ADDREF(this, mRefCnt, "nsXPCWrappedNative", sizeof(*this));
if(1 == mRefCnt && mRoot != this)
NS_ADDREF(mRoot);
else if(2 == mRefCnt && nsnull != (xpcc = mClass->GetXPCContext()))

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

@ -58,7 +58,7 @@ NS_IMETHODIMP_(nsrefcnt) xpctestNoisy::AddRef(void)
{
NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt");
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "xpctestNoisy");
NS_LOG_ADDREF(this, mRefCnt, "xpctestNoisy", sizeof(*this));
printf("Noisy %d - incremented refcount to %d\n", mID, mRefCnt);
return mRefCnt;
}

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

@ -485,7 +485,6 @@ nsCSSFrameConstructor::~nsCSSFrameConstructor(void)
NS_IMPL_ISUPPORTS(nsCSSFrameConstructor, kIStyleFrameConstructionIID);
NS_IMETHODIMP
nsCSSFrameConstructor::Init(nsIDocument* aDocument)
{

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

@ -46,6 +46,7 @@
static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
//-----------------------------------------------------------------------------
nsCaret::nsCaret()
: mPresShell(nsnull)
, mBlinkTimer(nsnull)

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше