diff --git a/content/base/src/nsDOMFile.cpp b/content/base/src/nsDOMFile.cpp index ffeb30039512..982bd0a4506f 100644 --- a/content/base/src/nsDOMFile.cpp +++ b/content/base/src/nsDOMFile.cpp @@ -648,9 +648,7 @@ class nsDOMMemoryFileDataOwnerMemoryReporter MOZ_FINAL : public MemoryMultiReporter { public: - nsDOMMemoryFileDataOwnerMemoryReporter() - : MemoryMultiReporter("dom-memory-file-data-owner") - {} + nsDOMMemoryFileDataOwnerMemoryReporter() {} NS_IMETHOD CollectReports(nsIMemoryReporterCallback *aCallback, nsISupports *aClosure) diff --git a/content/base/src/nsFrameMessageManager.cpp b/content/base/src/nsFrameMessageManager.cpp index 1aeffbbf0013..281bc0f483e2 100644 --- a/content/base/src/nsFrameMessageManager.cpp +++ b/content/base/src/nsFrameMessageManager.cpp @@ -1133,9 +1133,7 @@ namespace dom { class MessageManagerReporter MOZ_FINAL : public MemoryMultiReporter { public: - MessageManagerReporter() - : MemoryMultiReporter("message-manager") - {} + MessageManagerReporter() {} NS_IMETHOD CollectReports(nsIMemoryReporterCallback* aCallback, nsISupports* aData); diff --git a/content/canvas/src/WebGLContextReporter.cpp b/content/canvas/src/WebGLContextReporter.cpp index 678c285f89b6..f5207076a742 100644 --- a/content/canvas/src/WebGLContextReporter.cpp +++ b/content/canvas/src/WebGLContextReporter.cpp @@ -99,7 +99,6 @@ WebGLMemoryTracker* WebGLMemoryTracker::UniqueInstance() } WebGLMemoryTracker::WebGLMemoryTracker() - : MemoryMultiReporter("webgl") { } diff --git a/content/media/MediaDecoder.cpp b/content/media/MediaDecoder.cpp index 2bf4b1edad9d..bec0daf389d2 100644 --- a/content/media/MediaDecoder.cpp +++ b/content/media/MediaDecoder.cpp @@ -1858,7 +1858,6 @@ MediaDecoder::GetOwner() } MediaMemoryTracker::MediaMemoryTracker() - : MemoryMultiReporter("media") { } diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 8a8ae3818061..8e21165c8157 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -196,9 +196,7 @@ MemoryReportRequestParent::~MemoryReportRequestParent() class ContentParentsMemoryReporter MOZ_FINAL : public MemoryMultiReporter { public: - ContentParentsMemoryReporter() - : MemoryMultiReporter("content-parents") - {} + ContentParentsMemoryReporter() {} NS_IMETHOD CollectReports(nsIMemoryReporterCallback* cb, nsISupports* aClosure); diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 35870e901afb..e499c2af0db4 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -2019,8 +2019,7 @@ class WorkerPrivate::MemoryReporter MOZ_FINAL : public MemoryMultiReporter public: MemoryReporter(WorkerPrivate* aWorkerPrivate) - : MemoryMultiReporter("workers"), - mMutex(aWorkerPrivate->mMutex), mWorkerPrivate(aWorkerPrivate), + : mMutex(aWorkerPrivate->mMutex), mWorkerPrivate(aWorkerPrivate), mAlreadyMappedToAddon(false) { aWorkerPrivate->AssertIsOnWorkerThread(); diff --git a/gfx/thebes/gfxASurface.cpp b/gfx/thebes/gfxASurface.cpp index eb558318cf00..57b4b84c13b0 100644 --- a/gfx/thebes/gfxASurface.cpp +++ b/gfx/thebes/gfxASurface.cpp @@ -634,9 +634,7 @@ static int64_t gSurfaceMemoryUsed[gfxSurfaceTypeMax] = { 0 }; class SurfaceMemoryReporter MOZ_FINAL : public MemoryMultiReporter { public: - SurfaceMemoryReporter() - : MemoryMultiReporter("gfx-surface") - { } + SurfaceMemoryReporter() { } NS_IMETHOD CollectReports(nsIMemoryReporterCallback *aCb, nsISupports *aClosure) diff --git a/gfx/thebes/gfxFont.h b/gfx/thebes/gfxFont.h index 6a2421110830..4ce69ad4a328 100644 --- a/gfx/thebes/gfxFont.h +++ b/gfx/thebes/gfxFont.h @@ -954,9 +954,7 @@ protected: class MemoryReporter MOZ_FINAL : public mozilla::MemoryMultiReporter { public: - MemoryReporter() - : MemoryMultiReporter("font-cache") - {} + MemoryReporter() {} NS_IMETHOD CollectReports(nsIMemoryReporterCallback* aCb, nsISupports* aClosure); diff --git a/gfx/thebes/gfxPlatformFontList.cpp b/gfx/thebes/gfxPlatformFontList.cpp index 10a95a50f6ba..279a82e9d7a7 100644 --- a/gfx/thebes/gfxPlatformFontList.cpp +++ b/gfx/thebes/gfxPlatformFontList.cpp @@ -74,7 +74,6 @@ gfxFontListPrefObserver::Observe(nsISupports *aSubject, NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(FontListMallocSizeOf) gfxPlatformFontList::MemoryReporter::MemoryReporter() - : MemoryMultiReporter("font-list") {} NS_IMETHODIMP diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index cd7f3ccb8875..1f925ad548fb 100644 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -229,9 +229,7 @@ class GPUAdapterReporter : public MemoryMultiReporter } public: - GPUAdapterReporter() - : MemoryMultiReporter("gpu-adapter") - {} + GPUAdapterReporter() {} NS_IMETHOD CollectReports(nsIMemoryReporterCallback* aCb, diff --git a/image/src/imgLoader.cpp b/image/src/imgLoader.cpp index d15a279fc28f..211ea601fb5f 100644 --- a/image/src/imgLoader.cpp +++ b/image/src/imgLoader.cpp @@ -53,9 +53,7 @@ NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(ImagesMallocSizeOf) class imgMemoryReporter MOZ_FINAL : public MemoryMultiReporter { public: - imgMemoryReporter() - : MemoryMultiReporter("images") - {} + imgMemoryReporter() {} NS_IMETHOD CollectReports(nsIMemoryReporterCallback *callback, nsISupports *closure) diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index 1cc0672022b3..97a287d2b9da 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -2397,9 +2397,7 @@ ReportJSRuntimeExplicitTreeStats(const JS::RuntimeStats &rtStats, class JSMainRuntimeCompartmentsReporter MOZ_FINAL : public MemoryMultiReporter { public: - JSMainRuntimeCompartmentsReporter() - : MemoryMultiReporter("js-main-runtime-compartments") - {} + JSMainRuntimeCompartmentsReporter() {} typedef js::Vector Paths; diff --git a/modules/libpref/src/Preferences.cpp b/modules/libpref/src/Preferences.cpp index ae509ee2b67c..dfff204cf1e5 100644 --- a/modules/libpref/src/Preferences.cpp +++ b/modules/libpref/src/Preferences.cpp @@ -226,9 +226,7 @@ Preferences::SizeOfIncludingThisAndOtherStuff(mozilla::MallocSizeOf aMallocSizeO class PreferenceServiceReporter MOZ_FINAL : public MemoryMultiReporter { public: - PreferenceServiceReporter() - : MemoryMultiReporter("preference-service") - {} + PreferenceServiceReporter() {} NS_IMETHOD CollectReports(nsIMemoryReporterCallback* aCallback, nsISupports* aData); diff --git a/netwerk/cache/nsCacheService.cpp b/netwerk/cache/nsCacheService.cpp index 18f86d41d363..9ae9789abb12 100644 --- a/netwerk/cache/nsCacheService.cpp +++ b/netwerk/cache/nsCacheService.cpp @@ -1075,8 +1075,7 @@ NS_IMPL_ISUPPORTS_INHERITED2(nsCacheService, MemoryMultiReporter, nsICacheService, nsICacheServiceInternal) nsCacheService::nsCacheService() - : MemoryMultiReporter("cache-service"), - mObserver(nullptr), + : mObserver(nullptr), mLock("nsCacheService.mLock"), mCondVar(mLock, "nsCacheService.mCondVar"), mTimeStampLock("nsCacheService.mTimeStampLock"), diff --git a/startupcache/StartupCache.cpp b/startupcache/StartupCache.cpp index b6fe76a7e17f..c575545da106 100644 --- a/startupcache/StartupCache.cpp +++ b/startupcache/StartupCache.cpp @@ -126,8 +126,7 @@ enum StartupCache::TelemetrifyAge StartupCache::gPostFlushAgeAction = StartupCac NS_IMPL_ISUPPORTS_INHERITED0(StartupCache, MemoryMultiReporter) StartupCache::StartupCache() - : MemoryMultiReporter("startup-cache"), - mArchive(nullptr), mStartupWriteInitiated(false), mWriteThread(nullptr) + : mArchive(nullptr), mStartupWriteInitiated(false), mWriteThread(nullptr) { } StartupCache::~StartupCache() diff --git a/storage/src/mozStorageService.cpp b/storage/src/mozStorageService.cpp index e83cf9afb843..7f1c4b4df01c 100644 --- a/storage/src/mozStorageService.cpp +++ b/storage/src/mozStorageService.cpp @@ -278,8 +278,7 @@ Service::getSynchronousPref() int32_t Service::sDefaultPageSize = PREF_TS_PAGESIZE_DEFAULT; Service::Service() -: MemoryMultiReporter("storage-sqlite") -, mMutex("Service::mMutex") +: mMutex("Service::mMutex") , mSqliteVFS(nullptr) , mRegistrationMutex("Service::mRegistrationMutex") , mConnections() diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp index 547abad25aec..5dbee0f9d4f4 100644 --- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -2565,7 +2565,6 @@ nsCycleCollector::CollectReports(nsIHandleReportCallback* aHandleReport, //////////////////////////////////////////////////////////////////////// nsCycleCollector::nsCycleCollector() : - MemoryMultiReporter("cycle-collector"), mActivelyCollecting(false), mScanInProgress(false), mJSRuntime(nullptr), diff --git a/xpcom/base/nsIMemoryReporter.idl b/xpcom/base/nsIMemoryReporter.idl index ef9bb373d00b..a3acdc6a6315 100644 --- a/xpcom/base/nsIMemoryReporter.idl +++ b/xpcom/base/nsIMemoryReporter.idl @@ -500,9 +500,8 @@ namespace mozilla { // The following base class reduces the amount of boilerplate code required for // memory uni-reporters. You just need to provide the following. -// - The constant values: nameAndPath (which serves as both the reporters name, -// and the path in its single report), kind, units, and description. They -// are arguments to the MemoryUniReporter constructor. +// - The constant values: path, kind, units, and description. They are +// arguments to the MemoryUniReporter constructor. // - A private Amount() or public GetAmount() method. It can use the // MallocSizeOf method if necessary. (There is also // MallocSizeOfOn{Alloc,Free}, which can be useful.) Use Amount() if the @@ -510,17 +509,17 @@ namespace mozilla { // provide one or the other, you'll get assertion failures when the memory // reporter runs.) // -// The class name of subclasses should match the nameAndPath, minus the -// "explicit" (if present), and with "Reporter" at the end. For example: -// - nameAndPath == "explicit/dom/xyzzy" --> DOMXyzzyReporter -// - nameAndPath == "js-compartments/system" --> JSCompartmentsSystemReporter +// The class name of subclasses should match the path, minus the "explicit" (if +// present), and with "Reporter" at the end. For example: +// - path == "explicit/dom/xyzzy" --> DOMXyzzyReporter +// - path == "js-compartments/system" --> JSCompartmentsSystemReporter // class MemoryUniReporter : public nsIMemoryReporter { public: - MemoryUniReporter(const char* aNameAndPath, int32_t aKind, int32_t aUnits, + MemoryUniReporter(const char* aPath, int32_t aKind, int32_t aUnits, const char* aDescription) - : mNameAndPath(aNameAndPath) + : mPath(aPath) , mKind(aKind) , mUnits(aUnits) , mDescription(aDescription) @@ -530,12 +529,6 @@ public: NS_DECL_THREADSAFE_ISUPPORTS - NS_IMETHOD GetName(nsACString& aName) - { - aName.Assign(mNameAndPath); - return NS_OK; - } - NS_IMETHOD CollectReports(nsIMemoryReporterCallback* aCallback, nsISupports* aData) { @@ -544,7 +537,7 @@ public: if (NS_WARN_IF(NS_FAILED(rv))) return rv; - return aCallback->Callback(EmptyCString(), mNameAndPath, mKind, mUnits, + return aCallback->Callback(EmptyCString(), mPath, mKind, mUnits, amount, mDescription, aData); } @@ -566,7 +559,7 @@ protected: NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_ALLOC_FUN(MallocSizeOfOnAlloc) NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_FREE_FUN(MallocSizeOfOnFree) - const nsCString mNameAndPath; + const nsCString mPath; const int32_t mKind; const int32_t mUnits; const nsCString mDescription; @@ -587,9 +580,7 @@ protected: class MemoryMultiReporter : public nsIMemoryReporter { public: - MemoryMultiReporter(const char* aName) - : mName(aName) - {} + MemoryMultiReporter() {} virtual ~MemoryMultiReporter() {} @@ -602,8 +593,6 @@ protected: NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(MallocSizeOf) NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_ALLOC_FUN(MallocSizeOfOnAlloc) NS_MEMORY_REPORTER_MALLOC_SIZEOF_ON_FREE_FUN(MallocSizeOfOnFree) - - const nsCString mName; }; } // namespace mozilla diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index 0ffb34ef1f64..1252e270cf33 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -799,9 +799,7 @@ namespace dmd { class DMDReporter MOZ_FINAL : public MemoryMultiReporter { public: - DMDReporter() - : MemoryMultiReporter("dmd") - {} + DMDReporter() {} NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport, nsISupports* aData) diff --git a/xpcom/ds/nsObserverService.cpp b/xpcom/ds/nsObserverService.cpp index b3ef8525f2b6..506ccb028efc 100644 --- a/xpcom/ds/nsObserverService.cpp +++ b/xpcom/ds/nsObserverService.cpp @@ -175,7 +175,6 @@ NS_IMPL_ISUPPORTS_INHERITED2( nsObserverService) nsObserverService::nsObserverService() : - MemoryMultiReporter("observer-service"), mShuttingDown(false) { }