Bug 1307961 - require consistent bloatview reporting for nsISupports classes; r=froydnj
☠☠ backed out by 8acf32ac3d00 ☠ ☠
authorAndrew McCreight <continuation@mozilla.com>
Mon, 12 Dec 2016 07:58:33 -0500
changeset 325675 aba6c73511a2cec62891f79e1ecd09f1b85dd175
parent 325674 16f0999bbcf379ac936fa6ce0b56027cff662f5d
child 325676 8acf32ac3d0061f812eeab81635fb83be1b14cca
push id31070
push usercbook@mozilla.com
push dateTue, 13 Dec 2016 15:04:28 +0000
treeherdermozilla-central@cb369201f52f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1307961
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1307961 - require consistent bloatview reporting for nsISupports classes; r=froydnj
dom/archivereader/ArchiveEvent.cpp
dom/archivereader/ArchiveRequest.cpp
dom/archivereader/ArchiveZipEvent.cpp
dom/archivereader/ArchiveZipFile.cpp
dom/archivereader/ArchiveZipFile.h
dom/asmjscache/AsmJSCache.cpp
dom/base/Crypto.cpp
dom/base/PostMessageEvent.cpp
dom/base/ShadowRoot.cpp
dom/base/nsContentPermissionHelper.cpp
dom/base/nsDocument.cpp
dom/base/nsGlobalWindow.cpp
dom/base/nsScriptNameSpaceManager.cpp
dom/canvas/ImageData.h
dom/html/HTMLContentElement.cpp
dom/ipc/ContentChild.cpp
dom/ipc/ProcessHangMonitor.cpp
dom/media/BufferMediaResource.h
dom/media/DOMMediaStream.h
dom/media/FileBlockCache.cpp
dom/media/MediaDecoder.cpp
dom/media/MediaRecorder.cpp
dom/media/MediaResource.h
dom/media/MediaShutdownManager.cpp
dom/media/MediaStreamTrack.h
dom/media/directshow/DirectShowDecoder.cpp
dom/media/mediasource/SourceBufferResource.cpp
dom/media/systemservices/CamerasParent.cpp
dom/media/webaudio/BufferDecoder.cpp
dom/media/webrtc/RTCIdentityProviderRegistrar.cpp
dom/presentation/ipc/PresentationBuilderParent.cpp
dom/presentation/ipc/PresentationParent.cpp
dom/xbl/XBLChildrenElement.h
dom/xul/templates/nsXULTemplateBuilder.cpp
embedding/browser/nsWebBrowserContentPolicy.cpp
embedding/components/printingui/ipc/PrintDataUtils.cpp
embedding/components/printingui/ipc/PrintProgressDialogChild.cpp
embedding/components/printingui/ipc/PrintProgressDialogParent.cpp
embedding/components/printingui/ipc/PrintingParent.cpp
gfx/layers/Layers.cpp
gfx/layers/client/CompositableChild.cpp
gfx/layers/client/CompositableClient.cpp
gfx/layers/ipc/CompositorThread.cpp
gfx/src/nsDeviceContext.cpp
gfx/thebes/gfxContext.cpp
gfx/thebes/gfxTextRun.cpp
gfx/vr/ipc/VRManagerChild.cpp
layout/forms/nsComboboxControlFrame.cpp
layout/mathml/nsMathMLChar.cpp
layout/printing/ipc/RemotePrintJobChild.cpp
layout/style/FontFace.cpp
layout/style/FontFaceSet.cpp
layout/style/StyleRule.cpp
layout/style/nsCSSValue.cpp
layout/style/nsCSSValue.h
layout/style/nsDOMCSSAttrDeclaration.cpp
layout/style/nsStyleContext.cpp
layout/style/nsStyleStruct.h
modules/libjar/nsZipArchive.cpp
netwerk/base/nsUDPSocket.cpp
netwerk/cache2/AppCacheStorage.cpp
netwerk/cache2/CacheEntry.cpp
netwerk/cache2/CacheFile.cpp
netwerk/cache2/CacheFileChunk.cpp
netwerk/cache2/CacheFileIOManager.cpp
netwerk/cache2/CacheFileInputStream.cpp
netwerk/cache2/CacheFileMetadata.cpp
netwerk/cache2/CacheFileOutputStream.cpp
netwerk/cache2/CacheIndex.cpp
netwerk/cache2/OldWrappers.cpp
netwerk/cache2/OldWrappers.h
netwerk/protocol/ftp/FTPChannelChild.cpp
netwerk/protocol/ftp/nsFtpConnectionThread.cpp
netwerk/protocol/websocket/IPCTransportProvider.cpp
parser/html/nsHtml5OwningUTF16Buffer.cpp
parser/html/nsHtml5StringParser.cpp
rdf/base/nsInMemoryDataSource.cpp
rdf/base/nsRDFXMLParser.cpp
rdf/base/nsRDFXMLSerializer.cpp
tools/profiler/gecko/ThreadResponsiveness.cpp
widget/PuppetWidget.cpp
widget/windows/WidgetTraceEvent.cpp
xpcom/base/nsTraceRefcnt.cpp
xpcom/glue/nsISupportsImpl.h
xpcom/reflect/xptcall/xptcprivate.h
xpcom/threads/SharedThreadPool.cpp
xpcom/threads/nsTimerImpl.cpp
--- a/dom/archivereader/ArchiveEvent.cpp
+++ b/dom/archivereader/ArchiveEvent.cpp
@@ -10,22 +10,20 @@
 #include "nsProxyRelease.h"
 
 USING_ARCHIVEREADER_NAMESPACE
 
 NS_IMPL_ISUPPORTS0(ArchiveItem)
 
 ArchiveItem::ArchiveItem()
 {
-  MOZ_COUNT_CTOR(ArchiveItem);
 }
 
 ArchiveItem::~ArchiveItem()
 {
-  MOZ_COUNT_DTOR(ArchiveItem);
 }
 
 
 nsCString
 ArchiveItem::GetType()
 {
   if (mType.IsEmpty()) {
     return NS_LITERAL_CSTRING("binary/octet-stream");
@@ -38,26 +36,23 @@ void
 ArchiveItem::SetType(const nsCString& aType)
 {
   mType = aType;
 }
 
 ArchiveReaderEvent::ArchiveReaderEvent(ArchiveReader* aArchiveReader)
 : mArchiveReader(aArchiveReader)
 {
-  MOZ_COUNT_CTOR(ArchiveReaderEvent);
 }
 
 ArchiveReaderEvent::~ArchiveReaderEvent()
 {
   if (!NS_IsMainThread()) {
     NS_ReleaseOnMainThread(mMimeService.forget());
   }
-
-  MOZ_COUNT_DTOR(ArchiveReaderEvent);
 }
 
 // From the filename to the mimetype:
 nsresult
 ArchiveReaderEvent::GetType(nsCString& aExt,
                             nsCString& aMimeType)
 {
   MOZ_ASSERT(NS_IsMainThread());
--- a/dom/archivereader/ArchiveRequest.cpp
+++ b/dom/archivereader/ArchiveRequest.cpp
@@ -21,23 +21,21 @@ USING_ARCHIVEREADER_NAMESPACE
 class ArchiveRequestEvent : public Runnable
 {
 public:
   NS_DECL_NSIRUNNABLE
 
   explicit ArchiveRequestEvent(ArchiveRequest* aRequest)
   : mRequest(aRequest)
   {
-    MOZ_COUNT_CTOR(ArchiveRequestEvent);
   }
 
 protected:
   ~ArchiveRequestEvent()
   {
-    MOZ_COUNT_DTOR(ArchiveRequestEvent);
   }
 
 private: //data
   RefPtr<ArchiveRequest> mRequest;
 };
 
 NS_IMETHODIMP
 ArchiveRequestEvent::Run()
@@ -51,26 +49,23 @@ ArchiveRequestEvent::Run()
 
 ArchiveRequest::ArchiveRequest(nsPIDOMWindowInner* aWindow,
                                ArchiveReader* aReader)
 : DOMRequest(aWindow),
   mArchiveReader(aReader)
 {
   MOZ_ASSERT(aReader);
 
-  MOZ_COUNT_CTOR(ArchiveRequest);
-
   /* An event to make this request asynchronous: */
   RefPtr<ArchiveRequestEvent> event = new ArchiveRequestEvent(this);
   NS_DispatchToCurrentThread(event);
 }
 
 ArchiveRequest::~ArchiveRequest()
 {
-  MOZ_COUNT_DTOR(ArchiveRequest);
 }
 
 nsresult
 ArchiveRequest::GetEventTargetParent(EventChainPreVisitor& aVisitor)
 {
   aVisitor.mCanHandle = true;
   aVisitor.mParentTarget = nullptr;
   return NS_OK;
--- a/dom/archivereader/ArchiveZipEvent.cpp
+++ b/dom/archivereader/ArchiveZipEvent.cpp
@@ -23,22 +23,20 @@ USING_ARCHIVEREADER_NAMESPACE
 
 ArchiveZipItem::ArchiveZipItem(const char* aFilename,
                                const ZipCentral& aCentralStruct,
                                const nsACString& aEncoding)
 : mFilename(aFilename),
   mCentralStruct(aCentralStruct),
   mEncoding(aEncoding)
 {
-  MOZ_COUNT_CTOR(ArchiveZipItem);
 }
 
 ArchiveZipItem::~ArchiveZipItem()
 {
-  MOZ_COUNT_DTOR(ArchiveZipItem);
 }
 
 nsresult
 ArchiveZipItem::ConvertFilename()
 {
   if (mEncoding.IsEmpty()) {
     return NS_ERROR_FAILURE;
   }
--- a/dom/archivereader/ArchiveZipFile.cpp
+++ b/dom/archivereader/ArchiveZipFile.cpp
@@ -31,33 +31,30 @@ public:
                      uint32_t aLength,
                      ZipCentral& aCentral)
   : mCentral(aCentral),
     mFilename(aFilename),
     mStart(aStart),
     mLength(aLength),
     mStatus(NotStarted)
   {
-    MOZ_COUNT_CTOR(ArchiveInputStream);
-
     // Reset the data:
     memset(&mData, 0, sizeof(mData));
 
     mData.parentSize = aParentSize;
     mData.inputStream = aInputStream;
   }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIINPUTSTREAM
   NS_DECL_NSISEEKABLESTREAM
 
 private:
   virtual ~ArchiveInputStream()
   {
-    MOZ_COUNT_DTOR(ArchiveInputStream);
     Close();
   }
 
   nsresult Init();
 
 private: // data
   ZipCentral mCentral;
   nsString mFilename;
--- a/dom/archivereader/ArchiveZipFile.h
+++ b/dom/archivereader/ArchiveZipFile.h
@@ -32,42 +32,39 @@ public:
                      ZipCentral& aCentral,
                      BlobImpl* aBlobImpl)
   : BlobImplBase(aName, aContentType, aLength),
     mCentral(aCentral),
     mBlobImpl(aBlobImpl),
     mFilename(aName)
   {
     MOZ_ASSERT(mBlobImpl);
-    MOZ_COUNT_CTOR(ArchiveZipBlobImpl);
   }
 
   ArchiveZipBlobImpl(const nsAString& aName,
                      const nsAString& aContentType,
                      uint64_t aStart,
                      uint64_t aLength,
                      ZipCentral& aCentral,
                      BlobImpl* aBlobImpl)
   : BlobImplBase(aContentType, aStart, aLength),
     mCentral(aCentral),
     mBlobImpl(aBlobImpl),
     mFilename(aName)
   {
     MOZ_ASSERT(mBlobImpl);
-    MOZ_COUNT_CTOR(ArchiveZipBlobImpl);
   }
 
   // Overrides:
   virtual void GetInternalStream(nsIInputStream** aInputStream,
                                  ErrorResult& aRv) override;
 
 protected:
   virtual ~ArchiveZipBlobImpl()
   {
-    MOZ_COUNT_DTOR(ArchiveZipBlobImpl);
   }
 
   virtual already_AddRefed<BlobImpl>
   CreateSlice(uint64_t aStart, uint64_t aLength, const nsAString& aContentType,
               mozilla::ErrorResult& aRv) override;
 
 private: // Data
   ZipCentral mCentral;
--- a/dom/asmjscache/AsmJSCache.cpp
+++ b/dom/asmjscache/AsmJSCache.cpp
@@ -355,26 +355,24 @@ public:
     mResult(JS::AsmJSCache_InternalError),
     mIsApp(false),
     mEnforcingQuota(true),
     mActorDestroyed(false),
     mOpened(false)
   {
     MOZ_ASSERT(XRE_IsParentProcess());
     AssertIsOnOwningThread();
-    MOZ_COUNT_CTOR(ParentRunnable);
   }
 
 private:
   ~ParentRunnable() override
   {
     MOZ_ASSERT(mState == eFinished);
     MOZ_ASSERT(!mDirectoryLock);
     MOZ_ASSERT(mActorDestroyed);
-    MOZ_COUNT_DTOR(ParentRunnable);
   }
 
   bool
   IsOnOwningThread() const
   {
     MOZ_ASSERT(mOwningThread);
 
     bool current;
@@ -1228,17 +1226,16 @@ public:
     mOpenMode(aOpenMode),
     mState(eInitial),
     mResult(JS::AsmJSCache_InternalError),
     mActorDestroyed(false),
     mWaiting(false),
     mOpened(false)
   {
     MOZ_ASSERT(!NS_IsMainThread());
-    MOZ_COUNT_CTOR(ChildRunnable);
   }
 
   JS::AsmJSCacheResult
   BlockUntilOpen(AutoClose* aCloser)
   {
     MOZ_ASSERT(!mWaiting, "Can only call BlockUntilOpen once");
     MOZ_ASSERT(!mOpened, "Can only call BlockUntilOpen once");
 
@@ -1277,17 +1274,16 @@ public:
 
 private:
   ~ChildRunnable() override
   {
     MOZ_ASSERT(!mWaiting, "Shouldn't be destroyed while thread is waiting");
     MOZ_ASSERT(!mOpened);
     MOZ_ASSERT(mState == eFinished);
     MOZ_ASSERT(mActorDestroyed);
-    MOZ_COUNT_DTOR(ChildRunnable);
   }
 
   // IPDL methods.
   mozilla::ipc::IPCResult
   RecvOnOpenMetadataForRead(const Metadata& aMetadata) override
   {
     MOZ_ASSERT(NS_IsMainThread());
     MOZ_ASSERT(mState == eOpening);
--- a/dom/base/Crypto.cpp
+++ b/dom/base/Crypto.cpp
@@ -27,22 +27,20 @@ NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(Crypto)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(Crypto)
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Crypto, mParent, mSubtle)
 
 Crypto::Crypto()
 {
-  MOZ_COUNT_CTOR(Crypto);
 }
 
 Crypto::~Crypto()
 {
-  MOZ_COUNT_DTOR(Crypto);
 }
 
 void
 Crypto::Init(nsIGlobalObject* aParent)
 {
   mParent = do_QueryInterface(aParent);
   MOZ_ASSERT(mParent);
 }
--- a/dom/base/PostMessageEvent.cpp
+++ b/dom/base/PostMessageEvent.cpp
@@ -39,22 +39,20 @@ PostMessageEvent::PostMessageEvent(nsGlo
                         StructuredCloneScope::SameProcessSameThread),
   mSource(aSource),
   mCallerOrigin(aCallerOrigin),
   mTargetWindow(aTargetWindow),
   mProvidedPrincipal(aProvidedPrincipal),
   mSourceDocument(aSourceDocument),
   mTrustedCaller(aTrustedCaller)
 {
-  MOZ_COUNT_CTOR(PostMessageEvent);
 }
 
 PostMessageEvent::~PostMessageEvent()
 {
-  MOZ_COUNT_DTOR(PostMessageEvent);
 }
 
 NS_IMETHODIMP
 PostMessageEvent::Run()
 {
   MOZ_ASSERT(mTargetWindow->IsOuterWindow(),
              "should have been passed an outer window!");
   MOZ_ASSERT(!mSource || mSource->IsOuterWindow(),
--- a/dom/base/ShadowRoot.cpp
+++ b/dom/base/ShadowRoot.cpp
@@ -734,22 +734,20 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_
 NS_INTERFACE_MAP_END_INHERITING(StyleSheetList)
 
 NS_IMPL_ADDREF_INHERITED(ShadowRootStyleSheetList, StyleSheetList)
 NS_IMPL_RELEASE_INHERITED(ShadowRootStyleSheetList, StyleSheetList)
 
 ShadowRootStyleSheetList::ShadowRootStyleSheetList(ShadowRoot* aShadowRoot)
   : mShadowRoot(aShadowRoot)
 {
-  MOZ_COUNT_CTOR(ShadowRootStyleSheetList);
 }
 
 ShadowRootStyleSheetList::~ShadowRootStyleSheetList()
 {
-  MOZ_COUNT_DTOR(ShadowRootStyleSheetList);
 }
 
 StyleSheet*
 ShadowRootStyleSheetList::IndexedGetter(uint32_t aIndex, bool& aFound)
 {
   aFound = aIndex < mShadowRoot->mProtoBinding->SheetCount();
   if (!aFound) {
     return nullptr;
--- a/dom/base/nsContentPermissionHelper.cpp
+++ b/dom/base/nsContentPermissionHelper.cpp
@@ -569,22 +569,20 @@ nsContentPermissionRequestProxy::nsConte
 
   if (mOnChangeCallback) {
     mOnChangeCallback->NotifyVisibility(aIsVisible);
   }
 }
 
 nsContentPermissionRequestProxy::nsContentPermissionRequestProxy()
 {
-  MOZ_COUNT_CTOR(nsContentPermissionRequestProxy);
 }
 
 nsContentPermissionRequestProxy::~nsContentPermissionRequestProxy()
 {
-  MOZ_COUNT_DTOR(nsContentPermissionRequestProxy);
 }
 
 nsresult
 nsContentPermissionRequestProxy::Init(const nsTArray<PermissionRequest>& requests,
                                       ContentPermissionRequestParent* parent)
 {
   NS_ASSERTION(parent, "null parent");
   mParent = parent;
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -1213,23 +1213,21 @@ void nsIDocument::SelectorCache::CacheLi
 }
 
 class nsIDocument::SelectorCacheKeyDeleter final : public Runnable
 {
 public:
   explicit SelectorCacheKeyDeleter(SelectorCacheKey* aToDelete)
     : mSelector(aToDelete)
   {
-    MOZ_COUNT_CTOR(SelectorCacheKeyDeleter);
   }
 
 protected:
   ~SelectorCacheKeyDeleter()
   {
-    MOZ_COUNT_DTOR(SelectorCacheKeyDeleter);
   }
 
 public:
   NS_IMETHOD Run() override
   {
     return NS_OK;
   }
 
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -6407,25 +6407,23 @@ public:
     : mWindow(aWindow)
     , mWidget(aWidget)
     , mScreen(aScreen)
     , mTransitionData(aTransitionData)
     , mDuration(aDuration)
     , mStage(eBeforeToggle)
     , mFullscreen(aFullscreen)
   {
-    MOZ_COUNT_CTOR(FullscreenTransitionTask);
   }
 
   NS_IMETHOD Run() override;
 
 private:
   ~FullscreenTransitionTask() override
   {
-    MOZ_COUNT_DTOR(FullscreenTransitionTask);
   }
 
   /**
    * The flow of fullscreen transition:
    *
    *         parent process         |         child process
    * ----------------------------------------------------------------
    *
--- a/dom/base/nsScriptNameSpaceManager.cpp
+++ b/dom/base/nsScriptNameSpaceManager.cpp
@@ -97,23 +97,21 @@ static const PLDHashTableOps hash_table_
 };
 
 #define GLOBALNAME_HASHTABLE_INITIAL_LENGTH          32
 
 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 *
 nsScriptNameSpaceManager::AddToHash(const char *aKey,
                                     const char16_t **aClassName)
 {
   NS_ConvertASCIItoUTF16 key(aKey);
   auto entry = static_cast<GlobalNameMapEntry*>(mGlobalNames.Add(&key, fallible));
--- a/dom/canvas/ImageData.h
+++ b/dom/canvas/ImageData.h
@@ -20,27 +20,25 @@
 
 namespace mozilla {
 namespace dom {
 
 class ImageData final : public nsISupports
 {
   ~ImageData()
   {
-    MOZ_COUNT_DTOR(ImageData);
     DropData();
   }
 
 public:
   ImageData(uint32_t aWidth, uint32_t aHeight, JSObject& aData)
     : mWidth(aWidth)
     , mHeight(aHeight)
     , mData(&aData)
   {
-    MOZ_COUNT_CTOR(ImageData);
     HoldData();
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ImageData)
 
   static already_AddRefed<ImageData>
     Constructor(const GlobalObject& aGlobal,
--- a/dom/html/HTMLContentElement.cpp
+++ b/dom/html/HTMLContentElement.cpp
@@ -328,18 +328,16 @@ NS_INTERFACE_TABLE_HEAD(DistributedConte
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DistributedContentList)
 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.
       nsINode* contentNode = aHostElement;
       for (nsIContent* content = contentNode->GetFirstChild();
            content;
            content = content->GetNextSibling()) {
         mDistributedNodes.AppendElement(content);
@@ -347,17 +345,16 @@ DistributedContentList::DistributedConte
     } else {
       mDistributedNodes.AppendElements(aHostElement->MatchedNodes());
     }
   }
 }
 
 DistributedContentList::~DistributedContentList()
 {
-  MOZ_COUNT_DTOR(DistributedContentList);
 }
 
 nsIContent*
 DistributedContentList::Item(uint32_t aIndex)
 {
   return mDistributedNodes.SafeElementAt(aIndex);
 }
 
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -240,25 +240,23 @@ private:
 };
 
 NS_IMPL_ISUPPORTS(MemoryReportRequestChild, nsIRunnable)
 
 MemoryReportRequestChild::MemoryReportRequestChild(
   bool aAnonymize, const MaybeFileDesc& aDMDFile)
 : mAnonymize(aAnonymize)
 {
-  MOZ_COUNT_CTOR(MemoryReportRequestChild);
   if (aDMDFile.type() == MaybeFileDesc::TFileDescriptor) {
     mDMDFile = aDMDFile.get_FileDescriptor();
   }
 }
 
 MemoryReportRequestChild::~MemoryReportRequestChild()
 {
-  MOZ_COUNT_DTOR(MemoryReportRequestChild);
 }
 
 // IPC sender for remote GC/CC logging.
 class CycleCollectWithLogsChild final
   : public PCycleCollectWithLogsChild
   , public nsICycleCollectorLogSink
 {
 public:
--- a/dom/ipc/ProcessHangMonitor.cpp
+++ b/dom/ipc/ProcessHangMonitor.cpp
@@ -1074,36 +1074,32 @@ InterruptCallback(JSContext* cx)
 
 ProcessHangMonitor* ProcessHangMonitor::sInstance;
 
 ProcessHangMonitor::ProcessHangMonitor()
  : mCPOWTimeout(false)
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
 
-  MOZ_COUNT_CTOR(ProcessHangMonitor);
-
   if (XRE_IsContentProcess()) {
     nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
     obs->AddObserver(this, "xpcom-shutdown", false);
   }
 
   mThread = new base::Thread("ProcessHangMonitor");
   if (!mThread->Start()) {
     delete mThread;
     mThread = nullptr;
   }
 }
 
 ProcessHangMonitor::~ProcessHangMonitor()
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
 
-  MOZ_COUNT_DTOR(ProcessHangMonitor);
-
   MOZ_ASSERT(sInstance == this);
   sInstance = nullptr;
 
   delete mThread;
 }
 
 ProcessHangMonitor*
 ProcessHangMonitor::GetOrCreate()
--- a/dom/media/BufferMediaResource.h
+++ b/dom/media/BufferMediaResource.h
@@ -25,23 +25,21 @@ public:
                       nsIPrincipal* aPrincipal,
                       const nsACString& aContentType) :
     mBuffer(aBuffer),
     mLength(aLength),
     mOffset(0),
     mPrincipal(aPrincipal),
     mContentType(aContentType)
   {
-    MOZ_COUNT_CTOR(BufferMediaResource);
   }
 
 protected:
   virtual ~BufferMediaResource()
   {
-    MOZ_COUNT_DTOR(BufferMediaResource);
   }
 
 private:
   nsresult Close() override { return NS_OK; }
   void Suspend(bool aCloseImmediately) override {}
   void Resume() override {}
   // Get the current principal for the channel
   already_AddRefed<nsIPrincipal> GetCurrentPrincipal() override
--- a/dom/media/DOMMediaStream.h
+++ b/dom/media/DOMMediaStream.h
@@ -79,26 +79,24 @@ public:
 class MediaStreamTrackSourceGetter : public nsISupports
 {
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(MediaStreamTrackSourceGetter)
 
 public:
   MediaStreamTrackSourceGetter()
   {
-    MOZ_COUNT_CTOR(MediaStreamTrackSourceGetter);
   }
 
   virtual already_AddRefed<dom::MediaStreamTrackSource>
   GetMediaStreamTrackSource(TrackID aInputTrackID) = 0;
 
 protected:
   virtual ~MediaStreamTrackSourceGetter()
   {
-    MOZ_COUNT_DTOR(MediaStreamTrackSourceGetter);
   }
 };
 
 /**
  * DOM wrapper for MediaStreams.
  *
  * To account for track operations such as clone(), addTrack() and
  * removeTrack(), a DOMMediaStream wraps three internal (and chained)
--- a/dom/media/FileBlockCache.cpp
+++ b/dom/media/FileBlockCache.cpp
@@ -33,17 +33,16 @@ nsresult FileBlockCache::Open(PRFileDesc
 FileBlockCache::FileBlockCache()
   : mFileMonitor("MediaCache.Writer.IO.Monitor"),
     mFD(nullptr),
     mFDCurrentPos(0),
     mDataMonitor("MediaCache.Writer.Data.Monitor"),
     mIsWriteScheduled(false),
     mIsOpen(false)
 {
-  MOZ_COUNT_CTOR(FileBlockCache);
 }
 
 FileBlockCache::~FileBlockCache()
 {
   NS_ASSERTION(!mIsOpen, "Should Close() FileBlockCache before destroying");
   {
     // Note, mThread will be shutdown by the time this runs, so we won't
     // block while taking mFileMonitor.
@@ -52,17 +51,16 @@ FileBlockCache::~FileBlockCache()
       PRStatus prrc;
       prrc = PR_Close(mFD);
       if (prrc != PR_SUCCESS) {
         NS_WARNING("PR_Close() failed.");
       }
       mFD = nullptr;
     }
   }
-  MOZ_COUNT_DTOR(FileBlockCache);
 }
 
 
 void FileBlockCache::Close()
 {
   NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
   MonitorAutoLock mon(mDataMonitor);
 
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -412,17 +412,16 @@ MediaDecoder::MediaDecoder(MediaDecoderO
   , INIT_CANONICAL(mSameOriginMedia, false)
   , INIT_CANONICAL(mMediaPrincipalHandle, PRINCIPAL_HANDLE_NONE)
   , INIT_CANONICAL(mPlaybackBytesPerSecond, 0.0)
   , INIT_CANONICAL(mPlaybackRateReliable, true)
   , INIT_CANONICAL(mDecoderPosition, 0)
   , INIT_CANONICAL(mIsVisible, !aOwner->IsHidden())
   , mTelemetryReported(false)
 {
-  MOZ_COUNT_CTOR(MediaDecoder);
   MOZ_ASSERT(NS_IsMainThread());
   MediaMemoryTracker::AddMediaDecoder(this);
 
   mAudioChannel = AudioChannelService::GetDefaultAudioChannel();
   mResourceCallback->Connect(this);
 
   //
   // Initialize watchers.
@@ -511,17 +510,16 @@ MediaDecoder::Shutdown()
 
 MediaDecoder::~MediaDecoder()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_DIAGNOSTIC_ASSERT(IsShutdown());
   mResourceCallback->Disconnect();
   MediaMemoryTracker::RemoveMediaDecoder(this);
   UnpinForSeek();
-  MOZ_COUNT_DTOR(MediaDecoder);
 }
 
 void
 MediaDecoder::OnPlaybackEvent(MediaEventType aEvent)
 {
   switch (aEvent) {
     case MediaEventType::PlaybackStarted:
       mPlaybackStatistics->Start();
--- a/dom/media/MediaRecorder.cpp
+++ b/dom/media/MediaRecorder.cpp
@@ -419,17 +419,16 @@ public:
     , mTimeSlice(aTimeSlice)
     , mStopIssued(false)
     , mIsStartEventFired(false)
     , mIsRegisterProfiler(false)
     , mNeedSessionEndTask(true)
     , 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);
     mEncodedBufferCache = new EncodedBufferCache(maxMem);
     mLastBlobTimeStamp = TimeStamp::Now();
   }
 
   void PrincipalChanged(MediaStreamTrack* aTrack) override
@@ -584,17 +583,16 @@ public:
     return (mEncoder ?  mEncoder->SizeOfExcludingThis(aMallocSizeOf) : 0);
   }
 
 
 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) {
       mReadThread->Shutdown();
       mReadThread = nullptr;
       // Inside the if() so that if we delete after xpcom-shutdown's Observe(), we
       // won't try to remove it after the observer service is shut down.
       nsContentUtils::UnregisterShutdownObserver(this);
--- a/dom/media/MediaResource.h
+++ b/dom/media/MediaResource.h
@@ -405,23 +405,21 @@ protected:
                     nsIURI* aURI,
                     const nsACString& aContentType) :
     mCallback(aCallback),
     mChannel(aChannel),
     mURI(aURI),
     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
   {
     return mContentType;
   }
 
   // Set the request's load flags to aFlags.  If the request is part of a
--- a/dom/media/MediaShutdownManager.cpp
+++ b/dom/media/MediaShutdownManager.cpp
@@ -18,23 +18,21 @@ extern LazyLogModule gMediaDecoderLog;
 
 NS_IMPL_ISUPPORTS(MediaShutdownManager, nsIAsyncShutdownBlocker)
 
 MediaShutdownManager::MediaShutdownManager()
   : mIsObservingShutdown(false)
   , 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
 // may interfere with our shutdown listener.
 StaticRefPtr<MediaShutdownManager> MediaShutdownManager::sInstance;
 
 MediaShutdownManager&
 MediaShutdownManager::Instance()
--- a/dom/media/MediaStreamTrack.h
+++ b/dom/media/MediaStreamTrack.h
@@ -61,17 +61,16 @@ public:
   };
 
   MediaStreamTrackSource(nsIPrincipal* aPrincipal,
                          const nsString& aLabel)
     : mPrincipal(aPrincipal),
       mLabel(aLabel),
       mStopped(false)
   {
-    MOZ_COUNT_CTOR(MediaStreamTrackSource);
   }
 
   /**
    * Use to clean up any resources that have to be cleaned before the
    * destructor is called. It is often too late in the destructor because
    * of garbage collection having removed the members already.
    */
   virtual void Destroy() {}
@@ -161,17 +160,16 @@ public:
       Stop();
       mStopped = true;
     }
   }
 
 protected:
   virtual ~MediaStreamTrackSource()
   {
-    MOZ_COUNT_DTOR(MediaStreamTrackSource);
   }
 
   /**
    * Called by a sub class when the principal has changed.
    * Notifies all sinks.
    */
   void PrincipalChanged()
   {
--- a/dom/media/directshow/DirectShowDecoder.cpp
+++ b/dom/media/directshow/DirectShowDecoder.cpp
@@ -48,18 +48,14 @@ DirectShowDecoder::IsEnabled()
 {
   return CanDecodeMP3UsingDirectShow() &&
          Preferences::GetBool("media.directshow.enabled");
 }
 
 DirectShowDecoder::DirectShowDecoder(MediaDecoderOwner* aOwner)
   : MediaDecoder(aOwner)
 {
-  MOZ_COUNT_CTOR(DirectShowDecoder);
 }
 
-DirectShowDecoder::~DirectShowDecoder()
-{
-  MOZ_COUNT_DTOR(DirectShowDecoder);
-}
+DirectShowDecoder::~DirectShowDecoder() = default;
 
 } // namespace mozilla
 
--- a/dom/media/mediasource/SourceBufferResource.cpp
+++ b/dom/media/mediasource/SourceBufferResource.cpp
@@ -161,25 +161,23 @@ SourceBufferResource::Ended()
   ReentrantMonitorAutoEnter mon(mMonitor);
   mEnded = true;
   mon.NotifyAll();
 }
 
 SourceBufferResource::~SourceBufferResource()
 {
   SBR_DEBUG("");
-  MOZ_COUNT_DTOR(SourceBufferResource);
 }
 
 SourceBufferResource::SourceBufferResource(const nsACString& aType)
   : mType(aType)
   , mMonitor("mozilla::SourceBufferResource::mMonitor")
   , mOffset(0)
   , mClosed(false)
   , mEnded(false)
 {
   SBR_DEBUG("");
-  MOZ_COUNT_CTOR(SourceBufferResource);
 }
 
 #undef SBR_DEBUG
 #undef SBR_DEBUGV
 } // namespace mozilla
--- a/dom/media/systemservices/CamerasParent.cpp
+++ b/dom/media/systemservices/CamerasParent.cpp
@@ -1070,25 +1070,22 @@ CamerasParent::CamerasParent()
 #endif
       if (!self->mVideoCaptureThread->StartWithOptions(options)) {
         MOZ_CRASH();
       }
       self->mThreadMonitor.NotifyAll();
       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.
   // That runnable takes a ref to us, so it must have finished
   // by the time we get here.
   for (int i = 0; i < CaptureEngine::MaxEngine; i++) {
     MOZ_ASSERT(!mEngines[i].mEngine);
   }
--- a/dom/media/webaudio/BufferDecoder.cpp
+++ b/dom/media/webaudio/BufferDecoder.cpp
@@ -14,23 +14,21 @@ namespace mozilla {
 
 NS_IMPL_ISUPPORTS0(BufferDecoder)
 
 BufferDecoder::BufferDecoder(MediaResource* aResource, GMPCrashHelper* aCrashHelper)
   : mResource(aResource)
   , 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
 BufferDecoder::BeginDecoding(TaskQueue* aTaskQueueIdentity)
 {
   MOZ_ASSERT(!mTaskQueueIdentity && aTaskQueueIdentity);
   mTaskQueueIdentity = aTaskQueueIdentity;
 }
--- a/dom/media/webrtc/RTCIdentityProviderRegistrar.cpp
+++ b/dom/media/webrtc/RTCIdentityProviderRegistrar.cpp
@@ -24,22 +24,20 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(RT
                                       mValidateAssertionCallback)
 
 RTCIdentityProviderRegistrar::RTCIdentityProviderRegistrar(
     nsIGlobalObject* aGlobal)
     : mGlobal(aGlobal)
     , mGenerateAssertionCallback(nullptr)
     , mValidateAssertionCallback(nullptr)
 {
-  MOZ_COUNT_CTOR(RTCIdentityProviderRegistrar);
 }
 
 RTCIdentityProviderRegistrar::~RTCIdentityProviderRegistrar()
 {
-  MOZ_COUNT_DTOR(RTCIdentityProviderRegistrar);
 }
 
 nsIGlobalObject*
 RTCIdentityProviderRegistrar::GetParentObject() const
 {
   return mGlobal;
 }
 
--- a/dom/presentation/ipc/PresentationBuilderParent.cpp
+++ b/dom/presentation/ipc/PresentationBuilderParent.cpp
@@ -105,23 +105,20 @@ PresentationSessionTransportIPC::Close(n
 
 NS_IMPL_ISUPPORTS(PresentationBuilderParent,
                   nsIPresentationSessionTransportBuilder,
                   nsIPresentationDataChannelSessionTransportBuilder)
 
 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));
   }
 }
 
 NS_IMETHODIMP
 PresentationBuilderParent::BuildDataChannelTransport(
                       uint8_t aRole,
--- a/dom/presentation/ipc/PresentationParent.cpp
+++ b/dom/presentation/ipc/PresentationParent.cpp
@@ -88,22 +88,20 @@ PresentationTransportBuilderConstructorI
 
 NS_IMPL_ISUPPORTS(PresentationParent,
                   nsIPresentationAvailabilityListener,
                   nsIPresentationSessionListener,
                   nsIPresentationRespondingListener)
 
 PresentationParent::PresentationParent()
 {
-  MOZ_COUNT_CTOR(PresentationParent);
 }
 
 /* virtual */ PresentationParent::~PresentationParent()
 {
-  MOZ_COUNT_DTOR(PresentationParent);
 }
 
 bool
 PresentationParent::Init(ContentParentId aContentParentId)
 {
   MOZ_ASSERT(!mService);
   mService = do_GetService(PRESENTATION_SERVICE_CONTRACTID);
   mChildId = aContentParentId;
@@ -383,22 +381,20 @@ PresentationParent::RecvNotifyTransportC
 
 NS_IMPL_ISUPPORTS(PresentationRequestParent, nsIPresentationServiceCallback)
 
 PresentationRequestParent::PresentationRequestParent(nsIPresentationService* aService,
                                                      ContentParentId aContentParentId)
   : mService(aService)
   , mChildId(aContentParentId)
 {
-  MOZ_COUNT_CTOR(PresentationRequestParent);
 }
 
 PresentationRequestParent::~PresentationRequestParent()
 {
-  MOZ_COUNT_DTOR(PresentationRequestParent);
 }
 
 void
 PresentationRequestParent::ActorDestroy(ActorDestroyReason aWhy)
 {
   mActorDestroyed = true;
   mService = nullptr;
 }
--- a/dom/xbl/XBLChildrenElement.h
+++ b/dom/xbl/XBLChildrenElement.h
@@ -156,17 +156,16 @@ private:
 } // namespace mozilla
 
 class nsAnonymousContentList : public nsINodeList
 {
 public:
   explicit nsAnonymousContentList(nsIContent* aParent)
     : mParent(aParent)
   {
-    MOZ_COUNT_CTOR(nsAnonymousContentList);
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsAnonymousContentList)
   // nsIDOMNodeList interface
   NS_DECL_NSIDOMNODELIST
 
   // nsINodeList interface
@@ -178,15 +177,14 @@ public:
 
   bool IsListFor(nsIContent* aContent) {
     return mParent == aContent;
   }
 
 private:
   virtual ~nsAnonymousContentList()
   {
-    MOZ_COUNT_DTOR(nsAnonymousContentList);
   }
 
   nsCOMPtr<nsIContent> mParent;
 };
 
 #endif // nsXBLChildrenElement_h___
--- a/dom/xul/templates/nsXULTemplateBuilder.cpp
+++ b/dom/xul/templates/nsXULTemplateBuilder.cpp
@@ -97,17 +97,16 @@ LazyLogModule gXULTemplateLog("nsXULTemp
 //
 
 nsXULTemplateBuilder::nsXULTemplateBuilder(void)
     : mQueriesCompiled(false),
       mFlags(0),
       mTop(nullptr),
       mObservedDocument(nullptr)
 {
-    MOZ_COUNT_CTOR(nsXULTemplateBuilder);
 }
 
 void
 nsXULTemplateBuilder::DestroyMatchMap()
 {
     for (auto iter = mMatchMap.Iter(); !iter.Done(); iter.Next()) {
         nsTemplateMatch*& match = iter.Data();
         // delete all the matches in the list
@@ -127,18 +126,16 @@ nsXULTemplateBuilder::~nsXULTemplateBuil
 
     if (--gRefCnt == 0) {
         NS_IF_RELEASE(gRDFService);
         NS_IF_RELEASE(gRDFContainerUtils);
         NS_IF_RELEASE(gSystemPrincipal);
         NS_IF_RELEASE(gScriptSecurityManager);
         NS_IF_RELEASE(gObserverService);
     }
-
-    MOZ_COUNT_DTOR(nsXULTemplateBuilder);
 }
 
 
 nsresult
 nsXULTemplateBuilder::InitGlobals()
 {
     nsresult rv;
 
--- a/embedding/browser/nsWebBrowserContentPolicy.cpp
+++ b/embedding/browser/nsWebBrowserContentPolicy.cpp
@@ -7,22 +7,20 @@
 #include "nsWebBrowserContentPolicy.h"
 #include "nsIDocShell.h"
 #include "nsCOMPtr.h"
 #include "nsContentPolicyUtils.h"
 #include "nsIContentViewer.h"
 
 nsWebBrowserContentPolicy::nsWebBrowserContentPolicy()
 {
-  MOZ_COUNT_CTOR(nsWebBrowserContentPolicy);
 }
 
 nsWebBrowserContentPolicy::~nsWebBrowserContentPolicy()
 {
-  MOZ_COUNT_DTOR(nsWebBrowserContentPolicy);
 }
 
 NS_IMPL_ISUPPORTS(nsWebBrowserContentPolicy, nsIContentPolicy)
 
 NS_IMETHODIMP
 nsWebBrowserContentPolicy::ShouldLoad(uint32_t aContentType,
                                       nsIURI* aContentLocation,
                                       nsIURI* aRequestingLocation,
--- a/embedding/components/printingui/ipc/PrintDataUtils.cpp
+++ b/embedding/components/printingui/ipc/PrintDataUtils.cpp
@@ -19,22 +19,20 @@ namespace embedding {
  * settings dialogs that need an nsIWebBrowserPrint to interrogate.
  */
 
 NS_IMPL_ISUPPORTS(MockWebBrowserPrint, nsIWebBrowserPrint);
 
 MockWebBrowserPrint::MockWebBrowserPrint(const PrintData &aData)
   : mData(aData)
 {
-  MOZ_COUNT_CTOR(MockWebBrowserPrint);
 }
 
 MockWebBrowserPrint::~MockWebBrowserPrint()
 {
-  MOZ_COUNT_DTOR(MockWebBrowserPrint);
 }
 
 NS_IMETHODIMP
 MockWebBrowserPrint::GetGlobalPrintSettings(nsIPrintSettings **aGlobalPrintSettings)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
--- a/embedding/components/printingui/ipc/PrintProgressDialogChild.cpp
+++ b/embedding/components/printingui/ipc/PrintProgressDialogChild.cpp
@@ -17,27 +17,25 @@ namespace embedding {
 NS_IMPL_ISUPPORTS(PrintProgressDialogChild,
                   nsIWebProgressListener,
                   nsIPrintProgressParams)
 
 PrintProgressDialogChild::PrintProgressDialogChild(
   nsIObserver* aOpenObserver) :
   mOpenObserver(aOpenObserver)
 {
-  MOZ_COUNT_CTOR(PrintProgressDialogChild);
 }
 
 PrintProgressDialogChild::~PrintProgressDialogChild()
 {
   // When the printing engine stops supplying information about printing
   // progress, it'll drop references to us and destroy us. We need to signal
   // 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
 PrintProgressDialogChild::RecvDialogOpened()
 {
   // nsPrintEngine's observer, which we're reporting to here, doesn't care
   // what gets passed as the subject, topic or data, so we'll just send
   // nullptrs.
--- a/embedding/components/printingui/ipc/PrintProgressDialogParent.cpp
+++ b/embedding/components/printingui/ipc/PrintProgressDialogParent.cpp
@@ -12,22 +12,20 @@ using mozilla::Unused;
 namespace mozilla {
 namespace embedding {
 
 NS_IMPL_ISUPPORTS(PrintProgressDialogParent, nsIObserver)
 
 PrintProgressDialogParent::PrintProgressDialogParent() :
   mActive(true)
 {
-  MOZ_COUNT_CTOR(PrintProgressDialogParent);
 }
 
 PrintProgressDialogParent::~PrintProgressDialogParent()
 {
-  MOZ_COUNT_DTOR(PrintProgressDialogParent);
 }
 
 void
 PrintProgressDialogParent::SetWebProgressListener(nsIWebProgressListener* aListener)
 {
   mWebProgressListener = aListener;
 }
 
--- a/embedding/components/printingui/ipc/PrintingParent.cpp
+++ b/embedding/components/printingui/ipc/PrintingParent.cpp
@@ -303,23 +303,20 @@ PrintingParent::SerializeAndEnsureRemote
     remotePrintJob->RegisterListener(aListener);
   }
 
   return NS_OK;
 }
 
 PrintingParent::PrintingParent()
 {
-  MOZ_COUNT_CTOR(PrintingParent);
-
   mPrintSettingsSvc =
     do_GetService("@mozilla.org/gfx/printsettings-service;1");
   MOZ_ASSERT(mPrintSettingsSvc);
 }
 
 PrintingParent::~PrintingParent()
 {
-  MOZ_COUNT_DTOR(PrintingParent);
 }
 
 } // namespace embedding
 } // namespace mozilla
 
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -209,22 +209,20 @@ Layer::Layer(LayerManager* aManager, voi
   mScrollbarDirection(ScrollDirection::NONE),
   mScrollbarThumbRatio(0.0f),
   mIsScrollbarContainer(false),
 #ifdef DEBUG
   mDebugColorIndex(0),
 #endif
   mAnimationGeneration(0)
 {
-  MOZ_COUNT_CTOR(Layer);
 }
 
 Layer::~Layer()
 {
-  MOZ_COUNT_DTOR(Layer);
 }
 
 Animation*
 Layer::AddAnimation()
 {
   MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) AddAnimation", this));
 
   MOZ_ASSERT(!mPendingAnimations, "should have called ClearAnimations first");
@@ -1117,23 +1115,21 @@ ContainerLayer::ContainerLayer(LayerMana
     mPresShellResolution(1.0f),
     mScaleToResolution(false),
     mUseIntermediateSurface(false),
     mSupportsComponentAlphaChildren(false),
     mMayHaveReadbackChild(false),
     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
 ContainerLayer::InsertAfter(Layer* aChild, Layer* aAfter)
 {
   if(aChild->Manager() != Manager()) {
     NS_ERROR("Child has wrong manager");
     return false;
--- a/gfx/layers/client/CompositableChild.cpp
+++ b/gfx/layers/client/CompositableChild.cpp
@@ -23,22 +23,20 @@ CompositableChild::DestroyActor(PComposi
   static_cast<CompositableChild*>(aChild)->Release();
 }
 
 CompositableChild::CompositableChild()
  : mCompositableClient(nullptr),
    mAsyncID(0),
    mCanSend(true)
 {
-  MOZ_COUNT_CTOR(CompositableChild);
 }
 
 CompositableChild::~CompositableChild()
 {
-  MOZ_COUNT_DTOR(CompositableChild);
 }
 
 bool
 CompositableChild::IsConnected() const
 {
   return mCompositableClient && mCanSend;
 }
 
--- a/gfx/layers/client/CompositableClient.cpp
+++ b/gfx/layers/client/CompositableClient.cpp
@@ -52,22 +52,20 @@ CompositableClient::FromIPDLActor(PCompo
   return client;
 }
 
 CompositableClient::CompositableClient(CompositableForwarder* aForwarder,
                                        TextureFlags aTextureFlags)
 : mForwarder(aForwarder)
 , mTextureFlags(aTextureFlags)
 {
-  MOZ_COUNT_CTOR(CompositableClient);
 }
 
 CompositableClient::~CompositableClient()
 {
-  MOZ_COUNT_DTOR(CompositableClient);
   Destroy();
 }
 
 LayersBackend
 CompositableClient::GetCompositorBackendType() const
 {
   return mForwarder->GetCompositorBackendType();
 }
--- a/gfx/layers/ipc/CompositorThread.cpp
+++ b/gfx/layers/ipc/CompositorThread.cpp
@@ -48,25 +48,22 @@ CompositorThreadHolder::GetSingleton()
 {
   return sCompositorThreadHolder;
 }
 
 CompositorThreadHolder::CompositorThreadHolder()
   : mCompositorThread(CreateCompositorThread())
 {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_COUNT_CTOR(CompositorThreadHolder);
 }
 
 CompositorThreadHolder::~CompositorThreadHolder()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  MOZ_COUNT_DTOR(CompositorThreadHolder);
-
   DestroyCompositorThread(mCompositorThread);
 }
 
 /* static */ void
 CompositorThreadHolder::DestroyCompositorThread(base::Thread* aCompositorThread)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
--- a/gfx/src/nsDeviceContext.cpp
+++ b/gfx/src/nsDeviceContext.cpp
@@ -41,33 +41,33 @@
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 using mozilla::services::GetObserverService;
 
 class nsFontCache final : public nsIObserver
 {
 public:
-    nsFontCache()   { MOZ_COUNT_CTOR(nsFontCache); }
+    nsFontCache() {}
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIOBSERVER
 
     void Init(nsDeviceContext* aContext);
     void Destroy();
 
     already_AddRefed<nsFontMetrics> GetMetricsFor(
         const nsFont& aFont, const nsFontMetrics::Params& aParams);
 
     void FontMetricsDeleted(const nsFontMetrics* aFontMetrics);
     void Compact();
     void Flush();
 
 protected:
-    ~nsFontCache()  { MOZ_COUNT_DTOR(nsFontCache); }
+    ~nsFontCache() {}
 
     nsDeviceContext*          mContext; // owner
     nsCOMPtr<nsIAtom>         mLocaleLanguage;
     nsTArray<nsFontMetrics*>  mFontMetrics;
 };
 
 NS_IMPL_ISUPPORTS(nsFontCache, nsIObserver)
 
--- a/gfx/thebes/gfxContext.cpp
+++ b/gfx/thebes/gfxContext.cpp
@@ -71,18 +71,16 @@ gfxContext::gfxContext(DrawTarget *aTarg
   : mPathIsRect(false)
   , mTransformChanged(false)
   , mDT(aTarget)
 {
   if (!aTarget) {
     gfxCriticalError() << "Don't create a gfxContext without a DrawTarget";
   }
 
-  MOZ_COUNT_CTOR(gfxContext);
-
   mStateStack.SetLength(1);
   CurrentState().drawTarget = mDT;
   CurrentState().deviceOffset = aDeviceOffset;
   mDT->SetTransform(GetDTTransform());
 }
 
 /* static */ already_AddRefed<gfxContext>
 gfxContext::CreateOrNull(DrawTarget* aTarget,
@@ -114,17 +112,16 @@ gfxContext::CreatePreservingTransformOrN
 gfxContext::~gfxContext()
 {
   for (int i = mStateStack.Length() - 1; i >= 0; i--) {
     for (unsigned int c = 0; c < mStateStack[i].pushedClips.Length(); c++) {
       mStateStack[i].drawTarget->PopClip();
     }
   }
   mDT->Flush();
-  MOZ_COUNT_DTOR(gfxContext);
 }
 
 void
 gfxContext::Save()
 {
   CurrentState().transform = mTransform;
   mStateStack.AppendElement(AzureState(CurrentState()));
   CurrentState().pushedClips.Clear();
--- a/gfx/thebes/gfxTextRun.cpp
+++ b/gfx/thebes/gfxTextRun.cpp
@@ -149,17 +149,16 @@ gfxTextRun::gfxTextRun(const gfxTextRunF
                        uint32_t aLength, gfxFontGroup *aFontGroup, uint32_t aFlags)
     : gfxShapedText(aLength, aFlags, aParams->mAppUnitsPerDevUnit)
     , mUserData(aParams->mUserData)
     , mFontGroup(aFontGroup)
     , mReleasedFontGroup(false)
     , mShapingState(eShapingState_Normal)
 {
     NS_ASSERTION(mAppUnitsPerDevUnit > 0, "Invalid app unit scale");
-    MOZ_COUNT_CTOR(gfxTextRun);
     NS_ADDREF(mFontGroup);
 
 #ifndef RELEASE_OR_BETA
     gfxTextPerfMetrics *tp = aFontGroup->GetTextPerfMetrics();
     if (tp) {
         tp->current.textrunConst++;
     }
 #endif
@@ -194,18 +193,16 @@ gfxTextRun::~gfxTextRun()
 #ifndef RELEASE_OR_BETA
         gfxTextPerfMetrics *tp = mFontGroup->GetTextPerfMetrics();
         if (tp) {
             tp->current.textrunDestr++;
         }
 #endif
         NS_RELEASE(mFontGroup);
     }
-
-    MOZ_COUNT_DTOR(gfxTextRun);
 }
 
 void
 gfxTextRun::ReleaseFontGroup()
 {
     NS_ASSERTION(!mReleasedFontGroup, "doubly released!");
     NS_RELEASE(mFontGroup);
     mReleasedFontGroup = true;
--- a/gfx/vr/ipc/VRManagerChild.cpp
+++ b/gfx/vr/ipc/VRManagerChild.cpp
@@ -42,26 +42,24 @@ void ReleaseVRManagerParentSingleton() {
 VRManagerChild::VRManagerChild()
   : TextureForwarder()
   , mDisplaysInitialized(false)
   , mInputFrameID(-1)
   , mMessageLoop(MessageLoop::current())
   , mFrameRequestCallbackCounter(0)
   , mBackend(layers::LayersBackend::LAYERS_NONE)
 {
-  MOZ_COUNT_CTOR(VRManagerChild);
   MOZ_ASSERT(NS_IsMainThread());
 
   mStartTimeStamp = TimeStamp::Now();
 }
 
 VRManagerChild::~VRManagerChild()
 {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_COUNT_DTOR(VRManagerChild);
 }
 
 /*static*/ void
 VRManagerChild::IdentifyTextureHost(const TextureFactoryIdentifier& aIdentifier)
 {
   if (sVRManagerChildSingleton) {
     sVRManagerChildSingleton->mBackend = aIdentifier.mParentBackend;
     sVRManagerChildSingleton->mSyncObject = SyncObject::CreateSyncObject(aIdentifier.mSyncHandle);
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -378,23 +378,21 @@ nsComboboxControlFrame::ShowList(bool aS
 
 class nsResizeDropdownAtFinalPosition final
   : public nsIReflowCallback, public Runnable
 {
 public:
   explicit nsResizeDropdownAtFinalPosition(nsComboboxControlFrame* aFrame)
     : mFrame(aFrame)
   {
-    MOZ_COUNT_CTOR(nsResizeDropdownAtFinalPosition);
   }
 
 protected:
   ~nsResizeDropdownAtFinalPosition()
   {
-    MOZ_COUNT_DTOR(nsResizeDropdownAtFinalPosition);
   }
 
 public:
   virtual bool ReflowFinished() override
   {
     Run();
     NS_RELEASE_THIS();
     return false;
--- a/layout/mathml/nsMathMLChar.cpp
+++ b/layout/mathml/nsMathMLChar.cpp
@@ -601,34 +601,32 @@ public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
 
   nsPropertiesTable mUnicodeTable;
 
   nsGlyphTableList()
     : mUnicodeTable(NS_LITERAL_STRING("Unicode"))
   {
-    MOZ_COUNT_CTOR(nsGlyphTableList);
   }
 
   nsresult Initialize();
   nsresult Finalize();
 
   // Add a glyph table in the list, return the new table that was added
   nsGlyphTable*
   AddGlyphTable(const nsString& aPrimaryFontName);
 
   // Find the glyph table in the list corresponding to the given font family.
   nsGlyphTable*
   GetGlyphTableFor(const nsAString& aFamily);
 
 private:
   ~nsGlyphTableList()
   {
-    MOZ_COUNT_DTOR(nsGlyphTableList);
   }
 
   nsPropertiesTable* PropertiesTableAt(int32_t aIndex) {
     return &mPropertiesTableList.ElementAt(aIndex);
   }
   int32_t PropertiesTableCount() {
     return mPropertiesTableList.Length();
   }
--- a/layout/printing/ipc/RemotePrintJobChild.cpp
+++ b/layout/printing/ipc/RemotePrintJobChild.cpp
@@ -13,17 +13,16 @@
 namespace mozilla {
 namespace layout {
 
 NS_IMPL_ISUPPORTS(RemotePrintJobChild,
                   nsIWebProgressListener)
 
 RemotePrintJobChild::RemotePrintJobChild()
 {
-  MOZ_COUNT_CTOR(RemotePrintJobChild);
 }
 
 nsresult
 RemotePrintJobChild::InitializePrint(const nsString& aDocumentTitle,
                                      const nsString& aPrintToFile,
                                      const int32_t& aStartPage,
                                      const int32_t& aEndPage)
 {
@@ -136,17 +135,16 @@ RemotePrintJobChild::OnSecurityChange(ns
 {
   return NS_OK;
 }
 
 // End of nsIWebProgressListener
 
 RemotePrintJobChild::~RemotePrintJobChild()
 {
-  MOZ_COUNT_DTOR(RemotePrintJobChild);
 }
 
 void
 RemotePrintJobChild::ActorDestroy(ActorDestroyReason aWhy)
 {
   mPagePrintTimer = nullptr;
   mPrintEngine = nullptr;
 }
--- a/layout/style/FontFace.cpp
+++ b/layout/style/FontFace.cpp
@@ -104,23 +104,20 @@ FontFace::FontFace(nsISupports* aParent,
   , mLoadedRejection(NS_OK)
   , mStatus(FontFaceLoadStatus::Unloaded)
   , mSourceType(SourceType(0))
   , mSourceBuffer(nullptr)
   , mSourceBufferLength(0)
   , mFontFaceSet(aFontFaceSet)
   , mInFontFaceSet(false)
 {
-  MOZ_COUNT_CTOR(FontFace);
 }
 
 FontFace::~FontFace()
 {
-  MOZ_COUNT_DTOR(FontFace);
-
   SetUserFontEntry(nullptr);
 
   if (mSourceBuffer) {
     free(mSourceBuffer);
   }
 }
 
 JSObject*
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -99,18 +99,16 @@ FontFaceSet::FontFaceSet(nsPIDOMWindowIn
   , mDocument(aDocument)
   , mResolveLazilyCreatedReadyPromise(false)
   , mStatus(FontFaceSetLoadStatus::Loaded)
   , mNonRuleFacesDirty(false)
   , mHasLoadingFontFaces(false)
   , mHasLoadingFontFacesIsDirty(false)
   , mDelayedLoadCheck(false)
 {
-  MOZ_COUNT_CTOR(FontFaceSet);
-
   nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aWindow);
 
   // If the pref is not set, don't create the Promise (which the page wouldn't
   // be able to get to anyway) as it causes the window.FontFaceSet constructor
   // to be created.
   if (global && PrefEnabled()) {
     mResolveLazilyCreatedReadyPromise = true;
   }
@@ -122,18 +120,16 @@ FontFaceSet::FontFaceSet(nsPIDOMWindowIn
 
   mDocument->CSSLoader()->AddObserver(this);
 
   mUserFontSet = new UserFontSet(this);
 }
 
 FontFaceSet::~FontFaceSet()
 {
-  MOZ_COUNT_DTOR(FontFaceSet);
-
   Disconnect();
   for (auto it = mLoaders.Iter(); !it.Done(); it.Next()) {
     it.Get()->GetKey()->Cancel();
   }
 }
 
 JSObject*
 FontFaceSet::WrapObject(JSContext* aContext, JS::Handle<JSObject*> aGivenProto)
--- a/layout/style/StyleRule.cpp
+++ b/layout/style/StyleRule.cpp
@@ -1125,24 +1125,21 @@ protected:
 };
 
 } // namespace css
 } // namespace mozilla
 
 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()
 {
   return reinterpret_cast<css::DOMCSSStyleRule*>
                          (reinterpret_cast<char*>(this) -
            offsetof(css::DOMCSSStyleRule, mDOMDeclaration));
 }
--- a/layout/style/nsCSSValue.cpp
+++ b/layout/style/nsCSSValue.cpp
@@ -2400,17 +2400,16 @@ nsCSSValueList_heap::SizeOfIncludingThis
   }
   return n;
 }
 
 // --- nsCSSValueSharedList -----------------
 
 nsCSSValueSharedList::~nsCSSValueSharedList()
 {
-  MOZ_COUNT_DTOR(nsCSSValueSharedList);
   if (mHead) {
     NS_CSS_DELETE_LIST_MEMBER(nsCSSValueList, mHead, mNext);
     delete mHead;
   }
 }
 
 void
 nsCSSValueSharedList::AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
@@ -3056,24 +3055,20 @@ nsCSSValueGradient::SizeOfIncludingThis(
 }
 
 // --- nsCSSValueTokenStream ------------
 
 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
 {
   // Only measure it if it's unshared, to avoid double-counting.
   size_t n = 0;
   if (mRefCnt <= 1) {
     n += aMallocSizeOf(this);
--- a/layout/style/nsCSSValue.h
+++ b/layout/style/nsCSSValue.h
@@ -294,45 +294,35 @@ private:
   GridTemplateAreasValue&
   operator=(const GridTemplateAreasValue& aOther) = delete;
 };
 
 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
 {
   // 1.0 means 100% for all components, but the value may fall outside
   // the range of [0.0, 1.0], so it is necessary to clamp them when
   // converting to nscolor.
   float mR;
@@ -1115,25 +1105,23 @@ private:
 #define CSSVALUE_LIST_FOR_EXTRA_VALUES(var)                                   \
   for (nsCSSValue *var = First() + 1, *var##_end = First() + mCount;          \
        var != var##_end; ++var)
 
   explicit Array(size_t aItemCount)
     : mRefCnt(0)
     , mCount(aItemCount)
   {
-    MOZ_COUNT_CTOR(nsCSSValue::Array);
     CSSVALUE_LIST_FOR_EXTRA_VALUES(val) {
       new (val) nsCSSValue();
     }
   }
 
   ~Array()
   {
-    MOZ_COUNT_DTOR(nsCSSValue::Array);
     CSSVALUE_LIST_FOR_EXTRA_VALUES(val) {
       val->~nsCSSValue();
     }
   }
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
 #undef CSSVALUE_LIST_FOR_EXTRA_VALUES
@@ -1193,24 +1181,22 @@ private:
 // This is a reference counted list value.  Note that the object is
 // a wrapper for the reference count and a pointer to the head of the
 // list, whereas the other list types (such as nsCSSValueList) do
 // not have such a wrapper.
 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:
   // Private destructor, to discourage deletion outside of Release():
   ~nsCSSValueSharedList();
 
 public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(nsCSSValueSharedList)
@@ -1837,26 +1823,22 @@ private:
 class nsCSSValueFloatColor final {
 public:
   nsCSSValueFloatColor(float aComponent1, float aComponent2, float aComponent3,
                        float aAlpha)
     : mComponent1(aComponent1)
     , 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;
 
   nscolor GetColorValue(nsCSSUnit aUnit) const;
   float Comp1() const { return mComponent1; }
   float Comp2() const { return mComponent2; }
   float Comp3() const { return mComponent3; }
--- a/layout/style/nsDOMCSSAttrDeclaration.cpp
+++ b/layout/style/nsDOMCSSAttrDeclaration.cpp
@@ -23,24 +23,21 @@
 
 using namespace mozilla;
 
 nsDOMCSSAttributeDeclaration::nsDOMCSSAttributeDeclaration(dom::Element* aElement,
                                                            bool aIsSMILOverride)
   : 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)
 
 // mElement holds a strong ref to us, so if it's going to be
 // skipped, the attribute declaration can't be part of a garbage
 // cycle.
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsDOMCSSAttributeDeclaration)
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -93,19 +93,17 @@ nsStyleContext::nsStyleContext(nsStyleCo
 #endif
   , mCachedResetData(nullptr)
   , mBits(((uint64_t)aPseudoType) << NS_STYLE_CONTEXT_TYPE_SHIFT)
   , mRefCnt(0)
 #ifdef DEBUG
   , mFrameRefCnt(0)
   , mComputingStruct(nsStyleStructID_None)
 #endif
-{
-  MOZ_COUNT_CTOR(nsStyleContext);
-}
+{}
 
 nsStyleContext::nsStyleContext(nsStyleContext* aParent,
                                nsIAtom* aPseudoTag,
                                CSSPseudoElementType aPseudoType,
                                already_AddRefed<nsRuleNode> aRuleNode,
                                bool aSkipParentDisplayBasedStyleFixup)
   : nsStyleContext(aParent, OwningStyleContextSource(Move(aRuleNode)),
                    aPseudoTag, aPseudoType)
@@ -178,17 +176,16 @@ nsStyleContext::FinishConstruction(bool 
   #define eStyleStruct_LastItem (nsStyleStructID_Length - 1)
   NS_ASSERTION(NS_STYLE_INHERIT_MASK & NS_STYLE_INHERIT_BIT(LastItem),
                "NS_STYLE_INHERIT_MASK must be bigger, and other bits shifted");
   #undef eStyleStruct_LastItem
 }
 
 nsStyleContext::~nsStyleContext()
 {
-  MOZ_COUNT_DTOR(nsStyleContext);
   NS_ASSERTION((nullptr == mChild) && (nullptr == mEmptyChild), "destructing context with children");
 
 #ifdef DEBUG
   if (sExpensiveStyleStructAssertionsEnabled) {
     // Assert that the style structs we are about to destroy are not referenced
     // anywhere else in the style context tree.  These checks are expensive,
     // which is why they are not enabled by default.
     nsStyleContext* root = this;
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -1136,28 +1136,26 @@ public:
     // item, see the private declarations)
     return ::operator new(aBaseSize +
                           (aArrayLen - 1) * sizeof(nsCSSShadowItem));
   }
 
   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)
       new (&mArray[i]) nsCSSShadowItem();
     }
   }
 
 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();
     }
   }
 
 public:
   uint32_t Length() const { return mLength; }
   nsCSSShadowItem* ShadowAt(uint32_t i) {
--- a/modules/libjar/nsZipArchive.cpp
+++ b/modules/libjar/nsZipArchive.cpp
@@ -165,17 +165,16 @@ nsresult gZlibInit(z_stream *zs)
 nsZipHandle::nsZipHandle()
   : mFileData(nullptr)
   , mLen(0)
   , mMap(nullptr)
   , mRefCnt(0)
   , mFileStart(nullptr)
   , mTotalLen(0)
 {
-  MOZ_COUNT_CTOR(nsZipHandle);
 }
 
 NS_IMPL_ADDREF(nsZipHandle)
 NS_IMPL_RELEASE(nsZipHandle)
 
 nsresult nsZipHandle::Init(nsIFile *file, nsZipHandle **ret,
                            PRFileDesc **aFd)
 {
@@ -339,17 +338,16 @@ nsZipHandle::~nsZipHandle()
   if (mMap) {
     PR_MemUnmap((void *)mFileStart, mTotalLen);
     PR_CloseFileMap(mMap);
   }
   mFileStart = nullptr;
   mFileData = nullptr;
   mMap = nullptr;
   mBuf = nullptr;
-  MOZ_COUNT_DTOR(nsZipHandle);
 }
 
 //***********************************************************
 //      nsZipArchive  --  public methods
 //***********************************************************
 
 //---------------------------------------------
 //  nsZipArchive::OpenArchive
@@ -951,31 +949,27 @@ int64_t nsZipArchive::SizeOfMapping()
 nsZipArchive::nsZipArchive()
   : mRefCnt(0)
   , mCommentPtr(nullptr)
   , mCommentLen(0)
   , mBuiltSynthetics(false)
 {
   zipLog.AddRef();
 
-  MOZ_COUNT_CTOR(nsZipArchive);
-
   // initialize the table to nullptr
   memset(mFiles, 0, sizeof(mFiles));
 }
 
 NS_IMPL_ADDREF(nsZipArchive)
 NS_IMPL_RELEASE(nsZipArchive)
 
 nsZipArchive::~nsZipArchive()
 {
   CloseArchive();
 
-  MOZ_COUNT_DTOR(nsZipArchive);
-
   zipLog.Release();
 }
 
 
 //------------------------------------------
 // nsZipFind constructor and destructor
 //------------------------------------------
 
--- a/netwerk/base/nsUDPSocket.cpp
+++ b/netwerk/base/nsUDPSocket.cpp
@@ -259,23 +259,21 @@ nsUDPSocket::nsUDPSocket()
   if (!gSocketTransportService)
   {
     // This call can fail if we're offline, for example.
     nsCOMPtr<nsISocketTransportService> sts =
         do_GetService(kSocketTransportServiceCID2);
   }
 
   mSts = gSocketTransportService;
-  MOZ_COUNT_CTOR(nsUDPSocket);
 }
 
 nsUDPSocket::~nsUDPSocket()
 {
   CloseSocket();
-  MOZ_COUNT_DTOR(nsUDPSocket);
 }
 
 void
 nsUDPSocket::AddOutputBytes(uint64_t aBytes)
 {
   mByteWriteCount += aBytes;
 }
 
--- a/netwerk/cache2/AppCacheStorage.cpp
+++ b/netwerk/cache2/AppCacheStorage.cpp
@@ -23,23 +23,21 @@ namespace net {
 
 NS_IMPL_ISUPPORTS_INHERITED0(AppCacheStorage, CacheStorage)
 
 AppCacheStorage::AppCacheStorage(nsILoadContextInfo* aInfo,
                                  nsIApplicationCache* aAppCache)
 : 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,
                                             const nsACString & aIdExtension,
                                             uint32_t aFlags,
                                             nsICacheEntryOpenCallback *aCallback)
 {
   if (!CacheStorageService::Self())
--- a/netwerk/cache2/CacheEntry.cpp
+++ b/netwerk/cache2/CacheEntry.cpp
@@ -43,18 +43,16 @@ static uint32_t const ENTRY_NOT_WANTED =
 
 NS_IMPL_ISUPPORTS(CacheEntryHandle, nsICacheEntry)
 
 // CacheEntryHandle
 
 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
     // the service lock. Can access CacheStorageService::Self() w/o a check
     // since CacheEntry hrefs it.
     CacheStorageService::Self()->Lock().AssertCurrentThreadOwns();
   }
 #endif
@@ -63,18 +61,16 @@ CacheEntryHandle::CacheEntryHandle(Cache
 
   LOG(("New CacheEntryHandle %p for entry %p", this, aEntry));
 }
 
 CacheEntryHandle::~CacheEntryHandle()
 {
   mEntry->ReleaseHandleRef();
   mEntry->OnHandleClosed(this);
-
-  MOZ_COUNT_DTOR(CacheEntryHandle);
 }
 
 // CacheEntry::Callback
 
 CacheEntry::Callback::Callback(CacheEntry* aEntry,
                                nsICacheEntryOpenCallback *aCallback,
                                bool aReadOnly, bool aCheckOnAnyThread,
                                bool aSecret)
@@ -1859,22 +1855,20 @@ void CacheEntry::StoreFrecency(double aF
   }
 }
 
 // CacheOutputCloseListener
 
 CacheOutputCloseListener::CacheOutputCloseListener(CacheEntry* aEntry)
 : mEntry(aEntry)
 {
-  MOZ_COUNT_CTOR(CacheOutputCloseListener);
 }
 
 CacheOutputCloseListener::~CacheOutputCloseListener()
 {
-  MOZ_COUNT_DTOR(CacheOutputCloseListener);
 }
 
 void CacheOutputCloseListener::OnOutputClosed()
 {
   // We need this class and to redispatch since this callback is invoked
   // under the file's lock and to do the job we need to enter the entry's
   // lock too.  That would lead to potential deadlocks.
   NS_DispatchToCurrentThread(this);
--- a/netwerk/cache2/CacheFile.cpp
+++ b/netwerk/cache2/CacheFile.cpp
@@ -34,25 +34,23 @@ public:
                                nsresult aResult,
                                bool aIsNew)
     : mCallback(aCallback)
     , mRV(aResult)
     , mIsNew(aIsNew)
   {
     LOG(("NotifyCacheFileListenerEvent::NotifyCacheFileListenerEvent() "
          "[this=%p]", this));
-    MOZ_COUNT_CTOR(NotifyCacheFileListenerEvent);
   }
 
 protected:
   ~NotifyCacheFileListenerEvent()
   {
     LOG(("NotifyCacheFileListenerEvent::~NotifyCacheFileListenerEvent() "
          "[this=%p]", this));
-    MOZ_COUNT_DTOR(NotifyCacheFileListenerEvent);
   }
 
 public:
   NS_IMETHOD Run() override
   {
     LOG(("NotifyCacheFileListenerEvent::Run() [this=%p]", this));
 
     mCallback->OnFileReady(mRV, mIsNew);
@@ -73,25 +71,23 @@ public:
                            CacheFileChunk *aChunk)
     : mCallback(aCallback)
     , mRV(aResult)
     , mChunkIdx(aChunkIdx)
     , mChunk(aChunk)
   {
     LOG(("NotifyChunkListenerEvent::NotifyChunkListenerEvent() [this=%p]",
          this));
-    MOZ_COUNT_CTOR(NotifyChunkListenerEvent);
   }
 
 protected:
   ~NotifyChunkListenerEvent()
   {
     LOG(("NotifyChunkListenerEvent::~NotifyChunkListenerEvent() [this=%p]",
          this));
-    MOZ_COUNT_DTOR(NotifyChunkListenerEvent);
   }
 
 public:
   NS_IMETHOD Run() override
   {
     LOG(("NotifyChunkListenerEvent::Run() [this=%p]", this));
 
     mCallback->OnChunkAvailable(mRV, mChunkIdx, mChunk);
@@ -109,17 +105,16 @@ protected:
 class DoomFileHelper : public CacheFileIOListener
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
   explicit DoomFileHelper(CacheFileListener *aListener)
     : mListener(aListener)
   {
-    MOZ_COUNT_CTOR(DoomFileHelper);
   }
 
 
   NS_IMETHOD OnFileOpened(CacheFileHandle *aHandle, nsresult aResult) override
   {
     MOZ_CRASH("DoomFileHelper::OnFileOpened should not be called!");
     return NS_ERROR_UNEXPECTED;
   }
@@ -154,17 +149,16 @@ public:
   {
     MOZ_CRASH("DoomFileHelper::OnFileRenamed should not be called!");
     return NS_ERROR_UNEXPECTED;
   }
 
 private:
   virtual ~DoomFileHelper()
   {
-    MOZ_COUNT_DTOR(DoomFileHelper);
   }
 
   nsCOMPtr<CacheFileListener>  mListener;
 };
 
 NS_IMPL_ISUPPORTS(DoomFileHelper, CacheFileIOListener)
 
 
--- a/netwerk/cache2/CacheFileChunk.cpp
+++ b/netwerk/cache2/CacheFileChunk.cpp
@@ -246,25 +246,23 @@ class NotifyUpdateListenerEvent : public
 public:
   NotifyUpdateListenerEvent(CacheFileChunkListener *aCallback,
                             CacheFileChunk *aChunk)
     : mCallback(aCallback)
     , mChunk(aChunk)
   {
     LOG(("NotifyUpdateListenerEvent::NotifyUpdateListenerEvent() [this=%p]",
          this));
-    MOZ_COUNT_CTOR(NotifyUpdateListenerEvent);
   }
 
 protected:
   ~NotifyUpdateListenerEvent()
   {
     LOG(("NotifyUpdateListenerEvent::~NotifyUpdateListenerEvent() [this=%p]",
          this));
-    MOZ_COUNT_DTOR(NotifyUpdateListenerEvent);
   }
 
 public:
   NS_IMETHOD Run() override
   {
     LOG(("NotifyUpdateListenerEvent::Run() [this=%p]", this));
 
     mCallback->OnChunkUpdated(mChunk);
@@ -342,25 +340,22 @@ CacheFileChunk::CacheFileChunk(CacheFile
   , mBuffersSize(0)
   , mLimitAllocation(!aFile->mOpenAsMemoryOnly && aInitByWriter)
   , mIsPriority(aFile->mPriority)
   , mExpectedHash(0)
   , mFile(aFile)
 {
   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
 CacheFileChunk::AssertOwnsLock() const
 {
   mFile->AssertOwnsLock();
 }
 
--- a/netwerk/cache2/CacheFileIOManager.cpp
+++ b/netwerk/cache2/CacheFileIOManager.cpp
@@ -540,23 +540,21 @@ CacheFileHandles::SizeOfExcludingThis(mo
 // Events
 
 class ShutdownEvent : public Runnable {
 public:
   ShutdownEvent()
     : mMonitor("ShutdownEvent.mMonitor")
     , mNotified(false)
   {
-    MOZ_COUNT_CTOR(ShutdownEvent);
   }
 
 protected:
   ~ShutdownEvent()
   {
-    MOZ_COUNT_DTOR(ShutdownEvent);
   }
 
 public:
   NS_IMETHOD Run() override
   {
     MonitorAutoLock mon(mMonitor);
 
     CacheFileIOManager::gInstance->ShutdownInternal();
@@ -596,24 +594,22 @@ protected:
 class OpenFileEvent : public Runnable {
 public:
   OpenFileEvent(const nsACString &aKey, uint32_t aFlags,
                 CacheFileIOListener *aCallback)
     : mFlags(aFlags)
     , mCallback(aCallback)
     , mKey(aKey)
   {
-    MOZ_COUNT_CTOR(OpenFileEvent);
     mIOMan = CacheFileIOManager::gInstance;
   }
 
 protected:
   ~OpenFileEvent()
   {
-    MOZ_COUNT_DTOR(OpenFileEvent);
   }
 
 public:
   NS_IMETHOD Run() override
   {
     nsresult rv = NS_OK;
 
     if (!(mFlags & CacheFileIOManager::SPECIAL_FILE)) {
@@ -658,23 +654,21 @@ public:
   ReadEvent(CacheFileHandle *aHandle, int64_t aOffset, char *aBuf,
             int32_t aCount, CacheFileIOListener *aCallback)
     : mHandle(aHandle)
     , mOffset(aOffset)
     , mBuf(aBuf)
     , mCount(aCount)
     , mCallback(aCallback)
   {
-    MOZ_COUNT_CTOR(ReadEvent);
   }
 
 protected:
   ~ReadEvent()
   {
-    MOZ_COUNT_DTOR(ReadEvent);
   }
 
 public:
   NS_IMETHOD Run() override
   {
     nsresult rv;
 
     if (mHandle->IsClosed() || (mCallback && mCallback->IsKilled())) {
@@ -704,24 +698,21 @@ public:
     : mHandle(aHandle)
     , mOffset(aOffset)
     , mBuf(aBuf)
     , mCount(aCount)
     , mValidate(aValidate)
     , mTruncate(aTruncate)
     , mCallback(aCallback)
   {
-    MOZ_COUNT_CTOR(WriteEvent);
   }
 
 protected:
   ~WriteEvent()
   {
-    MOZ_COUNT_DTOR(WriteEvent);
-
     if (!mCallback && mBuf) {
       free(const_cast<char *>(mBuf));
     }
   }
 
 public:
   NS_IMETHOD Run() override
   {
@@ -765,23 +756,21 @@ protected:
 
 class DoomFileEvent : public Runnable {
 public:
   DoomFileEvent(CacheFileHandle *aHandle,
                 CacheFileIOListener *aCallback)
     : mCallback(aCallback)
     , mHandle(aHandle)
   {
-    MOZ_COUNT_CTOR(DoomFileEvent);
   }
 
 protected:
   ~DoomFileEvent()
   {
-    MOZ_COUNT_DTOR(DoomFileEvent);
   }
 
 public:
   NS_IMETHOD Run() override
   {
     nsresult rv;
 
     if (mHandle->IsClosed()) {
@@ -804,29 +793,26 @@ protected:
 };
 
 class DoomFileByKeyEvent : public Runnable {
 public:
   DoomFileByKeyEvent(const nsACString &aKey,
                      CacheFileIOListener *aCallback)
     : mCallback(aCallback)
   {
-    MOZ_COUNT_CTOR(DoomFileByKeyEvent);
-
     SHA1Sum sum;
     sum.update(aKey.BeginReading(), aKey.Length());
     sum.finish(mHash);
 
     mIOMan = CacheFileIOManager::gInstance;
   }
 
 protected:
   ~DoomFileByKeyEvent()
   {
-    MOZ_COUNT_DTOR(DoomFileByKeyEvent);
   }
 
 public:
   NS_IMETHOD Run() override
   {
     nsresult rv;
 
     if (!mIOMan) {
@@ -849,23 +835,21 @@ protected:
   RefPtr<CacheFileIOManager>    mIOMan;
 };
 
 class ReleaseNSPRHandleEvent : public Runnable {
 public:
   explicit ReleaseNSPRHandleEvent(CacheFileHandle *aHandle)
     : mHandle(aHandle)
   {
-    MOZ_COUNT_CTOR(ReleaseNSPRHandleEvent);
   }
 
 protected:
   ~ReleaseNSPRHandleEvent()
   {
-    MOZ_COUNT_DTOR(ReleaseNSPRHandleEvent);
   }
 
 public:
   NS_IMETHOD Run() override
   {
     if (!mHandle->IsClosed()) {
       CacheFileIOManager::gInstance->MaybeReleaseNSPRHandleInternal(mHandle);
     }
@@ -881,23 +865,21 @@ class TruncateSeekSetEOFEvent : public R
 public:
   TruncateSeekSetEOFEvent(CacheFileHandle *aHandle, int64_t aTruncatePos,
                           int64_t aEOFPos, CacheFileIOListener *aCallback)
     : mHandle(aHandle)
     , mTruncatePos(aTruncatePos)
     , mEOFPos(aEOFPos)
     , mCallback(aCallback)
   {
-    MOZ_COUNT_CTOR(TruncateSeekSetEOFEvent);
   }
 
 protected:
   ~TruncateSeekSetEOFEvent()
   {
-    MOZ_COUNT_DTOR(TruncateSeekSetEOFEvent);
   }
 
 public:
   NS_IMETHOD Run() override
   {
     nsresult rv;
 
     if (mHandle->IsClosed() || (mCallback && mCallback->IsKilled())) {
@@ -924,23 +906,21 @@ protected:
 class RenameFileEvent : public Runnable {
 public:
   RenameFileEvent(CacheFileHandle *aHandle, const nsACString &aNewName,
                   CacheFileIOListener *aCallback)
     : mHandle(aHandle)
     , mNewName(aNewName)
     , mCallback(aCallback)
   {
-    MOZ_COUNT_CTOR(RenameFileEvent);
   }
 
 protected:
   ~RenameFileEvent()
   {
-    MOZ_COUNT_DTOR(RenameFileEvent);
   }
 
 public:
   NS_IMETHOD Run() override
   {
     nsresult rv;
 
     if (mHandle->IsClosed()) {
@@ -968,23 +948,21 @@ public:
   InitIndexEntryEvent(CacheFileHandle *aHandle,
                       OriginAttrsHash aOriginAttrsHash, bool aAnonymous,
                       bool aPinning)
     : mHandle(aHandle)
     , mOriginAttrsHash(aOriginAttrsHash)
     , mAnonymous(aAnonymous)
     , mPinning(aPinning)
   {
-    MOZ_COUNT_CTOR(InitIndexEntryEvent);
   }
 
 protected:
   ~InitIndexEntryEvent()
   {
-    MOZ_COUNT_DTOR(InitIndexEntryEvent);
   }
 
 public:
   NS_IMETHOD Run() override
   {
     if (mHandle->IsClosed() || mHandle->IsDoomed()) {
       return NS_OK;
     }
@@ -1012,31 +990,29 @@ protected:
 class UpdateIndexEntryEvent : public Runnable {
 public:
   UpdateIndexEntryEvent(CacheFileHandle *aHandle, const uint32_t *aFrecency,
                         const uint32_t *aExpirationTime)
     : mHandle(aHandle)
     , mHasFrecency(false)
     , mHasExpirationTime(false)
   {
-    MOZ_COUNT_CTOR(UpdateIndexEntryEvent);
     if (aFrecency) {
       mHasFrecency = true;
       mFrecency = *aFrecency;
     }
     if (aExpirationTime) {
       mHasExpirationTime = true;
       mExpirationTime = *aExpirationTime;
     }
   }
 
 protected:
   ~UpdateIndexEntryEvent()
   {
-    MOZ_COUNT_DTOR(UpdateIndexEntryEvent);
   }
 
 public:
   NS_IMETHOD Run() override
   {
     if (mHandle->IsClosed() || mHandle->IsDoomed()) {
       return NS_OK;
     }
@@ -1109,24 +1085,22 @@ NS_IMPL_ISUPPORTS(CacheFileIOManager, ns
 CacheFileIOManager::CacheFileIOManager()
   : mShuttingDown(false)
   , mTreeCreated(false)
   , mTreeCreationFailed(false)
   , mOverLimitEvicting(false)
   , 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
 nsresult
 CacheFileIOManager::Init()
 {
   LOG(("CacheFileIOManager::Init()"));
 
--- a/netwerk/cache2/CacheFileInputStream.cpp
+++ b/netwerk/cache2/CacheFileInputStream.cpp
@@ -52,27 +52,25 @@ CacheFileInputStream::CacheFileInputStre
   , mInReadSegments(false)
   , mWaitingForUpdate(false)
   , mAlternativeData(aAlternativeData)
   , mListeningForChunk(-1)
   , mCallbackFlags(0)
   , mCacheEntryHandle(aEntry)
 {
   LOG(("CacheFileInputStream::CacheFileInputStream() [this=%p]", this));
-  MOZ_COUNT_CTOR(CacheFileInputStream);
 
   if (mAlternativeData) {
     mPos = mFile->mAltDataOffset;
   }
 }
 
 CacheFileInputStream::~CacheFileInputStream()
 {
   LOG(("CacheFileInputStream::~CacheFileInputStream() [this=%p]", this));
-  MOZ_COUNT_DTOR(CacheFileInputStream);
   MOZ_ASSERT(!mInReadSegments);
 }
 
 // nsIInputStream
 NS_IMETHODIMP
 CacheFileInputStream::Close()
 {
   LOG(("CacheFileInputStream::Close() [this=%p]", this));
--- a/netwerk/cache2/CacheFileMetadata.cpp
+++ b/netwerk/cache2/CacheFileMetadata.cpp
@@ -53,17 +53,16 @@ CacheFileMetadata::CacheFileMetadata(Cac
   , mIsDirty(false)
   , mAnonymous(false)
   , mAllocExactSize(false)
   , mFirstRead(true)
 {
   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;
   mKey = aKey;
 
   DebugOnly<nsresult> rv;
   rv = ParseKey(aKey);
   MOZ_ASSERT(NS_SUCCEEDED(rv));
@@ -83,17 +82,16 @@ CacheFileMetadata::CacheFileMetadata(boo
   , mIsDirty(true)
   , mAnonymous(false)
   , mAllocExactSize(false)
   , mFirstRead(true)
 {
   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) {
     AddFlags(kCacheEntryIsPinned);
   }
   mMetaHdr.mExpirationTime = nsICacheEntry::NO_EXPIRATION_TIME;
   mKey = aKey;
   mMetaHdr.mKeySize = mKey.Length();
@@ -116,25 +114,23 @@ CacheFileMetadata::CacheFileMetadata()
   , mElementsSize(0)
   , mIsDirty(false)
   , mAnonymous(false)
   , mAllocExactSize(false)
   , mFirstRead(true)
 {
   LOG(("CacheFileMetadata::CacheFileMetadata() [this=%p]", this));
 
-  MOZ_COUNT_CTOR(CacheFileMetadata);
   memset(&mMetaHdr, 0, sizeof(CacheFileMetadataHeader));
 }
 
 CacheFileMetadata::~CacheFileMetadata()
 {
   LOG(("CacheFileMetadata::~CacheFileMetadata() [this=%p]", this));
 
-  MOZ_COUNT_DTOR(CacheFileMetadata);
   MOZ_ASSERT(!mListener);
 
   if (mHashArray) {
     CacheFileUtils::FreeBuffer(mHashArray);
     mHashArray = nullptr;
     mHashArraySize = 0;
   }
 
--- a/netwerk/cache2/CacheFileOutputStream.cpp
+++ b/netwerk/cache2/CacheFileOutputStream.cpp
@@ -51,27 +51,25 @@ CacheFileOutputStream::CacheFileOutputSt
   , mCloseListener(aCloseListener)
   , mPos(0)
   , mClosed(false)
   , mAlternativeData(aAlternativeData)
   , mStatus(NS_OK)
   , mCallbackFlags(0)
 {
   LOG(("CacheFileOutputStream::CacheFileOutputStream() [this=%p]", this));
-  MOZ_COUNT_CTOR(CacheFileOutputStream);
 
   if (mAlternativeData) {
     mPos = mFile->mAltDataOffset;
   }
 }
 
 CacheFileOutputStream::~CacheFileOutputStream()
 {
   LOG(("CacheFileOutputStream::~CacheFileOutputStream() [this=%p]", this));
-  MOZ_COUNT_DTOR(CacheFileOutputStream);
 }
 
 // nsIOutputStream
 NS_IMETHODIMP
 CacheFileOutputStream::Close()
 {
   LOG(("CacheFileOutputStream::Close() [this=%p]", this));
   return CloseWithStatus(NS_OK);
--- a/netwerk/cache2/CacheIndex.cpp
+++ b/netwerk/cache2/CacheIndex.cpp
@@ -273,25 +273,23 @@ CacheIndex::CacheIndex()
   , mRWBufSize(0)
   , mRWBufPos(0)
   , mRWPending(false)
   , mJournalReadSuccessfully(false)
   , mAsyncGetDiskConsumptionBlocked(false)
 {
   sLock.AssertCurrentThreadOwns();
   LOG(("CacheIndex::CacheIndex [this=%p]", this));
-  MOZ_COUNT_CTOR(CacheIndex);
   MOZ_ASSERT(!gInstance, "multiple CacheIndex instances!");
 }
 
 CacheIndex::~CacheIndex()
 {
   sLock.AssertCurrentThreadOwns();
   LOG(("CacheIndex::~CacheIndex [this=%p]", this));
-  MOZ_COUNT_DTOR(CacheIndex);
 
   ReleaseBuffer();
 }
 
 // static
 nsresult
 CacheIndex::Init(nsIFile *aCacheDirectory)
 {
--- a/netwerk/cache2/OldWrappers.cpp
+++ b/netwerk/cache2/OldWrappers.cpp
@@ -36,24 +36,22 @@ namespace {
 // Fires the doom callback back on the main thread
 // after the cache I/O thread is looped.
 
 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
   nsCOMPtr<nsICacheEntryDoomCallback> mCB;
 };
 
 nsresult DoomCallbackSynchronizer::Dispatch()
 {
@@ -89,23 +87,21 @@ NS_IMETHODIMP DoomCallbackSynchronizer::
 
 class DoomCallbackWrapper : public nsICacheListener
 {
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSICACHELISTENER
 
   explicit DoomCallbackWrapper(nsICacheEntryDoomCallback* cb) : mCB(cb)
   {
-    MOZ_COUNT_CTOR(DoomCallbackWrapper);
   }
 
 private:
   virtual ~DoomCallbackWrapper()
   {
-    MOZ_COUNT_DTOR(DoomCallbackWrapper);
   }
 
   nsCOMPtr<nsICacheEntryDoomCallback> mCB;
 };
 
 NS_IMPL_ISUPPORTS(DoomCallbackWrapper, nsICacheListener);
 
 NS_IMETHODIMP DoomCallbackWrapper::OnCacheEntryAvailable(nsICacheEntryDescriptor *descriptor,
@@ -138,18 +134,16 @@ NS_IMPL_ISUPPORTS(_OldVisitCallbackWrapp
     // The device has not been found, to not break the chain, simulate
     // storage info callback.
     mCB->OnCacheStorageInfo(0, 0, 0, nullptr);
   }
 
   if (mVisitEntries) {
     mCB->OnCacheEntryVisitCompleted();
   }
-
-  MOZ_COUNT_DTOR(_OldVisitCallbackWrapper);
 }
 
 NS_IMETHODIMP _OldVisitCallbackWrapper::VisitDevice(const char * deviceID,
                                                     nsICacheDeviceInfo *deviceInfo,
                                                     bool *_retval)
 {
   if (!mCB)
     return NS_ERROR_NULL_POINTER;
@@ -344,30 +338,27 @@ NS_IMETHODIMP
 }
 
 
 // _OldCacheEntryWrapper
 
 _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()));
 }
 
 NS_IMETHODIMP _OldCacheEntryWrapper::GetIsForcedValid(bool *aIsForcedValid)
 {
   // Unused stub
   return NS_ERROR_NOT_IMPLEMENTED;
 }
@@ -675,23 +666,21 @@ NS_IMPL_ISUPPORTS_INHERITED(_OldCacheLoa
   , mWriteToDisk(aWriteToDisk)
   , mNew(true)
   , mOpening(true)
   , mSync(false)
   , mStatus(NS_ERROR_UNEXPECTED)
   , mRunCount(0)
   , mAppCache(aAppCache)
 {
-  MOZ_COUNT_CTOR(_OldCacheLoad);
 }
 
 _OldCacheLoad::~_OldCacheLoad()
 {
   ProxyReleaseMainThread(mAppCache);
-  MOZ_COUNT_DTOR(_OldCacheLoad);
 }
 
 nsresult _OldCacheLoad::Start()
 {
   LOG(("_OldCacheLoad::Start [this=%p, key=%s]", this, mCacheKey.get()));
 
   mLoadStart = mozilla::TimeStamp::Now();
 
@@ -902,22 +891,20 @@ NS_IMPL_ISUPPORTS(_OldStorage, nsICacheS
                          bool aOfflineStorage,
                          nsIApplicationCache* aAppCache)
 : mLoadInfo(GetLoadContextInfo(aInfo))
 , mAppCache(aAppCache)
 , mWriteToDisk(aAllowDisk)
 , mLookupAppCache(aLookupAppCache)
 , mOfflineStorage(aOfflineStorage)
 {
-  MOZ_COUNT_CTOR(_OldStorage);
 }
 
 _OldStorage::~_OldStorage()
 {
-  MOZ_COUNT_DTOR(_OldStorage);
 }
 
 NS_IMETHODIMP _OldStorage::AsyncOpenURI(nsIURI *aURI,
                                         const nsACString & aIdExtension,
                                         uint32_t aFlags,
                                         nsICacheEntryOpenCallback *aCallback)
 {
   NS_ENSURE_ARG(aURI);
--- a/netwerk/cache2/OldWrappers.h
+++ b/netwerk/cache2/OldWrappers.h
@@ -244,17 +244,16 @@ class _OldVisitCallbackWrapper : public 
                            bool visitEntries,
                            nsILoadContextInfo * aInfo)
   : mCB(cb)
   , mVisitEntries(visitEntries)
   , mDeviceID(deviceID)
   , mLoadInfo(aInfo)
   , mHit(false)
   {
-    MOZ_COUNT_CTOR(_OldVisitCallbackWrapper);
   }
 
 private:
   virtual ~_OldVisitCallbackWrapper();
   nsCOMPtr<nsICacheStorageVisitor> mCB;
   bool mVisitEntries;
   char const * mDeviceID;
   nsCOMPtr<nsILoadContextInfo> mLoadInfo;
--- a/netwerk/protocol/ftp/FTPChannelChild.cpp
+++ b/netwerk/protocol/ftp/FTPChannelChild.cpp
@@ -518,22 +518,20 @@ FTPChannelChild::RecvOnStopRequest(const
 
 class nsFtpChildAsyncAlert : public Runnable
 {
 public:
   nsFtpChildAsyncAlert(nsIPrompt *aPrompter, nsString aResponseMsg)
     : mPrompter(aPrompter)
     , mResponseMsg(aResponseMsg)
   {
-    MOZ_COUNT_CTOR(nsFtpChildAsyncAlert);
   }
 protected:
   virtual ~nsFtpChildAsyncAlert()
   {
-    MOZ_COUNT_DTOR(nsFtpChildAsyncAlert);
   }
 public:
   NS_IMETHOD Run() override
   {
     if (mPrompter) {
       mPrompter->Alert(nullptr, mResponseMsg.get());
     }
     return NS_OK;
--- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
+++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
@@ -1789,22 +1789,20 @@ nsFtpState::KillControlConnection()
 
 class nsFtpAsyncAlert : public Runnable
 {
 public:
     nsFtpAsyncAlert(nsIPrompt *aPrompter, nsString aResponseMsg)
         : mPrompter(aPrompter)
         , mResponseMsg(aResponseMsg)
     {
-        MOZ_COUNT_CTOR(nsFtpAsyncAlert);
     }
 protected:
     virtual ~nsFtpAsyncAlert()
     {
-        MOZ_COUNT_DTOR(nsFtpAsyncAlert);
     }
 public:
     NS_IMETHOD Run() override
     {
         if (mPrompter) {
             mPrompter->Alert(nullptr, mResponseMsg.get());
         }
         return NS_OK;
--- a/netwerk/protocol/websocket/IPCTransportProvider.cpp
+++ b/netwerk/protocol/websocket/IPCTransportProvider.cpp
@@ -14,22 +14,20 @@ namespace mozilla {
 namespace net {
 
 NS_IMPL_ISUPPORTS(TransportProviderParent,
                   nsITransportProvider,
                   nsIHttpUpgradeListener)
 
 TransportProviderParent::TransportProviderParent()
 {
-  MOZ_COUNT_CTOR(TransportProviderParent);
 }
 
 TransportProviderParent::~TransportProviderParent()
 {
-  MOZ_COUNT_DTOR(TransportProviderParent);
 }
 
 NS_IMETHODIMP
 TransportProviderParent::SetListener(nsIHttpUpgradeListener* aListener)
 {
   MOZ_ASSERT(aListener);
   mListener = aListener;
 
@@ -72,22 +70,20 @@ TransportProviderParent::MaybeNotify()
 }
 
 
 NS_IMPL_ISUPPORTS(TransportProviderChild,
                   nsITransportProvider)
 
 TransportProviderChild::TransportProviderChild()
 {
-  MOZ_COUNT_CTOR(TransportProviderChild);
 }
 
 TransportProviderChild::~TransportProviderChild()
 {
-  MOZ_COUNT_DTOR(TransportProviderChild);
   Send__delete__(this);
 }
 
 NS_IMETHODIMP
 TransportProviderChild::SetListener(nsIHttpUpgradeListener* aListener)
 {
   MOZ_CRASH("Don't call this in child process");
   return NS_OK;
--- a/parser/html/nsHtml5OwningUTF16Buffer.cpp
+++ b/parser/html/nsHtml5OwningUTF16Buffer.cpp
@@ -3,31 +3,26 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsHtml5OwningUTF16Buffer.h"
 
 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.
   RefPtr<nsHtml5OwningUTF16Buffer> tail;
   tail.swap(next);
   while (tail && tail->mRefCnt == 1) {
     RefPtr<nsHtml5OwningUTF16Buffer> tmp;
     tmp.swap(tail->next);
--- a/parser/html/nsHtml5StringParser.cpp
+++ b/parser/html/nsHtml5StringParser.cpp
@@ -13,23 +13,21 @@
 
 NS_IMPL_ISUPPORTS0(nsHtml5StringParser)
 
 nsHtml5StringParser::nsHtml5StringParser()
   : mBuilder(new nsHtml5OplessBuilder())
   , mTreeBuilder(new nsHtml5TreeBuilder(mBuilder))
   , mTokenizer(new nsHtml5Tokenizer(mTreeBuilder, false))
 {
-  MOZ_COUNT_CTOR(nsHtml5StringParser);
   mTokenizer->setInterner(&mAtomTable);
 }
 
 nsHtml5StringParser::~nsHtml5StringParser()
 {
-  MOZ_COUNT_DTOR(nsHtml5StringParser);
 }
 
 nsresult
 nsHtml5StringParser::ParseFragment(const nsAString& aSourceBuffer,
                                    nsIContent* aTargetNode,
                                    nsIAtom* aContextLocalName,
                                    int32_t aContextNamespace,
                                    bool aQuirks,
--- a/rdf/base/nsInMemoryDataSource.cpp
+++ b/rdf/base/nsInMemoryDataSource.cpp
@@ -731,17 +731,16 @@ InMemoryDataSource::InMemoryDataSource(n
     : mForwardArcs(PLDHashTable::StubOps(), sizeof(Entry))
     , mReverseArcs(PLDHashTable::StubOps(), sizeof(Entry))
     , mNumObservers(0)
     , mReadCount(0)
 {
     NS_INIT_AGGREGATED(aOuter);
 
     mPropagateChanges = true;
-    MOZ_COUNT_CTOR(InMemoryDataSource);
 }
 
 
 InMemoryDataSource::~InMemoryDataSource()
 {
 #ifdef DEBUG_REFS
     --gInstanceCount;
     fprintf(stdout, "%d - RDF: InMemoryDataSource\n", gInstanceCount);
@@ -763,18 +762,16 @@ InMemoryDataSource::~InMemoryDataSource(
                 doomed->mNext = doomed->u.as.mInvNext = nullptr;
                 doomed->Release();
             }
         }
     }
 
     MOZ_LOG(gLog, LogLevel::Debug,
            ("InMemoryDataSource(%p): destroyed.", this));
-
-    MOZ_COUNT_DTOR(InMemoryDataSource);
 }
 
 
 ////////////////////////////////////////////////////////////////////////
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(InMemoryDataSource)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(InMemoryDataSource)
--- a/rdf/base/nsRDFXMLParser.cpp
+++ b/rdf/base/nsRDFXMLParser.cpp
@@ -33,22 +33,20 @@ nsRDFXMLParser::Create(nsISupports* aOut
     NS_ADDREF(result);
     rv = result->QueryInterface(aIID, aResult);
     NS_RELEASE(result);
     return rv;
 }
 
 nsRDFXMLParser::nsRDFXMLParser()
 {
-    MOZ_COUNT_CTOR(nsRDFXMLParser);
 }
 
 nsRDFXMLParser::~nsRDFXMLParser()
 {
-    MOZ_COUNT_DTOR(nsRDFXMLParser);
 }
 
 NS_IMETHODIMP
 nsRDFXMLParser::ParseAsync(nsIRDFDataSource* aSink, nsIURI* aBaseURI, nsIStreamListener** aResult)
 {
     nsresult rv;
 
     nsCOMPtr<nsIRDFContentSink> sink =
--- a/rdf/base/nsRDFXMLSerializer.cpp
+++ b/rdf/base/nsRDFXMLSerializer.cpp
@@ -90,23 +90,20 @@ nsRDFXMLSerializer::Create(nsISupports* 
         if (NS_FAILED(rv)) break;
     } while (0);
 
     return rv;
 }
 
 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);
         NS_IF_RELEASE(kRDF_Alt);
         NS_IF_RELEASE(kRDF_instanceOf);
         NS_IF_RELEASE(kRDF_type);
         NS_IF_RELEASE(kRDF_nextVal);
         NS_IF_RELEASE(gRDFC);
--- a/tools/profiler/gecko/ThreadResponsiveness.cpp
+++ b/tools/profiler/gecko/ThreadResponsiveness.cpp
@@ -20,23 +20,21 @@ class CheckResponsivenessTask : public m
                                 public nsITimerCallback {
 public:
   CheckResponsivenessTask()
     : mLastTracerTime(TimeStamp::Now())
     , mMonitor("CheckResponsivenessTask")
     , mTimer(nullptr)
     , mStop(false)
   {
-    MOZ_COUNT_CTOR(CheckResponsivenessTask);
   }
 
 protected:
   ~CheckResponsivenessTask()
   {
-    MOZ_COUNT_DTOR(CheckResponsivenessTask);
   }
 
 public:
   NS_IMETHOD Run() override
   {
     MonitorAutoLock mon(mMonitor);
     if (mStop)
       return NS_OK;
--- a/widget/PuppetWidget.cpp
+++ b/widget/PuppetWidget.cpp
@@ -80,30 +80,26 @@ PuppetWidget::PuppetWidget(TabChild* aTa
   , mMemoryPressureObserver(nullptr)
   , mDPI(-1)
   , mRounding(-1)
   , mDefaultScale(-1)
   , mCursorHotspotX(0)
   , mCursorHotspotY(0)
   , mNativeKeyCommandsValid(false)
 {
-  MOZ_COUNT_CTOR(PuppetWidget);
-
   mSingleLineCommands.SetCapacity(4);
   mMultiLineCommands.SetCapacity(4);
   mRichTextCommands.SetCapacity(4);
 
   // Setting 'Unknown' means "not yet cached".
   mInputContext.mIMEState.mEnabled = IMEState::UNKNOWN;
 }
 
 PuppetWidget::~PuppetWidget()
 {
-  MOZ_COUNT_DTOR(PuppetWidget);
-
   Destroy();
 }
 
 void
 PuppetWidget::InfallibleCreate(nsIWidget* aParent,
                                nsNativeWidget aNativeParent,
                                const LayoutDeviceIntRect& aRect,
                                nsWidgetInitData* aInitData)
--- a/widget/windows/WidgetTraceEvent.cpp
+++ b/widget/windows/WidgetTraceEvent.cpp
@@ -29,22 +29,17 @@ namespace {
 
 // Used for signaling the background thread from the main thread.
 HANDLE sEventHandle = nullptr;
 
 // We need a runnable in order to find the hidden window on the main
 // 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;
 
   NS_IMETHOD Run() override {
     // Jump through some hoops to locate the hidden window.
     nsCOMPtr<nsIAppShellService> appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID));
     nsCOMPtr<nsIXULWindow> hiddenWindow;
 
--- a/xpcom/base/nsTraceRefcnt.cpp
+++ b/xpcom/base/nsTraceRefcnt.cpp
@@ -276,21 +276,30 @@ typedef mozilla::CodeAddressService<Code
                                     CodeAddressServiceLock> WalkTheStackCodeAddressService;
 
 mozilla::StaticAutoPtr<WalkTheStackCodeAddressService> gCodeAddressService;
 
 #endif // MOZ_STACKWALKING
 
 ////////////////////////////////////////////////////////////////////////////////
 
+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);
     mStats.Clear();
     mTotalLeaked = 0;
   }
 
   ~BloatEntry()
@@ -302,16 +311,21 @@ public:
   {
     return (uint32_t)mClassSize;
   }
   const char* GetClassName()
   {
     return mClassName;
   }
 
+  BloatEntryType GetEntryType() const
+  {
+    return mEntryType;
+  }
+
   void Ctor()
   {
     mStats.mCreates++;
   }
 
   void Dtor()
   {
     mStats.mDestroys++;
@@ -383,16 +397,17 @@ public:
     }
   }
 
 protected:
   char* mClassName;
   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
 BloatViewFreeEntry(void* aPool, PLHashEntry* aHashEntry, unsigned aFlag)
 {
   if (aFlag == HT_FREE_ENTRY) {
     BloatEntry* entry = static_cast<BloatEntry*>(aHashEntry->value);
     delete entry;
@@ -411,39 +426,43 @@ RecreateBloatView()
   gBloatView = PL_NewHashTable(256,
                                PL_HashString,
                                PL_CompareStrings,
                                PL_CompareValues,
                                &bloatViewHashAllocOps, nullptr);
 }
 
 static BloatEntry*
-GetBloatEntry(const char* aTypeName, uint32_t aInstanceSize)
+GetBloatEntry(const char* aTypeName,
+              uint32_t aInstanceSize,
+              BloatEntryType aEntryType)
 {
   if (!gBloatView) {
     RecreateBloatView();
   }
   BloatEntry* entry = nullptr;
   if (gBloatView) {
     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;
         entry = nullptr;
       }
     } else {
       MOZ_ASSERT(aInstanceSize == 0 || entry->GetClassSize() == aInstanceSize,
                  "Mismatched sizes were recorded in the memory leak logging table. "
                  "The usual cause of this is having a templated class that uses "
                  "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;
 }
 
 static int
 DumpSerialNumbers(PLHashEntry* aHashEntry, int aIndex, void* aClosure)
 {
@@ -510,17 +529,18 @@ nsTraceRefcnt::DumpStatistics()
              "Calling DumpStatistics more than once may result in "
              "bogus positive or negative leaks being reported");
   gDumpedStatistics = true;
 
   // Don't try to log while we hold the lock, we'd deadlock.
   AutoRestore<LoggingType> 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) {
     msg = "ALL (cumulative) LEAK STATISTICS";
   } else {
     msg = "ALL (cumulative) LEAK AND BLOAT STATISTICS";
   }
   const bool leaked = total.PrintDumpHeader(gBloatLog, msg);
@@ -984,18 +1004,18 @@ LogDMDFile()
   nsMemoryInfoDumper::DumpDMDToFile(logFile);
 }
 #endif // MOZ_DMD
 
 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
     /* FIXME bug 491977: This is only going to operate on the
      * BlockingResourceBase which is compiled into
      * libxul/libxpcom_core.so. Anyone using external linkage will
      * have their own copy of BlockingResourceBase statics which will
      * not be freed by this method.
@@ -1035,17 +1055,17 @@ NS_LogAddRef(void* aPtr, nsrefcnt aRefcn
   }
   if (gLogging == NoLogging) {
     return;
   }
   if (aRefcnt == 1 || gLogging == FullLogging) {
     AutoTraceLogLock lock;
 
     if (aRefcnt == 1 && gBloatLog) {
-      BloatEntry* entry = GetBloatEntry(aClass, aClassSize);
+      BloatEntry* entry = GetBloatEntry(aClass, aClassSize, RefcountedBloatEntry);
       if (entry) {
         entry->Ctor();
       }
     }
 
     // Here's the case where MOZ_COUNT_CTOR was not used,
     // yet we still want to see creation information:
 
@@ -1088,17 +1108,17 @@ NS_LogRelease(void* aPtr, nsrefcnt aRefc
   }
   if (gLogging == NoLogging) {
     return;
   }
   if (aRefcnt == 0 || gLogging == FullLogging) {
     AutoTraceLogLock lock;
 
     if (aRefcnt == 0 && gBloatLog) {
-      BloatEntry* entry = GetBloatEntry(aClass, 0);
+      BloatEntry* entry = GetBloatEntry(aClass, 0, RefcountedBloatEntry);
       if (entry) {
         entry->Dtor();
       }
     }
 
     bool loggingThisType = (!gTypesToLog || LogThisType(aClass));
     intptr_t serialno = 0;
     if (gSerialNumbers && loggingThisType) {
@@ -1147,17 +1167,17 @@ NS_LogCtor(void* aPtr, const char* aType
 
   if (gLogging == NoLogging) {
     return;
   }
 
   AutoTraceLogLock lock;
 
   if (gBloatLog) {
-    BloatEntry* entry = GetBloatEntry(aType, aInstanceSize);
+    BloatEntry* entry = GetBloatEntry(aType, aInstanceSize, ManualBloatEntry);
     if (entry) {
       entry->Ctor();
     }
   }
 
   bool loggingThisType = (!gTypesToLog || LogThisType(aType));
   intptr_t serialno = 0;
   if (gSerialNumbers && loggingThisType) {
@@ -1184,17 +1204,17 @@ NS_LogDtor(void* aPtr, const char* aType
 
   if (gLogging == NoLogging) {
     return;
   }
 
   AutoTraceLogLock lock;
 
   if (gBloatLog) {
-    BloatEntry* entry = GetBloatEntry(aType, aInstanceSize);
+    BloatEntry* entry = GetBloatEntry(aType, aInstanceSize, ManualBloatEntry);
     if (entry) {
       entry->Dtor();
     }
   }
 
   bool loggingThisType = (!gTypesToLog || LogThisType(aType));
   intptr_t serialno = 0;
   if (gSerialNumbers && loggingThisType) {
--- a/xpcom/glue/nsISupportsImpl.h
+++ b/xpcom/glue/nsISupportsImpl.h
@@ -84,47 +84,55 @@ private:
 #define NS_LOG_RELEASE(_p, _rc, _type) \
   NS_LogRelease((_p), (_rc), (_type))
 
 #include "mozilla/TypeTraits.h"
 #define MOZ_ASSERT_CLASSNAME(_type)                         \
   static_assert(mozilla::IsClass<_type>::value,             \
                 "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
 // 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)
 
 #define MOZ_COUNT_CTOR_INHERITED(_type, _base)                    \
 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)
 
 #define MOZ_LOG_CTOR(_ptr, _name, _size) \
 do {                                     \
   NS_LogCtor((void*)_ptr, _name, _size); \
 } while (0)
 
 #define MOZ_COUNT_DTOR(_type)                                 \
 do {                                                          \
   MOZ_ASSERT_CLASSNAME(_type);                                \
+  MOZ_ASSERT_NOT_ISUPPORTS(_type);                            \
   NS_LogDtor((void*)this, #_type, sizeof(*this));             \
 } while (0)
 
 #define MOZ_COUNT_DTOR_INHERITED(_type, _base)                    \
 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)
 
 #define MOZ_LOG_DTOR(_ptr, _name, _size) \
 do {                                     \
   NS_LogDtor((void*)_ptr, _name, _size); \
 } while (0)
 
--- a/xpcom/reflect/xptcall/xptcprivate.h
+++ b/xpcom/reflect/xptcall/xptcprivate.h
@@ -42,22 +42,22 @@ public:
 class nsXPTCStubBase final : public nsIXPTCStubBase
 {
 public:
     NS_DECL_ISUPPORTS_INHERITED
 
 #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
 #undef SENTINEL_ENTRY
 
 #if defined(__clang__) || defined(__GNUC__)
 #define ATTRIBUTE_USED __attribute__ ((__used__))
 #else
--- a/xpcom/threads/SharedThreadPool.cpp
+++ b/xpcom/threads/SharedThreadPool.cpp
@@ -154,23 +154,21 @@ NS_IMETHODIMP_(MozExternalRefCountType) 
 NS_IMPL_QUERY_INTERFACE(SharedThreadPool, nsIThreadPool, nsIEventTarget)
 
 SharedThreadPool::SharedThreadPool(const nsCString& aName,
                                    nsIThreadPool* aPool)
   : mName(aName)
   , mPool(aPool)
   , mRefCnt(0)
 {
-  MOZ_COUNT_CTOR(SharedThreadPool);
   mEventTarget = do_QueryInterface(aPool);
 }
 
 SharedThreadPool::~SharedThreadPool()
 {
-  MOZ_COUNT_DTOR(SharedThreadPool);
 }
 
 nsresult
 SharedThreadPool::EnsureThreadLimitIsAtLeast(uint32_t aLimit)
 {
   // We limit the number of threads that we use. Note that we
   // set the thread limit to the same as the idle limit so that we're not
   // constantly creating and destroying threads (see Bug 881954). When the
--- a/xpcom/threads/nsTimerImpl.cpp
+++ b/xpcom/threads/nsTimerImpl.cpp
@@ -138,26 +138,24 @@ nsTimer::Release(void)
 nsTimerImpl::nsTimerImpl(nsITimer* aTimer) :
   mClosure(nullptr),
   mName(nsTimerImpl::Nothing),
   mCallbackType(CallbackType::Unknown),
   mGeneration(0),
   mDelay(0),
   mITimer(aTimer)
 {
-  MOZ_COUNT_CTOR(nsTimerImpl);
   // XXXbsmedberg: shouldn't this be in Init()?
   mEventTarget = static_cast<nsIEventTarget*>(NS_GetCurrentThread());
 
   mCallback.c = nullptr;
 }
 
 nsTimerImpl::~nsTimerImpl()
 {
-  MOZ_COUNT_DTOR(nsTimerImpl);
   ReleaseCallback();
 }
 
 //static
 nsresult
 nsTimerImpl::Startup()
 {
   nsresult rv;