Bug 1307961 - require consistent bloatview reporting for nsISupports classes; r=froydnj

This commit is contained in:
Andrew McCreight 2016-12-12 07:58:33 -05:00
parent d3df6f204d
commit e31b5489da
87 changed files with 56 additions and 308 deletions

View File

@ -15,12 +15,10 @@ NS_IMPL_ISUPPORTS0(ArchiveItem)
ArchiveItem::ArchiveItem() ArchiveItem::ArchiveItem()
{ {
MOZ_COUNT_CTOR(ArchiveItem);
} }
ArchiveItem::~ArchiveItem() ArchiveItem::~ArchiveItem()
{ {
MOZ_COUNT_DTOR(ArchiveItem);
} }
@ -43,7 +41,6 @@ ArchiveItem::SetType(const nsCString& aType)
ArchiveReaderEvent::ArchiveReaderEvent(ArchiveReader* aArchiveReader) ArchiveReaderEvent::ArchiveReaderEvent(ArchiveReader* aArchiveReader)
: mArchiveReader(aArchiveReader) : mArchiveReader(aArchiveReader)
{ {
MOZ_COUNT_CTOR(ArchiveReaderEvent);
} }
ArchiveReaderEvent::~ArchiveReaderEvent() ArchiveReaderEvent::~ArchiveReaderEvent()
@ -51,8 +48,6 @@ ArchiveReaderEvent::~ArchiveReaderEvent()
if (!NS_IsMainThread()) { if (!NS_IsMainThread()) {
NS_ReleaseOnMainThread(mMimeService.forget()); NS_ReleaseOnMainThread(mMimeService.forget());
} }
MOZ_COUNT_DTOR(ArchiveReaderEvent);
} }
// From the filename to the mimetype: // From the filename to the mimetype:

View File

@ -26,13 +26,11 @@ public:
explicit ArchiveRequestEvent(ArchiveRequest* aRequest) explicit ArchiveRequestEvent(ArchiveRequest* aRequest)
: mRequest(aRequest) : mRequest(aRequest)
{ {
MOZ_COUNT_CTOR(ArchiveRequestEvent);
} }
protected: protected:
~ArchiveRequestEvent() ~ArchiveRequestEvent()
{ {
MOZ_COUNT_DTOR(ArchiveRequestEvent);
} }
private: //data private: //data
@ -56,8 +54,6 @@ ArchiveRequest::ArchiveRequest(nsPIDOMWindowInner* aWindow,
{ {
MOZ_ASSERT(aReader); MOZ_ASSERT(aReader);
MOZ_COUNT_CTOR(ArchiveRequest);
/* An event to make this request asynchronous: */ /* An event to make this request asynchronous: */
RefPtr<ArchiveRequestEvent> event = new ArchiveRequestEvent(this); RefPtr<ArchiveRequestEvent> event = new ArchiveRequestEvent(this);
NS_DispatchToCurrentThread(event); NS_DispatchToCurrentThread(event);
@ -65,7 +61,6 @@ ArchiveRequest::ArchiveRequest(nsPIDOMWindowInner* aWindow,
ArchiveRequest::~ArchiveRequest() ArchiveRequest::~ArchiveRequest()
{ {
MOZ_COUNT_DTOR(ArchiveRequest);
} }
nsresult nsresult

View File

@ -28,12 +28,10 @@ ArchiveZipItem::ArchiveZipItem(const char* aFilename,
mCentralStruct(aCentralStruct), mCentralStruct(aCentralStruct),
mEncoding(aEncoding) mEncoding(aEncoding)
{ {
MOZ_COUNT_CTOR(ArchiveZipItem);
} }
ArchiveZipItem::~ArchiveZipItem() ArchiveZipItem::~ArchiveZipItem()
{ {
MOZ_COUNT_DTOR(ArchiveZipItem);
} }
nsresult nsresult

View File

@ -36,8 +36,6 @@ public:
mLength(aLength), mLength(aLength),
mStatus(NotStarted) mStatus(NotStarted)
{ {
MOZ_COUNT_CTOR(ArchiveInputStream);
// Reset the data: // Reset the data:
memset(&mData, 0, sizeof(mData)); memset(&mData, 0, sizeof(mData));
@ -52,7 +50,6 @@ public:
private: private:
virtual ~ArchiveInputStream() virtual ~ArchiveInputStream()
{ {
MOZ_COUNT_DTOR(ArchiveInputStream);
Close(); Close();
} }

View File

@ -37,7 +37,6 @@ public:
mFilename(aName) mFilename(aName)
{ {
MOZ_ASSERT(mBlobImpl); MOZ_ASSERT(mBlobImpl);
MOZ_COUNT_CTOR(ArchiveZipBlobImpl);
} }
ArchiveZipBlobImpl(const nsAString& aName, ArchiveZipBlobImpl(const nsAString& aName,
@ -52,7 +51,6 @@ public:
mFilename(aName) mFilename(aName)
{ {
MOZ_ASSERT(mBlobImpl); MOZ_ASSERT(mBlobImpl);
MOZ_COUNT_CTOR(ArchiveZipBlobImpl);
} }
// Overrides: // Overrides:
@ -62,7 +60,6 @@ public:
protected: protected:
virtual ~ArchiveZipBlobImpl() virtual ~ArchiveZipBlobImpl()
{ {
MOZ_COUNT_DTOR(ArchiveZipBlobImpl);
} }
virtual already_AddRefed<BlobImpl> virtual already_AddRefed<BlobImpl>

View File

@ -360,7 +360,6 @@ public:
{ {
MOZ_ASSERT(XRE_IsParentProcess()); MOZ_ASSERT(XRE_IsParentProcess());
AssertIsOnOwningThread(); AssertIsOnOwningThread();
MOZ_COUNT_CTOR(ParentRunnable);
} }
private: private:
@ -369,7 +368,6 @@ private:
MOZ_ASSERT(mState == eFinished); MOZ_ASSERT(mState == eFinished);
MOZ_ASSERT(!mDirectoryLock); MOZ_ASSERT(!mDirectoryLock);
MOZ_ASSERT(mActorDestroyed); MOZ_ASSERT(mActorDestroyed);
MOZ_COUNT_DTOR(ParentRunnable);
} }
bool bool
@ -1233,7 +1231,6 @@ public:
mOpened(false) mOpened(false)
{ {
MOZ_ASSERT(!NS_IsMainThread()); MOZ_ASSERT(!NS_IsMainThread());
MOZ_COUNT_CTOR(ChildRunnable);
} }
JS::AsmJSCacheResult JS::AsmJSCacheResult
@ -1282,7 +1279,6 @@ private:
MOZ_ASSERT(!mOpened); MOZ_ASSERT(!mOpened);
MOZ_ASSERT(mState == eFinished); MOZ_ASSERT(mState == eFinished);
MOZ_ASSERT(mActorDestroyed); MOZ_ASSERT(mActorDestroyed);
MOZ_COUNT_DTOR(ChildRunnable);
} }
// IPDL methods. // IPDL methods.

View File

@ -32,12 +32,10 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Crypto, mParent, mSubtle)
Crypto::Crypto() Crypto::Crypto()
{ {
MOZ_COUNT_CTOR(Crypto);
} }
Crypto::~Crypto() Crypto::~Crypto()
{ {
MOZ_COUNT_DTOR(Crypto);
} }
void void

View File

@ -44,12 +44,10 @@ PostMessageEvent::PostMessageEvent(nsGlobalWindow* aSource,
mSourceDocument(aSourceDocument), mSourceDocument(aSourceDocument),
mTrustedCaller(aTrustedCaller) mTrustedCaller(aTrustedCaller)
{ {
MOZ_COUNT_CTOR(PostMessageEvent);
} }
PostMessageEvent::~PostMessageEvent() PostMessageEvent::~PostMessageEvent()
{ {
MOZ_COUNT_DTOR(PostMessageEvent);
} }
NS_IMETHODIMP NS_IMETHODIMP

View File

@ -739,12 +739,10 @@ NS_IMPL_RELEASE_INHERITED(ShadowRootStyleSheetList, StyleSheetList)
ShadowRootStyleSheetList::ShadowRootStyleSheetList(ShadowRoot* aShadowRoot) ShadowRootStyleSheetList::ShadowRootStyleSheetList(ShadowRoot* aShadowRoot)
: mShadowRoot(aShadowRoot) : mShadowRoot(aShadowRoot)
{ {
MOZ_COUNT_CTOR(ShadowRootStyleSheetList);
} }
ShadowRootStyleSheetList::~ShadowRootStyleSheetList() ShadowRootStyleSheetList::~ShadowRootStyleSheetList()
{ {
MOZ_COUNT_DTOR(ShadowRootStyleSheetList);
} }
StyleSheet* StyleSheet*

View File

@ -574,12 +574,10 @@ nsContentPermissionRequestProxy::nsContentPermissionRequesterProxy
nsContentPermissionRequestProxy::nsContentPermissionRequestProxy() nsContentPermissionRequestProxy::nsContentPermissionRequestProxy()
{ {
MOZ_COUNT_CTOR(nsContentPermissionRequestProxy);
} }
nsContentPermissionRequestProxy::~nsContentPermissionRequestProxy() nsContentPermissionRequestProxy::~nsContentPermissionRequestProxy()
{ {
MOZ_COUNT_DTOR(nsContentPermissionRequestProxy);
} }
nsresult nsresult

View File

@ -1218,13 +1218,11 @@ public:
explicit SelectorCacheKeyDeleter(SelectorCacheKey* aToDelete) explicit SelectorCacheKeyDeleter(SelectorCacheKey* aToDelete)
: mSelector(aToDelete) : mSelector(aToDelete)
{ {
MOZ_COUNT_CTOR(SelectorCacheKeyDeleter);
} }
protected: protected:
~SelectorCacheKeyDeleter() ~SelectorCacheKeyDeleter()
{ {
MOZ_COUNT_DTOR(SelectorCacheKeyDeleter);
} }
public: public:

View File

@ -6412,7 +6412,6 @@ public:
, mStage(eBeforeToggle) , mStage(eBeforeToggle)
, mFullscreen(aFullscreen) , mFullscreen(aFullscreen)
{ {
MOZ_COUNT_CTOR(FullscreenTransitionTask);
} }
NS_IMETHOD Run() override; NS_IMETHOD Run() override;
@ -6420,7 +6419,6 @@ public:
private: private:
~FullscreenTransitionTask() override ~FullscreenTransitionTask() override
{ {
MOZ_COUNT_DTOR(FullscreenTransitionTask);
} }
/** /**

View File

@ -102,13 +102,11 @@ nsScriptNameSpaceManager::nsScriptNameSpaceManager()
: mGlobalNames(&hash_table_ops, sizeof(GlobalNameMapEntry), : mGlobalNames(&hash_table_ops, sizeof(GlobalNameMapEntry),
GLOBALNAME_HASHTABLE_INITIAL_LENGTH) GLOBALNAME_HASHTABLE_INITIAL_LENGTH)
{ {
MOZ_COUNT_CTOR(nsScriptNameSpaceManager);
} }
nsScriptNameSpaceManager::~nsScriptNameSpaceManager() nsScriptNameSpaceManager::~nsScriptNameSpaceManager()
{ {
UnregisterWeakMemoryReporter(this); UnregisterWeakMemoryReporter(this);
MOZ_COUNT_DTOR(nsScriptNameSpaceManager);
} }
nsGlobalNameStruct * nsGlobalNameStruct *

View File

@ -25,7 +25,6 @@ class ImageData final : public nsISupports
{ {
~ImageData() ~ImageData()
{ {
MOZ_COUNT_DTOR(ImageData);
DropData(); DropData();
} }
@ -35,7 +34,6 @@ public:
, mHeight(aHeight) , mHeight(aHeight)
, mData(&aData) , mData(&aData)
{ {
MOZ_COUNT_CTOR(ImageData);
HoldData(); HoldData();
} }

View File

@ -333,8 +333,6 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(DistributedContentList)
DistributedContentList::DistributedContentList(HTMLContentElement* aHostElement) DistributedContentList::DistributedContentList(HTMLContentElement* aHostElement)
: mParent(aHostElement) : mParent(aHostElement)
{ {
MOZ_COUNT_CTOR(DistributedContentList);
if (aHostElement->IsInsertionPoint()) { if (aHostElement->IsInsertionPoint()) {
if (aHostElement->MatchedNodes().IsEmpty()) { if (aHostElement->MatchedNodes().IsEmpty()) {
// Fallback content. // Fallback content.
@ -352,7 +350,6 @@ DistributedContentList::DistributedContentList(HTMLContentElement* aHostElement)
DistributedContentList::~DistributedContentList() DistributedContentList::~DistributedContentList()
{ {
MOZ_COUNT_DTOR(DistributedContentList);
} }
nsIContent* nsIContent*

View File

@ -245,7 +245,6 @@ MemoryReportRequestChild::MemoryReportRequestChild(
bool aAnonymize, const MaybeFileDesc& aDMDFile) bool aAnonymize, const MaybeFileDesc& aDMDFile)
: mAnonymize(aAnonymize) : mAnonymize(aAnonymize)
{ {
MOZ_COUNT_CTOR(MemoryReportRequestChild);
if (aDMDFile.type() == MaybeFileDesc::TFileDescriptor) { if (aDMDFile.type() == MaybeFileDesc::TFileDescriptor) {
mDMDFile = aDMDFile.get_FileDescriptor(); mDMDFile = aDMDFile.get_FileDescriptor();
} }
@ -253,7 +252,6 @@ MemoryReportRequestChild::MemoryReportRequestChild(
MemoryReportRequestChild::~MemoryReportRequestChild() MemoryReportRequestChild::~MemoryReportRequestChild()
{ {
MOZ_COUNT_DTOR(MemoryReportRequestChild);
} }
// IPC sender for remote GC/CC logging. // IPC sender for remote GC/CC logging.

View File

@ -1079,8 +1079,6 @@ ProcessHangMonitor::ProcessHangMonitor()
{ {
MOZ_RELEASE_ASSERT(NS_IsMainThread()); MOZ_RELEASE_ASSERT(NS_IsMainThread());
MOZ_COUNT_CTOR(ProcessHangMonitor);
if (XRE_IsContentProcess()) { if (XRE_IsContentProcess()) {
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService(); nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
obs->AddObserver(this, "xpcom-shutdown", false); obs->AddObserver(this, "xpcom-shutdown", false);
@ -1097,8 +1095,6 @@ ProcessHangMonitor::~ProcessHangMonitor()
{ {
MOZ_RELEASE_ASSERT(NS_IsMainThread()); MOZ_RELEASE_ASSERT(NS_IsMainThread());
MOZ_COUNT_DTOR(ProcessHangMonitor);
MOZ_ASSERT(sInstance == this); MOZ_ASSERT(sInstance == this);
sInstance = nullptr; sInstance = nullptr;

View File

@ -30,13 +30,11 @@ public:
mPrincipal(aPrincipal), mPrincipal(aPrincipal),
mContentType(aContentType) mContentType(aContentType)
{ {
MOZ_COUNT_CTOR(BufferMediaResource);
} }
protected: protected:
virtual ~BufferMediaResource() virtual ~BufferMediaResource()
{ {
MOZ_COUNT_DTOR(BufferMediaResource);
} }
private: private:

View File

@ -84,7 +84,6 @@ class MediaStreamTrackSourceGetter : public nsISupports
public: public:
MediaStreamTrackSourceGetter() MediaStreamTrackSourceGetter()
{ {
MOZ_COUNT_CTOR(MediaStreamTrackSourceGetter);
} }
virtual already_AddRefed<dom::MediaStreamTrackSource> virtual already_AddRefed<dom::MediaStreamTrackSource>
@ -93,7 +92,6 @@ public:
protected: protected:
virtual ~MediaStreamTrackSourceGetter() virtual ~MediaStreamTrackSourceGetter()
{ {
MOZ_COUNT_DTOR(MediaStreamTrackSourceGetter);
} }
}; };

View File

@ -38,7 +38,6 @@ FileBlockCache::FileBlockCache()
mIsWriteScheduled(false), mIsWriteScheduled(false),
mIsOpen(false) mIsOpen(false)
{ {
MOZ_COUNT_CTOR(FileBlockCache);
} }
FileBlockCache::~FileBlockCache() FileBlockCache::~FileBlockCache()
@ -57,7 +56,6 @@ FileBlockCache::~FileBlockCache()
mFD = nullptr; mFD = nullptr;
} }
} }
MOZ_COUNT_DTOR(FileBlockCache);
} }

View File

@ -417,7 +417,6 @@ MediaDecoder::MediaDecoder(MediaDecoderOwner* aOwner)
, INIT_CANONICAL(mIsVisible, !aOwner->IsHidden()) , INIT_CANONICAL(mIsVisible, !aOwner->IsHidden())
, mTelemetryReported(false) , mTelemetryReported(false)
{ {
MOZ_COUNT_CTOR(MediaDecoder);
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
MediaMemoryTracker::AddMediaDecoder(this); MediaMemoryTracker::AddMediaDecoder(this);
@ -516,7 +515,6 @@ MediaDecoder::~MediaDecoder()
mResourceCallback->Disconnect(); mResourceCallback->Disconnect();
MediaMemoryTracker::RemoveMediaDecoder(this); MediaMemoryTracker::RemoveMediaDecoder(this);
UnpinForSeek(); UnpinForSeek();
MOZ_COUNT_DTOR(MediaDecoder);
} }
void void

View File

@ -424,7 +424,6 @@ public:
, mSelectedVideoTrackID(TRACK_NONE) , mSelectedVideoTrackID(TRACK_NONE)
{ {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
MOZ_COUNT_CTOR(MediaRecorder::Session);
uint32_t maxMem = Preferences::GetUint("media.recorder.max_memory", uint32_t maxMem = Preferences::GetUint("media.recorder.max_memory",
MAX_ALLOW_MEMORY_BUFFER); MAX_ALLOW_MEMORY_BUFFER);
@ -589,7 +588,6 @@ private:
// Only DestroyRunnable is allowed to delete Session object. // Only DestroyRunnable is allowed to delete Session object.
virtual ~Session() virtual ~Session()
{ {
MOZ_COUNT_DTOR(MediaRecorder::Session);
LOG(LogLevel::Debug, ("Session.~Session (%p)", this)); LOG(LogLevel::Debug, ("Session.~Session (%p)", this));
CleanupStreams(); CleanupStreams();
if (mReadThread) { if (mReadThread) {

View File

@ -410,13 +410,11 @@ protected:
mContentType(aContentType), mContentType(aContentType),
mLoadInBackground(false) mLoadInBackground(false)
{ {
MOZ_COUNT_CTOR(BaseMediaResource);
NS_ASSERTION(!mContentType.IsEmpty(), "Must know content type"); NS_ASSERTION(!mContentType.IsEmpty(), "Must know content type");
mURI->GetSpec(mContentURL); mURI->GetSpec(mContentURL);
} }
virtual ~BaseMediaResource() virtual ~BaseMediaResource()
{ {
MOZ_COUNT_DTOR(BaseMediaResource);
} }
const nsCString& GetContentType() const override const nsCString& GetContentType() const override

View File

@ -23,13 +23,11 @@ MediaShutdownManager::MediaShutdownManager()
, mIsDoingXPCOMShutDown(false) , mIsDoingXPCOMShutDown(false)
{ {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
MOZ_COUNT_CTOR(MediaShutdownManager);
} }
MediaShutdownManager::~MediaShutdownManager() MediaShutdownManager::~MediaShutdownManager()
{ {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
MOZ_COUNT_DTOR(MediaShutdownManager);
} }
// Note that we don't use ClearOnShutdown() on this StaticRefPtr, as that // Note that we don't use ClearOnShutdown() on this StaticRefPtr, as that

View File

@ -66,7 +66,6 @@ public:
mLabel(aLabel), mLabel(aLabel),
mStopped(false) mStopped(false)
{ {
MOZ_COUNT_CTOR(MediaStreamTrackSource);
} }
/** /**
@ -166,7 +165,6 @@ public:
protected: protected:
virtual ~MediaStreamTrackSource() virtual ~MediaStreamTrackSource()
{ {
MOZ_COUNT_DTOR(MediaStreamTrackSource);
} }
/** /**

View File

@ -53,13 +53,9 @@ DirectShowDecoder::IsEnabled()
DirectShowDecoder::DirectShowDecoder(MediaDecoderOwner* aOwner) DirectShowDecoder::DirectShowDecoder(MediaDecoderOwner* aOwner)
: MediaDecoder(aOwner) : MediaDecoder(aOwner)
{ {
MOZ_COUNT_CTOR(DirectShowDecoder);
} }
DirectShowDecoder::~DirectShowDecoder() DirectShowDecoder::~DirectShowDecoder() = default;
{
MOZ_COUNT_DTOR(DirectShowDecoder);
}
} // namespace mozilla } // namespace mozilla

View File

@ -166,7 +166,6 @@ SourceBufferResource::Ended()
SourceBufferResource::~SourceBufferResource() SourceBufferResource::~SourceBufferResource()
{ {
SBR_DEBUG(""); SBR_DEBUG("");
MOZ_COUNT_DTOR(SourceBufferResource);
} }
SourceBufferResource::SourceBufferResource(const nsACString& aType) SourceBufferResource::SourceBufferResource(const nsACString& aType)
@ -177,7 +176,6 @@ SourceBufferResource::SourceBufferResource(const nsACString& aType)
, mEnded(false) , mEnded(false)
{ {
SBR_DEBUG(""); SBR_DEBUG("");
MOZ_COUNT_CTOR(SourceBufferResource);
} }
#undef SBR_DEBUG #undef SBR_DEBUG

View File

@ -1075,15 +1075,12 @@ CamerasParent::CamerasParent()
return NS_OK; return NS_OK;
}); });
NS_DispatchToMainThread(threadStart); NS_DispatchToMainThread(threadStart);
MOZ_COUNT_CTOR(CamerasParent);
} }
CamerasParent::~CamerasParent() CamerasParent::~CamerasParent()
{ {
LOG(("~CamerasParent: %p", this)); LOG(("~CamerasParent: %p", this));
MOZ_COUNT_DTOR(CamerasParent);
#ifdef DEBUG #ifdef DEBUG
// Verify we have shut down the webrtc engines, this is // Verify we have shut down the webrtc engines, this is
// supposed to happen in ActorDestroy. // supposed to happen in ActorDestroy.

View File

@ -19,13 +19,11 @@ BufferDecoder::BufferDecoder(MediaResource* aResource, GMPCrashHelper* aCrashHel
, mCrashHelper(aCrashHelper) , mCrashHelper(aCrashHelper)
{ {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
MOZ_COUNT_CTOR(BufferDecoder);
} }
BufferDecoder::~BufferDecoder() BufferDecoder::~BufferDecoder()
{ {
// The dtor may run on any thread, we cannot be sure. // The dtor may run on any thread, we cannot be sure.
MOZ_COUNT_DTOR(BufferDecoder);
} }
void void

View File

@ -29,12 +29,10 @@ RTCIdentityProviderRegistrar::RTCIdentityProviderRegistrar(
, mGenerateAssertionCallback(nullptr) , mGenerateAssertionCallback(nullptr)
, mValidateAssertionCallback(nullptr) , mValidateAssertionCallback(nullptr)
{ {
MOZ_COUNT_CTOR(RTCIdentityProviderRegistrar);
} }
RTCIdentityProviderRegistrar::~RTCIdentityProviderRegistrar() RTCIdentityProviderRegistrar::~RTCIdentityProviderRegistrar()
{ {
MOZ_COUNT_DTOR(RTCIdentityProviderRegistrar);
} }
nsIGlobalObject* nsIGlobalObject*

View File

@ -110,13 +110,10 @@ NS_IMPL_ISUPPORTS(PresentationBuilderParent,
PresentationBuilderParent::PresentationBuilderParent(PresentationParent* aParent) PresentationBuilderParent::PresentationBuilderParent(PresentationParent* aParent)
: mParent(aParent) : mParent(aParent)
{ {
MOZ_COUNT_CTOR(PresentationBuilderParent);
} }
PresentationBuilderParent::~PresentationBuilderParent() PresentationBuilderParent::~PresentationBuilderParent()
{ {
MOZ_COUNT_DTOR(PresentationBuilderParent);
if (mNeedDestroyActor) { if (mNeedDestroyActor) {
Unused << NS_WARN_IF(!Send__delete__(this)); Unused << NS_WARN_IF(!Send__delete__(this));
} }

View File

@ -93,12 +93,10 @@ NS_IMPL_ISUPPORTS(PresentationParent,
PresentationParent::PresentationParent() PresentationParent::PresentationParent()
{ {
MOZ_COUNT_CTOR(PresentationParent);
} }
/* virtual */ PresentationParent::~PresentationParent() /* virtual */ PresentationParent::~PresentationParent()
{ {
MOZ_COUNT_DTOR(PresentationParent);
} }
bool bool
@ -388,12 +386,10 @@ PresentationRequestParent::PresentationRequestParent(nsIPresentationService* aSe
: mService(aService) : mService(aService)
, mChildId(aContentParentId) , mChildId(aContentParentId)
{ {
MOZ_COUNT_CTOR(PresentationRequestParent);
} }
PresentationRequestParent::~PresentationRequestParent() PresentationRequestParent::~PresentationRequestParent()
{ {
MOZ_COUNT_DTOR(PresentationRequestParent);
} }
void void

View File

@ -161,7 +161,6 @@ public:
explicit nsAnonymousContentList(nsIContent* aParent) explicit nsAnonymousContentList(nsIContent* aParent)
: mParent(aParent) : mParent(aParent)
{ {
MOZ_COUNT_CTOR(nsAnonymousContentList);
} }
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@ -183,7 +182,6 @@ public:
private: private:
virtual ~nsAnonymousContentList() virtual ~nsAnonymousContentList()
{ {
MOZ_COUNT_DTOR(nsAnonymousContentList);
} }
nsCOMPtr<nsIContent> mParent; nsCOMPtr<nsIContent> mParent;

View File

@ -102,7 +102,6 @@ nsXULTemplateBuilder::nsXULTemplateBuilder(void)
mTop(nullptr), mTop(nullptr),
mObservedDocument(nullptr) mObservedDocument(nullptr)
{ {
MOZ_COUNT_CTOR(nsXULTemplateBuilder);
} }
void void
@ -132,8 +131,6 @@ nsXULTemplateBuilder::~nsXULTemplateBuilder(void)
NS_IF_RELEASE(gScriptSecurityManager); NS_IF_RELEASE(gScriptSecurityManager);
NS_IF_RELEASE(gObserverService); NS_IF_RELEASE(gObserverService);
} }
MOZ_COUNT_DTOR(nsXULTemplateBuilder);
} }

View File

@ -12,12 +12,10 @@
nsWebBrowserContentPolicy::nsWebBrowserContentPolicy() nsWebBrowserContentPolicy::nsWebBrowserContentPolicy()
{ {
MOZ_COUNT_CTOR(nsWebBrowserContentPolicy);
} }
nsWebBrowserContentPolicy::~nsWebBrowserContentPolicy() nsWebBrowserContentPolicy::~nsWebBrowserContentPolicy()
{ {
MOZ_COUNT_DTOR(nsWebBrowserContentPolicy);
} }
NS_IMPL_ISUPPORTS(nsWebBrowserContentPolicy, nsIContentPolicy) NS_IMPL_ISUPPORTS(nsWebBrowserContentPolicy, nsIContentPolicy)

View File

@ -24,12 +24,10 @@ NS_IMPL_ISUPPORTS(MockWebBrowserPrint, nsIWebBrowserPrint);
MockWebBrowserPrint::MockWebBrowserPrint(const PrintData &aData) MockWebBrowserPrint::MockWebBrowserPrint(const PrintData &aData)
: mData(aData) : mData(aData)
{ {
MOZ_COUNT_CTOR(MockWebBrowserPrint);
} }
MockWebBrowserPrint::~MockWebBrowserPrint() MockWebBrowserPrint::~MockWebBrowserPrint()
{ {
MOZ_COUNT_DTOR(MockWebBrowserPrint);
} }
NS_IMETHODIMP NS_IMETHODIMP

View File

@ -22,7 +22,6 @@ PrintProgressDialogChild::PrintProgressDialogChild(
nsIObserver* aOpenObserver) : nsIObserver* aOpenObserver) :
mOpenObserver(aOpenObserver) mOpenObserver(aOpenObserver)
{ {
MOZ_COUNT_CTOR(PrintProgressDialogChild);
} }
PrintProgressDialogChild::~PrintProgressDialogChild() PrintProgressDialogChild::~PrintProgressDialogChild()
@ -32,7 +31,6 @@ PrintProgressDialogChild::~PrintProgressDialogChild()
// the parent to decrement its refcount, as well as prevent it from attempting // the parent to decrement its refcount, as well as prevent it from attempting
// to contact us further. // to contact us further.
Unused << Send__delete__(this); Unused << Send__delete__(this);
MOZ_COUNT_DTOR(PrintProgressDialogChild);
} }
mozilla::ipc::IPCResult mozilla::ipc::IPCResult

View File

@ -17,12 +17,10 @@ NS_IMPL_ISUPPORTS(PrintProgressDialogParent, nsIObserver)
PrintProgressDialogParent::PrintProgressDialogParent() : PrintProgressDialogParent::PrintProgressDialogParent() :
mActive(true) mActive(true)
{ {
MOZ_COUNT_CTOR(PrintProgressDialogParent);
} }
PrintProgressDialogParent::~PrintProgressDialogParent() PrintProgressDialogParent::~PrintProgressDialogParent()
{ {
MOZ_COUNT_DTOR(PrintProgressDialogParent);
} }
void void

View File

@ -308,8 +308,6 @@ PrintingParent::SerializeAndEnsureRemotePrintJob(
PrintingParent::PrintingParent() PrintingParent::PrintingParent()
{ {
MOZ_COUNT_CTOR(PrintingParent);
mPrintSettingsSvc = mPrintSettingsSvc =
do_GetService("@mozilla.org/gfx/printsettings-service;1"); do_GetService("@mozilla.org/gfx/printsettings-service;1");
MOZ_ASSERT(mPrintSettingsSvc); MOZ_ASSERT(mPrintSettingsSvc);
@ -317,7 +315,6 @@ PrintingParent::PrintingParent()
PrintingParent::~PrintingParent() PrintingParent::~PrintingParent()
{ {
MOZ_COUNT_DTOR(PrintingParent);
} }
} // namespace embedding } // namespace embedding

View File

@ -214,12 +214,10 @@ Layer::Layer(LayerManager* aManager, void* aImplData) :
#endif #endif
mAnimationGeneration(0) mAnimationGeneration(0)
{ {
MOZ_COUNT_CTOR(Layer);
} }
Layer::~Layer() Layer::~Layer()
{ {
MOZ_COUNT_DTOR(Layer);
} }
Animation* Animation*
@ -1122,13 +1120,11 @@ ContainerLayer::ContainerLayer(LayerManager* aManager, void* aImplData)
mChildrenChanged(false), mChildrenChanged(false),
mEventRegionsOverride(EventRegionsOverride::NoOverride) mEventRegionsOverride(EventRegionsOverride::NoOverride)
{ {
MOZ_COUNT_CTOR(ContainerLayer);
mContentFlags = 0; // Clear NO_TEXT, NO_TEXT_OVER_TRANSPARENT mContentFlags = 0; // Clear NO_TEXT, NO_TEXT_OVER_TRANSPARENT
} }
ContainerLayer::~ContainerLayer() ContainerLayer::~ContainerLayer()
{ {
MOZ_COUNT_DTOR(ContainerLayer);
} }
bool bool

View File

@ -28,12 +28,10 @@ CompositableChild::CompositableChild()
mAsyncID(0), mAsyncID(0),
mCanSend(true) mCanSend(true)
{ {
MOZ_COUNT_CTOR(CompositableChild);
} }
CompositableChild::~CompositableChild() CompositableChild::~CompositableChild()
{ {
MOZ_COUNT_DTOR(CompositableChild);
} }
bool bool

View File

@ -57,12 +57,10 @@ CompositableClient::CompositableClient(CompositableForwarder* aForwarder,
: mForwarder(aForwarder) : mForwarder(aForwarder)
, mTextureFlags(aTextureFlags) , mTextureFlags(aTextureFlags)
{ {
MOZ_COUNT_CTOR(CompositableClient);
} }
CompositableClient::~CompositableClient() CompositableClient::~CompositableClient()
{ {
MOZ_COUNT_DTOR(CompositableClient);
Destroy(); Destroy();
} }

View File

@ -53,15 +53,12 @@ CompositorThreadHolder::CompositorThreadHolder()
: mCompositorThread(CreateCompositorThread()) : mCompositorThread(CreateCompositorThread())
{ {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
MOZ_COUNT_CTOR(CompositorThreadHolder);
} }
CompositorThreadHolder::~CompositorThreadHolder() CompositorThreadHolder::~CompositorThreadHolder()
{ {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
MOZ_COUNT_DTOR(CompositorThreadHolder);
DestroyCompositorThread(mCompositorThread); DestroyCompositorThread(mCompositorThread);
} }

View File

@ -46,7 +46,7 @@ using mozilla::services::GetObserverService;
class nsFontCache final : public nsIObserver class nsFontCache final : public nsIObserver
{ {
public: public:
nsFontCache() { MOZ_COUNT_CTOR(nsFontCache); } nsFontCache() {}
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER NS_DECL_NSIOBSERVER
@ -62,7 +62,7 @@ public:
void Flush(); void Flush();
protected: protected:
~nsFontCache() { MOZ_COUNT_DTOR(nsFontCache); } ~nsFontCache() {}
nsDeviceContext* mContext; // owner nsDeviceContext* mContext; // owner
nsCOMPtr<nsIAtom> mLocaleLanguage; nsCOMPtr<nsIAtom> mLocaleLanguage;

View File

@ -76,8 +76,6 @@ gfxContext::gfxContext(DrawTarget *aTarget, const Point& aDeviceOffset)
gfxCriticalError() << "Don't create a gfxContext without a DrawTarget"; gfxCriticalError() << "Don't create a gfxContext without a DrawTarget";
} }
MOZ_COUNT_CTOR(gfxContext);
mStateStack.SetLength(1); mStateStack.SetLength(1);
CurrentState().drawTarget = mDT; CurrentState().drawTarget = mDT;
CurrentState().deviceOffset = aDeviceOffset; CurrentState().deviceOffset = aDeviceOffset;
@ -119,7 +117,6 @@ gfxContext::~gfxContext()
} }
} }
mDT->Flush(); mDT->Flush();
MOZ_COUNT_DTOR(gfxContext);
} }
void void

View File

@ -154,7 +154,6 @@ gfxTextRun::gfxTextRun(const gfxTextRunFactory::Parameters *aParams,
, mShapingState(eShapingState_Normal) , mShapingState(eShapingState_Normal)
{ {
NS_ASSERTION(mAppUnitsPerDevUnit > 0, "Invalid app unit scale"); NS_ASSERTION(mAppUnitsPerDevUnit > 0, "Invalid app unit scale");
MOZ_COUNT_CTOR(gfxTextRun);
NS_ADDREF(mFontGroup); NS_ADDREF(mFontGroup);
#ifndef RELEASE_OR_BETA #ifndef RELEASE_OR_BETA
@ -199,8 +198,6 @@ gfxTextRun::~gfxTextRun()
#endif #endif
NS_RELEASE(mFontGroup); NS_RELEASE(mFontGroup);
} }
MOZ_COUNT_DTOR(gfxTextRun);
} }
void void

View File

@ -47,7 +47,6 @@ VRManagerChild::VRManagerChild()
, mFrameRequestCallbackCounter(0) , mFrameRequestCallbackCounter(0)
, mBackend(layers::LayersBackend::LAYERS_NONE) , mBackend(layers::LayersBackend::LAYERS_NONE)
{ {
MOZ_COUNT_CTOR(VRManagerChild);
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
mStartTimeStamp = TimeStamp::Now(); mStartTimeStamp = TimeStamp::Now();
@ -56,7 +55,6 @@ VRManagerChild::VRManagerChild()
VRManagerChild::~VRManagerChild() VRManagerChild::~VRManagerChild()
{ {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
MOZ_COUNT_DTOR(VRManagerChild);
} }
/*static*/ void /*static*/ void

View File

@ -383,13 +383,11 @@ public:
explicit nsResizeDropdownAtFinalPosition(nsComboboxControlFrame* aFrame) explicit nsResizeDropdownAtFinalPosition(nsComboboxControlFrame* aFrame)
: mFrame(aFrame) : mFrame(aFrame)
{ {
MOZ_COUNT_CTOR(nsResizeDropdownAtFinalPosition);
} }
protected: protected:
~nsResizeDropdownAtFinalPosition() ~nsResizeDropdownAtFinalPosition()
{ {
MOZ_COUNT_DTOR(nsResizeDropdownAtFinalPosition);
} }
public: public:

View File

@ -606,7 +606,6 @@ public:
nsGlyphTableList() nsGlyphTableList()
: mUnicodeTable(NS_LITERAL_STRING("Unicode")) : mUnicodeTable(NS_LITERAL_STRING("Unicode"))
{ {
MOZ_COUNT_CTOR(nsGlyphTableList);
} }
nsresult Initialize(); nsresult Initialize();
@ -623,7 +622,6 @@ public:
private: private:
~nsGlyphTableList() ~nsGlyphTableList()
{ {
MOZ_COUNT_DTOR(nsGlyphTableList);
} }
nsPropertiesTable* PropertiesTableAt(int32_t aIndex) { nsPropertiesTable* PropertiesTableAt(int32_t aIndex) {

View File

@ -18,7 +18,6 @@ NS_IMPL_ISUPPORTS(RemotePrintJobChild,
RemotePrintJobChild::RemotePrintJobChild() RemotePrintJobChild::RemotePrintJobChild()
{ {
MOZ_COUNT_CTOR(RemotePrintJobChild);
} }
nsresult nsresult
@ -141,7 +140,6 @@ RemotePrintJobChild::OnSecurityChange(nsIWebProgress* aProgress,
RemotePrintJobChild::~RemotePrintJobChild() RemotePrintJobChild::~RemotePrintJobChild()
{ {
MOZ_COUNT_DTOR(RemotePrintJobChild);
} }
void void

View File

@ -109,13 +109,10 @@ FontFace::FontFace(nsISupports* aParent, FontFaceSet* aFontFaceSet)
, mFontFaceSet(aFontFaceSet) , mFontFaceSet(aFontFaceSet)
, mInFontFaceSet(false) , mInFontFaceSet(false)
{ {
MOZ_COUNT_CTOR(FontFace);
} }
FontFace::~FontFace() FontFace::~FontFace()
{ {
MOZ_COUNT_DTOR(FontFace);
SetUserFontEntry(nullptr); SetUserFontEntry(nullptr);
if (mSourceBuffer) { if (mSourceBuffer) {

View File

@ -104,8 +104,6 @@ FontFaceSet::FontFaceSet(nsPIDOMWindowInner* aWindow, nsIDocument* aDocument)
, mHasLoadingFontFacesIsDirty(false) , mHasLoadingFontFacesIsDirty(false)
, mDelayedLoadCheck(false) , mDelayedLoadCheck(false)
{ {
MOZ_COUNT_CTOR(FontFaceSet);
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aWindow); nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aWindow);
// If the pref is not set, don't create the Promise (which the page wouldn't // If the pref is not set, don't create the Promise (which the page wouldn't
@ -127,8 +125,6 @@ FontFaceSet::FontFaceSet(nsPIDOMWindowInner* aWindow, nsIDocument* aDocument)
FontFaceSet::~FontFaceSet() FontFaceSet::~FontFaceSet()
{ {
MOZ_COUNT_DTOR(FontFaceSet);
Disconnect(); Disconnect();
for (auto it = mLoaders.Iter(); !it.Done(); it.Next()) { for (auto it = mLoaders.Iter(); !it.Done(); it.Next()) {
it.Get()->GetKey()->Cancel(); it.Get()->GetKey()->Cancel();

View File

@ -1130,14 +1130,11 @@ protected:
DOMCSSDeclarationImpl::DOMCSSDeclarationImpl(css::StyleRule *aRule) DOMCSSDeclarationImpl::DOMCSSDeclarationImpl(css::StyleRule *aRule)
: mRule(aRule) : mRule(aRule)
{ {
MOZ_COUNT_CTOR(DOMCSSDeclarationImpl);
} }
DOMCSSDeclarationImpl::~DOMCSSDeclarationImpl(void) DOMCSSDeclarationImpl::~DOMCSSDeclarationImpl(void)
{ {
NS_ASSERTION(!mRule, "DropReference not called."); NS_ASSERTION(!mRule, "DropReference not called.");
MOZ_COUNT_DTOR(DOMCSSDeclarationImpl);
} }
inline css::DOMCSSStyleRule* DOMCSSDeclarationImpl::DomRule() inline css::DOMCSSStyleRule* DOMCSSDeclarationImpl::DomRule()

View File

@ -2405,7 +2405,6 @@ nsCSSValueList_heap::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) co
nsCSSValueSharedList::~nsCSSValueSharedList() nsCSSValueSharedList::~nsCSSValueSharedList()
{ {
MOZ_COUNT_DTOR(nsCSSValueSharedList);
if (mHead) { if (mHead) {
NS_CSS_DELETE_LIST_MEMBER(nsCSSValueList, mHead, mNext); NS_CSS_DELETE_LIST_MEMBER(nsCSSValueList, mHead, mNext);
delete mHead; delete mHead;
@ -3061,14 +3060,10 @@ nsCSSValueTokenStream::nsCSSValueTokenStream()
: mPropertyID(eCSSProperty_UNKNOWN) : mPropertyID(eCSSProperty_UNKNOWN)
, mShorthandPropertyID(eCSSProperty_UNKNOWN) , mShorthandPropertyID(eCSSProperty_UNKNOWN)
, mLevel(SheetType::Count) , mLevel(SheetType::Count)
{ {}
MOZ_COUNT_CTOR(nsCSSValueTokenStream);
}
nsCSSValueTokenStream::~nsCSSValueTokenStream() nsCSSValueTokenStream::~nsCSSValueTokenStream()
{ {}
MOZ_COUNT_DTOR(nsCSSValueTokenStream);
}
size_t size_t
nsCSSValueTokenStream::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const nsCSSValueTokenStream::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const

View File

@ -299,35 +299,25 @@ class FontFamilyListRefCnt final : public FontFamilyList {
public: public:
FontFamilyListRefCnt() FontFamilyListRefCnt()
: FontFamilyList() : FontFamilyList()
{ {}
MOZ_COUNT_CTOR(FontFamilyListRefCnt);
}
explicit FontFamilyListRefCnt(FontFamilyType aGenericType) explicit FontFamilyListRefCnt(FontFamilyType aGenericType)
: FontFamilyList(aGenericType) : FontFamilyList(aGenericType)
{ {}
MOZ_COUNT_CTOR(FontFamilyListRefCnt);
}
FontFamilyListRefCnt(const nsAString& aFamilyName, FontFamilyListRefCnt(const nsAString& aFamilyName,
QuotedName aQuoted) QuotedName aQuoted)
: FontFamilyList(aFamilyName, aQuoted) : FontFamilyList(aFamilyName, aQuoted)
{ {}
MOZ_COUNT_CTOR(FontFamilyListRefCnt);
}
FontFamilyListRefCnt(const FontFamilyListRefCnt& aOther) FontFamilyListRefCnt(const FontFamilyListRefCnt& aOther)
: FontFamilyList(aOther) : FontFamilyList(aOther)
{ {}
MOZ_COUNT_CTOR(FontFamilyListRefCnt);
}
NS_INLINE_DECL_REFCOUNTING(FontFamilyListRefCnt); NS_INLINE_DECL_REFCOUNTING(FontFamilyListRefCnt);
private: private:
~FontFamilyListRefCnt() { ~FontFamilyListRefCnt() {}
MOZ_COUNT_DTOR(FontFamilyListRefCnt);
}
}; };
struct RGBAColorData struct RGBAColorData
@ -1120,7 +1110,6 @@ private:
: mRefCnt(0) : mRefCnt(0)
, mCount(aItemCount) , mCount(aItemCount)
{ {
MOZ_COUNT_CTOR(nsCSSValue::Array);
CSSVALUE_LIST_FOR_EXTRA_VALUES(val) { CSSVALUE_LIST_FOR_EXTRA_VALUES(val) {
new (val) nsCSSValue(); new (val) nsCSSValue();
} }
@ -1128,7 +1117,6 @@ private:
~Array() ~Array()
{ {
MOZ_COUNT_DTOR(nsCSSValue::Array);
CSSVALUE_LIST_FOR_EXTRA_VALUES(val) { CSSVALUE_LIST_FOR_EXTRA_VALUES(val) {
val->~nsCSSValue(); val->~nsCSSValue();
} }
@ -1198,14 +1186,12 @@ struct nsCSSValueSharedList final {
nsCSSValueSharedList() nsCSSValueSharedList()
: mHead(nullptr) : mHead(nullptr)
{ {
MOZ_COUNT_CTOR(nsCSSValueSharedList);
} }
// Takes ownership of aList. // Takes ownership of aList.
explicit nsCSSValueSharedList(nsCSSValueList* aList) explicit nsCSSValueSharedList(nsCSSValueList* aList)
: mHead(aList) : mHead(aList)
{ {
MOZ_COUNT_CTOR(nsCSSValueSharedList);
} }
private: private:
@ -1842,16 +1828,12 @@ public:
, mComponent2(aComponent2) , mComponent2(aComponent2)
, mComponent3(aComponent3) , mComponent3(aComponent3)
, mAlpha(aAlpha) , mAlpha(aAlpha)
{ {}
MOZ_COUNT_CTOR(nsCSSValueFloatColor);
}
private: private:
// Private destructor, to discourage deletion outside of Release(): // Private destructor, to discourage deletion outside of Release():
~nsCSSValueFloatColor() ~nsCSSValueFloatColor()
{ {}
MOZ_COUNT_DTOR(nsCSSValueFloatColor);
}
public: public:
bool operator==(nsCSSValueFloatColor& aOther) const; bool operator==(nsCSSValueFloatColor& aOther) const;

View File

@ -28,14 +28,11 @@ nsDOMCSSAttributeDeclaration::nsDOMCSSAttributeDeclaration(dom::Element* aElemen
: mElement(aElement) : mElement(aElement)
, mIsSMILOverride(aIsSMILOverride) , mIsSMILOverride(aIsSMILOverride)
{ {
MOZ_COUNT_CTOR(nsDOMCSSAttributeDeclaration);
NS_ASSERTION(aElement, "Inline style for a NULL element?"); NS_ASSERTION(aElement, "Inline style for a NULL element?");
} }
nsDOMCSSAttributeDeclaration::~nsDOMCSSAttributeDeclaration() nsDOMCSSAttributeDeclaration::~nsDOMCSSAttributeDeclaration()
{ {
MOZ_COUNT_DTOR(nsDOMCSSAttributeDeclaration);
} }
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsDOMCSSAttributeDeclaration, mElement) NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsDOMCSSAttributeDeclaration, mElement)

View File

@ -98,9 +98,7 @@ nsStyleContext::nsStyleContext(nsStyleContext* aParent,
, mFrameRefCnt(0) , mFrameRefCnt(0)
, mComputingStruct(nsStyleStructID_None) , mComputingStruct(nsStyleStructID_None)
#endif #endif
{ {}
MOZ_COUNT_CTOR(nsStyleContext);
}
nsStyleContext::nsStyleContext(nsStyleContext* aParent, nsStyleContext::nsStyleContext(nsStyleContext* aParent,
nsIAtom* aPseudoTag, nsIAtom* aPseudoTag,
@ -183,7 +181,6 @@ nsStyleContext::FinishConstruction(bool aSkipParentDisplayBasedStyleFixup)
nsStyleContext::~nsStyleContext() nsStyleContext::~nsStyleContext()
{ {
MOZ_COUNT_DTOR(nsStyleContext);
NS_ASSERTION((nullptr == mChild) && (nullptr == mEmptyChild), "destructing context with children"); NS_ASSERTION((nullptr == mChild) && (nullptr == mEmptyChild), "destructing context with children");
#ifdef DEBUG #ifdef DEBUG

View File

@ -1141,7 +1141,6 @@ public:
explicit nsCSSShadowArray(uint32_t aArrayLen) : explicit nsCSSShadowArray(uint32_t aArrayLen) :
mLength(aArrayLen) mLength(aArrayLen)
{ {
MOZ_COUNT_CTOR(nsCSSShadowArray);
for (uint32_t i = 1; i < mLength; ++i) { for (uint32_t i = 1; i < mLength; ++i) {
// Make sure we call the constructors of each nsCSSShadowItem // Make sure we call the constructors of each nsCSSShadowItem
// (the first one is called for us because we declared it under private) // (the first one is called for us because we declared it under private)
@ -1152,7 +1151,6 @@ public:
private: private:
// Private destructor, to discourage deletion outside of Release(): // Private destructor, to discourage deletion outside of Release():
~nsCSSShadowArray() { ~nsCSSShadowArray() {
MOZ_COUNT_DTOR(nsCSSShadowArray);
for (uint32_t i = 1; i < mLength; ++i) { for (uint32_t i = 1; i < mLength; ++i) {
mArray[i].~nsCSSShadowItem(); mArray[i].~nsCSSShadowItem();
} }

View File

@ -170,7 +170,6 @@ nsZipHandle::nsZipHandle()
, mFileStart(nullptr) , mFileStart(nullptr)
, mTotalLen(0) , mTotalLen(0)
{ {
MOZ_COUNT_CTOR(nsZipHandle);
} }
NS_IMPL_ADDREF(nsZipHandle) NS_IMPL_ADDREF(nsZipHandle)
@ -344,7 +343,6 @@ nsZipHandle::~nsZipHandle()
mFileData = nullptr; mFileData = nullptr;
mMap = nullptr; mMap = nullptr;
mBuf = nullptr; mBuf = nullptr;
MOZ_COUNT_DTOR(nsZipHandle);
} }
//*********************************************************** //***********************************************************
@ -956,8 +954,6 @@ nsZipArchive::nsZipArchive()
{ {
zipLog.AddRef(); zipLog.AddRef();
MOZ_COUNT_CTOR(nsZipArchive);
// initialize the table to nullptr // initialize the table to nullptr
memset(mFiles, 0, sizeof(mFiles)); memset(mFiles, 0, sizeof(mFiles));
} }
@ -969,8 +965,6 @@ nsZipArchive::~nsZipArchive()
{ {
CloseArchive(); CloseArchive();
MOZ_COUNT_DTOR(nsZipArchive);
zipLog.Release(); zipLog.Release();
} }

View File

@ -264,13 +264,11 @@ nsUDPSocket::nsUDPSocket()
} }
mSts = gSocketTransportService; mSts = gSocketTransportService;
MOZ_COUNT_CTOR(nsUDPSocket);
} }
nsUDPSocket::~nsUDPSocket() nsUDPSocket::~nsUDPSocket()
{ {
CloseSocket(); CloseSocket();
MOZ_COUNT_DTOR(nsUDPSocket);
} }
void void

View File

@ -28,13 +28,11 @@ AppCacheStorage::AppCacheStorage(nsILoadContextInfo* aInfo,
: CacheStorage(aInfo, true /* disk */, false /* lookup app cache */, false /* skip size check */, false /* pin */) : CacheStorage(aInfo, true /* disk */, false /* lookup app cache */, false /* skip size check */, false /* pin */)
, mAppCache(aAppCache) , mAppCache(aAppCache)
{ {
MOZ_COUNT_CTOR(AppCacheStorage);
} }
AppCacheStorage::~AppCacheStorage() AppCacheStorage::~AppCacheStorage()
{ {
ProxyReleaseMainThread(mAppCache); ProxyReleaseMainThread(mAppCache);
MOZ_COUNT_DTOR(AppCacheStorage);
} }
NS_IMETHODIMP AppCacheStorage::AsyncOpenURI(nsIURI *aURI, NS_IMETHODIMP AppCacheStorage::AsyncOpenURI(nsIURI *aURI,

View File

@ -48,8 +48,6 @@ NS_IMPL_ISUPPORTS(CacheEntryHandle, nsICacheEntry)
CacheEntryHandle::CacheEntryHandle(CacheEntry* aEntry) CacheEntryHandle::CacheEntryHandle(CacheEntry* aEntry)
: mEntry(aEntry) : mEntry(aEntry)
{ {
MOZ_COUNT_CTOR(CacheEntryHandle);
#ifdef DEBUG #ifdef DEBUG
if (!mEntry->HandlesCount()) { if (!mEntry->HandlesCount()) {
// CacheEntry.mHandlesCount must go from zero to one only under // CacheEntry.mHandlesCount must go from zero to one only under
@ -68,8 +66,6 @@ CacheEntryHandle::~CacheEntryHandle()
{ {
mEntry->ReleaseHandleRef(); mEntry->ReleaseHandleRef();
mEntry->OnHandleClosed(this); mEntry->OnHandleClosed(this);
MOZ_COUNT_DTOR(CacheEntryHandle);
} }
// CacheEntry::Callback // CacheEntry::Callback
@ -1864,12 +1860,10 @@ void CacheEntry::StoreFrecency(double aFrecency)
CacheOutputCloseListener::CacheOutputCloseListener(CacheEntry* aEntry) CacheOutputCloseListener::CacheOutputCloseListener(CacheEntry* aEntry)
: mEntry(aEntry) : mEntry(aEntry)
{ {
MOZ_COUNT_CTOR(CacheOutputCloseListener);
} }
CacheOutputCloseListener::~CacheOutputCloseListener() CacheOutputCloseListener::~CacheOutputCloseListener()
{ {
MOZ_COUNT_DTOR(CacheOutputCloseListener);
} }
void CacheOutputCloseListener::OnOutputClosed() void CacheOutputCloseListener::OnOutputClosed()

View File

@ -39,7 +39,6 @@ public:
{ {
LOG(("NotifyCacheFileListenerEvent::NotifyCacheFileListenerEvent() " LOG(("NotifyCacheFileListenerEvent::NotifyCacheFileListenerEvent() "
"[this=%p]", this)); "[this=%p]", this));
MOZ_COUNT_CTOR(NotifyCacheFileListenerEvent);
} }
protected: protected:
@ -47,7 +46,6 @@ protected:
{ {
LOG(("NotifyCacheFileListenerEvent::~NotifyCacheFileListenerEvent() " LOG(("NotifyCacheFileListenerEvent::~NotifyCacheFileListenerEvent() "
"[this=%p]", this)); "[this=%p]", this));
MOZ_COUNT_DTOR(NotifyCacheFileListenerEvent);
} }
public: public:
@ -78,7 +76,6 @@ public:
{ {
LOG(("NotifyChunkListenerEvent::NotifyChunkListenerEvent() [this=%p]", LOG(("NotifyChunkListenerEvent::NotifyChunkListenerEvent() [this=%p]",
this)); this));
MOZ_COUNT_CTOR(NotifyChunkListenerEvent);
} }
protected: protected:
@ -86,7 +83,6 @@ protected:
{ {
LOG(("NotifyChunkListenerEvent::~NotifyChunkListenerEvent() [this=%p]", LOG(("NotifyChunkListenerEvent::~NotifyChunkListenerEvent() [this=%p]",
this)); this));
MOZ_COUNT_DTOR(NotifyChunkListenerEvent);
} }
public: public:
@ -114,7 +110,6 @@ public:
explicit DoomFileHelper(CacheFileListener *aListener) explicit DoomFileHelper(CacheFileListener *aListener)
: mListener(aListener) : mListener(aListener)
{ {
MOZ_COUNT_CTOR(DoomFileHelper);
} }
@ -159,7 +154,6 @@ public:
private: private:
virtual ~DoomFileHelper() virtual ~DoomFileHelper()
{ {
MOZ_COUNT_DTOR(DoomFileHelper);
} }
nsCOMPtr<CacheFileListener> mListener; nsCOMPtr<CacheFileListener> mListener;

View File

@ -251,7 +251,6 @@ public:
{ {
LOG(("NotifyUpdateListenerEvent::NotifyUpdateListenerEvent() [this=%p]", LOG(("NotifyUpdateListenerEvent::NotifyUpdateListenerEvent() [this=%p]",
this)); this));
MOZ_COUNT_CTOR(NotifyUpdateListenerEvent);
} }
protected: protected:
@ -259,7 +258,6 @@ protected:
{ {
LOG(("NotifyUpdateListenerEvent::~NotifyUpdateListenerEvent() [this=%p]", LOG(("NotifyUpdateListenerEvent::~NotifyUpdateListenerEvent() [this=%p]",
this)); this));
MOZ_COUNT_DTOR(NotifyUpdateListenerEvent);
} }
public: public:
@ -347,15 +345,12 @@ CacheFileChunk::CacheFileChunk(CacheFile *aFile, uint32_t aIndex,
{ {
LOG(("CacheFileChunk::CacheFileChunk() [this=%p, index=%u, initByWriter=%d]", LOG(("CacheFileChunk::CacheFileChunk() [this=%p, index=%u, initByWriter=%d]",
this, aIndex, aInitByWriter)); this, aIndex, aInitByWriter));
MOZ_COUNT_CTOR(CacheFileChunk);
mBuf = new CacheFileChunkBuffer(this); mBuf = new CacheFileChunkBuffer(this);
} }
CacheFileChunk::~CacheFileChunk() CacheFileChunk::~CacheFileChunk()
{ {
LOG(("CacheFileChunk::~CacheFileChunk() [this=%p]", this)); LOG(("CacheFileChunk::~CacheFileChunk() [this=%p]", this));
MOZ_COUNT_DTOR(CacheFileChunk);
} }
void void

View File

@ -545,13 +545,11 @@ public:
: mMonitor("ShutdownEvent.mMonitor") : mMonitor("ShutdownEvent.mMonitor")
, mNotified(false) , mNotified(false)
{ {
MOZ_COUNT_CTOR(ShutdownEvent);
} }
protected: protected:
~ShutdownEvent() ~ShutdownEvent()
{ {
MOZ_COUNT_DTOR(ShutdownEvent);
} }
public: public:
@ -601,14 +599,12 @@ public:
, mCallback(aCallback) , mCallback(aCallback)
, mKey(aKey) , mKey(aKey)
{ {
MOZ_COUNT_CTOR(OpenFileEvent);
mIOMan = CacheFileIOManager::gInstance; mIOMan = CacheFileIOManager::gInstance;
} }
protected: protected:
~OpenFileEvent() ~OpenFileEvent()
{ {
MOZ_COUNT_DTOR(OpenFileEvent);
} }
public: public:
@ -663,13 +659,11 @@ public:
, mCount(aCount) , mCount(aCount)
, mCallback(aCallback) , mCallback(aCallback)
{ {
MOZ_COUNT_CTOR(ReadEvent);
} }
protected: protected:
~ReadEvent() ~ReadEvent()
{ {
MOZ_COUNT_DTOR(ReadEvent);
} }
public: public:
@ -709,14 +703,11 @@ public:
, mTruncate(aTruncate) , mTruncate(aTruncate)
, mCallback(aCallback) , mCallback(aCallback)
{ {
MOZ_COUNT_CTOR(WriteEvent);
} }
protected: protected:
~WriteEvent() ~WriteEvent()
{ {
MOZ_COUNT_DTOR(WriteEvent);
if (!mCallback && mBuf) { if (!mCallback && mBuf) {
free(const_cast<char *>(mBuf)); free(const_cast<char *>(mBuf));
} }
@ -770,13 +761,11 @@ public:
: mCallback(aCallback) : mCallback(aCallback)
, mHandle(aHandle) , mHandle(aHandle)
{ {
MOZ_COUNT_CTOR(DoomFileEvent);
} }
protected: protected:
~DoomFileEvent() ~DoomFileEvent()
{ {
MOZ_COUNT_DTOR(DoomFileEvent);
} }
public: public:
@ -809,8 +798,6 @@ public:
CacheFileIOListener *aCallback) CacheFileIOListener *aCallback)
: mCallback(aCallback) : mCallback(aCallback)
{ {
MOZ_COUNT_CTOR(DoomFileByKeyEvent);
SHA1Sum sum; SHA1Sum sum;
sum.update(aKey.BeginReading(), aKey.Length()); sum.update(aKey.BeginReading(), aKey.Length());
sum.finish(mHash); sum.finish(mHash);
@ -821,7 +808,6 @@ public:
protected: protected:
~DoomFileByKeyEvent() ~DoomFileByKeyEvent()
{ {
MOZ_COUNT_DTOR(DoomFileByKeyEvent);
} }
public: public:
@ -854,13 +840,11 @@ public:
explicit ReleaseNSPRHandleEvent(CacheFileHandle *aHandle) explicit ReleaseNSPRHandleEvent(CacheFileHandle *aHandle)
: mHandle(aHandle) : mHandle(aHandle)
{ {
MOZ_COUNT_CTOR(ReleaseNSPRHandleEvent);
} }
protected: protected:
~ReleaseNSPRHandleEvent() ~ReleaseNSPRHandleEvent()
{ {
MOZ_COUNT_DTOR(ReleaseNSPRHandleEvent);
} }
public: public:
@ -886,13 +870,11 @@ public:
, mEOFPos(aEOFPos) , mEOFPos(aEOFPos)
, mCallback(aCallback) , mCallback(aCallback)
{ {
MOZ_COUNT_CTOR(TruncateSeekSetEOFEvent);
} }
protected: protected:
~TruncateSeekSetEOFEvent() ~TruncateSeekSetEOFEvent()
{ {
MOZ_COUNT_DTOR(TruncateSeekSetEOFEvent);
} }
public: public:
@ -929,13 +911,11 @@ public:
, mNewName(aNewName) , mNewName(aNewName)
, mCallback(aCallback) , mCallback(aCallback)
{ {
MOZ_COUNT_CTOR(RenameFileEvent);
} }
protected: protected:
~RenameFileEvent() ~RenameFileEvent()
{ {
MOZ_COUNT_DTOR(RenameFileEvent);
} }
public: public:
@ -973,13 +953,11 @@ public:
, mAnonymous(aAnonymous) , mAnonymous(aAnonymous)
, mPinning(aPinning) , mPinning(aPinning)
{ {
MOZ_COUNT_CTOR(InitIndexEntryEvent);
} }
protected: protected:
~InitIndexEntryEvent() ~InitIndexEntryEvent()
{ {
MOZ_COUNT_DTOR(InitIndexEntryEvent);
} }
public: public:
@ -1017,7 +995,6 @@ public:
, mHasFrecency(false) , mHasFrecency(false)
, mHasExpirationTime(false) , mHasExpirationTime(false)
{ {
MOZ_COUNT_CTOR(UpdateIndexEntryEvent);
if (aFrecency) { if (aFrecency) {
mHasFrecency = true; mHasFrecency = true;
mFrecency = *aFrecency; mFrecency = *aFrecency;
@ -1031,7 +1008,6 @@ public:
protected: protected:
~UpdateIndexEntryEvent() ~UpdateIndexEntryEvent()
{ {
MOZ_COUNT_DTOR(UpdateIndexEntryEvent);
} }
public: public:
@ -1114,14 +1090,12 @@ CacheFileIOManager::CacheFileIOManager()
, mRemovingTrashDirs(false) , mRemovingTrashDirs(false)
{ {
LOG(("CacheFileIOManager::CacheFileIOManager [this=%p]", this)); LOG(("CacheFileIOManager::CacheFileIOManager [this=%p]", this));
MOZ_COUNT_CTOR(CacheFileIOManager);
MOZ_ASSERT(!gInstance, "multiple CacheFileIOManager instances!"); MOZ_ASSERT(!gInstance, "multiple CacheFileIOManager instances!");
} }
CacheFileIOManager::~CacheFileIOManager() CacheFileIOManager::~CacheFileIOManager()
{ {
LOG(("CacheFileIOManager::~CacheFileIOManager [this=%p]", this)); LOG(("CacheFileIOManager::~CacheFileIOManager [this=%p]", this));
MOZ_COUNT_DTOR(CacheFileIOManager);
} }
// static // static

View File

@ -57,7 +57,6 @@ CacheFileInputStream::CacheFileInputStream(CacheFile *aFile,
, mCacheEntryHandle(aEntry) , mCacheEntryHandle(aEntry)
{ {
LOG(("CacheFileInputStream::CacheFileInputStream() [this=%p]", this)); LOG(("CacheFileInputStream::CacheFileInputStream() [this=%p]", this));
MOZ_COUNT_CTOR(CacheFileInputStream);
if (mAlternativeData) { if (mAlternativeData) {
mPos = mFile->mAltDataOffset; mPos = mFile->mAltDataOffset;
@ -67,7 +66,6 @@ CacheFileInputStream::CacheFileInputStream(CacheFile *aFile,
CacheFileInputStream::~CacheFileInputStream() CacheFileInputStream::~CacheFileInputStream()
{ {
LOG(("CacheFileInputStream::~CacheFileInputStream() [this=%p]", this)); LOG(("CacheFileInputStream::~CacheFileInputStream() [this=%p]", this));
MOZ_COUNT_DTOR(CacheFileInputStream);
MOZ_ASSERT(!mInReadSegments); MOZ_ASSERT(!mInReadSegments);
} }

View File

@ -58,7 +58,6 @@ CacheFileMetadata::CacheFileMetadata(CacheFileHandle *aHandle, const nsACString
LOG(("CacheFileMetadata::CacheFileMetadata() [this=%p, handle=%p, key=%s]", LOG(("CacheFileMetadata::CacheFileMetadata() [this=%p, handle=%p, key=%s]",
this, aHandle, PromiseFlatCString(aKey).get())); this, aHandle, PromiseFlatCString(aKey).get()));
MOZ_COUNT_CTOR(CacheFileMetadata);
memset(&mMetaHdr, 0, sizeof(CacheFileMetadataHeader)); memset(&mMetaHdr, 0, sizeof(CacheFileMetadataHeader));
mMetaHdr.mVersion = kCacheEntryVersion; mMetaHdr.mVersion = kCacheEntryVersion;
mMetaHdr.mExpirationTime = nsICacheEntry::NO_EXPIRATION_TIME; mMetaHdr.mExpirationTime = nsICacheEntry::NO_EXPIRATION_TIME;
@ -88,7 +87,6 @@ CacheFileMetadata::CacheFileMetadata(bool aMemoryOnly, bool aPinned, const nsACS
LOG(("CacheFileMetadata::CacheFileMetadata() [this=%p, key=%s]", LOG(("CacheFileMetadata::CacheFileMetadata() [this=%p, key=%s]",
this, PromiseFlatCString(aKey).get())); this, PromiseFlatCString(aKey).get()));
MOZ_COUNT_CTOR(CacheFileMetadata);
memset(&mMetaHdr, 0, sizeof(CacheFileMetadataHeader)); memset(&mMetaHdr, 0, sizeof(CacheFileMetadataHeader));
mMetaHdr.mVersion = kCacheEntryVersion; mMetaHdr.mVersion = kCacheEntryVersion;
if (aPinned) { if (aPinned) {
@ -121,7 +119,6 @@ CacheFileMetadata::CacheFileMetadata()
{ {
LOG(("CacheFileMetadata::CacheFileMetadata() [this=%p]", this)); LOG(("CacheFileMetadata::CacheFileMetadata() [this=%p]", this));
MOZ_COUNT_CTOR(CacheFileMetadata);
memset(&mMetaHdr, 0, sizeof(CacheFileMetadataHeader)); memset(&mMetaHdr, 0, sizeof(CacheFileMetadataHeader));
} }
@ -129,7 +126,6 @@ CacheFileMetadata::~CacheFileMetadata()
{ {
LOG(("CacheFileMetadata::~CacheFileMetadata() [this=%p]", this)); LOG(("CacheFileMetadata::~CacheFileMetadata() [this=%p]", this));
MOZ_COUNT_DTOR(CacheFileMetadata);
MOZ_ASSERT(!mListener); MOZ_ASSERT(!mListener);
if (mHashArray) { if (mHashArray) {

View File

@ -56,7 +56,6 @@ CacheFileOutputStream::CacheFileOutputStream(CacheFile *aFile,
, mCallbackFlags(0) , mCallbackFlags(0)
{ {
LOG(("CacheFileOutputStream::CacheFileOutputStream() [this=%p]", this)); LOG(("CacheFileOutputStream::CacheFileOutputStream() [this=%p]", this));
MOZ_COUNT_CTOR(CacheFileOutputStream);
if (mAlternativeData) { if (mAlternativeData) {
mPos = mFile->mAltDataOffset; mPos = mFile->mAltDataOffset;
@ -66,7 +65,6 @@ CacheFileOutputStream::CacheFileOutputStream(CacheFile *aFile,
CacheFileOutputStream::~CacheFileOutputStream() CacheFileOutputStream::~CacheFileOutputStream()
{ {
LOG(("CacheFileOutputStream::~CacheFileOutputStream() [this=%p]", this)); LOG(("CacheFileOutputStream::~CacheFileOutputStream() [this=%p]", this));
MOZ_COUNT_DTOR(CacheFileOutputStream);
} }
// nsIOutputStream // nsIOutputStream

View File

@ -278,7 +278,6 @@ CacheIndex::CacheIndex()
{ {
sLock.AssertCurrentThreadOwns(); sLock.AssertCurrentThreadOwns();
LOG(("CacheIndex::CacheIndex [this=%p]", this)); LOG(("CacheIndex::CacheIndex [this=%p]", this));
MOZ_COUNT_CTOR(CacheIndex);
MOZ_ASSERT(!gInstance, "multiple CacheIndex instances!"); MOZ_ASSERT(!gInstance, "multiple CacheIndex instances!");
} }
@ -286,7 +285,6 @@ CacheIndex::~CacheIndex()
{ {
sLock.AssertCurrentThreadOwns(); sLock.AssertCurrentThreadOwns();
LOG(("CacheIndex::~CacheIndex [this=%p]", this)); LOG(("CacheIndex::~CacheIndex [this=%p]", this));
MOZ_COUNT_DTOR(CacheIndex);
ReleaseBuffer(); ReleaseBuffer();
} }

View File

@ -41,14 +41,12 @@ class DoomCallbackSynchronizer : public Runnable
public: public:
explicit DoomCallbackSynchronizer(nsICacheEntryDoomCallback* cb) : mCB(cb) explicit DoomCallbackSynchronizer(nsICacheEntryDoomCallback* cb) : mCB(cb)
{ {
MOZ_COUNT_CTOR(DoomCallbackSynchronizer);
} }
nsresult Dispatch(); nsresult Dispatch();
private: private:
virtual ~DoomCallbackSynchronizer() virtual ~DoomCallbackSynchronizer()
{ {
MOZ_COUNT_DTOR(DoomCallbackSynchronizer);
} }
NS_DECL_NSIRUNNABLE NS_DECL_NSIRUNNABLE
@ -94,13 +92,11 @@ class DoomCallbackWrapper : public nsICacheListener
explicit DoomCallbackWrapper(nsICacheEntryDoomCallback* cb) : mCB(cb) explicit DoomCallbackWrapper(nsICacheEntryDoomCallback* cb) : mCB(cb)
{ {
MOZ_COUNT_CTOR(DoomCallbackWrapper);
} }
private: private:
virtual ~DoomCallbackWrapper() virtual ~DoomCallbackWrapper()
{ {
MOZ_COUNT_DTOR(DoomCallbackWrapper);
} }
nsCOMPtr<nsICacheEntryDoomCallback> mCB; nsCOMPtr<nsICacheEntryDoomCallback> mCB;
@ -143,8 +139,6 @@ _OldVisitCallbackWrapper::~_OldVisitCallbackWrapper()
if (mVisitEntries) { if (mVisitEntries) {
mCB->OnCacheEntryVisitCompleted(); mCB->OnCacheEntryVisitCompleted();
} }
MOZ_COUNT_DTOR(_OldVisitCallbackWrapper);
} }
NS_IMETHODIMP _OldVisitCallbackWrapper::VisitDevice(const char * deviceID, NS_IMETHODIMP _OldVisitCallbackWrapper::VisitDevice(const char * deviceID,
@ -349,20 +343,17 @@ _OldGetDiskConsumption::VisitEntry(const char * deviceID,
_OldCacheEntryWrapper::_OldCacheEntryWrapper(nsICacheEntryDescriptor* desc) _OldCacheEntryWrapper::_OldCacheEntryWrapper(nsICacheEntryDescriptor* desc)
: mOldDesc(desc), mOldInfo(desc) : mOldDesc(desc), mOldInfo(desc)
{ {
MOZ_COUNT_CTOR(_OldCacheEntryWrapper);
LOG(("Creating _OldCacheEntryWrapper %p for descriptor %p", this, desc)); LOG(("Creating _OldCacheEntryWrapper %p for descriptor %p", this, desc));
} }
_OldCacheEntryWrapper::_OldCacheEntryWrapper(nsICacheEntryInfo* info) _OldCacheEntryWrapper::_OldCacheEntryWrapper(nsICacheEntryInfo* info)
: mOldDesc(nullptr), mOldInfo(info) : mOldDesc(nullptr), mOldInfo(info)
{ {
MOZ_COUNT_CTOR(_OldCacheEntryWrapper);
LOG(("Creating _OldCacheEntryWrapper %p for info %p", this, info)); LOG(("Creating _OldCacheEntryWrapper %p for info %p", this, info));
} }
_OldCacheEntryWrapper::~_OldCacheEntryWrapper() _OldCacheEntryWrapper::~_OldCacheEntryWrapper()
{ {
MOZ_COUNT_DTOR(_OldCacheEntryWrapper);
LOG(("Destroying _OldCacheEntryWrapper %p for descriptor %p", this, mOldInfo.get())); LOG(("Destroying _OldCacheEntryWrapper %p for descriptor %p", this, mOldInfo.get()));
} }
@ -680,13 +671,11 @@ _OldCacheLoad::_OldCacheLoad(nsCSubstring const& aScheme,
, mRunCount(0) , mRunCount(0)
, mAppCache(aAppCache) , mAppCache(aAppCache)
{ {
MOZ_COUNT_CTOR(_OldCacheLoad);
} }
_OldCacheLoad::~_OldCacheLoad() _OldCacheLoad::~_OldCacheLoad()
{ {
ProxyReleaseMainThread(mAppCache); ProxyReleaseMainThread(mAppCache);
MOZ_COUNT_DTOR(_OldCacheLoad);
} }
nsresult _OldCacheLoad::Start() nsresult _OldCacheLoad::Start()
@ -907,12 +896,10 @@ _OldStorage::_OldStorage(nsILoadContextInfo* aInfo,
, mLookupAppCache(aLookupAppCache) , mLookupAppCache(aLookupAppCache)
, mOfflineStorage(aOfflineStorage) , mOfflineStorage(aOfflineStorage)
{ {
MOZ_COUNT_CTOR(_OldStorage);
} }
_OldStorage::~_OldStorage() _OldStorage::~_OldStorage()
{ {
MOZ_COUNT_DTOR(_OldStorage);
} }
NS_IMETHODIMP _OldStorage::AsyncOpenURI(nsIURI *aURI, NS_IMETHODIMP _OldStorage::AsyncOpenURI(nsIURI *aURI,

View File

@ -249,7 +249,6 @@ class _OldVisitCallbackWrapper : public nsICacheVisitor
, mLoadInfo(aInfo) , mLoadInfo(aInfo)
, mHit(false) , mHit(false)
{ {
MOZ_COUNT_CTOR(_OldVisitCallbackWrapper);
} }
private: private:

View File

@ -523,12 +523,10 @@ public:
: mPrompter(aPrompter) : mPrompter(aPrompter)
, mResponseMsg(aResponseMsg) , mResponseMsg(aResponseMsg)
{ {
MOZ_COUNT_CTOR(nsFtpChildAsyncAlert);
} }
protected: protected:
virtual ~nsFtpChildAsyncAlert() virtual ~nsFtpChildAsyncAlert()
{ {
MOZ_COUNT_DTOR(nsFtpChildAsyncAlert);
} }
public: public:
NS_IMETHOD Run() override NS_IMETHOD Run() override

View File

@ -1794,12 +1794,10 @@ public:
: mPrompter(aPrompter) : mPrompter(aPrompter)
, mResponseMsg(aResponseMsg) , mResponseMsg(aResponseMsg)
{ {
MOZ_COUNT_CTOR(nsFtpAsyncAlert);
} }
protected: protected:
virtual ~nsFtpAsyncAlert() virtual ~nsFtpAsyncAlert()
{ {
MOZ_COUNT_DTOR(nsFtpAsyncAlert);
} }
public: public:
NS_IMETHOD Run() override NS_IMETHOD Run() override

View File

@ -19,12 +19,10 @@ NS_IMPL_ISUPPORTS(TransportProviderParent,
TransportProviderParent::TransportProviderParent() TransportProviderParent::TransportProviderParent()
{ {
MOZ_COUNT_CTOR(TransportProviderParent);
} }
TransportProviderParent::~TransportProviderParent() TransportProviderParent::~TransportProviderParent()
{ {
MOZ_COUNT_DTOR(TransportProviderParent);
} }
NS_IMETHODIMP NS_IMETHODIMP
@ -77,12 +75,10 @@ NS_IMPL_ISUPPORTS(TransportProviderChild,
TransportProviderChild::TransportProviderChild() TransportProviderChild::TransportProviderChild()
{ {
MOZ_COUNT_CTOR(TransportProviderChild);
} }
TransportProviderChild::~TransportProviderChild() TransportProviderChild::~TransportProviderChild()
{ {
MOZ_COUNT_DTOR(TransportProviderChild);
Send__delete__(this); Send__delete__(this);
} }

View File

@ -8,21 +8,16 @@ nsHtml5OwningUTF16Buffer::nsHtml5OwningUTF16Buffer(char16_t* aBuffer)
: nsHtml5UTF16Buffer(aBuffer, 0), : nsHtml5UTF16Buffer(aBuffer, 0),
next(nullptr), next(nullptr),
key(nullptr) key(nullptr)
{ {}
MOZ_COUNT_CTOR(nsHtml5OwningUTF16Buffer);
}
nsHtml5OwningUTF16Buffer::nsHtml5OwningUTF16Buffer(void* aKey) nsHtml5OwningUTF16Buffer::nsHtml5OwningUTF16Buffer(void* aKey)
: nsHtml5UTF16Buffer(nullptr, 0), : nsHtml5UTF16Buffer(nullptr, 0),
next(nullptr), next(nullptr),
key(aKey) key(aKey)
{ {}
MOZ_COUNT_CTOR(nsHtml5OwningUTF16Buffer);
}
nsHtml5OwningUTF16Buffer::~nsHtml5OwningUTF16Buffer() nsHtml5OwningUTF16Buffer::~nsHtml5OwningUTF16Buffer()
{ {
MOZ_COUNT_DTOR(nsHtml5OwningUTF16Buffer);
DeleteBuffer(); DeleteBuffer();
// This is to avoid dtor recursion on 'next', bug 706932. // This is to avoid dtor recursion on 'next', bug 706932.

View File

@ -18,13 +18,11 @@ nsHtml5StringParser::nsHtml5StringParser()
, mTreeBuilder(new nsHtml5TreeBuilder(mBuilder)) , mTreeBuilder(new nsHtml5TreeBuilder(mBuilder))
, mTokenizer(new nsHtml5Tokenizer(mTreeBuilder, false)) , mTokenizer(new nsHtml5Tokenizer(mTreeBuilder, false))
{ {
MOZ_COUNT_CTOR(nsHtml5StringParser);
mTokenizer->setInterner(&mAtomTable); mTokenizer->setInterner(&mAtomTable);
} }
nsHtml5StringParser::~nsHtml5StringParser() nsHtml5StringParser::~nsHtml5StringParser()
{ {
MOZ_COUNT_DTOR(nsHtml5StringParser);
} }
nsresult nsresult

View File

@ -736,7 +736,6 @@ InMemoryDataSource::InMemoryDataSource(nsISupports* aOuter)
NS_INIT_AGGREGATED(aOuter); NS_INIT_AGGREGATED(aOuter);
mPropagateChanges = true; mPropagateChanges = true;
MOZ_COUNT_CTOR(InMemoryDataSource);
} }
@ -768,8 +767,6 @@ InMemoryDataSource::~InMemoryDataSource()
MOZ_LOG(gLog, LogLevel::Debug, MOZ_LOG(gLog, LogLevel::Debug,
("InMemoryDataSource(%p): destroyed.", this)); ("InMemoryDataSource(%p): destroyed.", this));
MOZ_COUNT_DTOR(InMemoryDataSource);
} }

View File

@ -38,12 +38,10 @@ nsRDFXMLParser::Create(nsISupports* aOuter, REFNSIID aIID, void** aResult)
nsRDFXMLParser::nsRDFXMLParser() nsRDFXMLParser::nsRDFXMLParser()
{ {
MOZ_COUNT_CTOR(nsRDFXMLParser);
} }
nsRDFXMLParser::~nsRDFXMLParser() nsRDFXMLParser::~nsRDFXMLParser()
{ {
MOZ_COUNT_DTOR(nsRDFXMLParser);
} }
NS_IMETHODIMP NS_IMETHODIMP

View File

@ -95,13 +95,10 @@ nsRDFXMLSerializer::Create(nsISupports* aOuter, REFNSIID aIID, void** aResult)
nsRDFXMLSerializer::nsRDFXMLSerializer() nsRDFXMLSerializer::nsRDFXMLSerializer()
{ {
MOZ_COUNT_CTOR(nsRDFXMLSerializer);
} }
nsRDFXMLSerializer::~nsRDFXMLSerializer() nsRDFXMLSerializer::~nsRDFXMLSerializer()
{ {
MOZ_COUNT_DTOR(nsRDFXMLSerializer);
if (--gRefCnt == 0) { if (--gRefCnt == 0) {
NS_IF_RELEASE(kRDF_Bag); NS_IF_RELEASE(kRDF_Bag);
NS_IF_RELEASE(kRDF_Seq); NS_IF_RELEASE(kRDF_Seq);

View File

@ -25,13 +25,11 @@ public:
, mTimer(nullptr) , mTimer(nullptr)
, mStop(false) , mStop(false)
{ {
MOZ_COUNT_CTOR(CheckResponsivenessTask);
} }
protected: protected:
~CheckResponsivenessTask() ~CheckResponsivenessTask()
{ {
MOZ_COUNT_DTOR(CheckResponsivenessTask);
} }
public: public:

View File

@ -85,8 +85,6 @@ PuppetWidget::PuppetWidget(TabChild* aTabChild)
, mCursorHotspotY(0) , mCursorHotspotY(0)
, mNativeKeyCommandsValid(false) , mNativeKeyCommandsValid(false)
{ {
MOZ_COUNT_CTOR(PuppetWidget);
mSingleLineCommands.SetCapacity(4); mSingleLineCommands.SetCapacity(4);
mMultiLineCommands.SetCapacity(4); mMultiLineCommands.SetCapacity(4);
mRichTextCommands.SetCapacity(4); mRichTextCommands.SetCapacity(4);
@ -97,8 +95,6 @@ PuppetWidget::PuppetWidget(TabChild* aTabChild)
PuppetWidget::~PuppetWidget() PuppetWidget::~PuppetWidget()
{ {
MOZ_COUNT_DTOR(PuppetWidget);
Destroy(); Destroy();
} }

View File

@ -34,12 +34,7 @@ HANDLE sEventHandle = nullptr;
// thread. // thread.
class HWNDGetter : public mozilla::Runnable { class HWNDGetter : public mozilla::Runnable {
public: public:
HWNDGetter() : hidden_window_hwnd(nullptr) { HWNDGetter() : hidden_window_hwnd(nullptr) {}
MOZ_COUNT_CTOR(HWNDGetter);
}
~HWNDGetter() {
MOZ_COUNT_DTOR(HWNDGetter);
}
HWND hidden_window_hwnd; HWND hidden_window_hwnd;

View File

@ -281,11 +281,20 @@ mozilla::StaticAutoPtr<WalkTheStackCodeAddressService> gCodeAddressService;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
enum BloatEntryType
{
RefcountedBloatEntry,
ManualBloatEntry,
};
class BloatEntry class BloatEntry
{ {
public: public:
BloatEntry(const char* aClassName, uint32_t aClassSize) BloatEntry(const char* aClassName,
uint32_t aClassSize,
BloatEntryType aEntryType)
: mClassSize(aClassSize) : mClassSize(aClassSize)
, mEntryType(aEntryType)
{ {
MOZ_ASSERT(strlen(aClassName) > 0, "BloatEntry name must be non-empty"); MOZ_ASSERT(strlen(aClassName) > 0, "BloatEntry name must be non-empty");
mClassName = PL_strdup(aClassName); mClassName = PL_strdup(aClassName);
@ -307,6 +316,11 @@ public:
return mClassName; return mClassName;
} }
BloatEntryType GetEntryType() const
{
return mEntryType;
}
void Ctor() void Ctor()
{ {
mStats.mCreates++; mStats.mCreates++;
@ -388,6 +402,7 @@ protected:
double mClassSize; // This is stored as a double because of the way we compute the avg class size for total bloat. double mClassSize; // This is stored as a double because of the way we compute the avg class size for total bloat.
int64_t mTotalLeaked; // Used only for TOTAL entry. int64_t mTotalLeaked; // Used only for TOTAL entry.
nsTraceRefcntStats mStats; nsTraceRefcntStats mStats;
BloatEntryType mEntryType;
}; };
static void static void
@ -416,7 +431,9 @@ RecreateBloatView()
} }
static BloatEntry* static BloatEntry*
GetBloatEntry(const char* aTypeName, uint32_t aInstanceSize) GetBloatEntry(const char* aTypeName,
uint32_t aInstanceSize,
BloatEntryType aEntryType)
{ {
if (!gBloatView) { if (!gBloatView) {
RecreateBloatView(); RecreateBloatView();
@ -426,7 +443,7 @@ GetBloatEntry(const char* aTypeName, uint32_t aInstanceSize)
entry = (BloatEntry*)PL_HashTableLookup(gBloatView, aTypeName); entry = (BloatEntry*)PL_HashTableLookup(gBloatView, aTypeName);
if (!entry && aInstanceSize > 0) { if (!entry && aInstanceSize > 0) {
entry = new BloatEntry(aTypeName, aInstanceSize); entry = new BloatEntry(aTypeName, aInstanceSize, aEntryType);
PLHashEntry* e = PL_HashTableAdd(gBloatView, aTypeName, entry); PLHashEntry* e = PL_HashTableAdd(gBloatView, aTypeName, entry);
if (!e) { if (!e) {
delete entry; delete entry;
@ -439,6 +456,8 @@ GetBloatEntry(const char* aTypeName, uint32_t aInstanceSize)
"MOZ_COUNT_{C,D}TOR in the constructor or destructor, respectively. " "MOZ_COUNT_{C,D}TOR in the constructor or destructor, respectively. "
"As a workaround, the MOZ_COUNT_{C,D}TOR calls can be moved to a " "As a workaround, the MOZ_COUNT_{C,D}TOR calls can be moved to a "
"non-templated base class."); "non-templated base class.");
MOZ_ASSERT(entry->GetEntryType() == aEntryType,
"Don't use MOZ_COUNT_CTOR and MOZ_COUNT_DTOR for refcounted classes.");
} }
} }
return entry; return entry;
@ -515,7 +534,8 @@ nsTraceRefcnt::DumpStatistics()
AutoRestore<LoggingType> saveLogging(gLogging); AutoRestore<LoggingType> saveLogging(gLogging);
gLogging = NoLogging; gLogging = NoLogging;
BloatEntry total("TOTAL", 0); BloatEntry total("TOTAL", 0, ManualBloatEntry);
// Second and third args are just dummies.
PL_HashTableEnumerateEntries(gBloatView, BloatEntry::TotalEntries, &total); PL_HashTableEnumerateEntries(gBloatView, BloatEntry::TotalEntries, &total);
const char* msg; const char* msg;
if (gLogLeaksOnly) { if (gLogLeaksOnly) {
@ -989,8 +1009,8 @@ namespace mozilla {
void void
LogTerm() LogTerm()
{ {
NS_ASSERTION(gInitCount > 0, MOZ_ASSERT(gInitCount > 0,
"NS_LogTerm without matching NS_LogInit"); "NS_LogTerm without matching NS_LogInit");
if (--gInitCount == 0) { if (--gInitCount == 0) {
#ifdef DEBUG #ifdef DEBUG
@ -1040,7 +1060,7 @@ NS_LogAddRef(void* aPtr, nsrefcnt aRefcnt,
AutoTraceLogLock lock; AutoTraceLogLock lock;
if (aRefcnt == 1 && gBloatLog) { if (aRefcnt == 1 && gBloatLog) {
BloatEntry* entry = GetBloatEntry(aClass, aClassSize); BloatEntry* entry = GetBloatEntry(aClass, aClassSize, RefcountedBloatEntry);
if (entry) { if (entry) {
entry->Ctor(); entry->Ctor();
} }
@ -1093,7 +1113,7 @@ NS_LogRelease(void* aPtr, nsrefcnt aRefcnt, const char* aClass)
AutoTraceLogLock lock; AutoTraceLogLock lock;
if (aRefcnt == 0 && gBloatLog) { if (aRefcnt == 0 && gBloatLog) {
BloatEntry* entry = GetBloatEntry(aClass, 0); BloatEntry* entry = GetBloatEntry(aClass, 0, RefcountedBloatEntry);
if (entry) { if (entry) {
entry->Dtor(); entry->Dtor();
} }
@ -1152,7 +1172,7 @@ NS_LogCtor(void* aPtr, const char* aType, uint32_t aInstanceSize)
AutoTraceLogLock lock; AutoTraceLogLock lock;
if (gBloatLog) { if (gBloatLog) {
BloatEntry* entry = GetBloatEntry(aType, aInstanceSize); BloatEntry* entry = GetBloatEntry(aType, aInstanceSize, ManualBloatEntry);
if (entry) { if (entry) {
entry->Ctor(); entry->Ctor();
} }
@ -1189,7 +1209,7 @@ NS_LogDtor(void* aPtr, const char* aType, uint32_t aInstanceSize)
AutoTraceLogLock lock; AutoTraceLogLock lock;
if (gBloatLog) { if (gBloatLog) {
BloatEntry* entry = GetBloatEntry(aType, aInstanceSize); BloatEntry* entry = GetBloatEntry(aType, aInstanceSize, ManualBloatEntry);
if (entry) { if (entry) {
entry->Dtor(); entry->Dtor();
} }

View File

@ -89,12 +89,17 @@ private:
static_assert(mozilla::IsClass<_type>::value, \ static_assert(mozilla::IsClass<_type>::value, \
"Token '" #_type "' is not a class type.") "Token '" #_type "' is not a class type.")
#define MOZ_ASSERT_NOT_ISUPPORTS(_type) \
static_assert(!mozilla::IsBaseOf<nsISupports, _type>::value, \
"nsISupports classes don't need to call MOZ_COUNT_CTOR or MOZ_COUNT_DTOR");
// Note that the following constructor/destructor logging macros are redundant // Note that the following constructor/destructor logging macros are redundant
// for refcounted objects that log via the NS_LOG_ADDREF/NS_LOG_RELEASE macros. // for refcounted objects that log via the NS_LOG_ADDREF/NS_LOG_RELEASE macros.
// Refcount logging is preferred. // Refcount logging is preferred.
#define MOZ_COUNT_CTOR(_type) \ #define MOZ_COUNT_CTOR(_type) \
do { \ do { \
MOZ_ASSERT_CLASSNAME(_type); \ MOZ_ASSERT_CLASSNAME(_type); \
MOZ_ASSERT_NOT_ISUPPORTS(_type); \
NS_LogCtor((void*)this, #_type, sizeof(*this)); \ NS_LogCtor((void*)this, #_type, sizeof(*this)); \
} while (0) } while (0)
@ -102,6 +107,7 @@ do { \
do { \ do { \
MOZ_ASSERT_CLASSNAME(_type); \ MOZ_ASSERT_CLASSNAME(_type); \
MOZ_ASSERT_CLASSNAME(_base); \ MOZ_ASSERT_CLASSNAME(_base); \
MOZ_ASSERT_NOT_ISUPPORTS(_type); \
NS_LogCtor((void*)this, #_type, sizeof(*this) - sizeof(_base)); \ NS_LogCtor((void*)this, #_type, sizeof(*this) - sizeof(_base)); \
} while (0) } while (0)
@ -113,6 +119,7 @@ do { \
#define MOZ_COUNT_DTOR(_type) \ #define MOZ_COUNT_DTOR(_type) \
do { \ do { \
MOZ_ASSERT_CLASSNAME(_type); \ MOZ_ASSERT_CLASSNAME(_type); \
MOZ_ASSERT_NOT_ISUPPORTS(_type); \
NS_LogDtor((void*)this, #_type, sizeof(*this)); \ NS_LogDtor((void*)this, #_type, sizeof(*this)); \
} while (0) } while (0)
@ -120,6 +127,7 @@ do { \
do { \ do { \
MOZ_ASSERT_CLASSNAME(_type); \ MOZ_ASSERT_CLASSNAME(_type); \
MOZ_ASSERT_CLASSNAME(_base); \ MOZ_ASSERT_CLASSNAME(_base); \
MOZ_ASSERT_NOT_ISUPPORTS(_type); \
NS_LogDtor((void*)this, #_type, sizeof(*this) - sizeof(_base)); \ NS_LogDtor((void*)this, #_type, sizeof(*this) - sizeof(_base)); \
} while (0) } while (0)

View File

@ -47,12 +47,12 @@ public:
#include "xptcstubsdef.inc" #include "xptcstubsdef.inc"
nsXPTCStubBase(nsIXPTCProxy* aOuter, xptiInterfaceEntry *aEntry) nsXPTCStubBase(nsIXPTCProxy* aOuter, xptiInterfaceEntry *aEntry)
: mOuter(aOuter), mEntry(aEntry) { MOZ_COUNT_CTOR(nsXPTCStubBase); } : mOuter(aOuter), mEntry(aEntry) {}
nsIXPTCProxy* mOuter; nsIXPTCProxy* mOuter;
xptiInterfaceEntry* mEntry; xptiInterfaceEntry* mEntry;
~nsXPTCStubBase() { MOZ_COUNT_DTOR(nsXPTCStubBase); } ~nsXPTCStubBase() {}
}; };
#undef STUB_ENTRY #undef STUB_ENTRY

View File

@ -159,13 +159,11 @@ SharedThreadPool::SharedThreadPool(const nsCString& aName,
, mPool(aPool) , mPool(aPool)
, mRefCnt(0) , mRefCnt(0)
{ {
MOZ_COUNT_CTOR(SharedThreadPool);
mEventTarget = do_QueryInterface(aPool); mEventTarget = do_QueryInterface(aPool);
} }
SharedThreadPool::~SharedThreadPool() SharedThreadPool::~SharedThreadPool()
{ {
MOZ_COUNT_DTOR(SharedThreadPool);
} }
nsresult nsresult

View File

@ -143,7 +143,6 @@ nsTimerImpl::nsTimerImpl(nsITimer* aTimer) :
mDelay(0), mDelay(0),
mITimer(aTimer) mITimer(aTimer)
{ {
MOZ_COUNT_CTOR(nsTimerImpl);
// XXXbsmedberg: shouldn't this be in Init()? // XXXbsmedberg: shouldn't this be in Init()?
mEventTarget = static_cast<nsIEventTarget*>(NS_GetCurrentThread()); mEventTarget = static_cast<nsIEventTarget*>(NS_GetCurrentThread());
@ -152,7 +151,6 @@ nsTimerImpl::nsTimerImpl(nsITimer* aTimer) :
nsTimerImpl::~nsTimerImpl() nsTimerImpl::~nsTimerImpl()
{ {
MOZ_COUNT_DTOR(nsTimerImpl);
ReleaseCallback(); ReleaseCallback();
} }