From e31b5489da847719c3e710589e51ea31992e206f Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Mon, 12 Dec 2016 07:58:33 -0500 Subject: [PATCH] Bug 1307961 - require consistent bloatview reporting for nsISupports classes; r=froydnj --- dom/archivereader/ArchiveEvent.cpp | 5 --- dom/archivereader/ArchiveRequest.cpp | 5 --- dom/archivereader/ArchiveZipEvent.cpp | 2 - dom/archivereader/ArchiveZipFile.cpp | 3 -- dom/archivereader/ArchiveZipFile.h | 3 -- dom/asmjscache/AsmJSCache.cpp | 4 -- dom/base/Crypto.cpp | 2 - dom/base/PostMessageEvent.cpp | 2 - dom/base/ShadowRoot.cpp | 2 - dom/base/nsContentPermissionHelper.cpp | 2 - dom/base/nsDocument.cpp | 2 - dom/base/nsGlobalWindow.cpp | 2 - dom/base/nsScriptNameSpaceManager.cpp | 2 - dom/canvas/ImageData.h | 2 - dom/html/HTMLContentElement.cpp | 3 -- dom/ipc/ContentChild.cpp | 2 - dom/ipc/ProcessHangMonitor.cpp | 4 -- dom/media/BufferMediaResource.h | 2 - dom/media/DOMMediaStream.h | 2 - dom/media/FileBlockCache.cpp | 2 - dom/media/MediaDecoder.cpp | 2 - dom/media/MediaRecorder.cpp | 2 - dom/media/MediaResource.h | 2 - dom/media/MediaShutdownManager.cpp | 2 - dom/media/MediaStreamTrack.h | 2 - dom/media/directshow/DirectShowDecoder.cpp | 6 +-- .../mediasource/SourceBufferResource.cpp | 2 - dom/media/systemservices/CamerasParent.cpp | 3 -- dom/media/webaudio/BufferDecoder.cpp | 2 - .../webrtc/RTCIdentityProviderRegistrar.cpp | 2 - .../ipc/PresentationBuilderParent.cpp | 3 -- dom/presentation/ipc/PresentationParent.cpp | 4 -- dom/xbl/XBLChildrenElement.h | 2 - dom/xul/templates/nsXULTemplateBuilder.cpp | 3 -- .../browser/nsWebBrowserContentPolicy.cpp | 2 - .../printingui/ipc/PrintDataUtils.cpp | 2 - .../ipc/PrintProgressDialogChild.cpp | 2 - .../ipc/PrintProgressDialogParent.cpp | 2 - .../printingui/ipc/PrintingParent.cpp | 3 -- gfx/layers/Layers.cpp | 4 -- gfx/layers/client/CompositableChild.cpp | 2 - gfx/layers/client/CompositableClient.cpp | 2 - gfx/layers/ipc/CompositorThread.cpp | 3 -- gfx/src/nsDeviceContext.cpp | 4 +- gfx/thebes/gfxContext.cpp | 3 -- gfx/thebes/gfxTextRun.cpp | 3 -- gfx/vr/ipc/VRManagerChild.cpp | 2 - layout/forms/nsComboboxControlFrame.cpp | 2 - layout/mathml/nsMathMLChar.cpp | 2 - layout/printing/ipc/RemotePrintJobChild.cpp | 2 - layout/style/FontFace.cpp | 3 -- layout/style/FontFaceSet.cpp | 4 -- layout/style/StyleRule.cpp | 3 -- layout/style/nsCSSValue.cpp | 9 +---- layout/style/nsCSSValue.h | 32 ++++----------- layout/style/nsDOMCSSAttrDeclaration.cpp | 3 -- layout/style/nsStyleContext.cpp | 5 +-- layout/style/nsStyleStruct.h | 2 - modules/libjar/nsZipArchive.cpp | 6 --- netwerk/base/nsUDPSocket.cpp | 2 - netwerk/cache2/AppCacheStorage.cpp | 2 - netwerk/cache2/CacheEntry.cpp | 6 --- netwerk/cache2/CacheFile.cpp | 6 --- netwerk/cache2/CacheFileChunk.cpp | 5 --- netwerk/cache2/CacheFileIOManager.cpp | 26 ------------ netwerk/cache2/CacheFileInputStream.cpp | 2 - netwerk/cache2/CacheFileMetadata.cpp | 4 -- netwerk/cache2/CacheFileOutputStream.cpp | 2 - netwerk/cache2/CacheIndex.cpp | 2 - netwerk/cache2/OldWrappers.cpp | 13 ------ netwerk/cache2/OldWrappers.h | 1 - netwerk/protocol/ftp/FTPChannelChild.cpp | 2 - .../protocol/ftp/nsFtpConnectionThread.cpp | 2 - .../websocket/IPCTransportProvider.cpp | 4 -- parser/html/nsHtml5OwningUTF16Buffer.cpp | 9 +---- parser/html/nsHtml5StringParser.cpp | 2 - rdf/base/nsInMemoryDataSource.cpp | 3 -- rdf/base/nsRDFXMLParser.cpp | 2 - rdf/base/nsRDFXMLSerializer.cpp | 3 -- tools/profiler/gecko/ThreadResponsiveness.cpp | 2 - widget/PuppetWidget.cpp | 4 -- widget/windows/WidgetTraceEvent.cpp | 7 +--- xpcom/base/nsTraceRefcnt.cpp | 40 ++++++++++++++----- xpcom/glue/nsISupportsImpl.h | 8 ++++ xpcom/reflect/xptcall/xptcprivate.h | 4 +- xpcom/threads/SharedThreadPool.cpp | 2 - xpcom/threads/nsTimerImpl.cpp | 2 - 87 files changed, 56 insertions(+), 308 deletions(-) diff --git a/dom/archivereader/ArchiveEvent.cpp b/dom/archivereader/ArchiveEvent.cpp index b1b3dcd82384..649a08dcaa22 100644 --- a/dom/archivereader/ArchiveEvent.cpp +++ b/dom/archivereader/ArchiveEvent.cpp @@ -15,12 +15,10 @@ NS_IMPL_ISUPPORTS0(ArchiveItem) ArchiveItem::ArchiveItem() { - MOZ_COUNT_CTOR(ArchiveItem); } ArchiveItem::~ArchiveItem() { - MOZ_COUNT_DTOR(ArchiveItem); } @@ -43,7 +41,6 @@ ArchiveItem::SetType(const nsCString& aType) ArchiveReaderEvent::ArchiveReaderEvent(ArchiveReader* aArchiveReader) : mArchiveReader(aArchiveReader) { - MOZ_COUNT_CTOR(ArchiveReaderEvent); } ArchiveReaderEvent::~ArchiveReaderEvent() @@ -51,8 +48,6 @@ ArchiveReaderEvent::~ArchiveReaderEvent() if (!NS_IsMainThread()) { NS_ReleaseOnMainThread(mMimeService.forget()); } - - MOZ_COUNT_DTOR(ArchiveReaderEvent); } // From the filename to the mimetype: diff --git a/dom/archivereader/ArchiveRequest.cpp b/dom/archivereader/ArchiveRequest.cpp index c4b19f56bc4f..ae4d64f5fec4 100644 --- a/dom/archivereader/ArchiveRequest.cpp +++ b/dom/archivereader/ArchiveRequest.cpp @@ -26,13 +26,11 @@ public: explicit ArchiveRequestEvent(ArchiveRequest* aRequest) : mRequest(aRequest) { - MOZ_COUNT_CTOR(ArchiveRequestEvent); } protected: ~ArchiveRequestEvent() { - MOZ_COUNT_DTOR(ArchiveRequestEvent); } private: //data @@ -56,8 +54,6 @@ ArchiveRequest::ArchiveRequest(nsPIDOMWindowInner* aWindow, { MOZ_ASSERT(aReader); - MOZ_COUNT_CTOR(ArchiveRequest); - /* An event to make this request asynchronous: */ RefPtr event = new ArchiveRequestEvent(this); NS_DispatchToCurrentThread(event); @@ -65,7 +61,6 @@ ArchiveRequest::ArchiveRequest(nsPIDOMWindowInner* aWindow, ArchiveRequest::~ArchiveRequest() { - MOZ_COUNT_DTOR(ArchiveRequest); } nsresult diff --git a/dom/archivereader/ArchiveZipEvent.cpp b/dom/archivereader/ArchiveZipEvent.cpp index 56251eef66eb..397446f30629 100644 --- a/dom/archivereader/ArchiveZipEvent.cpp +++ b/dom/archivereader/ArchiveZipEvent.cpp @@ -28,12 +28,10 @@ ArchiveZipItem::ArchiveZipItem(const char* aFilename, mCentralStruct(aCentralStruct), mEncoding(aEncoding) { - MOZ_COUNT_CTOR(ArchiveZipItem); } ArchiveZipItem::~ArchiveZipItem() { - MOZ_COUNT_DTOR(ArchiveZipItem); } nsresult diff --git a/dom/archivereader/ArchiveZipFile.cpp b/dom/archivereader/ArchiveZipFile.cpp index d374fe91f045..4889a27bdc88 100644 --- a/dom/archivereader/ArchiveZipFile.cpp +++ b/dom/archivereader/ArchiveZipFile.cpp @@ -36,8 +36,6 @@ public: mLength(aLength), mStatus(NotStarted) { - MOZ_COUNT_CTOR(ArchiveInputStream); - // Reset the data: memset(&mData, 0, sizeof(mData)); @@ -52,7 +50,6 @@ public: private: virtual ~ArchiveInputStream() { - MOZ_COUNT_DTOR(ArchiveInputStream); Close(); } diff --git a/dom/archivereader/ArchiveZipFile.h b/dom/archivereader/ArchiveZipFile.h index d1196486c424..c97415d7d0d4 100644 --- a/dom/archivereader/ArchiveZipFile.h +++ b/dom/archivereader/ArchiveZipFile.h @@ -37,7 +37,6 @@ public: mFilename(aName) { MOZ_ASSERT(mBlobImpl); - MOZ_COUNT_CTOR(ArchiveZipBlobImpl); } ArchiveZipBlobImpl(const nsAString& aName, @@ -52,7 +51,6 @@ public: mFilename(aName) { MOZ_ASSERT(mBlobImpl); - MOZ_COUNT_CTOR(ArchiveZipBlobImpl); } // Overrides: @@ -62,7 +60,6 @@ public: protected: virtual ~ArchiveZipBlobImpl() { - MOZ_COUNT_DTOR(ArchiveZipBlobImpl); } virtual already_AddRefed diff --git a/dom/asmjscache/AsmJSCache.cpp b/dom/asmjscache/AsmJSCache.cpp index fb52bb00b454..491c3a764747 100644 --- a/dom/asmjscache/AsmJSCache.cpp +++ b/dom/asmjscache/AsmJSCache.cpp @@ -360,7 +360,6 @@ public: { MOZ_ASSERT(XRE_IsParentProcess()); AssertIsOnOwningThread(); - MOZ_COUNT_CTOR(ParentRunnable); } private: @@ -369,7 +368,6 @@ private: MOZ_ASSERT(mState == eFinished); MOZ_ASSERT(!mDirectoryLock); MOZ_ASSERT(mActorDestroyed); - MOZ_COUNT_DTOR(ParentRunnable); } bool @@ -1233,7 +1231,6 @@ public: mOpened(false) { MOZ_ASSERT(!NS_IsMainThread()); - MOZ_COUNT_CTOR(ChildRunnable); } JS::AsmJSCacheResult @@ -1282,7 +1279,6 @@ private: MOZ_ASSERT(!mOpened); MOZ_ASSERT(mState == eFinished); MOZ_ASSERT(mActorDestroyed); - MOZ_COUNT_DTOR(ChildRunnable); } // IPDL methods. diff --git a/dom/base/Crypto.cpp b/dom/base/Crypto.cpp index 4de6409ac018..b44240bb4e8a 100644 --- a/dom/base/Crypto.cpp +++ b/dom/base/Crypto.cpp @@ -32,12 +32,10 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Crypto, mParent, mSubtle) Crypto::Crypto() { - MOZ_COUNT_CTOR(Crypto); } Crypto::~Crypto() { - MOZ_COUNT_DTOR(Crypto); } void diff --git a/dom/base/PostMessageEvent.cpp b/dom/base/PostMessageEvent.cpp index c1c5cdad4929..78d9337df188 100644 --- a/dom/base/PostMessageEvent.cpp +++ b/dom/base/PostMessageEvent.cpp @@ -44,12 +44,10 @@ PostMessageEvent::PostMessageEvent(nsGlobalWindow* aSource, mSourceDocument(aSourceDocument), mTrustedCaller(aTrustedCaller) { - MOZ_COUNT_CTOR(PostMessageEvent); } PostMessageEvent::~PostMessageEvent() { - MOZ_COUNT_DTOR(PostMessageEvent); } NS_IMETHODIMP diff --git a/dom/base/ShadowRoot.cpp b/dom/base/ShadowRoot.cpp index 9540754f7da1..02797727688a 100644 --- a/dom/base/ShadowRoot.cpp +++ b/dom/base/ShadowRoot.cpp @@ -739,12 +739,10 @@ NS_IMPL_RELEASE_INHERITED(ShadowRootStyleSheetList, StyleSheetList) ShadowRootStyleSheetList::ShadowRootStyleSheetList(ShadowRoot* aShadowRoot) : mShadowRoot(aShadowRoot) { - MOZ_COUNT_CTOR(ShadowRootStyleSheetList); } ShadowRootStyleSheetList::~ShadowRootStyleSheetList() { - MOZ_COUNT_DTOR(ShadowRootStyleSheetList); } StyleSheet* diff --git a/dom/base/nsContentPermissionHelper.cpp b/dom/base/nsContentPermissionHelper.cpp index 53c1c0453b3c..49b58aebed10 100644 --- a/dom/base/nsContentPermissionHelper.cpp +++ b/dom/base/nsContentPermissionHelper.cpp @@ -574,12 +574,10 @@ nsContentPermissionRequestProxy::nsContentPermissionRequesterProxy nsContentPermissionRequestProxy::nsContentPermissionRequestProxy() { - MOZ_COUNT_CTOR(nsContentPermissionRequestProxy); } nsContentPermissionRequestProxy::~nsContentPermissionRequestProxy() { - MOZ_COUNT_DTOR(nsContentPermissionRequestProxy); } nsresult diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index c76424e042c3..2af18d72733d 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -1218,13 +1218,11 @@ public: explicit SelectorCacheKeyDeleter(SelectorCacheKey* aToDelete) : mSelector(aToDelete) { - MOZ_COUNT_CTOR(SelectorCacheKeyDeleter); } protected: ~SelectorCacheKeyDeleter() { - MOZ_COUNT_DTOR(SelectorCacheKeyDeleter); } public: diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 4ee7641172a6..c70519e1e9a9 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -6412,7 +6412,6 @@ public: , mStage(eBeforeToggle) , mFullscreen(aFullscreen) { - MOZ_COUNT_CTOR(FullscreenTransitionTask); } NS_IMETHOD Run() override; @@ -6420,7 +6419,6 @@ public: private: ~FullscreenTransitionTask() override { - MOZ_COUNT_DTOR(FullscreenTransitionTask); } /** diff --git a/dom/base/nsScriptNameSpaceManager.cpp b/dom/base/nsScriptNameSpaceManager.cpp index 6003a1fc1762..9b7418772089 100644 --- a/dom/base/nsScriptNameSpaceManager.cpp +++ b/dom/base/nsScriptNameSpaceManager.cpp @@ -102,13 +102,11 @@ nsScriptNameSpaceManager::nsScriptNameSpaceManager() : mGlobalNames(&hash_table_ops, sizeof(GlobalNameMapEntry), GLOBALNAME_HASHTABLE_INITIAL_LENGTH) { - MOZ_COUNT_CTOR(nsScriptNameSpaceManager); } nsScriptNameSpaceManager::~nsScriptNameSpaceManager() { UnregisterWeakMemoryReporter(this); - MOZ_COUNT_DTOR(nsScriptNameSpaceManager); } nsGlobalNameStruct * diff --git a/dom/canvas/ImageData.h b/dom/canvas/ImageData.h index 50f2c6535d2b..54bced09a9c1 100644 --- a/dom/canvas/ImageData.h +++ b/dom/canvas/ImageData.h @@ -25,7 +25,6 @@ class ImageData final : public nsISupports { ~ImageData() { - MOZ_COUNT_DTOR(ImageData); DropData(); } @@ -35,7 +34,6 @@ public: , mHeight(aHeight) , mData(&aData) { - MOZ_COUNT_CTOR(ImageData); HoldData(); } diff --git a/dom/html/HTMLContentElement.cpp b/dom/html/HTMLContentElement.cpp index 01c0158a0387..14569964bb1e 100644 --- a/dom/html/HTMLContentElement.cpp +++ b/dom/html/HTMLContentElement.cpp @@ -333,8 +333,6 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(DistributedContentList) DistributedContentList::DistributedContentList(HTMLContentElement* aHostElement) : mParent(aHostElement) { - MOZ_COUNT_CTOR(DistributedContentList); - if (aHostElement->IsInsertionPoint()) { if (aHostElement->MatchedNodes().IsEmpty()) { // Fallback content. @@ -352,7 +350,6 @@ DistributedContentList::DistributedContentList(HTMLContentElement* aHostElement) DistributedContentList::~DistributedContentList() { - MOZ_COUNT_DTOR(DistributedContentList); } nsIContent* diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index cdea6f615c9c..d7e0c4ab3841 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -245,7 +245,6 @@ MemoryReportRequestChild::MemoryReportRequestChild( bool aAnonymize, const MaybeFileDesc& aDMDFile) : mAnonymize(aAnonymize) { - MOZ_COUNT_CTOR(MemoryReportRequestChild); if (aDMDFile.type() == MaybeFileDesc::TFileDescriptor) { mDMDFile = aDMDFile.get_FileDescriptor(); } @@ -253,7 +252,6 @@ MemoryReportRequestChild::MemoryReportRequestChild( MemoryReportRequestChild::~MemoryReportRequestChild() { - MOZ_COUNT_DTOR(MemoryReportRequestChild); } // IPC sender for remote GC/CC logging. diff --git a/dom/ipc/ProcessHangMonitor.cpp b/dom/ipc/ProcessHangMonitor.cpp index 622c10e3499b..5a7aa9ce8823 100644 --- a/dom/ipc/ProcessHangMonitor.cpp +++ b/dom/ipc/ProcessHangMonitor.cpp @@ -1079,8 +1079,6 @@ ProcessHangMonitor::ProcessHangMonitor() { MOZ_RELEASE_ASSERT(NS_IsMainThread()); - MOZ_COUNT_CTOR(ProcessHangMonitor); - if (XRE_IsContentProcess()) { nsCOMPtr obs = mozilla::services::GetObserverService(); obs->AddObserver(this, "xpcom-shutdown", false); @@ -1097,8 +1095,6 @@ ProcessHangMonitor::~ProcessHangMonitor() { MOZ_RELEASE_ASSERT(NS_IsMainThread()); - MOZ_COUNT_DTOR(ProcessHangMonitor); - MOZ_ASSERT(sInstance == this); sInstance = nullptr; diff --git a/dom/media/BufferMediaResource.h b/dom/media/BufferMediaResource.h index 5633ddf9c779..75ff8b3f705d 100644 --- a/dom/media/BufferMediaResource.h +++ b/dom/media/BufferMediaResource.h @@ -30,13 +30,11 @@ public: mPrincipal(aPrincipal), mContentType(aContentType) { - MOZ_COUNT_CTOR(BufferMediaResource); } protected: virtual ~BufferMediaResource() { - MOZ_COUNT_DTOR(BufferMediaResource); } private: diff --git a/dom/media/DOMMediaStream.h b/dom/media/DOMMediaStream.h index 12f3529a8a16..22090285b218 100644 --- a/dom/media/DOMMediaStream.h +++ b/dom/media/DOMMediaStream.h @@ -84,7 +84,6 @@ class MediaStreamTrackSourceGetter : public nsISupports public: MediaStreamTrackSourceGetter() { - MOZ_COUNT_CTOR(MediaStreamTrackSourceGetter); } virtual already_AddRefed @@ -93,7 +92,6 @@ public: protected: virtual ~MediaStreamTrackSourceGetter() { - MOZ_COUNT_DTOR(MediaStreamTrackSourceGetter); } }; diff --git a/dom/media/FileBlockCache.cpp b/dom/media/FileBlockCache.cpp index ce6a34cce278..d85e6cd016de 100644 --- a/dom/media/FileBlockCache.cpp +++ b/dom/media/FileBlockCache.cpp @@ -38,7 +38,6 @@ FileBlockCache::FileBlockCache() mIsWriteScheduled(false), mIsOpen(false) { - MOZ_COUNT_CTOR(FileBlockCache); } FileBlockCache::~FileBlockCache() @@ -57,7 +56,6 @@ FileBlockCache::~FileBlockCache() mFD = nullptr; } } - MOZ_COUNT_DTOR(FileBlockCache); } diff --git a/dom/media/MediaDecoder.cpp b/dom/media/MediaDecoder.cpp index 87c414c47ea0..bb21795ced71 100644 --- a/dom/media/MediaDecoder.cpp +++ b/dom/media/MediaDecoder.cpp @@ -417,7 +417,6 @@ MediaDecoder::MediaDecoder(MediaDecoderOwner* aOwner) , INIT_CANONICAL(mIsVisible, !aOwner->IsHidden()) , mTelemetryReported(false) { - MOZ_COUNT_CTOR(MediaDecoder); MOZ_ASSERT(NS_IsMainThread()); MediaMemoryTracker::AddMediaDecoder(this); @@ -516,7 +515,6 @@ MediaDecoder::~MediaDecoder() mResourceCallback->Disconnect(); MediaMemoryTracker::RemoveMediaDecoder(this); UnpinForSeek(); - MOZ_COUNT_DTOR(MediaDecoder); } void diff --git a/dom/media/MediaRecorder.cpp b/dom/media/MediaRecorder.cpp index 5e4908344751..2deeb906d86b 100644 --- a/dom/media/MediaRecorder.cpp +++ b/dom/media/MediaRecorder.cpp @@ -424,7 +424,6 @@ public: , mSelectedVideoTrackID(TRACK_NONE) { MOZ_ASSERT(NS_IsMainThread()); - MOZ_COUNT_CTOR(MediaRecorder::Session); uint32_t maxMem = Preferences::GetUint("media.recorder.max_memory", MAX_ALLOW_MEMORY_BUFFER); @@ -589,7 +588,6 @@ private: // Only DestroyRunnable is allowed to delete Session object. virtual ~Session() { - MOZ_COUNT_DTOR(MediaRecorder::Session); LOG(LogLevel::Debug, ("Session.~Session (%p)", this)); CleanupStreams(); if (mReadThread) { diff --git a/dom/media/MediaResource.h b/dom/media/MediaResource.h index 7d2f153aadc3..8985905fbcac 100644 --- a/dom/media/MediaResource.h +++ b/dom/media/MediaResource.h @@ -410,13 +410,11 @@ protected: mContentType(aContentType), mLoadInBackground(false) { - MOZ_COUNT_CTOR(BaseMediaResource); NS_ASSERTION(!mContentType.IsEmpty(), "Must know content type"); mURI->GetSpec(mContentURL); } virtual ~BaseMediaResource() { - MOZ_COUNT_DTOR(BaseMediaResource); } const nsCString& GetContentType() const override diff --git a/dom/media/MediaShutdownManager.cpp b/dom/media/MediaShutdownManager.cpp index 4f9971f796d4..2a95d8da29cb 100644 --- a/dom/media/MediaShutdownManager.cpp +++ b/dom/media/MediaShutdownManager.cpp @@ -23,13 +23,11 @@ MediaShutdownManager::MediaShutdownManager() , mIsDoingXPCOMShutDown(false) { MOZ_ASSERT(NS_IsMainThread()); - MOZ_COUNT_CTOR(MediaShutdownManager); } MediaShutdownManager::~MediaShutdownManager() { MOZ_ASSERT(NS_IsMainThread()); - MOZ_COUNT_DTOR(MediaShutdownManager); } // Note that we don't use ClearOnShutdown() on this StaticRefPtr, as that diff --git a/dom/media/MediaStreamTrack.h b/dom/media/MediaStreamTrack.h index bf092e4b2aea..c40de2c12281 100644 --- a/dom/media/MediaStreamTrack.h +++ b/dom/media/MediaStreamTrack.h @@ -66,7 +66,6 @@ public: mLabel(aLabel), mStopped(false) { - MOZ_COUNT_CTOR(MediaStreamTrackSource); } /** @@ -166,7 +165,6 @@ public: protected: virtual ~MediaStreamTrackSource() { - MOZ_COUNT_DTOR(MediaStreamTrackSource); } /** diff --git a/dom/media/directshow/DirectShowDecoder.cpp b/dom/media/directshow/DirectShowDecoder.cpp index da68b4daa1d1..96d0e8da6801 100644 --- a/dom/media/directshow/DirectShowDecoder.cpp +++ b/dom/media/directshow/DirectShowDecoder.cpp @@ -53,13 +53,9 @@ DirectShowDecoder::IsEnabled() DirectShowDecoder::DirectShowDecoder(MediaDecoderOwner* aOwner) : MediaDecoder(aOwner) { - MOZ_COUNT_CTOR(DirectShowDecoder); } -DirectShowDecoder::~DirectShowDecoder() -{ - MOZ_COUNT_DTOR(DirectShowDecoder); -} +DirectShowDecoder::~DirectShowDecoder() = default; } // namespace mozilla diff --git a/dom/media/mediasource/SourceBufferResource.cpp b/dom/media/mediasource/SourceBufferResource.cpp index bb11072aeb5f..5bbdbc69239c 100644 --- a/dom/media/mediasource/SourceBufferResource.cpp +++ b/dom/media/mediasource/SourceBufferResource.cpp @@ -166,7 +166,6 @@ SourceBufferResource::Ended() SourceBufferResource::~SourceBufferResource() { SBR_DEBUG(""); - MOZ_COUNT_DTOR(SourceBufferResource); } SourceBufferResource::SourceBufferResource(const nsACString& aType) @@ -177,7 +176,6 @@ SourceBufferResource::SourceBufferResource(const nsACString& aType) , mEnded(false) { SBR_DEBUG(""); - MOZ_COUNT_CTOR(SourceBufferResource); } #undef SBR_DEBUG diff --git a/dom/media/systemservices/CamerasParent.cpp b/dom/media/systemservices/CamerasParent.cpp index ae550ac2fe27..c2ffc85d3c47 100644 --- a/dom/media/systemservices/CamerasParent.cpp +++ b/dom/media/systemservices/CamerasParent.cpp @@ -1075,15 +1075,12 @@ CamerasParent::CamerasParent() return NS_OK; }); NS_DispatchToMainThread(threadStart); - - MOZ_COUNT_CTOR(CamerasParent); } CamerasParent::~CamerasParent() { LOG(("~CamerasParent: %p", this)); - MOZ_COUNT_DTOR(CamerasParent); #ifdef DEBUG // Verify we have shut down the webrtc engines, this is // supposed to happen in ActorDestroy. diff --git a/dom/media/webaudio/BufferDecoder.cpp b/dom/media/webaudio/BufferDecoder.cpp index 61d8ff5ba09c..4fa8a3896727 100644 --- a/dom/media/webaudio/BufferDecoder.cpp +++ b/dom/media/webaudio/BufferDecoder.cpp @@ -19,13 +19,11 @@ BufferDecoder::BufferDecoder(MediaResource* aResource, GMPCrashHelper* aCrashHel , mCrashHelper(aCrashHelper) { MOZ_ASSERT(NS_IsMainThread()); - MOZ_COUNT_CTOR(BufferDecoder); } BufferDecoder::~BufferDecoder() { // The dtor may run on any thread, we cannot be sure. - MOZ_COUNT_DTOR(BufferDecoder); } void diff --git a/dom/media/webrtc/RTCIdentityProviderRegistrar.cpp b/dom/media/webrtc/RTCIdentityProviderRegistrar.cpp index 1d33923d24b5..76ed3e5adbdf 100644 --- a/dom/media/webrtc/RTCIdentityProviderRegistrar.cpp +++ b/dom/media/webrtc/RTCIdentityProviderRegistrar.cpp @@ -29,12 +29,10 @@ RTCIdentityProviderRegistrar::RTCIdentityProviderRegistrar( , mGenerateAssertionCallback(nullptr) , mValidateAssertionCallback(nullptr) { - MOZ_COUNT_CTOR(RTCIdentityProviderRegistrar); } RTCIdentityProviderRegistrar::~RTCIdentityProviderRegistrar() { - MOZ_COUNT_DTOR(RTCIdentityProviderRegistrar); } nsIGlobalObject* diff --git a/dom/presentation/ipc/PresentationBuilderParent.cpp b/dom/presentation/ipc/PresentationBuilderParent.cpp index 4b5055b71e1c..a9497f2edb02 100644 --- a/dom/presentation/ipc/PresentationBuilderParent.cpp +++ b/dom/presentation/ipc/PresentationBuilderParent.cpp @@ -110,13 +110,10 @@ NS_IMPL_ISUPPORTS(PresentationBuilderParent, PresentationBuilderParent::PresentationBuilderParent(PresentationParent* aParent) : mParent(aParent) { - MOZ_COUNT_CTOR(PresentationBuilderParent); } PresentationBuilderParent::~PresentationBuilderParent() { - MOZ_COUNT_DTOR(PresentationBuilderParent); - if (mNeedDestroyActor) { Unused << NS_WARN_IF(!Send__delete__(this)); } diff --git a/dom/presentation/ipc/PresentationParent.cpp b/dom/presentation/ipc/PresentationParent.cpp index 6f923fc03b2b..93d6f530caae 100644 --- a/dom/presentation/ipc/PresentationParent.cpp +++ b/dom/presentation/ipc/PresentationParent.cpp @@ -93,12 +93,10 @@ NS_IMPL_ISUPPORTS(PresentationParent, PresentationParent::PresentationParent() { - MOZ_COUNT_CTOR(PresentationParent); } /* virtual */ PresentationParent::~PresentationParent() { - MOZ_COUNT_DTOR(PresentationParent); } bool @@ -388,12 +386,10 @@ PresentationRequestParent::PresentationRequestParent(nsIPresentationService* aSe : mService(aService) , mChildId(aContentParentId) { - MOZ_COUNT_CTOR(PresentationRequestParent); } PresentationRequestParent::~PresentationRequestParent() { - MOZ_COUNT_DTOR(PresentationRequestParent); } void diff --git a/dom/xbl/XBLChildrenElement.h b/dom/xbl/XBLChildrenElement.h index 4714da4a8405..5d3aeea49b6b 100644 --- a/dom/xbl/XBLChildrenElement.h +++ b/dom/xbl/XBLChildrenElement.h @@ -161,7 +161,6 @@ public: explicit nsAnonymousContentList(nsIContent* aParent) : mParent(aParent) { - MOZ_COUNT_CTOR(nsAnonymousContentList); } NS_DECL_CYCLE_COLLECTING_ISUPPORTS @@ -183,7 +182,6 @@ public: private: virtual ~nsAnonymousContentList() { - MOZ_COUNT_DTOR(nsAnonymousContentList); } nsCOMPtr mParent; diff --git a/dom/xul/templates/nsXULTemplateBuilder.cpp b/dom/xul/templates/nsXULTemplateBuilder.cpp index 49fb3335d797..c767f9cf437e 100644 --- a/dom/xul/templates/nsXULTemplateBuilder.cpp +++ b/dom/xul/templates/nsXULTemplateBuilder.cpp @@ -102,7 +102,6 @@ nsXULTemplateBuilder::nsXULTemplateBuilder(void) mTop(nullptr), mObservedDocument(nullptr) { - MOZ_COUNT_CTOR(nsXULTemplateBuilder); } void @@ -132,8 +131,6 @@ nsXULTemplateBuilder::~nsXULTemplateBuilder(void) NS_IF_RELEASE(gScriptSecurityManager); NS_IF_RELEASE(gObserverService); } - - MOZ_COUNT_DTOR(nsXULTemplateBuilder); } diff --git a/embedding/browser/nsWebBrowserContentPolicy.cpp b/embedding/browser/nsWebBrowserContentPolicy.cpp index f6b17a1976ff..9f0534f57819 100644 --- a/embedding/browser/nsWebBrowserContentPolicy.cpp +++ b/embedding/browser/nsWebBrowserContentPolicy.cpp @@ -12,12 +12,10 @@ nsWebBrowserContentPolicy::nsWebBrowserContentPolicy() { - MOZ_COUNT_CTOR(nsWebBrowserContentPolicy); } nsWebBrowserContentPolicy::~nsWebBrowserContentPolicy() { - MOZ_COUNT_DTOR(nsWebBrowserContentPolicy); } NS_IMPL_ISUPPORTS(nsWebBrowserContentPolicy, nsIContentPolicy) diff --git a/embedding/components/printingui/ipc/PrintDataUtils.cpp b/embedding/components/printingui/ipc/PrintDataUtils.cpp index 30e2075b61f7..30e13cb135d2 100644 --- a/embedding/components/printingui/ipc/PrintDataUtils.cpp +++ b/embedding/components/printingui/ipc/PrintDataUtils.cpp @@ -24,12 +24,10 @@ NS_IMPL_ISUPPORTS(MockWebBrowserPrint, nsIWebBrowserPrint); MockWebBrowserPrint::MockWebBrowserPrint(const PrintData &aData) : mData(aData) { - MOZ_COUNT_CTOR(MockWebBrowserPrint); } MockWebBrowserPrint::~MockWebBrowserPrint() { - MOZ_COUNT_DTOR(MockWebBrowserPrint); } NS_IMETHODIMP diff --git a/embedding/components/printingui/ipc/PrintProgressDialogChild.cpp b/embedding/components/printingui/ipc/PrintProgressDialogChild.cpp index 7930e5cb8488..6306cb1b6826 100644 --- a/embedding/components/printingui/ipc/PrintProgressDialogChild.cpp +++ b/embedding/components/printingui/ipc/PrintProgressDialogChild.cpp @@ -22,7 +22,6 @@ PrintProgressDialogChild::PrintProgressDialogChild( nsIObserver* aOpenObserver) : mOpenObserver(aOpenObserver) { - MOZ_COUNT_CTOR(PrintProgressDialogChild); } PrintProgressDialogChild::~PrintProgressDialogChild() @@ -32,7 +31,6 @@ PrintProgressDialogChild::~PrintProgressDialogChild() // the parent to decrement its refcount, as well as prevent it from attempting // to contact us further. Unused << Send__delete__(this); - MOZ_COUNT_DTOR(PrintProgressDialogChild); } mozilla::ipc::IPCResult diff --git a/embedding/components/printingui/ipc/PrintProgressDialogParent.cpp b/embedding/components/printingui/ipc/PrintProgressDialogParent.cpp index cbb3716f2b8a..1e1f27f94d5b 100644 --- a/embedding/components/printingui/ipc/PrintProgressDialogParent.cpp +++ b/embedding/components/printingui/ipc/PrintProgressDialogParent.cpp @@ -17,12 +17,10 @@ NS_IMPL_ISUPPORTS(PrintProgressDialogParent, nsIObserver) PrintProgressDialogParent::PrintProgressDialogParent() : mActive(true) { - MOZ_COUNT_CTOR(PrintProgressDialogParent); } PrintProgressDialogParent::~PrintProgressDialogParent() { - MOZ_COUNT_DTOR(PrintProgressDialogParent); } void diff --git a/embedding/components/printingui/ipc/PrintingParent.cpp b/embedding/components/printingui/ipc/PrintingParent.cpp index 183ff37b83de..5d87b357a138 100644 --- a/embedding/components/printingui/ipc/PrintingParent.cpp +++ b/embedding/components/printingui/ipc/PrintingParent.cpp @@ -308,8 +308,6 @@ PrintingParent::SerializeAndEnsureRemotePrintJob( PrintingParent::PrintingParent() { - MOZ_COUNT_CTOR(PrintingParent); - mPrintSettingsSvc = do_GetService("@mozilla.org/gfx/printsettings-service;1"); MOZ_ASSERT(mPrintSettingsSvc); @@ -317,7 +315,6 @@ PrintingParent::PrintingParent() PrintingParent::~PrintingParent() { - MOZ_COUNT_DTOR(PrintingParent); } } // namespace embedding diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp index 481b35b53d75..b0e0b77b54a0 100644 --- a/gfx/layers/Layers.cpp +++ b/gfx/layers/Layers.cpp @@ -214,12 +214,10 @@ Layer::Layer(LayerManager* aManager, void* aImplData) : #endif mAnimationGeneration(0) { - MOZ_COUNT_CTOR(Layer); } Layer::~Layer() { - MOZ_COUNT_DTOR(Layer); } Animation* @@ -1122,13 +1120,11 @@ ContainerLayer::ContainerLayer(LayerManager* aManager, void* aImplData) mChildrenChanged(false), mEventRegionsOverride(EventRegionsOverride::NoOverride) { - MOZ_COUNT_CTOR(ContainerLayer); mContentFlags = 0; // Clear NO_TEXT, NO_TEXT_OVER_TRANSPARENT } ContainerLayer::~ContainerLayer() { - MOZ_COUNT_DTOR(ContainerLayer); } bool diff --git a/gfx/layers/client/CompositableChild.cpp b/gfx/layers/client/CompositableChild.cpp index 34a0e0696805..834855b169dd 100644 --- a/gfx/layers/client/CompositableChild.cpp +++ b/gfx/layers/client/CompositableChild.cpp @@ -28,12 +28,10 @@ CompositableChild::CompositableChild() mAsyncID(0), mCanSend(true) { - MOZ_COUNT_CTOR(CompositableChild); } CompositableChild::~CompositableChild() { - MOZ_COUNT_DTOR(CompositableChild); } bool diff --git a/gfx/layers/client/CompositableClient.cpp b/gfx/layers/client/CompositableClient.cpp index 52b9a4637276..f33cb8e1fc2b 100644 --- a/gfx/layers/client/CompositableClient.cpp +++ b/gfx/layers/client/CompositableClient.cpp @@ -57,12 +57,10 @@ CompositableClient::CompositableClient(CompositableForwarder* aForwarder, : mForwarder(aForwarder) , mTextureFlags(aTextureFlags) { - MOZ_COUNT_CTOR(CompositableClient); } CompositableClient::~CompositableClient() { - MOZ_COUNT_DTOR(CompositableClient); Destroy(); } diff --git a/gfx/layers/ipc/CompositorThread.cpp b/gfx/layers/ipc/CompositorThread.cpp index d1789bb9cfe5..234c70cac894 100644 --- a/gfx/layers/ipc/CompositorThread.cpp +++ b/gfx/layers/ipc/CompositorThread.cpp @@ -53,15 +53,12 @@ CompositorThreadHolder::CompositorThreadHolder() : mCompositorThread(CreateCompositorThread()) { MOZ_ASSERT(NS_IsMainThread()); - MOZ_COUNT_CTOR(CompositorThreadHolder); } CompositorThreadHolder::~CompositorThreadHolder() { MOZ_ASSERT(NS_IsMainThread()); - MOZ_COUNT_DTOR(CompositorThreadHolder); - DestroyCompositorThread(mCompositorThread); } diff --git a/gfx/src/nsDeviceContext.cpp b/gfx/src/nsDeviceContext.cpp index aed4323b9e03..a0ee2d309464 100644 --- a/gfx/src/nsDeviceContext.cpp +++ b/gfx/src/nsDeviceContext.cpp @@ -46,7 +46,7 @@ using mozilla::services::GetObserverService; class nsFontCache final : public nsIObserver { public: - nsFontCache() { MOZ_COUNT_CTOR(nsFontCache); } + nsFontCache() {} NS_DECL_ISUPPORTS NS_DECL_NSIOBSERVER @@ -62,7 +62,7 @@ public: void Flush(); protected: - ~nsFontCache() { MOZ_COUNT_DTOR(nsFontCache); } + ~nsFontCache() {} nsDeviceContext* mContext; // owner nsCOMPtr mLocaleLanguage; diff --git a/gfx/thebes/gfxContext.cpp b/gfx/thebes/gfxContext.cpp index 88ab15131f3e..6b532b1a1005 100644 --- a/gfx/thebes/gfxContext.cpp +++ b/gfx/thebes/gfxContext.cpp @@ -76,8 +76,6 @@ gfxContext::gfxContext(DrawTarget *aTarget, const Point& aDeviceOffset) gfxCriticalError() << "Don't create a gfxContext without a DrawTarget"; } - MOZ_COUNT_CTOR(gfxContext); - mStateStack.SetLength(1); CurrentState().drawTarget = mDT; CurrentState().deviceOffset = aDeviceOffset; @@ -119,7 +117,6 @@ gfxContext::~gfxContext() } } mDT->Flush(); - MOZ_COUNT_DTOR(gfxContext); } void diff --git a/gfx/thebes/gfxTextRun.cpp b/gfx/thebes/gfxTextRun.cpp index 6718eed0101e..27fc68c4debd 100644 --- a/gfx/thebes/gfxTextRun.cpp +++ b/gfx/thebes/gfxTextRun.cpp @@ -154,7 +154,6 @@ gfxTextRun::gfxTextRun(const gfxTextRunFactory::Parameters *aParams, , mShapingState(eShapingState_Normal) { NS_ASSERTION(mAppUnitsPerDevUnit > 0, "Invalid app unit scale"); - MOZ_COUNT_CTOR(gfxTextRun); NS_ADDREF(mFontGroup); #ifndef RELEASE_OR_BETA @@ -199,8 +198,6 @@ gfxTextRun::~gfxTextRun() #endif NS_RELEASE(mFontGroup); } - - MOZ_COUNT_DTOR(gfxTextRun); } void diff --git a/gfx/vr/ipc/VRManagerChild.cpp b/gfx/vr/ipc/VRManagerChild.cpp index fb17d2b1f377..ad5453e13854 100644 --- a/gfx/vr/ipc/VRManagerChild.cpp +++ b/gfx/vr/ipc/VRManagerChild.cpp @@ -47,7 +47,6 @@ VRManagerChild::VRManagerChild() , mFrameRequestCallbackCounter(0) , mBackend(layers::LayersBackend::LAYERS_NONE) { - MOZ_COUNT_CTOR(VRManagerChild); MOZ_ASSERT(NS_IsMainThread()); mStartTimeStamp = TimeStamp::Now(); @@ -56,7 +55,6 @@ VRManagerChild::VRManagerChild() VRManagerChild::~VRManagerChild() { MOZ_ASSERT(NS_IsMainThread()); - MOZ_COUNT_DTOR(VRManagerChild); } /*static*/ void diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index f69198cc784a..c60f7cbaedff 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -383,13 +383,11 @@ public: explicit nsResizeDropdownAtFinalPosition(nsComboboxControlFrame* aFrame) : mFrame(aFrame) { - MOZ_COUNT_CTOR(nsResizeDropdownAtFinalPosition); } protected: ~nsResizeDropdownAtFinalPosition() { - MOZ_COUNT_DTOR(nsResizeDropdownAtFinalPosition); } public: diff --git a/layout/mathml/nsMathMLChar.cpp b/layout/mathml/nsMathMLChar.cpp index 507e32b22d17..e73dba0627b6 100644 --- a/layout/mathml/nsMathMLChar.cpp +++ b/layout/mathml/nsMathMLChar.cpp @@ -606,7 +606,6 @@ public: nsGlyphTableList() : mUnicodeTable(NS_LITERAL_STRING("Unicode")) { - MOZ_COUNT_CTOR(nsGlyphTableList); } nsresult Initialize(); @@ -623,7 +622,6 @@ public: private: ~nsGlyphTableList() { - MOZ_COUNT_DTOR(nsGlyphTableList); } nsPropertiesTable* PropertiesTableAt(int32_t aIndex) { diff --git a/layout/printing/ipc/RemotePrintJobChild.cpp b/layout/printing/ipc/RemotePrintJobChild.cpp index d374c05ff78c..af65a67215a1 100644 --- a/layout/printing/ipc/RemotePrintJobChild.cpp +++ b/layout/printing/ipc/RemotePrintJobChild.cpp @@ -18,7 +18,6 @@ NS_IMPL_ISUPPORTS(RemotePrintJobChild, RemotePrintJobChild::RemotePrintJobChild() { - MOZ_COUNT_CTOR(RemotePrintJobChild); } nsresult @@ -141,7 +140,6 @@ RemotePrintJobChild::OnSecurityChange(nsIWebProgress* aProgress, RemotePrintJobChild::~RemotePrintJobChild() { - MOZ_COUNT_DTOR(RemotePrintJobChild); } void diff --git a/layout/style/FontFace.cpp b/layout/style/FontFace.cpp index b7b6a71588cc..604037cf7cac 100644 --- a/layout/style/FontFace.cpp +++ b/layout/style/FontFace.cpp @@ -109,13 +109,10 @@ FontFace::FontFace(nsISupports* aParent, FontFaceSet* aFontFaceSet) , mFontFaceSet(aFontFaceSet) , mInFontFaceSet(false) { - MOZ_COUNT_CTOR(FontFace); } FontFace::~FontFace() { - MOZ_COUNT_DTOR(FontFace); - SetUserFontEntry(nullptr); if (mSourceBuffer) { diff --git a/layout/style/FontFaceSet.cpp b/layout/style/FontFaceSet.cpp index d5840e392f47..81c42581684d 100644 --- a/layout/style/FontFaceSet.cpp +++ b/layout/style/FontFaceSet.cpp @@ -104,8 +104,6 @@ FontFaceSet::FontFaceSet(nsPIDOMWindowInner* aWindow, nsIDocument* aDocument) , mHasLoadingFontFacesIsDirty(false) , mDelayedLoadCheck(false) { - MOZ_COUNT_CTOR(FontFaceSet); - nsCOMPtr global = do_QueryInterface(aWindow); // 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() { - MOZ_COUNT_DTOR(FontFaceSet); - Disconnect(); for (auto it = mLoaders.Iter(); !it.Done(); it.Next()) { it.Get()->GetKey()->Cancel(); diff --git a/layout/style/StyleRule.cpp b/layout/style/StyleRule.cpp index 6aade8897984..b0958a4c3011 100644 --- a/layout/style/StyleRule.cpp +++ b/layout/style/StyleRule.cpp @@ -1130,14 +1130,11 @@ protected: DOMCSSDeclarationImpl::DOMCSSDeclarationImpl(css::StyleRule *aRule) : mRule(aRule) { - MOZ_COUNT_CTOR(DOMCSSDeclarationImpl); } DOMCSSDeclarationImpl::~DOMCSSDeclarationImpl(void) { NS_ASSERTION(!mRule, "DropReference not called."); - - MOZ_COUNT_DTOR(DOMCSSDeclarationImpl); } inline css::DOMCSSStyleRule* DOMCSSDeclarationImpl::DomRule() diff --git a/layout/style/nsCSSValue.cpp b/layout/style/nsCSSValue.cpp index 92ad6cbd887f..8d2d9cd7f7fe 100644 --- a/layout/style/nsCSSValue.cpp +++ b/layout/style/nsCSSValue.cpp @@ -2405,7 +2405,6 @@ nsCSSValueList_heap::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) co nsCSSValueSharedList::~nsCSSValueSharedList() { - MOZ_COUNT_DTOR(nsCSSValueSharedList); if (mHead) { NS_CSS_DELETE_LIST_MEMBER(nsCSSValueList, mHead, mNext); delete mHead; @@ -3061,14 +3060,10 @@ nsCSSValueTokenStream::nsCSSValueTokenStream() : mPropertyID(eCSSProperty_UNKNOWN) , mShorthandPropertyID(eCSSProperty_UNKNOWN) , mLevel(SheetType::Count) -{ - MOZ_COUNT_CTOR(nsCSSValueTokenStream); -} +{} nsCSSValueTokenStream::~nsCSSValueTokenStream() -{ - MOZ_COUNT_DTOR(nsCSSValueTokenStream); -} +{} size_t nsCSSValueTokenStream::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const diff --git a/layout/style/nsCSSValue.h b/layout/style/nsCSSValue.h index 1721cc8ee62c..7f062f0327cc 100644 --- a/layout/style/nsCSSValue.h +++ b/layout/style/nsCSSValue.h @@ -299,35 +299,25 @@ class FontFamilyListRefCnt final : public FontFamilyList { public: FontFamilyListRefCnt() : FontFamilyList() - { - MOZ_COUNT_CTOR(FontFamilyListRefCnt); - } + {} explicit FontFamilyListRefCnt(FontFamilyType aGenericType) : FontFamilyList(aGenericType) - { - MOZ_COUNT_CTOR(FontFamilyListRefCnt); - } + {} FontFamilyListRefCnt(const nsAString& aFamilyName, QuotedName aQuoted) : FontFamilyList(aFamilyName, aQuoted) - { - MOZ_COUNT_CTOR(FontFamilyListRefCnt); - } + {} FontFamilyListRefCnt(const FontFamilyListRefCnt& aOther) : FontFamilyList(aOther) - { - MOZ_COUNT_CTOR(FontFamilyListRefCnt); - } + {} NS_INLINE_DECL_REFCOUNTING(FontFamilyListRefCnt); private: - ~FontFamilyListRefCnt() { - MOZ_COUNT_DTOR(FontFamilyListRefCnt); - } + ~FontFamilyListRefCnt() {} }; struct RGBAColorData @@ -1120,7 +1110,6 @@ private: : mRefCnt(0) , mCount(aItemCount) { - MOZ_COUNT_CTOR(nsCSSValue::Array); CSSVALUE_LIST_FOR_EXTRA_VALUES(val) { new (val) nsCSSValue(); } @@ -1128,7 +1117,6 @@ private: ~Array() { - MOZ_COUNT_DTOR(nsCSSValue::Array); CSSVALUE_LIST_FOR_EXTRA_VALUES(val) { val->~nsCSSValue(); } @@ -1198,14 +1186,12 @@ struct nsCSSValueSharedList final { nsCSSValueSharedList() : mHead(nullptr) { - MOZ_COUNT_CTOR(nsCSSValueSharedList); } // Takes ownership of aList. explicit nsCSSValueSharedList(nsCSSValueList* aList) : mHead(aList) { - MOZ_COUNT_CTOR(nsCSSValueSharedList); } private: @@ -1842,16 +1828,12 @@ public: , mComponent2(aComponent2) , mComponent3(aComponent3) , mAlpha(aAlpha) - { - MOZ_COUNT_CTOR(nsCSSValueFloatColor); - } + {} private: // Private destructor, to discourage deletion outside of Release(): ~nsCSSValueFloatColor() - { - MOZ_COUNT_DTOR(nsCSSValueFloatColor); - } + {} public: bool operator==(nsCSSValueFloatColor& aOther) const; diff --git a/layout/style/nsDOMCSSAttrDeclaration.cpp b/layout/style/nsDOMCSSAttrDeclaration.cpp index cf9c731840ba..dd9f0b3ae60e 100644 --- a/layout/style/nsDOMCSSAttrDeclaration.cpp +++ b/layout/style/nsDOMCSSAttrDeclaration.cpp @@ -28,14 +28,11 @@ nsDOMCSSAttributeDeclaration::nsDOMCSSAttributeDeclaration(dom::Element* aElemen : mElement(aElement) , mIsSMILOverride(aIsSMILOverride) { - MOZ_COUNT_CTOR(nsDOMCSSAttributeDeclaration); - NS_ASSERTION(aElement, "Inline style for a NULL element?"); } nsDOMCSSAttributeDeclaration::~nsDOMCSSAttributeDeclaration() { - MOZ_COUNT_DTOR(nsDOMCSSAttributeDeclaration); } NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsDOMCSSAttributeDeclaration, mElement) diff --git a/layout/style/nsStyleContext.cpp b/layout/style/nsStyleContext.cpp index 4a7cca842c7f..0329daf38736 100644 --- a/layout/style/nsStyleContext.cpp +++ b/layout/style/nsStyleContext.cpp @@ -98,9 +98,7 @@ nsStyleContext::nsStyleContext(nsStyleContext* aParent, , mFrameRefCnt(0) , mComputingStruct(nsStyleStructID_None) #endif -{ - MOZ_COUNT_CTOR(nsStyleContext); -} +{} nsStyleContext::nsStyleContext(nsStyleContext* aParent, nsIAtom* aPseudoTag, @@ -183,7 +181,6 @@ nsStyleContext::FinishConstruction(bool aSkipParentDisplayBasedStyleFixup) nsStyleContext::~nsStyleContext() { - MOZ_COUNT_DTOR(nsStyleContext); NS_ASSERTION((nullptr == mChild) && (nullptr == mEmptyChild), "destructing context with children"); #ifdef DEBUG diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index fcd9605cb528..734203b0622a 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -1141,7 +1141,6 @@ public: explicit nsCSSShadowArray(uint32_t aArrayLen) : mLength(aArrayLen) { - MOZ_COUNT_CTOR(nsCSSShadowArray); for (uint32_t i = 1; i < mLength; ++i) { // Make sure we call the constructors of each nsCSSShadowItem // (the first one is called for us because we declared it under private) @@ -1152,7 +1151,6 @@ public: private: // Private destructor, to discourage deletion outside of Release(): ~nsCSSShadowArray() { - MOZ_COUNT_DTOR(nsCSSShadowArray); for (uint32_t i = 1; i < mLength; ++i) { mArray[i].~nsCSSShadowItem(); } diff --git a/modules/libjar/nsZipArchive.cpp b/modules/libjar/nsZipArchive.cpp index 429de1011194..a1d70d82c093 100644 --- a/modules/libjar/nsZipArchive.cpp +++ b/modules/libjar/nsZipArchive.cpp @@ -170,7 +170,6 @@ nsZipHandle::nsZipHandle() , mFileStart(nullptr) , mTotalLen(0) { - MOZ_COUNT_CTOR(nsZipHandle); } NS_IMPL_ADDREF(nsZipHandle) @@ -344,7 +343,6 @@ nsZipHandle::~nsZipHandle() mFileData = nullptr; mMap = nullptr; mBuf = nullptr; - MOZ_COUNT_DTOR(nsZipHandle); } //*********************************************************** @@ -956,8 +954,6 @@ nsZipArchive::nsZipArchive() { zipLog.AddRef(); - MOZ_COUNT_CTOR(nsZipArchive); - // initialize the table to nullptr memset(mFiles, 0, sizeof(mFiles)); } @@ -969,8 +965,6 @@ nsZipArchive::~nsZipArchive() { CloseArchive(); - MOZ_COUNT_DTOR(nsZipArchive); - zipLog.Release(); } diff --git a/netwerk/base/nsUDPSocket.cpp b/netwerk/base/nsUDPSocket.cpp index a0d74901879e..5b6bf2598e9f 100644 --- a/netwerk/base/nsUDPSocket.cpp +++ b/netwerk/base/nsUDPSocket.cpp @@ -264,13 +264,11 @@ nsUDPSocket::nsUDPSocket() } mSts = gSocketTransportService; - MOZ_COUNT_CTOR(nsUDPSocket); } nsUDPSocket::~nsUDPSocket() { CloseSocket(); - MOZ_COUNT_DTOR(nsUDPSocket); } void diff --git a/netwerk/cache2/AppCacheStorage.cpp b/netwerk/cache2/AppCacheStorage.cpp index c550b272d480..129a63669e57 100644 --- a/netwerk/cache2/AppCacheStorage.cpp +++ b/netwerk/cache2/AppCacheStorage.cpp @@ -28,13 +28,11 @@ AppCacheStorage::AppCacheStorage(nsILoadContextInfo* aInfo, : CacheStorage(aInfo, true /* disk */, false /* lookup app cache */, false /* skip size check */, false /* pin */) , mAppCache(aAppCache) { - MOZ_COUNT_CTOR(AppCacheStorage); } AppCacheStorage::~AppCacheStorage() { ProxyReleaseMainThread(mAppCache); - MOZ_COUNT_DTOR(AppCacheStorage); } NS_IMETHODIMP AppCacheStorage::AsyncOpenURI(nsIURI *aURI, diff --git a/netwerk/cache2/CacheEntry.cpp b/netwerk/cache2/CacheEntry.cpp index 79ad913c7e38..7325041d5d22 100644 --- a/netwerk/cache2/CacheEntry.cpp +++ b/netwerk/cache2/CacheEntry.cpp @@ -48,8 +48,6 @@ NS_IMPL_ISUPPORTS(CacheEntryHandle, nsICacheEntry) CacheEntryHandle::CacheEntryHandle(CacheEntry* aEntry) : mEntry(aEntry) { - MOZ_COUNT_CTOR(CacheEntryHandle); - #ifdef DEBUG if (!mEntry->HandlesCount()) { // CacheEntry.mHandlesCount must go from zero to one only under @@ -68,8 +66,6 @@ CacheEntryHandle::~CacheEntryHandle() { mEntry->ReleaseHandleRef(); mEntry->OnHandleClosed(this); - - MOZ_COUNT_DTOR(CacheEntryHandle); } // CacheEntry::Callback @@ -1864,12 +1860,10 @@ void CacheEntry::StoreFrecency(double aFrecency) CacheOutputCloseListener::CacheOutputCloseListener(CacheEntry* aEntry) : mEntry(aEntry) { - MOZ_COUNT_CTOR(CacheOutputCloseListener); } CacheOutputCloseListener::~CacheOutputCloseListener() { - MOZ_COUNT_DTOR(CacheOutputCloseListener); } void CacheOutputCloseListener::OnOutputClosed() diff --git a/netwerk/cache2/CacheFile.cpp b/netwerk/cache2/CacheFile.cpp index fa0a893823c9..91c54e9ce6fe 100644 --- a/netwerk/cache2/CacheFile.cpp +++ b/netwerk/cache2/CacheFile.cpp @@ -39,7 +39,6 @@ public: { LOG(("NotifyCacheFileListenerEvent::NotifyCacheFileListenerEvent() " "[this=%p]", this)); - MOZ_COUNT_CTOR(NotifyCacheFileListenerEvent); } protected: @@ -47,7 +46,6 @@ protected: { LOG(("NotifyCacheFileListenerEvent::~NotifyCacheFileListenerEvent() " "[this=%p]", this)); - MOZ_COUNT_DTOR(NotifyCacheFileListenerEvent); } public: @@ -78,7 +76,6 @@ public: { LOG(("NotifyChunkListenerEvent::NotifyChunkListenerEvent() [this=%p]", this)); - MOZ_COUNT_CTOR(NotifyChunkListenerEvent); } protected: @@ -86,7 +83,6 @@ protected: { LOG(("NotifyChunkListenerEvent::~NotifyChunkListenerEvent() [this=%p]", this)); - MOZ_COUNT_DTOR(NotifyChunkListenerEvent); } public: @@ -114,7 +110,6 @@ public: explicit DoomFileHelper(CacheFileListener *aListener) : mListener(aListener) { - MOZ_COUNT_CTOR(DoomFileHelper); } @@ -159,7 +154,6 @@ public: private: virtual ~DoomFileHelper() { - MOZ_COUNT_DTOR(DoomFileHelper); } nsCOMPtr mListener; diff --git a/netwerk/cache2/CacheFileChunk.cpp b/netwerk/cache2/CacheFileChunk.cpp index 83d79f79fceb..73f980a65a73 100644 --- a/netwerk/cache2/CacheFileChunk.cpp +++ b/netwerk/cache2/CacheFileChunk.cpp @@ -251,7 +251,6 @@ public: { LOG(("NotifyUpdateListenerEvent::NotifyUpdateListenerEvent() [this=%p]", this)); - MOZ_COUNT_CTOR(NotifyUpdateListenerEvent); } protected: @@ -259,7 +258,6 @@ protected: { LOG(("NotifyUpdateListenerEvent::~NotifyUpdateListenerEvent() [this=%p]", this)); - MOZ_COUNT_DTOR(NotifyUpdateListenerEvent); } public: @@ -347,15 +345,12 @@ CacheFileChunk::CacheFileChunk(CacheFile *aFile, uint32_t aIndex, { LOG(("CacheFileChunk::CacheFileChunk() [this=%p, index=%u, initByWriter=%d]", this, aIndex, aInitByWriter)); - MOZ_COUNT_CTOR(CacheFileChunk); - mBuf = new CacheFileChunkBuffer(this); } CacheFileChunk::~CacheFileChunk() { LOG(("CacheFileChunk::~CacheFileChunk() [this=%p]", this)); - MOZ_COUNT_DTOR(CacheFileChunk); } void diff --git a/netwerk/cache2/CacheFileIOManager.cpp b/netwerk/cache2/CacheFileIOManager.cpp index 1d0d5763551d..6de3dd9891c9 100644 --- a/netwerk/cache2/CacheFileIOManager.cpp +++ b/netwerk/cache2/CacheFileIOManager.cpp @@ -545,13 +545,11 @@ public: : mMonitor("ShutdownEvent.mMonitor") , mNotified(false) { - MOZ_COUNT_CTOR(ShutdownEvent); } protected: ~ShutdownEvent() { - MOZ_COUNT_DTOR(ShutdownEvent); } public: @@ -601,14 +599,12 @@ public: , mCallback(aCallback) , mKey(aKey) { - MOZ_COUNT_CTOR(OpenFileEvent); mIOMan = CacheFileIOManager::gInstance; } protected: ~OpenFileEvent() { - MOZ_COUNT_DTOR(OpenFileEvent); } public: @@ -663,13 +659,11 @@ public: , mCount(aCount) , mCallback(aCallback) { - MOZ_COUNT_CTOR(ReadEvent); } protected: ~ReadEvent() { - MOZ_COUNT_DTOR(ReadEvent); } public: @@ -709,14 +703,11 @@ public: , mTruncate(aTruncate) , mCallback(aCallback) { - MOZ_COUNT_CTOR(WriteEvent); } protected: ~WriteEvent() { - MOZ_COUNT_DTOR(WriteEvent); - if (!mCallback && mBuf) { free(const_cast(mBuf)); } @@ -770,13 +761,11 @@ public: : mCallback(aCallback) , mHandle(aHandle) { - MOZ_COUNT_CTOR(DoomFileEvent); } protected: ~DoomFileEvent() { - MOZ_COUNT_DTOR(DoomFileEvent); } public: @@ -809,8 +798,6 @@ public: CacheFileIOListener *aCallback) : mCallback(aCallback) { - MOZ_COUNT_CTOR(DoomFileByKeyEvent); - SHA1Sum sum; sum.update(aKey.BeginReading(), aKey.Length()); sum.finish(mHash); @@ -821,7 +808,6 @@ public: protected: ~DoomFileByKeyEvent() { - MOZ_COUNT_DTOR(DoomFileByKeyEvent); } public: @@ -854,13 +840,11 @@ public: explicit ReleaseNSPRHandleEvent(CacheFileHandle *aHandle) : mHandle(aHandle) { - MOZ_COUNT_CTOR(ReleaseNSPRHandleEvent); } protected: ~ReleaseNSPRHandleEvent() { - MOZ_COUNT_DTOR(ReleaseNSPRHandleEvent); } public: @@ -886,13 +870,11 @@ public: , mEOFPos(aEOFPos) , mCallback(aCallback) { - MOZ_COUNT_CTOR(TruncateSeekSetEOFEvent); } protected: ~TruncateSeekSetEOFEvent() { - MOZ_COUNT_DTOR(TruncateSeekSetEOFEvent); } public: @@ -929,13 +911,11 @@ public: , mNewName(aNewName) , mCallback(aCallback) { - MOZ_COUNT_CTOR(RenameFileEvent); } protected: ~RenameFileEvent() { - MOZ_COUNT_DTOR(RenameFileEvent); } public: @@ -973,13 +953,11 @@ public: , mAnonymous(aAnonymous) , mPinning(aPinning) { - MOZ_COUNT_CTOR(InitIndexEntryEvent); } protected: ~InitIndexEntryEvent() { - MOZ_COUNT_DTOR(InitIndexEntryEvent); } public: @@ -1017,7 +995,6 @@ public: , mHasFrecency(false) , mHasExpirationTime(false) { - MOZ_COUNT_CTOR(UpdateIndexEntryEvent); if (aFrecency) { mHasFrecency = true; mFrecency = *aFrecency; @@ -1031,7 +1008,6 @@ public: protected: ~UpdateIndexEntryEvent() { - MOZ_COUNT_DTOR(UpdateIndexEntryEvent); } public: @@ -1114,14 +1090,12 @@ CacheFileIOManager::CacheFileIOManager() , mRemovingTrashDirs(false) { LOG(("CacheFileIOManager::CacheFileIOManager [this=%p]", this)); - MOZ_COUNT_CTOR(CacheFileIOManager); MOZ_ASSERT(!gInstance, "multiple CacheFileIOManager instances!"); } CacheFileIOManager::~CacheFileIOManager() { LOG(("CacheFileIOManager::~CacheFileIOManager [this=%p]", this)); - MOZ_COUNT_DTOR(CacheFileIOManager); } // static diff --git a/netwerk/cache2/CacheFileInputStream.cpp b/netwerk/cache2/CacheFileInputStream.cpp index 26ca5753702d..a993c0fa3c9b 100644 --- a/netwerk/cache2/CacheFileInputStream.cpp +++ b/netwerk/cache2/CacheFileInputStream.cpp @@ -57,7 +57,6 @@ CacheFileInputStream::CacheFileInputStream(CacheFile *aFile, , mCacheEntryHandle(aEntry) { LOG(("CacheFileInputStream::CacheFileInputStream() [this=%p]", this)); - MOZ_COUNT_CTOR(CacheFileInputStream); if (mAlternativeData) { mPos = mFile->mAltDataOffset; @@ -67,7 +66,6 @@ CacheFileInputStream::CacheFileInputStream(CacheFile *aFile, CacheFileInputStream::~CacheFileInputStream() { LOG(("CacheFileInputStream::~CacheFileInputStream() [this=%p]", this)); - MOZ_COUNT_DTOR(CacheFileInputStream); MOZ_ASSERT(!mInReadSegments); } diff --git a/netwerk/cache2/CacheFileMetadata.cpp b/netwerk/cache2/CacheFileMetadata.cpp index 3814b4c878ee..8d2d3449074e 100644 --- a/netwerk/cache2/CacheFileMetadata.cpp +++ b/netwerk/cache2/CacheFileMetadata.cpp @@ -58,7 +58,6 @@ CacheFileMetadata::CacheFileMetadata(CacheFileHandle *aHandle, const nsACString LOG(("CacheFileMetadata::CacheFileMetadata() [this=%p, handle=%p, key=%s]", this, aHandle, PromiseFlatCString(aKey).get())); - MOZ_COUNT_CTOR(CacheFileMetadata); memset(&mMetaHdr, 0, sizeof(CacheFileMetadataHeader)); mMetaHdr.mVersion = kCacheEntryVersion; 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]", this, PromiseFlatCString(aKey).get())); - MOZ_COUNT_CTOR(CacheFileMetadata); memset(&mMetaHdr, 0, sizeof(CacheFileMetadataHeader)); mMetaHdr.mVersion = kCacheEntryVersion; if (aPinned) { @@ -121,7 +119,6 @@ CacheFileMetadata::CacheFileMetadata() { LOG(("CacheFileMetadata::CacheFileMetadata() [this=%p]", this)); - MOZ_COUNT_CTOR(CacheFileMetadata); memset(&mMetaHdr, 0, sizeof(CacheFileMetadataHeader)); } @@ -129,7 +126,6 @@ CacheFileMetadata::~CacheFileMetadata() { LOG(("CacheFileMetadata::~CacheFileMetadata() [this=%p]", this)); - MOZ_COUNT_DTOR(CacheFileMetadata); MOZ_ASSERT(!mListener); if (mHashArray) { diff --git a/netwerk/cache2/CacheFileOutputStream.cpp b/netwerk/cache2/CacheFileOutputStream.cpp index a3d414b8fa9f..2f7c8afca8f2 100644 --- a/netwerk/cache2/CacheFileOutputStream.cpp +++ b/netwerk/cache2/CacheFileOutputStream.cpp @@ -56,7 +56,6 @@ CacheFileOutputStream::CacheFileOutputStream(CacheFile *aFile, , mCallbackFlags(0) { LOG(("CacheFileOutputStream::CacheFileOutputStream() [this=%p]", this)); - MOZ_COUNT_CTOR(CacheFileOutputStream); if (mAlternativeData) { mPos = mFile->mAltDataOffset; @@ -66,7 +65,6 @@ CacheFileOutputStream::CacheFileOutputStream(CacheFile *aFile, CacheFileOutputStream::~CacheFileOutputStream() { LOG(("CacheFileOutputStream::~CacheFileOutputStream() [this=%p]", this)); - MOZ_COUNT_DTOR(CacheFileOutputStream); } // nsIOutputStream diff --git a/netwerk/cache2/CacheIndex.cpp b/netwerk/cache2/CacheIndex.cpp index 4525bbe6d604..57efafa21b36 100644 --- a/netwerk/cache2/CacheIndex.cpp +++ b/netwerk/cache2/CacheIndex.cpp @@ -278,7 +278,6 @@ CacheIndex::CacheIndex() { sLock.AssertCurrentThreadOwns(); LOG(("CacheIndex::CacheIndex [this=%p]", this)); - MOZ_COUNT_CTOR(CacheIndex); MOZ_ASSERT(!gInstance, "multiple CacheIndex instances!"); } @@ -286,7 +285,6 @@ CacheIndex::~CacheIndex() { sLock.AssertCurrentThreadOwns(); LOG(("CacheIndex::~CacheIndex [this=%p]", this)); - MOZ_COUNT_DTOR(CacheIndex); ReleaseBuffer(); } diff --git a/netwerk/cache2/OldWrappers.cpp b/netwerk/cache2/OldWrappers.cpp index 81df88df0e8f..292447c84eca 100644 --- a/netwerk/cache2/OldWrappers.cpp +++ b/netwerk/cache2/OldWrappers.cpp @@ -41,14 +41,12 @@ class DoomCallbackSynchronizer : public Runnable public: explicit DoomCallbackSynchronizer(nsICacheEntryDoomCallback* cb) : mCB(cb) { - MOZ_COUNT_CTOR(DoomCallbackSynchronizer); } nsresult Dispatch(); private: virtual ~DoomCallbackSynchronizer() { - MOZ_COUNT_DTOR(DoomCallbackSynchronizer); } NS_DECL_NSIRUNNABLE @@ -94,13 +92,11 @@ class DoomCallbackWrapper : public nsICacheListener explicit DoomCallbackWrapper(nsICacheEntryDoomCallback* cb) : mCB(cb) { - MOZ_COUNT_CTOR(DoomCallbackWrapper); } private: virtual ~DoomCallbackWrapper() { - MOZ_COUNT_DTOR(DoomCallbackWrapper); } nsCOMPtr mCB; @@ -143,8 +139,6 @@ _OldVisitCallbackWrapper::~_OldVisitCallbackWrapper() if (mVisitEntries) { mCB->OnCacheEntryVisitCompleted(); } - - MOZ_COUNT_DTOR(_OldVisitCallbackWrapper); } NS_IMETHODIMP _OldVisitCallbackWrapper::VisitDevice(const char * deviceID, @@ -349,20 +343,17 @@ _OldGetDiskConsumption::VisitEntry(const char * deviceID, _OldCacheEntryWrapper::_OldCacheEntryWrapper(nsICacheEntryDescriptor* desc) : mOldDesc(desc), mOldInfo(desc) { - MOZ_COUNT_CTOR(_OldCacheEntryWrapper); LOG(("Creating _OldCacheEntryWrapper %p for descriptor %p", this, desc)); } _OldCacheEntryWrapper::_OldCacheEntryWrapper(nsICacheEntryInfo* info) : mOldDesc(nullptr), mOldInfo(info) { - MOZ_COUNT_CTOR(_OldCacheEntryWrapper); LOG(("Creating _OldCacheEntryWrapper %p for info %p", this, info)); } _OldCacheEntryWrapper::~_OldCacheEntryWrapper() { - MOZ_COUNT_DTOR(_OldCacheEntryWrapper); LOG(("Destroying _OldCacheEntryWrapper %p for descriptor %p", this, mOldInfo.get())); } @@ -680,13 +671,11 @@ _OldCacheLoad::_OldCacheLoad(nsCSubstring const& aScheme, , mRunCount(0) , mAppCache(aAppCache) { - MOZ_COUNT_CTOR(_OldCacheLoad); } _OldCacheLoad::~_OldCacheLoad() { ProxyReleaseMainThread(mAppCache); - MOZ_COUNT_DTOR(_OldCacheLoad); } nsresult _OldCacheLoad::Start() @@ -907,12 +896,10 @@ _OldStorage::_OldStorage(nsILoadContextInfo* aInfo, , mLookupAppCache(aLookupAppCache) , mOfflineStorage(aOfflineStorage) { - MOZ_COUNT_CTOR(_OldStorage); } _OldStorage::~_OldStorage() { - MOZ_COUNT_DTOR(_OldStorage); } NS_IMETHODIMP _OldStorage::AsyncOpenURI(nsIURI *aURI, diff --git a/netwerk/cache2/OldWrappers.h b/netwerk/cache2/OldWrappers.h index f85b0741acd8..0bdb3f52ea4a 100644 --- a/netwerk/cache2/OldWrappers.h +++ b/netwerk/cache2/OldWrappers.h @@ -249,7 +249,6 @@ class _OldVisitCallbackWrapper : public nsICacheVisitor , mLoadInfo(aInfo) , mHit(false) { - MOZ_COUNT_CTOR(_OldVisitCallbackWrapper); } private: diff --git a/netwerk/protocol/ftp/FTPChannelChild.cpp b/netwerk/protocol/ftp/FTPChannelChild.cpp index e8a243591f30..41e9fdba4337 100644 --- a/netwerk/protocol/ftp/FTPChannelChild.cpp +++ b/netwerk/protocol/ftp/FTPChannelChild.cpp @@ -523,12 +523,10 @@ public: : mPrompter(aPrompter) , mResponseMsg(aResponseMsg) { - MOZ_COUNT_CTOR(nsFtpChildAsyncAlert); } protected: virtual ~nsFtpChildAsyncAlert() { - MOZ_COUNT_DTOR(nsFtpChildAsyncAlert); } public: NS_IMETHOD Run() override diff --git a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp index 4bbf92d7f59d..85b7dca52f54 100644 --- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp +++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp @@ -1794,12 +1794,10 @@ public: : mPrompter(aPrompter) , mResponseMsg(aResponseMsg) { - MOZ_COUNT_CTOR(nsFtpAsyncAlert); } protected: virtual ~nsFtpAsyncAlert() { - MOZ_COUNT_DTOR(nsFtpAsyncAlert); } public: NS_IMETHOD Run() override diff --git a/netwerk/protocol/websocket/IPCTransportProvider.cpp b/netwerk/protocol/websocket/IPCTransportProvider.cpp index 356cf2d57cee..bd4579096d38 100644 --- a/netwerk/protocol/websocket/IPCTransportProvider.cpp +++ b/netwerk/protocol/websocket/IPCTransportProvider.cpp @@ -19,12 +19,10 @@ NS_IMPL_ISUPPORTS(TransportProviderParent, TransportProviderParent::TransportProviderParent() { - MOZ_COUNT_CTOR(TransportProviderParent); } TransportProviderParent::~TransportProviderParent() { - MOZ_COUNT_DTOR(TransportProviderParent); } NS_IMETHODIMP @@ -77,12 +75,10 @@ NS_IMPL_ISUPPORTS(TransportProviderChild, TransportProviderChild::TransportProviderChild() { - MOZ_COUNT_CTOR(TransportProviderChild); } TransportProviderChild::~TransportProviderChild() { - MOZ_COUNT_DTOR(TransportProviderChild); Send__delete__(this); } diff --git a/parser/html/nsHtml5OwningUTF16Buffer.cpp b/parser/html/nsHtml5OwningUTF16Buffer.cpp index 213e40209603..ff0256ca4514 100644 --- a/parser/html/nsHtml5OwningUTF16Buffer.cpp +++ b/parser/html/nsHtml5OwningUTF16Buffer.cpp @@ -8,21 +8,16 @@ nsHtml5OwningUTF16Buffer::nsHtml5OwningUTF16Buffer(char16_t* aBuffer) : nsHtml5UTF16Buffer(aBuffer, 0), next(nullptr), key(nullptr) -{ - MOZ_COUNT_CTOR(nsHtml5OwningUTF16Buffer); -} +{} nsHtml5OwningUTF16Buffer::nsHtml5OwningUTF16Buffer(void* aKey) : nsHtml5UTF16Buffer(nullptr, 0), next(nullptr), key(aKey) -{ - MOZ_COUNT_CTOR(nsHtml5OwningUTF16Buffer); -} +{} nsHtml5OwningUTF16Buffer::~nsHtml5OwningUTF16Buffer() { - MOZ_COUNT_DTOR(nsHtml5OwningUTF16Buffer); DeleteBuffer(); // This is to avoid dtor recursion on 'next', bug 706932. diff --git a/parser/html/nsHtml5StringParser.cpp b/parser/html/nsHtml5StringParser.cpp index d1eeca6b88d3..569b51552e02 100644 --- a/parser/html/nsHtml5StringParser.cpp +++ b/parser/html/nsHtml5StringParser.cpp @@ -18,13 +18,11 @@ nsHtml5StringParser::nsHtml5StringParser() , mTreeBuilder(new nsHtml5TreeBuilder(mBuilder)) , mTokenizer(new nsHtml5Tokenizer(mTreeBuilder, false)) { - MOZ_COUNT_CTOR(nsHtml5StringParser); mTokenizer->setInterner(&mAtomTable); } nsHtml5StringParser::~nsHtml5StringParser() { - MOZ_COUNT_DTOR(nsHtml5StringParser); } nsresult diff --git a/rdf/base/nsInMemoryDataSource.cpp b/rdf/base/nsInMemoryDataSource.cpp index 9bdd6b4fbec1..dbee61ac68be 100644 --- a/rdf/base/nsInMemoryDataSource.cpp +++ b/rdf/base/nsInMemoryDataSource.cpp @@ -736,7 +736,6 @@ InMemoryDataSource::InMemoryDataSource(nsISupports* aOuter) NS_INIT_AGGREGATED(aOuter); mPropagateChanges = true; - MOZ_COUNT_CTOR(InMemoryDataSource); } @@ -768,8 +767,6 @@ InMemoryDataSource::~InMemoryDataSource() MOZ_LOG(gLog, LogLevel::Debug, ("InMemoryDataSource(%p): destroyed.", this)); - - MOZ_COUNT_DTOR(InMemoryDataSource); } diff --git a/rdf/base/nsRDFXMLParser.cpp b/rdf/base/nsRDFXMLParser.cpp index 67de9082054f..f8237356bd3b 100644 --- a/rdf/base/nsRDFXMLParser.cpp +++ b/rdf/base/nsRDFXMLParser.cpp @@ -38,12 +38,10 @@ nsRDFXMLParser::Create(nsISupports* aOuter, REFNSIID aIID, void** aResult) nsRDFXMLParser::nsRDFXMLParser() { - MOZ_COUNT_CTOR(nsRDFXMLParser); } nsRDFXMLParser::~nsRDFXMLParser() { - MOZ_COUNT_DTOR(nsRDFXMLParser); } NS_IMETHODIMP diff --git a/rdf/base/nsRDFXMLSerializer.cpp b/rdf/base/nsRDFXMLSerializer.cpp index 677f58ca385e..c97356d7741e 100644 --- a/rdf/base/nsRDFXMLSerializer.cpp +++ b/rdf/base/nsRDFXMLSerializer.cpp @@ -95,13 +95,10 @@ nsRDFXMLSerializer::Create(nsISupports* aOuter, REFNSIID aIID, void** aResult) nsRDFXMLSerializer::nsRDFXMLSerializer() { - MOZ_COUNT_CTOR(nsRDFXMLSerializer); } nsRDFXMLSerializer::~nsRDFXMLSerializer() { - MOZ_COUNT_DTOR(nsRDFXMLSerializer); - if (--gRefCnt == 0) { NS_IF_RELEASE(kRDF_Bag); NS_IF_RELEASE(kRDF_Seq); diff --git a/tools/profiler/gecko/ThreadResponsiveness.cpp b/tools/profiler/gecko/ThreadResponsiveness.cpp index 0057251e2c18..59c910c1c33b 100644 --- a/tools/profiler/gecko/ThreadResponsiveness.cpp +++ b/tools/profiler/gecko/ThreadResponsiveness.cpp @@ -25,13 +25,11 @@ public: , mTimer(nullptr) , mStop(false) { - MOZ_COUNT_CTOR(CheckResponsivenessTask); } protected: ~CheckResponsivenessTask() { - MOZ_COUNT_DTOR(CheckResponsivenessTask); } public: diff --git a/widget/PuppetWidget.cpp b/widget/PuppetWidget.cpp index c877cb36c5b4..45291754379b 100644 --- a/widget/PuppetWidget.cpp +++ b/widget/PuppetWidget.cpp @@ -85,8 +85,6 @@ PuppetWidget::PuppetWidget(TabChild* aTabChild) , mCursorHotspotY(0) , mNativeKeyCommandsValid(false) { - MOZ_COUNT_CTOR(PuppetWidget); - mSingleLineCommands.SetCapacity(4); mMultiLineCommands.SetCapacity(4); mRichTextCommands.SetCapacity(4); @@ -97,8 +95,6 @@ PuppetWidget::PuppetWidget(TabChild* aTabChild) PuppetWidget::~PuppetWidget() { - MOZ_COUNT_DTOR(PuppetWidget); - Destroy(); } diff --git a/widget/windows/WidgetTraceEvent.cpp b/widget/windows/WidgetTraceEvent.cpp index 589449af8bd1..4e4be3af3ca7 100644 --- a/widget/windows/WidgetTraceEvent.cpp +++ b/widget/windows/WidgetTraceEvent.cpp @@ -34,12 +34,7 @@ HANDLE sEventHandle = nullptr; // thread. class HWNDGetter : public mozilla::Runnable { public: - HWNDGetter() : hidden_window_hwnd(nullptr) { - MOZ_COUNT_CTOR(HWNDGetter); - } - ~HWNDGetter() { - MOZ_COUNT_DTOR(HWNDGetter); - } + HWNDGetter() : hidden_window_hwnd(nullptr) {} HWND hidden_window_hwnd; diff --git a/xpcom/base/nsTraceRefcnt.cpp b/xpcom/base/nsTraceRefcnt.cpp index 4cd0503c9668..98783e194b6f 100644 --- a/xpcom/base/nsTraceRefcnt.cpp +++ b/xpcom/base/nsTraceRefcnt.cpp @@ -281,11 +281,20 @@ mozilla::StaticAutoPtr gCodeAddressService; //////////////////////////////////////////////////////////////////////////////// +enum BloatEntryType +{ + RefcountedBloatEntry, + ManualBloatEntry, +}; + class BloatEntry { public: - BloatEntry(const char* aClassName, uint32_t aClassSize) + BloatEntry(const char* aClassName, + uint32_t aClassSize, + BloatEntryType aEntryType) : mClassSize(aClassSize) + , mEntryType(aEntryType) { MOZ_ASSERT(strlen(aClassName) > 0, "BloatEntry name must be non-empty"); mClassName = PL_strdup(aClassName); @@ -307,6 +316,11 @@ public: return mClassName; } + BloatEntryType GetEntryType() const + { + return mEntryType; + } + void Ctor() { 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. int64_t mTotalLeaked; // Used only for TOTAL entry. nsTraceRefcntStats mStats; + BloatEntryType mEntryType; }; static void @@ -416,7 +431,9 @@ RecreateBloatView() } static BloatEntry* -GetBloatEntry(const char* aTypeName, uint32_t aInstanceSize) +GetBloatEntry(const char* aTypeName, + uint32_t aInstanceSize, + BloatEntryType aEntryType) { if (!gBloatView) { RecreateBloatView(); @@ -426,7 +443,7 @@ GetBloatEntry(const char* aTypeName, uint32_t aInstanceSize) entry = (BloatEntry*)PL_HashTableLookup(gBloatView, aTypeName); if (!entry && aInstanceSize > 0) { - entry = new BloatEntry(aTypeName, aInstanceSize); + entry = new BloatEntry(aTypeName, aInstanceSize, aEntryType); PLHashEntry* e = PL_HashTableAdd(gBloatView, aTypeName, entry); if (!e) { delete entry; @@ -439,6 +456,8 @@ GetBloatEntry(const char* aTypeName, uint32_t aInstanceSize) "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 " "non-templated base class."); + MOZ_ASSERT(entry->GetEntryType() == aEntryType, + "Don't use MOZ_COUNT_CTOR and MOZ_COUNT_DTOR for refcounted classes."); } } return entry; @@ -515,7 +534,8 @@ nsTraceRefcnt::DumpStatistics() AutoRestore saveLogging(gLogging); gLogging = NoLogging; - BloatEntry total("TOTAL", 0); + BloatEntry total("TOTAL", 0, ManualBloatEntry); + // Second and third args are just dummies. PL_HashTableEnumerateEntries(gBloatView, BloatEntry::TotalEntries, &total); const char* msg; if (gLogLeaksOnly) { @@ -989,8 +1009,8 @@ namespace mozilla { void LogTerm() { - NS_ASSERTION(gInitCount > 0, - "NS_LogTerm without matching NS_LogInit"); + MOZ_ASSERT(gInitCount > 0, + "NS_LogTerm without matching NS_LogInit"); if (--gInitCount == 0) { #ifdef DEBUG @@ -1040,7 +1060,7 @@ NS_LogAddRef(void* aPtr, nsrefcnt aRefcnt, AutoTraceLogLock lock; if (aRefcnt == 1 && gBloatLog) { - BloatEntry* entry = GetBloatEntry(aClass, aClassSize); + BloatEntry* entry = GetBloatEntry(aClass, aClassSize, RefcountedBloatEntry); if (entry) { entry->Ctor(); } @@ -1093,7 +1113,7 @@ NS_LogRelease(void* aPtr, nsrefcnt aRefcnt, const char* aClass) AutoTraceLogLock lock; if (aRefcnt == 0 && gBloatLog) { - BloatEntry* entry = GetBloatEntry(aClass, 0); + BloatEntry* entry = GetBloatEntry(aClass, 0, RefcountedBloatEntry); if (entry) { entry->Dtor(); } @@ -1152,7 +1172,7 @@ NS_LogCtor(void* aPtr, const char* aType, uint32_t aInstanceSize) AutoTraceLogLock lock; if (gBloatLog) { - BloatEntry* entry = GetBloatEntry(aType, aInstanceSize); + BloatEntry* entry = GetBloatEntry(aType, aInstanceSize, ManualBloatEntry); if (entry) { entry->Ctor(); } @@ -1189,7 +1209,7 @@ NS_LogDtor(void* aPtr, const char* aType, uint32_t aInstanceSize) AutoTraceLogLock lock; if (gBloatLog) { - BloatEntry* entry = GetBloatEntry(aType, aInstanceSize); + BloatEntry* entry = GetBloatEntry(aType, aInstanceSize, ManualBloatEntry); if (entry) { entry->Dtor(); } diff --git a/xpcom/glue/nsISupportsImpl.h b/xpcom/glue/nsISupportsImpl.h index 26db3c525d8f..fe2fe69f06d5 100644 --- a/xpcom/glue/nsISupportsImpl.h +++ b/xpcom/glue/nsISupportsImpl.h @@ -89,12 +89,17 @@ private: static_assert(mozilla::IsClass<_type>::value, \ "Token '" #_type "' is not a class type.") +#define MOZ_ASSERT_NOT_ISUPPORTS(_type) \ + static_assert(!mozilla::IsBaseOf::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 // for refcounted objects that log via the NS_LOG_ADDREF/NS_LOG_RELEASE macros. // Refcount logging is preferred. #define MOZ_COUNT_CTOR(_type) \ do { \ MOZ_ASSERT_CLASSNAME(_type); \ + MOZ_ASSERT_NOT_ISUPPORTS(_type); \ NS_LogCtor((void*)this, #_type, sizeof(*this)); \ } while (0) @@ -102,6 +107,7 @@ do { \ do { \ MOZ_ASSERT_CLASSNAME(_type); \ MOZ_ASSERT_CLASSNAME(_base); \ + MOZ_ASSERT_NOT_ISUPPORTS(_type); \ NS_LogCtor((void*)this, #_type, sizeof(*this) - sizeof(_base)); \ } while (0) @@ -113,6 +119,7 @@ do { \ #define MOZ_COUNT_DTOR(_type) \ do { \ MOZ_ASSERT_CLASSNAME(_type); \ + MOZ_ASSERT_NOT_ISUPPORTS(_type); \ NS_LogDtor((void*)this, #_type, sizeof(*this)); \ } while (0) @@ -120,6 +127,7 @@ do { \ do { \ MOZ_ASSERT_CLASSNAME(_type); \ MOZ_ASSERT_CLASSNAME(_base); \ + MOZ_ASSERT_NOT_ISUPPORTS(_type); \ NS_LogDtor((void*)this, #_type, sizeof(*this) - sizeof(_base)); \ } while (0) diff --git a/xpcom/reflect/xptcall/xptcprivate.h b/xpcom/reflect/xptcall/xptcprivate.h index 7805792e7fe6..4429ee47dd5b 100644 --- a/xpcom/reflect/xptcall/xptcprivate.h +++ b/xpcom/reflect/xptcall/xptcprivate.h @@ -47,12 +47,12 @@ public: #include "xptcstubsdef.inc" nsXPTCStubBase(nsIXPTCProxy* aOuter, xptiInterfaceEntry *aEntry) - : mOuter(aOuter), mEntry(aEntry) { MOZ_COUNT_CTOR(nsXPTCStubBase); } + : mOuter(aOuter), mEntry(aEntry) {} nsIXPTCProxy* mOuter; xptiInterfaceEntry* mEntry; - ~nsXPTCStubBase() { MOZ_COUNT_DTOR(nsXPTCStubBase); } + ~nsXPTCStubBase() {} }; #undef STUB_ENTRY diff --git a/xpcom/threads/SharedThreadPool.cpp b/xpcom/threads/SharedThreadPool.cpp index 9adf6449e327..c10034b7036d 100644 --- a/xpcom/threads/SharedThreadPool.cpp +++ b/xpcom/threads/SharedThreadPool.cpp @@ -159,13 +159,11 @@ SharedThreadPool::SharedThreadPool(const nsCString& aName, , mPool(aPool) , mRefCnt(0) { - MOZ_COUNT_CTOR(SharedThreadPool); mEventTarget = do_QueryInterface(aPool); } SharedThreadPool::~SharedThreadPool() { - MOZ_COUNT_DTOR(SharedThreadPool); } nsresult diff --git a/xpcom/threads/nsTimerImpl.cpp b/xpcom/threads/nsTimerImpl.cpp index cd2e31d936e7..d0aef0e6e946 100644 --- a/xpcom/threads/nsTimerImpl.cpp +++ b/xpcom/threads/nsTimerImpl.cpp @@ -143,7 +143,6 @@ nsTimerImpl::nsTimerImpl(nsITimer* aTimer) : mDelay(0), mITimer(aTimer) { - MOZ_COUNT_CTOR(nsTimerImpl); // XXXbsmedberg: shouldn't this be in Init()? mEventTarget = static_cast(NS_GetCurrentThread()); @@ -152,7 +151,6 @@ nsTimerImpl::nsTimerImpl(nsITimer* aTimer) : nsTimerImpl::~nsTimerImpl() { - MOZ_COUNT_DTOR(nsTimerImpl); ReleaseCallback(); }