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

This commit is contained in:
Daniel Holbert 2010-04-01 09:37:26 -07:00
Родитель ca50c7092d
Коммит 9a588376e3
11 изменённых файлов: 220 добавлений и 22 удалений

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

@ -124,7 +124,36 @@ public:
PRUint32 Serial() const { return mSerial; }
void SetSerial(PRUint32 aIndex) { mSerial = aIndex; }
NS_INLINE_DECL_REFCOUNTING(nsSMILInstanceTime)
nsrefcnt AddRef()
{
if (mRefCnt == PR_UINT32_MAX) {
NS_WARNING("refcount overflow, leaking nsSMILInstanceTime");
return mRefCnt;
}
NS_ASSERT_OWNINGTHREAD(_class);
NS_ABORT_IF_FALSE(_mOwningThread.GetThread() == PR_GetCurrentThread(),
"nsSMILInstanceTime addref isn't thread-safe!");
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "nsSMILInstanceTime", sizeof(*this));
return mRefCnt;
}
nsrefcnt Release()
{
if (mRefCnt == PR_UINT32_MAX) {
NS_WARNING("refcount overflow, leaking nsSMILInstanceTime");
return mRefCnt;
}
NS_ABORT_IF_FALSE(_mOwningThread.GetThread() == PR_GetCurrentThread(),
"nsSMILInstanceTime release isn't thread-safe!");
--mRefCnt;
NS_LOG_RELEASE(this, mRefCnt, "nsSMILInstanceTime");
if (mRefCnt == 0) {
delete this;
return 0;
}
return mRefCnt;
}
protected:
void SetBaseInterval(nsSMILInterval* aBaseInterval);
@ -133,6 +162,9 @@ protected:
nsSMILTimeValue mTime;
nsAutoRefCnt mRefCnt;
NS_DECL_OWNINGTHREAD
// Internal flags used for represent behaviour of different instance times`
enum {
// Indicates if this instance time should be removed when the owning timed

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

@ -46,7 +46,6 @@
#include "nsClassHashtable.h"
#include "nsTArray.h"
#include "nsCycleCollectionParticipant.h"
#include "nsISupportsImpl.h"
class nsXBLPrototypeBinding;
class nsIContent;
@ -78,7 +77,24 @@ public:
* which are queued to fire their constructors.
*/
NS_INLINE_DECL_REFCOUNTING(nsXBLBinding)
nsrefcnt AddRef()
{
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "nsXBLBinding", sizeof(nsXBLBinding));
return mRefCnt;
}
nsrefcnt Release()
{
--mRefCnt;
NS_LOG_RELEASE(this, mRefCnt, "nsXBLBinding");
if (mRefCnt == 0) {
mRefCnt = 1;
delete this;
return 0;
}
return mRefCnt;
}
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(nsXBLBinding)
@ -156,6 +172,7 @@ public:
// MEMBER VARIABLES
protected:
nsAutoRefCnt mRefCnt;
nsXBLPrototypeBinding* mPrototypeBinding; // Weak, but we're holding a ref to the docinfo
nsCOMPtr<nsIContent> mContent; // Strong. Our anonymous content stays around with us.
nsRefPtr<nsXBLBinding> mNextBinding; // Strong. The derived binding owns the base class bindings.

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

@ -57,6 +57,19 @@ nsXBLInsertionPoint::~nsXBLInsertionPoint()
}
}
nsrefcnt
nsXBLInsertionPoint::Release()
{
--mRefCnt;
NS_LOG_RELEASE(this, mRefCnt, "nsXBLInsertionPoint");
if (mRefCnt == 0) {
mRefCnt = 1;
delete this;
return 0;
}
return mRefCnt;
}
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXBLInsertionPoint)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_NATIVE(nsXBLInsertionPoint)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMARRAY(mElements)

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

@ -50,7 +50,15 @@ public:
nsXBLInsertionPoint(nsIContent* aParentElement, PRUint32 aIndex, nsIContent* aDefContent);
~nsXBLInsertionPoint();
NS_INLINE_DECL_REFCOUNTING(nsXBLInsertionPoint)
nsrefcnt AddRef()
{
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "nsXBLInsertionPoint",
sizeof(nsXBLInsertionPoint));
return mRefCnt;
}
nsrefcnt Release();
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(nsXBLInsertionPoint)
@ -82,6 +90,7 @@ public:
void UnbindDefaultContent();
protected:
nsAutoRefCnt mRefCnt;
nsIContent* mParentElement; // This ref is weak. The parent of the <children> element.
PRInt32 mIndex; // The index of this insertion point. -1 is a pseudo-point.
nsCOMArray<nsIContent> mElements; // An array of elements present at the insertion point.

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

@ -207,12 +207,27 @@ public:
nsXBLInsertionPointEntry::ReleasePool();
}
NS_INLINE_DECL_REFCOUNTING(nsXBLInsertionPointEntry)
nsrefcnt AddRef() {
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "nsXBLInsertionPointEntry", sizeof(nsXBLInsertionPointEntry));
return mRefCnt;
}
nsrefcnt Release() {
--mRefCnt;
NS_LOG_RELEASE(this, mRefCnt, "nsXBLInsertionPointEntry");
if (mRefCnt == 0) {
Destroy(this);
return 0;
}
return mRefCnt;
}
protected:
nsCOMPtr<nsIContent> mInsertionParent;
nsCOMPtr<nsIContent> mDefaultContent;
PRUint32 mInsertionIndex;
nsAutoRefCnt mRefCnt;
nsXBLInsertionPointEntry(nsIContent* aParent)
: mInsertionParent(aParent),

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

@ -404,12 +404,14 @@ public:
txCompileObserver(txMozillaXSLTProcessor* aProcessor,
nsILoadGroup* aLoadGroup);
TX_DECL_ACOMPILEOBSERVER
NS_INLINE_DECL_REFCOUNTING(txCompileObserver)
TX_DECL_ACOMPILEOBSERVER;
nsresult startLoad(nsIURI* aUri, txStylesheetCompiler* aCompiler,
nsIPrincipal* aSourcePrincipal);
protected:
nsAutoRefCnt mRefCnt;
private:
nsRefPtr<txMozillaXSLTProcessor> mProcessor;
nsCOMPtr<nsILoadGroup> mLoadGroup;
@ -427,6 +429,23 @@ txCompileObserver::txCompileObserver(txMozillaXSLTProcessor* aProcessor,
{
}
nsrefcnt
txCompileObserver::AddRef()
{
return ++mRefCnt;
}
nsrefcnt
txCompileObserver::Release()
{
if (--mRefCnt == 0) {
mRefCnt = 1; //stabilize
delete this;
return 0;
}
return mRefCnt;
}
nsresult
txCompileObserver::loadURI(const nsAString& aUri,
const nsAString& aReferrerUri,
@ -639,11 +658,11 @@ class txSyncCompileObserver : public txACompileObserver
public:
txSyncCompileObserver(txMozillaXSLTProcessor* aProcessor);
TX_DECL_ACOMPILEOBSERVER
NS_INLINE_DECL_REFCOUNTING(txSyncCompileObserver)
TX_DECL_ACOMPILEOBSERVER;
protected:
nsRefPtr<txMozillaXSLTProcessor> mProcessor;
nsAutoRefCnt mRefCnt;
};
txSyncCompileObserver::txSyncCompileObserver(txMozillaXSLTProcessor* aProcessor)
@ -651,6 +670,23 @@ txSyncCompileObserver::txSyncCompileObserver(txMozillaXSLTProcessor* aProcessor)
{
}
nsrefcnt
txSyncCompileObserver::AddRef()
{
return ++mRefCnt;
}
nsrefcnt
txSyncCompileObserver::Release()
{
if (--mRefCnt == 0) {
mRefCnt = 1; //stabilize
delete this;
return 0;
}
return mRefCnt;
}
nsresult
txSyncCompileObserver::loadURI(const nsAString& aUri,
const nsAString& aReferrerUri,

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

@ -64,8 +64,7 @@ class txDriver : public txACompileObserver
const XML_Char *aSystemId,
const XML_Char *aPublicId);
TX_DECL_ACOMPILEOBSERVER
NS_INLINE_DECL_REFCOUNTING(txDriver)
TX_DECL_ACOMPILEOBSERVER;
nsRefPtr<txStylesheetCompiler> mCompiler;
protected:
@ -74,6 +73,7 @@ class txDriver : public txACompileObserver
// keep track of the nsresult returned by the handlers, expat forgets them
nsresult mRV;
XML_Parser mExpatParser;
nsAutoRefCnt mRefCnt;
};
nsresult
@ -338,6 +338,23 @@ txDriver::createErrorString()
* txACompileObserver implementation
*/
nsrefcnt
txDriver::AddRef()
{
return ++mRefCnt;
}
nsrefcnt
txDriver::Release()
{
if (--mRefCnt == 0) {
mRefCnt = 1; //stabilize
delete this;
return 0;
}
return mRefCnt;
}
void
txDriver::onDoneCompiling(txStylesheetCompiler* aCompiler, nsresult aResult,
const PRUnichar *aErrorText, const PRUnichar *aParam)

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

@ -44,7 +44,6 @@
#include "txList.h"
#include "txXSLTPatterns.h"
#include "nsTPtrArray.h"
#include "nsISupportsImpl.h"
class txInstruction;
class txToplevelItem;
@ -69,7 +68,19 @@ public:
~txStylesheet();
nsresult init();
NS_INLINE_DECL_REFCOUNTING(txStylesheet)
nsrefcnt AddRef()
{
return ++mRefCnt;
}
nsrefcnt Release()
{
if (--mRefCnt == 0) {
mRefCnt = 1; //stabilize
delete this;
return 0;
}
return mRefCnt;
}
txInstruction* findTemplate(const txXPathNode& aNode,
const txExpandedName& aMode,
@ -148,6 +159,9 @@ private:
nsTPtrArray<txStripSpaceTest>& aFrameStripSpaceTests);
nsresult addAttributeSet(txAttributeSetItem* aAttributeSetItem);
// Refcount
nsAutoRefCnt mRefCnt;
// List of ImportFrames
txList mImportFrames;

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

@ -69,6 +69,27 @@ txStylesheetCompiler::txStylesheetCompiler(const nsAString& aStylesheetURI,
mStatus = init(aStylesheetURI, aStylesheet, aInsertPosition);
}
nsrefcnt
txStylesheetCompiler::AddRef()
{
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "txStylesheetCompiler", sizeof(*this));
return mRefCnt;
}
nsrefcnt
txStylesheetCompiler::Release()
{
--mRefCnt;
NS_LOG_RELEASE(this, mRefCnt, "txStylesheetCompiler");
if (mRefCnt == 0) {
mRefCnt = 1; //stabilize
delete this;
return 0;
}
return mRefCnt;
}
void
txStylesheetCompiler::setBaseURI(const nsString& aBaseURI)
{

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

@ -77,8 +77,8 @@ public:
class txACompileObserver
{
public:
virtual void AddRef() = 0;
virtual void Release() = 0;
virtual nsrefcnt AddRef() = 0;
virtual nsrefcnt Release() = 0;
virtual nsresult loadURI(const nsAString& aUri,
const nsAString& aReferrerUri,
@ -90,11 +90,13 @@ public:
};
#define TX_DECL_ACOMPILEOBSERVER \
nsrefcnt AddRef(); \
nsrefcnt Release(); \
nsresult loadURI(const nsAString& aUri, const nsAString& aReferrerUri, \
txStylesheetCompiler* aCompiler); \
void onDoneCompiling(txStylesheetCompiler* aCompiler, nsresult aResult, \
const PRUnichar *aErrorText = nsnull, \
const PRUnichar *aParam = nsnull);
const PRUnichar *aParam = nsnull)
class txStylesheetCompilerState : public txIParseContext
{
@ -213,6 +215,8 @@ public:
txStylesheet* aStylesheet,
txListIterator* aInsertPosition,
txACompileObserver* aObserver);
virtual nsrefcnt AddRef();
virtual nsrefcnt Release();
void setBaseURI(const nsString& aBaseURI);
@ -231,8 +235,12 @@ public:
txStylesheet* getStylesheet();
TX_DECL_ACOMPILEOBSERVER
NS_INLINE_DECL_REFCOUNTING(txStylesheetCompiler)
// txACompileObserver
nsresult loadURI(const nsAString& aUri, const nsAString& aReferrerUri,
txStylesheetCompiler* aCompiler);
void onDoneCompiling(txStylesheetCompiler* aCompiler, nsresult aResult,
const PRUnichar *aErrorText = nsnull,
const PRUnichar *aParam = nsnull);
private:
nsresult startElementInternal(PRInt32 aNamespaceID, nsIAtom* aLocalName,
@ -245,6 +253,7 @@ private:
nsresult ensureNewElementContext();
nsresult maybeDoneCompiling();
nsAutoRefCnt mRefCnt;
nsString mCharacters;
nsresult mStatus;
};

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

@ -40,7 +40,6 @@
#include "nsAutoPtr.h"
#include "nsIAtom.h"
#include "nsIRDFResource.h"
#include "nsISupportsImpl.h"
class nsXULTemplateResultRDF;
class nsBindingValues;
@ -96,6 +95,9 @@ class RDFBindingSet
{
protected:
// results hold a reference to a binding set in their nsBindingValues fields
PRInt32 mRefCnt;
// the number of bindings
PRInt32 mCount;
@ -105,7 +107,8 @@ protected:
public:
RDFBindingSet()
: mCount(0),
: mRefCnt(0),
mCount(0),
mFirst(nsnull)
{
MOZ_COUNT_CTOR(RDFBindingSet);
@ -113,7 +116,19 @@ public:
~RDFBindingSet();
NS_INLINE_DECL_REFCOUNTING(RDFBindingSet)
PRInt32 AddRef() {
mRefCnt++;
NS_LOG_ADDREF(this, mRefCnt, "RDFBindingSet", sizeof(*this));
return mRefCnt;
}
PRInt32 Release()
{
PRInt32 refcnt = --mRefCnt;
NS_LOG_RELEASE(this, refcnt, "RDFBindingSet");
if (refcnt == 0) delete this;
return refcnt;
}
PRInt32 Count() const { return mCount; }