Bug 798158 - Part 1: Use a pointer-sized type to store refcounts internally; r=bsmedberg

This commit is contained in:
Ehsan Akhgari 2014-03-27 16:38:33 -04:00
parent 6f2ea7ebeb
commit 345b35a6e8
103 changed files with 250 additions and 238 deletions

View File

@ -89,8 +89,8 @@ public:
NotificationController(DocAccessible* aDocument, nsIPresShell* aPresShell);
virtual ~NotificationController();
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
NS_IMETHOD_(MozExternalRefCountType) AddRef(void);
NS_IMETHOD_(MozExternalRefCountType) Release(void);
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(NotificationController)

View File

@ -28,8 +28,8 @@ protected:
virtual ~nsBasePrincipal();
public:
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
NS_IMETHOD_(MozExternalRefCountType) AddRef(void);
NS_IMETHOD_(MozExternalRefCountType) Release(void);
NS_IMETHOD GetCsp(nsIContentSecurityPolicy** aCsp);
NS_IMETHOD SetCsp(nsIContentSecurityPolicy* aCsp);
public:

View File

@ -35,7 +35,7 @@ NS_IMPL_CI_INTERFACE_GETTER2(nsNullPrincipal,
nsIPrincipal,
nsISerializable)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsNullPrincipal::AddRef()
{
NS_PRECONDITION(int32_t(refcount) >= 0, "illegal refcnt");
@ -44,7 +44,7 @@ nsNullPrincipal::AddRef()
return count;
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsNullPrincipal::Release()
{
NS_PRECONDITION(0 != refcount, "dup release");

View File

@ -46,7 +46,7 @@ static bool URIIsImmutable(nsIURI* aURI)
// Static member variables
const char nsBasePrincipal::sInvalid[] = "Invalid";
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsBasePrincipal::AddRef()
{
NS_PRECONDITION(int32_t(refcount) >= 0, "illegal refcnt");
@ -56,7 +56,7 @@ nsBasePrincipal::AddRef()
return count;
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsBasePrincipal::Release()
{
NS_PRECONDITION(0 != refcount, "dup release");

View File

@ -29,7 +29,7 @@ NS_IMPL_CI_INTERFACE_GETTER2(nsSystemPrincipal,
nsIPrincipal,
nsISerializable)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsSystemPrincipal::AddRef()
{
NS_PRECONDITION(int32_t(refcount) >= 0, "illegal refcnt");
@ -38,7 +38,7 @@ nsSystemPrincipal::AddRef()
return count;
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsSystemPrincipal::Release()
{
NS_PRECONDITION(0 != refcount, "dup release");

View File

@ -10,6 +10,7 @@
#include "nsCOMPtr.h"
#include "mozilla/dom/Comment.h"
#include "mozilla/dom/CommentBinding.h"
#include "mozilla/IntegerPrintfMacros.h"
using namespace mozilla;
using namespace dom;
@ -49,7 +50,7 @@ Comment::List(FILE* out, int32_t aIndent) const
int32_t indx;
for (indx = aIndent; --indx >= 0; ) fputs(" ", out);
fprintf(out, "Comment@%p refcount=%d<!--", (void*)this, mRefCnt.get());
fprintf(out, "Comment@%p refcount=%" PRIuPTR "<!--", (void*)this, mRefCnt.get());
nsAutoString tmp;
ToCString(tmp, 0, mText.GetLength());

View File

@ -18,6 +18,7 @@
#include "mozilla/dom/DocumentFragmentBinding.h"
#include "nsPIDOMWindow.h"
#include "nsIDocument.h"
#include "mozilla/IntegerPrintfMacros.h"
namespace mozilla {
namespace dom {
@ -72,7 +73,7 @@ DocumentFragment::List(FILE* out, int32_t aIndent) const
fprintf(out, "DocumentFragment@%p", (void *)this);
fprintf(out, " flags=[%08x]", static_cast<unsigned int>(GetFlags()));
fprintf(out, " refcount=%d<", mRefCnt.get());
fprintf(out, " refcount=%" PRIuPTR "<", mRefCnt.get());
nsIContent* child = GetFirstChild();
if (child) {

View File

@ -128,6 +128,7 @@
#include "nsITextControlElement.h"
#include "nsISupportsImpl.h"
#include "mozilla/dom/DocumentFragment.h"
#include "mozilla/IntegerPrintfMacros.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -2199,7 +2200,7 @@ Element::List(FILE* out, int32_t aIndent,
fprintf(out, " ranges:%d", ranges ? ranges->Count() : 0);
}
fprintf(out, " primaryframe=%p", static_cast<void*>(GetPrimaryFrame()));
fprintf(out, " refcount=%d<", mRefCnt.get());
fprintf(out, " refcount=%" PRIuPTR "<", mRefCnt.get());
nsIContent* child = GetFirstChild();
if (child) {

View File

@ -1783,7 +1783,7 @@ NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDocument)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsDocument::Release()
{
NS_PRECONDITION(0 != mRefCnt, "dup release");

View File

@ -16,6 +16,7 @@
#include "nsIDocument.h"
#include "nsThreadUtils.h"
#include "nsStubMutationObserver.h"
#include "mozilla/IntegerPrintfMacros.h"
#ifdef DEBUG
#include "nsRange.h"
#endif
@ -169,7 +170,7 @@ nsTextNode::List(FILE* out, int32_t aIndent) const
fprintf(out, " ranges:%d", ranges ? ranges->Count() : 0);
}
fprintf(out, " primaryframe=%p", static_cast<void*>(GetPrimaryFrame()));
fprintf(out, " refcount=%d<", mRefCnt.get());
fprintf(out, " refcount=%" PRIuPTR "<", mRefCnt.get());
nsAutoString tmp;
ToCString(tmp, 0, mText.GetLength());

View File

@ -118,7 +118,7 @@ SharedThreadPool::Get(const nsCString& aName, uint32_t aThreadLimit)
return instance.forget();
}
NS_IMETHODIMP_(nsrefcnt) SharedThreadPool::AddRef(void)
NS_IMETHODIMP_(MozExternalRefCountType) SharedThreadPool::AddRef(void)
{
MOZ_ASSERT(sMonitor);
ReentrantMonitorAutoEnter mon(*sMonitor);
@ -128,7 +128,7 @@ NS_IMETHODIMP_(nsrefcnt) SharedThreadPool::AddRef(void)
return count;
}
NS_IMETHODIMP_(nsrefcnt) SharedThreadPool::Release(void)
NS_IMETHODIMP_(MozExternalRefCountType) SharedThreadPool::Release(void)
{
MOZ_ASSERT(sMonitor);
bool dispatchShutdownEvent;

View File

@ -44,8 +44,8 @@ public:
// are implemented using locking, so it's not recommended that you use them
// in a tight loop.
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
NS_IMETHOD_(MozExternalRefCountType) AddRef(void);
NS_IMETHOD_(MozExternalRefCountType) Release(void);
// Forward behaviour to wrapped thread pool implementation.
NS_FORWARD_SAFE_NSITHREADPOOL(mPool);
@ -87,4 +87,4 @@ private:
} // namespace mozilla
#endif // SharedThreadPool_h_
#endif // SharedThreadPool_h_

View File

@ -32,7 +32,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(AudioNode, nsDOMEventTargetHelper)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
AudioNode::Release()
{
if (mRefCnt.get() == 1) {

View File

@ -29,7 +29,7 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(AudioParam)
NS_IMPL_CYCLE_COLLECTING_NATIVE_ADDREF(AudioParam)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
AudioParam::Release()
{
if (mRefCnt.get() == 1) {

View File

@ -31,8 +31,8 @@ public:
float aDefaultValue);
virtual ~AudioParam();
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
NS_IMETHOD_(MozExternalRefCountType) AddRef(void);
NS_IMETHOD_(MozExternalRefCountType) Release(void);
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AudioParam)
AudioContext* GetParentObject() const

View File

@ -5,6 +5,7 @@
#include "mozilla/dom/CDATASection.h"
#include "mozilla/dom/CDATASectionBinding.h"
#include "mozilla/IntegerPrintfMacros.h"
namespace mozilla {
namespace dom {
@ -48,7 +49,7 @@ CDATASection::List(FILE* out, int32_t aIndent) const
int32_t index;
for (index = aIndent; --index >= 0; ) fputs(" ", out);
fprintf(out, "CDATASection refcount=%d<", mRefCnt.get());
fprintf(out, "CDATASection refcount=%" PRIuPTR "<", mRefCnt.get());
nsAutoString tmp;
ToCString(tmp, 0, mText.GetLength());

View File

@ -8,6 +8,7 @@
#include "mozilla/dom/ProcessingInstruction.h"
#include "mozilla/dom/ProcessingInstructionBinding.h"
#include "mozilla/dom/XMLStylesheetProcessingInstruction.h"
#include "mozilla/IntegerPrintfMacros.h"
#include "nsContentUtils.h"
already_AddRefed<mozilla::dom::ProcessingInstruction>
@ -111,7 +112,7 @@ ProcessingInstruction::List(FILE* out, int32_t aIndent) const
int32_t index;
for (index = aIndent; --index >= 0; ) fputs(" ", out);
fprintf(out, "Processing instruction refcount=%d<", mRefCnt.get());
fprintf(out, "Processing instruction refcount=%" PRIuPTR "<", mRefCnt.get());
nsAutoString tmp;
ToCString(tmp, 0, mText.GetLength());

View File

@ -56,8 +56,8 @@ public:
public:
NS_METHOD_(nsrefcnt) AddRef();
NS_METHOD_(nsrefcnt) Release();
NS_METHOD_(MozExternalRefCountType) AddRef();
NS_METHOD_(MozExternalRefCountType) Release();
NS_DECL_OWNINGTHREAD
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(nsXMLBindingSet)

View File

@ -1726,10 +1726,10 @@ GetBuildId(JS::BuildIdCharVector* aBuildID)
class Client : public quota::Client
{
public:
NS_IMETHOD_(nsrefcnt)
NS_IMETHOD_(MozExternalRefCountType)
AddRef() MOZ_OVERRIDE;
NS_IMETHOD_(nsrefcnt)
NS_IMETHOD_(MozExternalRefCountType)
Release() MOZ_OVERRIDE;
virtual Type

View File

@ -24,8 +24,8 @@ class DeviceStorageRequestParent : public PDeviceStorageRequestParent
public:
DeviceStorageRequestParent(const DeviceStorageParams& aParams);
NS_IMETHOD_(nsrefcnt) AddRef();
NS_IMETHOD_(nsrefcnt) Release();
NS_IMETHOD_(MozExternalRefCountType) AddRef();
NS_IMETHOD_(MozExternalRefCountType) Release();
bool EnsureRequiredPermissions(mozilla::dom::ContentParent* aParent);
void Dispatch();

View File

@ -23,10 +23,10 @@ class LockedFile;
class FileHelperListener
{
public:
NS_IMETHOD_(nsrefcnt)
NS_IMETHOD_(MozExternalRefCountType)
AddRef() = 0;
NS_IMETHOD_(nsrefcnt)
NS_IMETHOD_(MozExternalRefCountType)
Release() = 0;
virtual void

View File

@ -69,10 +69,10 @@ private:
friend class FileService;
public:
NS_IMETHOD_(nsrefcnt)
NS_IMETHOD_(MozExternalRefCountType)
AddRef() MOZ_OVERRIDE;
NS_IMETHOD_(nsrefcnt)
NS_IMETHOD_(MozExternalRefCountType)
Release() MOZ_OVERRIDE;
inline nsresult

View File

@ -630,14 +630,14 @@ AsyncConnectionHelper::ConvertToArrayAndCleanup(
return rv;
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
StackBasedEventTarget::AddRef()
{
NS_NOTREACHED("Don't call me!");
return 2;
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
StackBasedEventTarget::Release()
{
NS_NOTREACHED("Don't call me!");

View File

@ -22,10 +22,10 @@ class Client : public mozilla::dom::quota::Client
typedef mozilla::dom::quota::UsageInfo UsageInfo;
public:
NS_IMETHOD_(nsrefcnt)
NS_IMETHOD_(MozExternalRefCountType)
AddRef() MOZ_OVERRIDE;
NS_IMETHOD_(nsrefcnt)
NS_IMETHOD_(MozExternalRefCountType)
Release() MOZ_OVERRIDE;
virtual Type

View File

@ -75,12 +75,12 @@ public:
};
// Could really use those NS_REFCOUNTING_HAHA_YEAH_RIGHT macros here.
NS_IMETHODIMP_(nsrefcnt) StartTransactionRunnable::AddRef()
NS_IMETHODIMP_(MozExternalRefCountType) StartTransactionRunnable::AddRef()
{
return 2;
}
NS_IMETHODIMP_(nsrefcnt) StartTransactionRunnable::Release()
NS_IMETHODIMP_(MozExternalRefCountType) StartTransactionRunnable::Release()
{
return 1;
}

View File

@ -49,8 +49,8 @@ class UpdateRefcountFunction;
class IDBTransactionListener
{
public:
NS_IMETHOD_(nsrefcnt) AddRef() = 0;
NS_IMETHOD_(nsrefcnt) Release() = 0;
NS_IMETHOD_(MozExternalRefCountType) AddRef() = 0;
NS_IMETHOD_(MozExternalRefCountType) Release() = 0;
// Called just before dispatching the final events on the transaction.
virtual nsresult NotifyTransactionPreComplete(IDBTransaction* aTransaction) = 0;

View File

@ -34,7 +34,7 @@ TCPServerSocketChildBase::~TCPServerSocketChildBase()
{
}
NS_IMETHODIMP_(nsrefcnt) TCPServerSocketChild::Release(void)
NS_IMETHODIMP_(MozExternalRefCountType) TCPServerSocketChild::Release(void)
{
nsrefcnt refcnt = TCPServerSocketChildBase::Release();
if (refcnt == 1 && mIPCOpen) {

View File

@ -36,7 +36,7 @@ class TCPServerSocketChild : public mozilla::net::PTCPServerSocketChild
{
public:
NS_DECL_NSITCPSERVERSOCKETCHILD
NS_IMETHOD_(nsrefcnt) Release() MOZ_OVERRIDE;
NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE;
TCPServerSocketChild();
~TCPServerSocketChild();

View File

@ -61,7 +61,7 @@ TCPSocketChildBase::~TCPSocketChildBase()
{
}
NS_IMETHODIMP_(nsrefcnt) TCPSocketChild::Release(void)
NS_IMETHODIMP_(MozExternalRefCountType) TCPSocketChild::Release(void)
{
nsrefcnt refcnt = TCPSocketChildBase::Release();
if (refcnt == 1 && mIPCOpen) {

View File

@ -40,7 +40,7 @@ class TCPSocketChild : public mozilla::net::PTCPSocketChild
{
public:
NS_DECL_NSITCPSOCKETCHILD
NS_IMETHOD_(nsrefcnt) Release() MOZ_OVERRIDE;
NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE;
TCPSocketChild();
~TCPSocketChild();

View File

@ -72,7 +72,7 @@ TCPSocketParentBase::AddIPDLReference()
this->AddRef();
}
NS_IMETHODIMP_(nsrefcnt) TCPSocketParent::Release(void)
NS_IMETHODIMP_(MozExternalRefCountType) TCPSocketParent::Release(void)
{
nsrefcnt refcnt = TCPSocketParentBase::Release();
if (refcnt == 1 && mIPCOpen) {

View File

@ -43,7 +43,7 @@ class TCPSocketParent : public mozilla::net::PTCPSocketParent
{
public:
NS_DECL_NSITCPSOCKETPARENT
NS_IMETHOD_(nsrefcnt) Release() MOZ_OVERRIDE;
NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE;
TCPSocketParent() : mIntermediaryObj(nullptr) {}

View File

@ -37,7 +37,7 @@ UDPSocketChildBase::AddIPDLReference()
this->AddRef();
}
NS_IMETHODIMP_(nsrefcnt) UDPSocketChild::Release(void)
NS_IMETHODIMP_(MozExternalRefCountType) UDPSocketChild::Release(void)
{
nsrefcnt refcnt = UDPSocketChildBase::Release();
if (refcnt == 1 && mIPCOpen) {

View File

@ -35,7 +35,7 @@ class UDPSocketChild : public mozilla::net::PUDPSocketChild
{
public:
NS_DECL_NSIUDPSOCKETCHILD
NS_IMETHOD_(nsrefcnt) Release() MOZ_OVERRIDE;
NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE;
UDPSocketChild();
virtual ~UDPSocketChild();

View File

@ -14,10 +14,10 @@ BEGIN_QUOTA_NAMESPACE
class AcquireListener
{
public:
NS_IMETHOD_(nsrefcnt)
NS_IMETHOD_(MozExternalRefCountType)
AddRef() = 0;
NS_IMETHOD_(nsrefcnt)
NS_IMETHOD_(MozExternalRefCountType)
Release() = 0;
virtual nsresult

View File

@ -28,10 +28,10 @@ class UsageInfo;
class Client
{
public:
NS_IMETHOD_(nsrefcnt)
NS_IMETHOD_(MozExternalRefCountType)
AddRef() = 0;
NS_IMETHOD_(nsrefcnt)
NS_IMETHOD_(MozExternalRefCountType)
Release() = 0;
enum Type {

View File

@ -56,8 +56,8 @@ public:
virtual nsSMILTime GetParentTime() const MOZ_OVERRIDE;
// nsARefreshObserver
NS_IMETHOD_(nsrefcnt) AddRef() MOZ_OVERRIDE;
NS_IMETHOD_(nsrefcnt) Release() MOZ_OVERRIDE;
NS_IMETHOD_(MozExternalRefCountType) AddRef() MOZ_OVERRIDE;
NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE;
virtual void WillRefresh(mozilla::TimeStamp aTime) MOZ_OVERRIDE;

View File

@ -29,7 +29,7 @@ class DOMStorageDBBridge;
class DOMStorageCacheBridge
{
public:
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(MozExternalRefCountType) AddRef(void);
NS_IMETHOD_(void) Release(void);
virtual ~DOMStorageCacheBridge() {}

View File

@ -22,7 +22,7 @@ namespace dom {
NS_IMPL_ADDREF(DOMStorageDBChild)
NS_IMETHODIMP_(nsrefcnt) DOMStorageDBChild::Release(void)
NS_IMETHODIMP_(MozExternalRefCountType) DOMStorageDBChild::Release(void)
{
NS_PRECONDITION(0 != mRefCnt, "dup release");
nsrefcnt count = --mRefCnt;

View File

@ -29,8 +29,8 @@ public:
DOMStorageDBChild(DOMLocalStorageManager* aManager);
virtual ~DOMStorageDBChild();
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
NS_IMETHOD_(MozExternalRefCountType) AddRef(void);
NS_IMETHOD_(MozExternalRefCountType) Release(void);
void AddIPDLReference();
void ReleaseIPDLReference();
@ -116,8 +116,8 @@ public:
CloneProtocol(Channel* aChannel,
mozilla::ipc::ProtocolCloneContext* aCtx) MOZ_OVERRIDE;
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
NS_IMETHOD_(MozExternalRefCountType) AddRef(void);
NS_IMETHOD_(MozExternalRefCountType) Release(void);
void AddIPDLReference();
void ReleaseIPDLReference();

View File

@ -45,8 +45,8 @@ public:
class txACompileObserver
{
public:
NS_IMETHOD_(nsrefcnt) AddRef() = 0;
NS_IMETHOD_(nsrefcnt) Release() = 0;
NS_IMETHOD_(MozExternalRefCountType) AddRef() = 0;
NS_IMETHOD_(MozExternalRefCountType) Release() = 0;
virtual nsresult loadURI(const nsAString& aUri,
const nsAString& aReferrerUri,

View File

@ -27,8 +27,8 @@ public:
nsTransactionItem(nsITransaction *aTransaction);
virtual ~nsTransactionItem();
NS_METHOD_(nsrefcnt) AddRef();
NS_METHOD_(nsrefcnt) Release();
NS_METHOD_(MozExternalRefCountType) AddRef();
NS_METHOD_(MozExternalRefCountType) Release();
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(nsTransactionItem)

View File

@ -16,7 +16,7 @@
NS_IMPL_ADDREF(nsPrintProgress)
NS_IMPL_RELEASE(nsPrintProgress)
#else
NS_IMETHODIMP_(nsrefcnt) nsPrintProgress::AddRef(void)
NS_IMETHODIMP_(MozExternalRefCountType) nsPrintProgress::AddRef(void)
{
NS_PRECONDITION(int32_t(mRefCnt) >= 0, "illegal refcnt");
nsrefcnt count;
@ -25,7 +25,7 @@ NS_IMETHODIMP_(nsrefcnt) nsPrintProgress::AddRef(void)
return count;
}
NS_IMETHODIMP_(nsrefcnt) nsPrintProgress::Release(void)
NS_IMETHODIMP_(MozExternalRefCountType) nsPrintProgress::Release(void)
{
nsrefcnt count;
NS_PRECONDITION(0 != mRefCnt, "dup release");

View File

@ -6,14 +6,14 @@
#include "nsCaseConversionImp2.h"
#include "nsUnicharUtils.h"
NS_IMETHODIMP_(nsrefcnt) nsCaseConversionImp2::AddRef(void)
NS_IMETHODIMP_(MozExternalRefCountType) nsCaseConversionImp2::AddRef(void)
{
return (nsrefcnt)1;
return (MozExternalRefCountType)1;
}
NS_IMETHODIMP_(nsrefcnt) nsCaseConversionImp2::Release(void)
NS_IMETHODIMP_(MozExternalRefCountType) nsCaseConversionImp2::Release(void)
{
return (nsrefcnt)1;
return (MozExternalRefCountType)1;
}
NS_IMPL_QUERY_INTERFACE1(nsCaseConversionImp2, nsICaseConversion)

View File

@ -10,14 +10,14 @@
NS_IMPL_QUERY_INTERFACE1(nsCategoryImp, nsIUGenCategory)
NS_IMETHODIMP_(nsrefcnt) nsCategoryImp::AddRef(void)
NS_IMETHODIMP_(MozExternalRefCountType) nsCategoryImp::AddRef(void)
{
return nsrefcnt(1);
return MozExternalRefCountType(1);
}
NS_IMETHODIMP_(nsrefcnt) nsCategoryImp::Release(void)
NS_IMETHODIMP_(MozExternalRefCountType) nsCategoryImp::Release(void)
{
return nsrefcnt(1);
return MozExternalRefCountType(1);
}
nsCategoryImp* nsCategoryImp::GetInstance()

View File

@ -398,13 +398,13 @@ XPCShellEnvironment::ProcessFile(JSContext *cx,
fprintf(stdout, "\n");
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
XPCShellDirProvider::AddRef()
{
return 2;
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
XPCShellDirProvider::Release()
{
return 1;

View File

@ -160,8 +160,8 @@ class NS_NO_VTABLE nsXPCClassInfo : public nsIClassInfo,
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_XPCCLASSINFO_IID)
NS_IMETHOD_(nsrefcnt) AddRef() = 0;
NS_IMETHOD_(nsrefcnt) Release() = 0;
NS_IMETHOD_(MozExternalRefCountType) AddRef() = 0;
NS_IMETHOD_(MozExternalRefCountType) Release() = 0;
virtual void PreserveWrapper(nsISupports *aNative) = 0;

View File

@ -3789,8 +3789,8 @@ private:
ComponentsSH ComponentsSH::singleton(0);
// Singleton refcounting.
NS_IMETHODIMP_(nsrefcnt) ComponentsSH::AddRef(void) { return 1; }
NS_IMETHODIMP_(nsrefcnt) ComponentsSH::Release(void) { return 1; }
NS_IMETHODIMP_(MozExternalRefCountType) ComponentsSH::AddRef(void) { return 1; }
NS_IMETHODIMP_(MozExternalRefCountType) ComponentsSH::Release(void) { return 1; }
NS_INTERFACE_MAP_BEGIN(ComponentsSH)
NS_INTERFACE_MAP_ENTRY(nsIXPCScriptable)

View File

@ -1654,13 +1654,13 @@ XPCShellDirProvider::SetPluginDir(nsIFile* pluginDir)
mPluginDir = pluginDir;
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
XPCShellDirProvider::AddRef()
{
return 2;
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
XPCShellDirProvider::Release()
{
return 1;

View File

@ -218,7 +218,7 @@ nsXPCWrappedJS::QueryInterface(REFNSIID aIID, void** aInstancePtr)
// For a description of nsXPCWrappedJS lifetime and reference counting, see
// the comment at the top of this file.
nsrefcnt
MozExternalRefCountType
nsXPCWrappedJS::AddRef(void)
{
if (!MOZ_LIKELY(NS_IsMainThread()))
@ -237,7 +237,7 @@ nsXPCWrappedJS::AddRef(void)
return cnt;
}
nsrefcnt
MozExternalRefCountType
nsXPCWrappedJS::Release(void)
{
if (!MOZ_LIKELY(NS_IsMainThread()))

View File

@ -45,8 +45,8 @@ public:
//
// The refresh driver does NOT hold references to refresh observers
// except while it is notifying them.
NS_IMETHOD_(nsrefcnt) AddRef(void) = 0;
NS_IMETHOD_(nsrefcnt) Release(void) = 0;
NS_IMETHOD_(MozExternalRefCountType) AddRef(void) = 0;
NS_IMETHOD_(MozExternalRefCountType) Release(void) = 0;
virtual void WillRefresh(mozilla::TimeStamp aTime) = 0;
};

View File

@ -36,8 +36,8 @@ public:
// Declare addref and release so they can be called on us, but don't
// implement them. Our subclasses must handle their own
// refcounting.
NS_IMETHOD_(nsrefcnt) AddRef() MOZ_OVERRIDE = 0;
NS_IMETHOD_(nsrefcnt) Release() MOZ_OVERRIDE = 0;
NS_IMETHOD_(MozExternalRefCountType) AddRef() MOZ_OVERRIDE = 0;
NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE = 0;
NS_DECL_NSICSSDECLARATION
using nsICSSDeclaration::GetLength;

View File

@ -101,8 +101,8 @@ public:
virtual int cancel(int how);
// nsISupport reference counted interface
NS_IMETHOD_(nsrefcnt) AddRef(void) = 0;
NS_IMETHOD_(nsrefcnt) Release(void) = 0;
NS_IMETHOD_(MozExternalRefCountType) AddRef(void) = 0;
NS_IMETHOD_(MozExternalRefCountType) Release(void) = 0;
uint32_t poll_flags() {
return poll_flags_;

View File

@ -7,26 +7,31 @@
#ifndef mozilla_RefCountType_h
#define mozilla_RefCountType_h
#include <stdint.h>
/**
* MozRefCountType is Mozilla's reference count type.
*
* This is the return type for AddRef() and Release() in nsISupports.
* IUnknown of COM returns an unsigned long from equivalent functions.
*
* We use the same type to represent the refcount of RefCounted objects
* as well, in order to be able to use the leak detection facilities
* that are implemented by XPCOM.
*
* The following ifdef exists to maintain binary compatibility with
* IUnknown, the base interface in Microsoft COM.
*
* Note that this type is not in the mozilla namespace so that it is
* usable for both C and C++ code.
*/
typedef uintptr_t MozRefCountType;
/*
* This is the return type for AddRef() and Release() in nsISupports.
* IUnknown of COM returns an unsigned long from equivalent functions.
*
* The following ifdef exists to maintain binary compatibility with
* IUnknown, the base interface in Microsoft COM.
*/
#ifdef XP_WIN
typedef unsigned long MozRefCountType;
typedef unsigned long MozExternalRefCountType;
#else
typedef uint32_t MozRefCountType;
typedef uint32_t MozExternalRefCountType;
#endif
#endif

View File

@ -95,7 +95,7 @@ NS_IMPL_QUERY_INTERFACE1(nsJAR, nsIZipReader)
NS_IMPL_ADDREF(nsJAR)
// Custom Release method works with nsZipReaderCache...
nsrefcnt nsJAR::Release(void)
MozExternalRefCountType nsJAR::Release(void)
{
nsrefcnt count;
NS_PRECONDITION(0 != mRefCnt, "dup release");

View File

@ -196,8 +196,8 @@ public:
/*
* Refcounting
*/
NS_METHOD_(nsrefcnt) AddRef(void);
NS_METHOD_(nsrefcnt) Release(void);
NS_METHOD_(MozExternalRefCountType) AddRef(void);
NS_METHOD_(MozExternalRefCountType) Release(void);
private:
//--- private members ---
@ -378,8 +378,8 @@ public:
static nsresult Init(nsZipArchive *zip, const char *entry,
nsZipHandle **ret);
NS_METHOD_(nsrefcnt) AddRef(void);
NS_METHOD_(nsrefcnt) Release(void);
NS_METHOD_(MozExternalRefCountType) AddRef(void);
NS_METHOD_(MozExternalRefCountType) Release(void);
int64_t SizeOfMapping();

View File

@ -310,14 +310,14 @@ NS_IMPL_QUERY_INTERFACE2(nsSocketInputStream,
nsIInputStream,
nsIAsyncInputStream)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsSocketInputStream::AddRef()
{
++mReaderRefCnt;
return mTransport->AddRef();
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsSocketInputStream::Release()
{
if (--mReaderRefCnt == 0)
@ -573,14 +573,14 @@ NS_IMPL_QUERY_INTERFACE2(nsSocketOutputStream,
nsIOutputStream,
nsIAsyncOutputStream)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsSocketOutputStream::AddRef()
{
++mWriterRefCnt;
return mTransport->AddRef();
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsSocketOutputStream::Release()
{
if (--mWriterRefCnt == 0)

View File

@ -655,7 +655,7 @@ nsCacheEntryDescriptor::VisitMetaData(nsICacheMetaDataVisitor * visitor)
******************************************************************************/
NS_IMPL_ADDREF(nsCacheEntryDescriptor::nsInputStreamWrapper)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsCacheEntryDescriptor::nsInputStreamWrapper::Release()
{
// Holding a reference to descriptor ensures that cache service won't go
@ -847,7 +847,7 @@ nsInputStreamWrapper::IsNonBlocking(bool *result)
******************************************************************************/
NS_IMPL_ADDREF(nsCacheEntryDescriptor::nsDecompressInputStreamWrapper)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsCacheEntryDescriptor::nsDecompressInputStreamWrapper::Release()
{
// Holding a reference to descriptor ensures that cache service won't go
@ -1037,7 +1037,7 @@ nsDecompressInputStreamWrapper::EndZstream()
******************************************************************************/
NS_IMPL_ADDREF(nsCacheEntryDescriptor::nsOutputStreamWrapper)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsCacheEntryDescriptor::nsOutputStreamWrapper::Release()
{
// Holding a reference to descriptor ensures that cache service won't go
@ -1267,7 +1267,7 @@ nsOutputStreamWrapper::IsNonBlocking(bool *result)
******************************************************************************/
NS_IMPL_ADDREF(nsCacheEntryDescriptor::nsCompressOutputStreamWrapper)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsCacheEntryDescriptor::nsCompressOutputStreamWrapper::Release()
{
// Holding a reference to descriptor ensures that cache service won't go

View File

@ -98,7 +98,7 @@ private:
NS_IMPL_ADDREF(CacheFileChunk)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
CacheFileChunk::Release()
{
NS_PRECONDITION(0 != mRefCnt, "dup release");

View File

@ -58,7 +58,7 @@ CacheFileHandle::DispatchRelease()
return false;
}
nsRefPtr<nsRunnableMethod<CacheFileHandle, nsrefcnt, false> > event =
nsRefPtr<nsRunnableMethod<CacheFileHandle, MozExternalRefCountType, false> > event =
NS_NewNonOwningRunnableMethod(this, &CacheFileHandle::Release);
nsresult rv = ioTarget->Dispatch(event, nsIEventTarget::DISPATCH_NORMAL);
if (NS_FAILED(rv)) {
@ -69,7 +69,7 @@ CacheFileHandle::DispatchRelease()
}
NS_IMPL_ADDREF(CacheFileHandle)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
CacheFileHandle::Release()
{
nsrefcnt count = mRefCnt - 1;

View File

@ -14,7 +14,7 @@ namespace mozilla {
namespace net {
NS_IMPL_ADDREF(CacheFileInputStream)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
CacheFileInputStream::Release()
{
NS_PRECONDITION(0 != mRefCnt, "dup release");

View File

@ -16,7 +16,7 @@ namespace mozilla {
namespace net {
NS_IMPL_ADDREF(CacheFileOutputStream)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
CacheFileOutputStream::Release()
{
NS_PRECONDITION(0 != mRefCnt, "dup release");

View File

@ -66,7 +66,7 @@ HttpChannelChild::~HttpChannelChild()
// Override nsHashPropertyBag's AddRef: we don't need thread-safe refcnt
NS_IMPL_ADDREF(HttpChannelChild)
NS_IMETHODIMP_(nsrefcnt) HttpChannelChild::Release()
NS_IMETHODIMP_(MozExternalRefCountType) HttpChannelChild::Release()
{
NS_PRECONDITION(0 != mRefCnt, "dup release");
NS_ASSERT_OWNINGTHREAD(HttpChannelChild);

View File

@ -346,8 +346,8 @@ public:
// Added manually so we can use nsRefPtr without inheriting from
// nsISupports
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
NS_IMETHOD_(MozExternalRefCountType) AddRef(void);
NS_IMETHOD_(MozExternalRefCountType) Release(void);
public: // intentional!
nsRefPtr<NullHttpTransaction> mTrans;

View File

@ -1841,7 +1841,7 @@ nsHttpTransaction::CancelPacing(nsresult reason)
NS_IMPL_ADDREF(nsHttpTransaction)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsHttpTransaction::Release()
{
nsrefcnt count;

View File

@ -28,8 +28,8 @@ class BaseWebSocketChannel : public nsIWebSocketChannel,
NS_DECL_NSIPROTOCOLHANDLER
NS_IMETHOD QueryInterface(const nsIID & uuid, void **result) = 0;
NS_IMETHOD_(nsrefcnt ) AddRef(void) = 0;
NS_IMETHOD_(nsrefcnt ) Release(void) = 0;
NS_IMETHOD_(MozExternalRefCountType ) AddRef(void) = 0;
NS_IMETHOD_(MozExternalRefCountType ) Release(void) = 0;
// Partial implementation of nsIWebSocketChannel
//

View File

@ -23,7 +23,7 @@ namespace net {
NS_IMPL_ADDREF(WebSocketChannelChild)
NS_IMETHODIMP_(nsrefcnt) WebSocketChannelChild::Release()
NS_IMETHODIMP_(MozExternalRefCountType) WebSocketChannelChild::Release()
{
NS_PRECONDITION(0 != mRefCnt, "dup release");
NS_ASSERT_OWNINGTHREAD(WebSocketChannelChild);

View File

@ -33,14 +33,14 @@ nsHtml5Atom::~nsHtml5Atom()
nsStringBuffer::FromData(mString)->Release();
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsHtml5Atom::AddRef()
{
NS_NOTREACHED("Attempt to AddRef an nsHtml5Atom.");
return 2;
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsHtml5Atom::Release()
{
NS_NOTREACHED("Attempt to Release an nsHtml5Atom.");

View File

@ -114,8 +114,8 @@ public:
}
};
NS_IMETHODIMP_(nsrefcnt) AsyncStatementClassInfo::AddRef() { return 2; }
NS_IMETHODIMP_(nsrefcnt) AsyncStatementClassInfo::Release() { return 1; }
NS_IMETHODIMP_(MozExternalRefCountType) AsyncStatementClassInfo::AddRef() { return 2; }
NS_IMETHODIMP_(MozExternalRefCountType) AsyncStatementClassInfo::Release() { return 1; }
NS_IMPL_QUERY_INTERFACE1(AsyncStatementClassInfo, nsIClassInfo)
static AsyncStatementClassInfo sAsyncStatementClassInfo;

View File

@ -64,8 +64,8 @@ AsyncStatementJSHelper::getParams(AsyncStatement *aStatement,
return NS_OK;
}
NS_IMETHODIMP_(nsrefcnt) AsyncStatementJSHelper::AddRef() { return 2; }
NS_IMETHODIMP_(nsrefcnt) AsyncStatementJSHelper::Release() { return 1; }
NS_IMETHODIMP_(MozExternalRefCountType) AsyncStatementJSHelper::AddRef() { return 2; }
NS_IMETHODIMP_(MozExternalRefCountType) AsyncStatementJSHelper::Release() { return 1; }
NS_INTERFACE_MAP_BEGIN(AsyncStatementJSHelper)
NS_INTERFACE_MAP_ENTRY(nsIXPCScriptable)
NS_INTERFACE_MAP_ENTRY(nsISupports)

View File

@ -498,7 +498,7 @@ NS_INTERFACE_MAP_END
// This is identical to what NS_IMPL_RELEASE provides, but with the
// extra |1 == count| case.
NS_IMETHODIMP_(nsrefcnt) Connection::Release(void)
NS_IMETHODIMP_(MozExternalRefCountType) Connection::Release(void)
{
NS_PRECONDITION(0 != mRefCnt, "dup release");
nsrefcnt count = --mRefCnt;

View File

@ -116,8 +116,8 @@ public:
}
};
NS_IMETHODIMP_(nsrefcnt) StatementClassInfo::AddRef() { return 2; }
NS_IMETHODIMP_(nsrefcnt) StatementClassInfo::Release() { return 1; }
NS_IMETHODIMP_(MozExternalRefCountType) StatementClassInfo::AddRef() { return 2; }
NS_IMETHODIMP_(MozExternalRefCountType) StatementClassInfo::Release() { return 1; }
NS_IMPL_QUERY_INTERFACE1(StatementClassInfo, nsIClassInfo)
static StatementClassInfo sStatementClassInfo;

View File

@ -157,8 +157,8 @@ StatementJSHelper::getParams(Statement *aStatement,
return NS_OK;
}
NS_IMETHODIMP_(nsrefcnt) StatementJSHelper::AddRef() { return 2; }
NS_IMETHODIMP_(nsrefcnt) StatementJSHelper::Release() { return 1; }
NS_IMETHODIMP_(MozExternalRefCountType) StatementJSHelper::AddRef() { return 2; }
NS_IMETHODIMP_(MozExternalRefCountType) StatementJSHelper::Release() { return 1; }
NS_INTERFACE_MAP_BEGIN(StatementJSHelper)
NS_INTERFACE_MAP_ENTRY(nsIXPCScriptable)
NS_INTERFACE_MAP_ENTRY(nsISupports)

View File

@ -617,13 +617,13 @@ NS_INTERFACE_MAP_BEGIN(nsXULAppInfo)
XRE_GetProcessType() == GeckoProcessType_Content)
NS_INTERFACE_MAP_END
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsXULAppInfo::AddRef()
{
return 1;
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsXULAppInfo::Release()
{
return 1;

View File

@ -164,13 +164,13 @@ NS_IMPL_QUERY_INTERFACE3(nsXREDirProvider,
nsIDirectoryServiceProvider2,
nsIProfileStartup)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsXREDirProvider::AddRef()
{
return 1;
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsXREDirProvider::Release()
{
return 0;

View File

@ -20,8 +20,8 @@ class nsXREDirProvider MOZ_FINAL : public nsIDirectoryServiceProvider2,
public:
// we use a custom isupports implementation (no refcount)
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
NS_IMETHOD_(MozExternalRefCountType) AddRef(void);
NS_IMETHOD_(MozExternalRefCountType) Release(void);
NS_DECL_NSIDIRECTORYSERVICEPROVIDER
NS_DECL_NSIDIRECTORYSERVICEPROVIDER2

View File

@ -8,6 +8,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/BasicEvents.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/IntegerPrintfMacros.h"
#include "mozilla/Likely.h"
#include "mozilla/Poison.h"
#include "nsIWidget.h"
@ -787,7 +788,7 @@ void nsView::List(FILE* out, int32_t aIndent) const
nsrefcnt widgetRefCnt = mWindow->AddRef() - 1;
mWindow->Release();
int32_t Z = mWindow->GetZIndex();
fprintf(out, "(widget=%p[%d] z=%d pos={%d,%d,%d,%d}) ",
fprintf(out, "(widget=%p[%" PRIuPTR "] z=%d pos={%d,%d,%d,%d}) ",
(void*)mWindow, widgetRefCnt, Z,
nonclientBounds.x, nonclientBounds.y,
windowBounds.width, windowBounds.height);

View File

@ -54,8 +54,8 @@ private: \
Internal() {} \
\
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); \
NS_IMETHOD_(nsrefcnt) AddRef(void); \
NS_IMETHOD_(nsrefcnt) Release(void); \
NS_IMETHOD_(MozExternalRefCountType) AddRef(void); \
NS_IMETHOD_(MozExternalRefCountType) Release(void); \
\
NS_DECL_OWNINGTHREAD \
}; \
@ -107,7 +107,7 @@ static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;
\
NS_IMPL_AGGREGATED_HELPER(_class) \
\
NS_IMETHODIMP_(nsrefcnt) \
NS_IMETHODIMP_(MozExternalRefCountType) \
_class::Internal::AddRef(void) \
{ \
_class* agg = (_class*)((char*)(this) - offsetof(_class, fAggregated)); \
@ -118,7 +118,7 @@ _class::Internal::AddRef(void) \
return agg->mRefCnt; \
} \
\
NS_IMETHODIMP_(nsrefcnt) \
NS_IMETHODIMP_(MozExternalRefCountType) \
_class::Internal::Release(void) \
{ \
_class* agg = (_class*)((char*)(this) - offsetof(_class, fAggregated)); \
@ -138,7 +138,7 @@ _class::Internal::Release(void) \
\
NS_IMPL_AGGREGATED_HELPER(_class) \
\
NS_IMETHODIMP_(nsrefcnt) \
NS_IMETHODIMP_(MozExternalRefCountType) \
_class::Internal::AddRef(void) \
{ \
_class* agg = NS_CYCLE_COLLECTION_CLASSNAME(_class)::Downcast(this); \
@ -148,7 +148,7 @@ _class::Internal::AddRef(void) \
NS_LOG_ADDREF(this, count, #_class, sizeof(*agg)); \
return count; \
} \
NS_IMETHODIMP_(nsrefcnt) \
NS_IMETHODIMP_(MozExternalRefCountType) \
_class::Internal::Release(void) \
{ \
_class* agg = NS_CYCLE_COLLECTION_CLASSNAME(_class)::Downcast(this); \
@ -171,13 +171,13 @@ _class::QueryInterface(const nsIID& aIID, void** aInstancePtr) \
return fOuter->QueryInterface(aIID, aInstancePtr); \
} \
\
NS_IMETHODIMP_(nsrefcnt) \
NS_IMETHODIMP_(MozExternalRefCountType) \
_class::AddRef(void) \
{ \
return fOuter->AddRef(); \
} \
\
NS_IMETHODIMP_(nsrefcnt) \
NS_IMETHODIMP_(MozExternalRefCountType) \
_class::Release(void) \
{ \
return fOuter->Release(); \

View File

@ -77,13 +77,13 @@ static Atomic<int32_t> gAssertionCount;
NS_IMPL_QUERY_INTERFACE2(nsDebugImpl, nsIDebug, nsIDebug2)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsDebugImpl::AddRef()
{
return 2;
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsDebugImpl::Release()
{
return 1;

View File

@ -61,7 +61,7 @@ public:
*
* @return The resulting reference count.
*/
NS_IMETHOD_(nsrefcnt) AddRef(void) = 0;
NS_IMETHOD_(MozExternalRefCountType) AddRef(void) = 0;
/**
* Decreases the reference count for this interface.
@ -70,7 +70,7 @@ public:
*
* @return The resulting reference count.
*/
NS_IMETHOD_(nsrefcnt) Release(void) = 0;
NS_IMETHOD_(MozExternalRefCountType) Release(void) = 0;
//@}
};

View File

@ -173,8 +173,8 @@ nsMemoryImpl::RunFlushers(const char16_t* aReason)
}
// XXX need NS_IMPL_STATIC_ADDREF/RELEASE
NS_IMETHODIMP_(nsrefcnt) nsMemoryImpl::FlushEvent::AddRef() { return 2; }
NS_IMETHODIMP_(nsrefcnt) nsMemoryImpl::FlushEvent::Release() { return 1; }
NS_IMETHODIMP_(MozExternalRefCountType) nsMemoryImpl::FlushEvent::AddRef() { return 2; }
NS_IMETHODIMP_(MozExternalRefCountType) nsMemoryImpl::FlushEvent::Release() { return 1; }
NS_IMPL_QUERY_INTERFACE1(nsMemoryImpl::FlushEvent, nsIRunnable)
NS_IMETHODIMP

View File

@ -20,8 +20,8 @@ class nsMemoryImpl : public nsIMemory
public:
// We don't use the generic macros because we are a special static object
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aResult);
NS_IMETHOD_(nsrefcnt) AddRef(void) { return 1; }
NS_IMETHOD_(nsrefcnt) Release(void) { return 1; }
NS_IMETHOD_(MozExternalRefCountType) AddRef(void) { return 1; }
NS_IMETHOD_(MozExternalRefCountType) Release(void) { return 1; }
NS_DECL_NSIMEMORY

View File

@ -1011,7 +1011,7 @@ NS_LogAddRef(void* aPtr, nsrefcnt aRefcnt,
else {
// Can't use PR_LOG(), b/c it truncates the line
fprintf(gRefcntsLog,
"\n<%s> 0x%08X %" PRIdPTR " AddRef %d\n", aClazz, NS_PTR_TO_INT32(aPtr), serialno, aRefcnt);
"\n<%s> 0x%08X %" PRIuPTR " AddRef %" PRIuPTR "\n", aClazz, NS_PTR_TO_INT32(aPtr), serialno, aRefcnt);
nsTraceRefcnt::WalkTheStack(gRefcntsLog);
fflush(gRefcntsLog);
}
@ -1059,7 +1059,7 @@ NS_LogRelease(void* aPtr, nsrefcnt aRefcnt, const char* aClazz)
else {
// Can't use PR_LOG(), b/c it truncates the line
fprintf(gRefcntsLog,
"\n<%s> 0x%08X %" PRIdPTR " Release %d\n", aClazz, NS_PTR_TO_INT32(aPtr), serialno, aRefcnt);
"\n<%s> 0x%08X %" PRIuPTR " Release %" PRIuPTR "\n", aClazz, NS_PTR_TO_INT32(aPtr), serialno, aRefcnt);
nsTraceRefcnt::WalkTheStack(gRefcntsLog);
fflush(gRefcntsLog);
}

View File

@ -402,13 +402,13 @@ CategoryEnumerator::enumfunc_createenumerator(const char* aStr, CategoryNode* aN
NS_IMPL_QUERY_INTERFACE2(nsCategoryManager, nsICategoryManager, nsIMemoryReporter)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsCategoryManager::AddRef()
{
return 2;
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsCategoryManager::Release()
{
return 1;

View File

@ -123,8 +123,8 @@ public:
{}
~PermanentAtomImpl();
NS_IMETHOD_(nsrefcnt) AddRef();
NS_IMETHOD_(nsrefcnt) Release();
NS_IMETHOD_(MozExternalRefCountType) AddRef();
NS_IMETHOD_(MozExternalRefCountType) Release();
virtual bool IsPermanent();
@ -393,13 +393,13 @@ PermanentAtomImpl::~PermanentAtomImpl()
mRefCnt = REFCNT_PERMANENT_SENTINEL;
}
NS_IMETHODIMP_(nsrefcnt) PermanentAtomImpl::AddRef()
NS_IMETHODIMP_(MozExternalRefCountType) PermanentAtomImpl::AddRef()
{
MOZ_ASSERT(NS_IsMainThread(), "wrong thread");
return 2;
}
NS_IMETHODIMP_(nsrefcnt) PermanentAtomImpl::Release()
NS_IMETHODIMP_(MozExternalRefCountType) PermanentAtomImpl::Release()
{
MOZ_ASSERT(NS_IsMainThread(), "wrong thread");
return 1;

View File

@ -341,7 +341,7 @@ nsExpirationTracker<T, K>::ExpirationTrackerObserver::Observe(nsISupports *a
}
template <class T, uint32_t K>
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsExpirationTracker<T,K>::ExpirationTrackerObserver::AddRef(void)
{
MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt");
@ -352,7 +352,7 @@ nsExpirationTracker<T,K>::ExpirationTrackerObserver::AddRef(void)
}
template <class T, uint32_t K>
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsExpirationTracker<T,K>::ExpirationTrackerObserver::Release(void)
{
MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");

View File

@ -5,13 +5,13 @@
#include "nsIClassInfoImpl.h"
#include "nsIProgrammingLanguage.h"
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
GenericClassInfo::AddRef()
{
return 2;
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
GenericClassInfo::Release()
{
return 1;

View File

@ -35,12 +35,12 @@ public:
};
// nsISupports interface
NS_IMETHODIMP_(nsrefcnt) EmptyEnumeratorImpl::AddRef(void)
NS_IMETHODIMP_(MozExternalRefCountType) EmptyEnumeratorImpl::AddRef(void)
{
return 2;
}
NS_IMETHODIMP_(nsrefcnt) EmptyEnumeratorImpl::Release(void)
NS_IMETHODIMP_(MozExternalRefCountType) EmptyEnumeratorImpl::Release(void)
{
return 1;
}

View File

@ -283,8 +283,8 @@ class ThreadSafeAutoRefCnt {
public: \
NS_IMETHOD QueryInterface(REFNSIID aIID, \
void** aInstancePtr); \
NS_IMETHOD_(nsrefcnt) AddRef(void); \
NS_IMETHOD_(nsrefcnt) Release(void); \
NS_IMETHOD_(MozExternalRefCountType) AddRef(void); \
NS_IMETHOD_(MozExternalRefCountType) Release(void); \
protected: \
nsAutoRefCnt mRefCnt; \
NS_DECL_OWNINGTHREAD \
@ -294,8 +294,8 @@ public:
public: \
NS_IMETHOD QueryInterface(REFNSIID aIID, \
void** aInstancePtr); \
NS_IMETHOD_(nsrefcnt) AddRef(void); \
NS_IMETHOD_(nsrefcnt) Release(void); \
NS_IMETHOD_(MozExternalRefCountType) AddRef(void); \
NS_IMETHOD_(MozExternalRefCountType) Release(void); \
protected: \
::mozilla::ThreadSafeAutoRefCnt mRefCnt; \
NS_DECL_OWNINGTHREAD \
@ -305,8 +305,8 @@ public:
public: \
NS_IMETHOD QueryInterface(REFNSIID aIID, \
void** aInstancePtr); \
NS_IMETHOD_(nsrefcnt) AddRef(void); \
NS_IMETHOD_(nsrefcnt) Release(void); \
NS_IMETHOD_(MozExternalRefCountType) AddRef(void); \
NS_IMETHOD_(MozExternalRefCountType) Release(void); \
NS_IMETHOD_(void) DeleteCycleCollectable(void); \
protected: \
nsCycleCollectingAutoRefCnt mRefCnt; \
@ -340,13 +340,13 @@ public:
return count;
#define NS_IMPL_CYCLE_COLLECTING_NATIVE_ADDREF(_class) \
NS_METHOD_(nsrefcnt) _class::AddRef(void) \
NS_METHOD_(MozExternalRefCountType) _class::AddRef(void) \
{ \
NS_IMPL_CC_NATIVE_ADDREF_BODY(_class) \
}
#define NS_IMPL_CYCLE_COLLECTING_NATIVE_RELEASE_WITH_LAST_RELEASE(_class, _last) \
NS_METHOD_(nsrefcnt) _class::Release(void) \
NS_METHOD_(MozExternalRefCountType) _class::Release(void) \
{ \
MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release"); \
NS_ASSERT_OWNINGTHREAD(_class); \
@ -371,17 +371,17 @@ NS_METHOD_(nsrefcnt) _class::Release(void)
}
#define NS_IMPL_CYCLE_COLLECTING_NATIVE_RELEASE(_class) \
NS_METHOD_(nsrefcnt) _class::Release(void) \
NS_METHOD_(MozExternalRefCountType) _class::Release(void) \
{ \
NS_IMPL_CC_NATIVE_RELEASE_BODY(_class) \
}
#define NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(_class) \
public: \
NS_METHOD_(nsrefcnt) AddRef(void) { \
NS_METHOD_(MozExternalRefCountType) AddRef(void) { \
NS_IMPL_CC_NATIVE_ADDREF_BODY(_class) \
} \
NS_METHOD_(nsrefcnt) Release(void) { \
NS_METHOD_(MozExternalRefCountType) Release(void) { \
NS_IMPL_CC_NATIVE_RELEASE_BODY(_class) \
} \
protected: \
@ -407,14 +407,14 @@ public:
*/
#define NS_INLINE_DECL_REFCOUNTING(_class) \
public: \
NS_METHOD_(nsrefcnt) AddRef(void) { \
NS_METHOD_(MozExternalRefCountType) AddRef(void) { \
MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt"); \
NS_ASSERT_OWNINGTHREAD(_class); \
++mRefCnt; \
NS_LOG_ADDREF(this, mRefCnt, #_class, sizeof(*this)); \
return mRefCnt; \
} \
NS_METHOD_(nsrefcnt) Release(void) { \
NS_METHOD_(MozExternalRefCountType) Release(void) { \
MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release"); \
NS_ASSERT_OWNINGTHREAD(_class); \
--mRefCnt; \
@ -442,13 +442,13 @@ public:
*/
#define NS_INLINE_DECL_THREADSAFE_REFCOUNTING(_class) \
public: \
NS_METHOD_(nsrefcnt) AddRef(void) { \
NS_METHOD_(MozExternalRefCountType) AddRef(void) { \
MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt"); \
nsrefcnt count = ++mRefCnt; \
NS_LOG_ADDREF(this, count, #_class, sizeof(*this)); \
return (nsrefcnt) count; \
} \
NS_METHOD_(nsrefcnt) Release(void) { \
NS_METHOD_(MozExternalRefCountType) Release(void) { \
MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release"); \
nsrefcnt count = --mRefCnt; \
NS_LOG_RELEASE(this, count, #_class); \
@ -467,7 +467,7 @@ public:
* @param _class The name of the class implementing the method
*/
#define NS_IMPL_ADDREF(_class) \
NS_IMETHODIMP_(nsrefcnt) _class::AddRef(void) \
NS_IMETHODIMP_(MozExternalRefCountType) _class::AddRef(void) \
{ \
MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt"); \
if (!mRefCnt.isThreadSafe) \
@ -485,7 +485,7 @@ NS_IMETHODIMP_(nsrefcnt) _class::AddRef(void) \
* @param _aggregator the owning/containing object
*/
#define NS_IMPL_ADDREF_USING_AGGREGATOR(_class, _aggregator) \
NS_IMETHODIMP_(nsrefcnt) _class::AddRef(void) \
NS_IMETHODIMP_(MozExternalRefCountType) _class::AddRef(void) \
{ \
NS_PRECONDITION(_aggregator, "null aggregator"); \
return (_aggregator)->AddRef(); \
@ -511,7 +511,7 @@ NS_IMETHODIMP_(nsrefcnt) _class::AddRef(void) \
* of object allocated with placement new).
*/
#define NS_IMPL_RELEASE_WITH_DESTROY(_class, _destroy) \
NS_IMETHODIMP_(nsrefcnt) _class::Release(void) \
NS_IMETHODIMP_(MozExternalRefCountType) _class::Release(void) \
{ \
MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release"); \
if (!mRefCnt.isThreadSafe) \
@ -552,7 +552,7 @@ NS_IMETHODIMP_(nsrefcnt) _class::Release(void) \
* @param _aggregator the owning/containing object
*/
#define NS_IMPL_RELEASE_USING_AGGREGATOR(_class, _aggregator) \
NS_IMETHODIMP_(nsrefcnt) _class::Release(void) \
NS_IMETHODIMP_(MozExternalRefCountType) _class::Release(void) \
{ \
NS_PRECONDITION(_aggregator, "null aggregator"); \
return (_aggregator)->Release(); \
@ -560,7 +560,7 @@ NS_IMETHODIMP_(nsrefcnt) _class::Release(void) \
#define NS_IMPL_CYCLE_COLLECTING_ADDREF(_class) \
NS_IMETHODIMP_(nsrefcnt) _class::AddRef(void) \
NS_IMETHODIMP_(MozExternalRefCountType) _class::AddRef(void) \
{ \
MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt"); \
NS_ASSERT_OWNINGTHREAD(_class); \
@ -571,7 +571,7 @@ NS_IMETHODIMP_(nsrefcnt) _class::AddRef(void) \
}
#define NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_DESTROY(_class, _destroy) \
NS_IMETHODIMP_(nsrefcnt) _class::Release(void) \
NS_IMETHODIMP_(MozExternalRefCountType) _class::Release(void) \
{ \
MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release"); \
NS_ASSERT_OWNINGTHREAD(_class); \
@ -591,7 +591,7 @@ NS_IMETHODIMP_(void) _class::DeleteCycleCollectable(void) \
// _LAST_RELEASE can be useful when certain resources should be released
// as soon as we know the object will be deleted.
#define NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_LAST_RELEASE(_class, _last) \
NS_IMETHODIMP_(nsrefcnt) _class::Release(void) \
NS_IMETHODIMP_(MozExternalRefCountType) _class::Release(void) \
{ \
MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release"); \
NS_ASSERT_OWNINGTHREAD(_class); \
@ -1053,8 +1053,8 @@ NS_IMETHODIMP _class::QueryInterface(REFNSIID aIID, void** aInstancePtr) \
public: \
NS_IMETHOD QueryInterface(REFNSIID aIID, \
void** aInstancePtr); \
NS_IMETHOD_(nsrefcnt) AddRef(void); \
NS_IMETHOD_(nsrefcnt) Release(void); \
NS_IMETHOD_(MozExternalRefCountType) AddRef(void); \
NS_IMETHOD_(MozExternalRefCountType) Release(void); \
/**
* These macros can be used in conjunction with NS_DECL_ISUPPORTS_INHERITED
@ -1065,7 +1065,7 @@ public: \
*/
#define NS_IMPL_ADDREF_INHERITED(Class, Super) \
NS_IMETHODIMP_(nsrefcnt) Class::AddRef(void) \
NS_IMETHODIMP_(MozExternalRefCountType) Class::AddRef(void) \
{ \
nsrefcnt r = Super::AddRef(); \
NS_LOG_ADDREF(this, r, #Class, sizeof(*this)); \
@ -1073,7 +1073,7 @@ NS_IMETHODIMP_(nsrefcnt) Class::AddRef(void) \
}
#define NS_IMPL_RELEASE_INHERITED(Class, Super) \
NS_IMETHODIMP_(nsrefcnt) Class::Release(void) \
NS_IMETHODIMP_(MozExternalRefCountType) Class::Release(void) \
{ \
nsrefcnt r = Super::Release(); \
NS_LOG_RELEASE(this, r, #Class); \
@ -1085,13 +1085,13 @@ NS_IMETHODIMP_(nsrefcnt) Class::Release(void) \
* class might be aggregated.
*/
#define NS_IMPL_NONLOGGING_ADDREF_INHERITED(Class, Super) \
NS_IMETHODIMP_(nsrefcnt) Class::AddRef(void) \
NS_IMETHODIMP_(MozExternalRefCountType) Class::AddRef(void) \
{ \
return Super::AddRef(); \
}
#define NS_IMPL_NONLOGGING_RELEASE_INHERITED(Class, Super) \
NS_IMETHODIMP_(nsrefcnt) Class::Release(void) \
NS_IMETHODIMP_(MozExternalRefCountType) Class::Release(void) \
{ \
return Super::Release(); \
}

View File

@ -682,14 +682,14 @@ nsPipeInputStream::OnInputException(nsresult reason, nsPipeEvents &events)
return result;
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsPipeInputStream::AddRef(void)
{
++mReaderRefCnt;
return mPipe->AddRef();
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsPipeInputStream::Release(void)
{
if (--mReaderRefCnt == 0)
@ -1037,14 +1037,14 @@ nsPipeOutputStream::OnOutputException(nsresult reason, nsPipeEvents &events)
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsPipeOutputStream::AddRef()
{
++mWriterRefCnt;
return mPipe->AddRef();
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsPipeOutputStream::Release()
{
if (--mWriterRefCnt == 0)

View File

@ -373,8 +373,8 @@ NS_IMPL_QUERY_INTERFACE2(nsSimpleUnicharStreamFactory,
nsIFactory,
nsISimpleUnicharStreamFactory)
NS_IMETHODIMP_(nsrefcnt) nsSimpleUnicharStreamFactory::AddRef() { return 2; }
NS_IMETHODIMP_(nsrefcnt) nsSimpleUnicharStreamFactory::Release() { return 1; }
NS_IMETHODIMP_(MozExternalRefCountType) nsSimpleUnicharStreamFactory::AddRef() { return 2; }
NS_IMETHODIMP_(MozExternalRefCountType) nsSimpleUnicharStreamFactory::Release() { return 1; }
NS_IMETHODIMP
nsSimpleUnicharStreamFactory::CreateInstance(nsISupports* aOuter, REFNSIID aIID,

View File

@ -24,13 +24,13 @@ nsXPTCStubBase::QueryInterface(REFNSIID aIID,
return mOuter->QueryInterface(aIID, aInstancePtr);
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsXPTCStubBase::AddRef()
{
return mOuter->AddRef();
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
nsXPTCStubBase::Release()
{
return mOuter->Release();

View File

@ -591,7 +591,7 @@ xptiInterfaceInfo::~xptiInterfaceInfo()
NS_ASSERTION(!mEntry, "bad state in dtor");
}
nsrefcnt
MozExternalRefCountType
xptiInterfaceInfo::AddRef(void)
{
nsrefcnt cnt = ++mRefCnt;
@ -599,7 +599,7 @@ xptiInterfaceInfo::AddRef(void)
return cnt;
}
nsrefcnt
MozExternalRefCountType
xptiInterfaceInfo::Release(void)
{
xptiInterfaceEntry* entry = mEntry;

View File

@ -18,7 +18,7 @@ public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFOO_IID)
NS_IMETHOD_(nsrefcnt) RefCnt() = 0;
NS_IMETHOD_(MozExternalRefCountType) RefCnt() = 0;
NS_IMETHOD_(int32_t) ID() = 0;
};
@ -34,7 +34,7 @@ public:
NS_DECL_ISUPPORTS
// IFoo implementation
NS_IMETHOD_(nsrefcnt) RefCnt() { return mRefCnt; }
NS_IMETHOD_(MozExternalRefCountType) RefCnt() { return mRefCnt; }
NS_IMETHOD_(int32_t) ID() { return mID; }
static int32_t gCount;
@ -108,7 +108,7 @@ Bar::~Bar()
NS_IMPL_ADDREF(Bar)
NS_IMPL_QUERY_INTERFACE1(Bar, IBar)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
Bar::Release(void)
{
++Bar::sReleaseCalled;

View File

@ -22,8 +22,8 @@ class IFoo : public nsISupports
// virtual dtor because IBar uses our Release()
virtual ~IFoo();
NS_IMETHOD_(nsrefcnt) AddRef();
NS_IMETHOD_(nsrefcnt) Release();
NS_IMETHOD_(MozExternalRefCountType) AddRef();
NS_IMETHOD_(MozExternalRefCountType) Release();
NS_IMETHOD QueryInterface( const nsIID&, void** );
static void print_totals();
@ -101,7 +101,7 @@ IFoo::~IFoo()
static_cast<void*>(this), total_destructions_);
}
nsrefcnt
MozExternalRefCountType
IFoo::AddRef()
{
++refcount_;
@ -110,7 +110,7 @@ IFoo::AddRef()
return refcount_;
}
nsrefcnt
MozExternalRefCountType
IFoo::Release()
{
int newcount = --refcount_;

View File

@ -269,13 +269,13 @@ NS_IMPL_QUERY_INTERFACE2(
nsIDirectoryServiceProvider2
)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
ScopedXPCOM::AddRef()
{
return 2;
}
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
ScopedXPCOM::Release()
{
return 1;

View File

@ -199,8 +199,8 @@ class IFoo MOZ_FINAL : public nsISupports
IFoo();
NS_IMETHOD_(nsrefcnt) AddRef();
NS_IMETHOD_(nsrefcnt) Release();
NS_IMETHOD_(MozExternalRefCountType) AddRef();
NS_IMETHOD_(MozExternalRefCountType) Release();
NS_IMETHOD QueryInterface( const nsIID&, void** );
NS_IMETHOD SetString(const nsACString& /*in*/ aString);
@ -245,7 +245,7 @@ IFoo::~IFoo()
static_cast<void*>(this), total_destructions_);
}
nsrefcnt
MozExternalRefCountType
IFoo::AddRef()
{
++refcount_;
@ -254,7 +254,7 @@ IFoo::AddRef()
return refcount_;
}
nsrefcnt
MozExternalRefCountType
IFoo::Release()
{
int newcount = --refcount_;

View File

@ -23,8 +23,8 @@ class Foo : public nsISupports
// virtual dtor because Bar uses our Release()
virtual ~Foo();
NS_IMETHOD_(nsrefcnt) AddRef();
NS_IMETHOD_(nsrefcnt) Release();
NS_IMETHOD_(MozExternalRefCountType) AddRef();
NS_IMETHOD_(MozExternalRefCountType) Release();
NS_IMETHOD QueryInterface( const nsIID&, void** );
static void print_totals();
@ -102,7 +102,7 @@ Foo::~Foo()
static_cast<void*>(this), total_destructions_);
}
nsrefcnt
MozExternalRefCountType
Foo::AddRef()
{
++refcount_;
@ -111,7 +111,7 @@ Foo::AddRef()
return refcount_;
}
nsrefcnt
MozExternalRefCountType
Foo::Release()
{
int newcount = --refcount_;

View File

@ -50,7 +50,7 @@ private:
NS_IMPL_QUERY_INTERFACE1(nsTestCom, nsITestCom)
nsrefcnt nsTestCom::AddRef()
MozExternalRefCountType nsTestCom::AddRef()
{
nsrefcnt res = ++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "nsTestCom", sizeof(*this));
@ -58,7 +58,7 @@ nsrefcnt nsTestCom::AddRef()
return res;
}
nsrefcnt nsTestCom::Release()
MozExternalRefCountType nsTestCom::Release()
{
nsrefcnt res = --mRefCnt;
NS_LOG_RELEASE(this, mRefCnt, "nsTestCom");

View File

@ -344,7 +344,7 @@ LazyIdleThread::SelfDestruct()
NS_IMPL_ADDREF(LazyIdleThread)
NS_IMETHODIMP_(nsrefcnt)
NS_IMETHODIMP_(MozExternalRefCountType)
LazyIdleThread::Release()
{
nsrefcnt count = --mRefCnt;

Some files were not shown because too many files have changed in this diff Show More