Bug 943660 (part 2) - Remove remnants of Remove nsIMemoryReporter::name.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 03 Dec 2013 20:01:24 -0800
changeset 173538 30d37e5c0b90d6ccce6c79aa31dc93be0eb4ad55
parent 173537 4dd987eef4313d4163da241b79e18000504f07b0
child 173539 c732b8ff38697d6841d6cb1ef0cd14dbe87205f9
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs943660
milestone28.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 943660 (part 2) - Remove remnants of Remove nsIMemoryReporter::name.
content/base/src/nsDOMFile.cpp
content/base/src/nsFrameMessageManager.cpp
content/canvas/src/WebGLContextReporter.cpp
content/media/MediaDecoder.cpp
dom/ipc/ContentParent.cpp
dom/workers/WorkerPrivate.cpp
gfx/thebes/gfxASurface.cpp
gfx/thebes/gfxFont.h
gfx/thebes/gfxPlatformFontList.cpp
gfx/thebes/gfxWindowsPlatform.cpp
image/src/imgLoader.cpp
js/xpconnect/src/XPCJSRuntime.cpp
modules/libpref/src/Preferences.cpp
netwerk/cache/nsCacheService.cpp
startupcache/StartupCache.cpp
storage/src/mozStorageService.cpp
xpcom/base/nsCycleCollector.cpp
xpcom/base/nsIMemoryReporter.idl
xpcom/base/nsMemoryReporterManager.cpp
xpcom/ds/nsObserverService.cpp
--- a/content/base/src/nsDOMFile.cpp
+++ b/content/base/src/nsDOMFile.cpp
@@ -643,19 +643,17 @@ nsDOMMemoryFile::DataOwner::sDataOwners;
 nsDOMMemoryFile::DataOwner::sMemoryReporterRegistered;
 
 NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(DOMMemoryFileDataOwnerMallocSizeOf)
 
 class nsDOMMemoryFileDataOwnerMemoryReporter MOZ_FINAL
   : public MemoryMultiReporter
 {
 public:
-  nsDOMMemoryFileDataOwnerMemoryReporter()
-    : MemoryMultiReporter("dom-memory-file-data-owner")
-  {}
+  nsDOMMemoryFileDataOwnerMemoryReporter() {}
 
   NS_IMETHOD CollectReports(nsIMemoryReporterCallback *aCallback,
                             nsISupports *aClosure)
   {
     typedef nsDOMMemoryFile::DataOwner DataOwner;
 
     StaticMutexAutoLock lock(DataOwner::sDataOwnerMutex);
 
--- a/content/base/src/nsFrameMessageManager.cpp
+++ b/content/base/src/nsFrameMessageManager.cpp
@@ -1128,19 +1128,17 @@ struct MessageManagerReferentCount
 } // anonymous namespace
 
 namespace mozilla {
 namespace dom {
 
 class MessageManagerReporter MOZ_FINAL : public MemoryMultiReporter
 {
 public:
-  MessageManagerReporter()
-    : MemoryMultiReporter("message-manager")
-  {}
+  MessageManagerReporter() {}
 
   NS_IMETHOD CollectReports(nsIMemoryReporterCallback* aCallback,
                             nsISupports* aData);
 
   static const size_t kSuspectReferentCount = 300;
 protected:
   void CountReferents(nsFrameMessageManager* aMessageManager,
                       MessageManagerReferentCount* aReferentCount);
--- a/content/canvas/src/WebGLContextReporter.cpp
+++ b/content/canvas/src/WebGLContextReporter.cpp
@@ -94,17 +94,16 @@ WebGLMemoryTracker* WebGLMemoryTracker::
     if (!sUniqueInstance) {
         sUniqueInstance = new WebGLMemoryTracker;
         sUniqueInstance->InitMemoryReporter();
     }
     return sUniqueInstance;
 }
 
 WebGLMemoryTracker::WebGLMemoryTracker()
-    : MemoryMultiReporter("webgl")
 {
 }
 
 void
 WebGLMemoryTracker::InitMemoryReporter()
 {
     RegisterWeakMemoryReporter(this);
 }
--- a/content/media/MediaDecoder.cpp
+++ b/content/media/MediaDecoder.cpp
@@ -1853,17 +1853,16 @@ MediaMemoryTracker::CollectReports(nsIHa
 MediaDecoderOwner*
 MediaDecoder::GetOwner()
 {
   MOZ_ASSERT(NS_IsMainThread());
   return mOwner;
 }
 
 MediaMemoryTracker::MediaMemoryTracker()
-  : MemoryMultiReporter("media")
 {
 }
 
 void
 MediaMemoryTracker::InitMemoryReporter()
 {
   RegisterWeakMemoryReporter(this);
 }
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -191,19 +191,17 @@ MemoryReportRequestParent::~MemoryReport
 {
     MOZ_COUNT_DTOR(MemoryReportRequestParent);
 }
 
 // A memory reporter for ContentParent objects themselves.
 class ContentParentsMemoryReporter MOZ_FINAL : public MemoryMultiReporter
 {
 public:
-    ContentParentsMemoryReporter()
-      : MemoryMultiReporter("content-parents")
-    {}
+    ContentParentsMemoryReporter() {}
 
     NS_IMETHOD CollectReports(nsIMemoryReporterCallback* cb,
                               nsISupports* aClosure);
 };
 
 NS_IMETHODIMP
 ContentParentsMemoryReporter::CollectReports(nsIMemoryReporterCallback* cb,
                                              nsISupports* aClosure)
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -2014,18 +2014,17 @@ class WorkerPrivate::MemoryReporter MOZ_
 
   SharedMutex mMutex;
   WorkerPrivate* mWorkerPrivate;
   nsCString mRtPath;
   bool mAlreadyMappedToAddon;
 
 public:
   MemoryReporter(WorkerPrivate* aWorkerPrivate)
-  : MemoryMultiReporter("workers"),
-    mMutex(aWorkerPrivate->mMutex), mWorkerPrivate(aWorkerPrivate),
+  : mMutex(aWorkerPrivate->mMutex), mWorkerPrivate(aWorkerPrivate),
     mAlreadyMappedToAddon(false)
   {
     aWorkerPrivate->AssertIsOnWorkerThread();
 
     nsCString escapedDomain(aWorkerPrivate->Domain());
     escapedDomain.ReplaceChar('/', '\\');
 
     NS_ConvertUTF16toUTF8 escapedURL(aWorkerPrivate->ScriptURL());
--- a/gfx/thebes/gfxASurface.cpp
+++ b/gfx/thebes/gfxASurface.cpp
@@ -629,19 +629,17 @@ PR_STATIC_ASSERT(uint32_t(CAIRO_SURFACE_
 
 /* Surface size memory reporting */
 
 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)
     {
         size_t len = NS_ARRAY_LENGTH(sSurfaceMemoryReporterAttrs);
         for (size_t i = 0; i < len; i++) {
             int64_t amount = gSurfaceMemoryUsed[i];
 
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -949,19 +949,17 @@ public:
                                 FontCacheSizes* aSizes) const;
     void AddSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
                                 FontCacheSizes* aSizes) const;
 
 protected:
     class MemoryReporter MOZ_FINAL : public mozilla::MemoryMultiReporter
     {
     public:
-        MemoryReporter()
-            : MemoryMultiReporter("font-cache")
-        {}
+        MemoryReporter() {}
 
         NS_IMETHOD CollectReports(nsIMemoryReporterCallback* aCb,
                                   nsISupports* aClosure);
     };
 
     // Observer for notifications that the font cache cares about
     class Observer MOZ_FINAL
         : public nsIObserver
--- a/gfx/thebes/gfxPlatformFontList.cpp
+++ b/gfx/thebes/gfxPlatformFontList.cpp
@@ -69,17 +69,16 @@ gfxFontListPrefObserver::Observe(nsISupp
     gfxPlatformFontList::PlatformFontList()->ClearPrefFonts();
     gfxFontCache::GetCache()->AgeAllGenerations();
     return NS_OK;
 }
 
 NS_MEMORY_REPORTER_MALLOC_SIZEOF_FUN(FontListMallocSizeOf)
 
 gfxPlatformFontList::MemoryReporter::MemoryReporter()
-    : MemoryMultiReporter("font-list")
 {}
 
 NS_IMETHODIMP
 gfxPlatformFontList::MemoryReporter::CollectReports
     (nsIMemoryReporterCallback* aCb,
      nsISupports* aClosure)
 {
     FontListSizes sizes;
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -224,19 +224,17 @@ class GPUAdapterReporter : public Memory
                 DXGIDevice->Release();
             }
         }
 
         return result;
     }
 
 public:
-    GPUAdapterReporter()
-      : MemoryMultiReporter("gpu-adapter")
-    {}
+    GPUAdapterReporter() {}
 
     NS_IMETHOD
     CollectReports(nsIMemoryReporterCallback* aCb,
                    nsISupports* aClosure)
     {
         HANDLE ProcessHandle = GetCurrentProcess();
 
         int64_t dedicatedBytesUsed = 0;
--- a/image/src/imgLoader.cpp
+++ b/image/src/imgLoader.cpp
@@ -48,19 +48,17 @@
 using namespace mozilla;
 using namespace mozilla::image;
 
 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)
   {
     AllSizes chrome;
     AllSizes content;
 
     for (uint32_t i = 0; i < mKnownLoaders.Length(); i++) {
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -2392,19 +2392,17 @@ ReportJSRuntimeExplicitTreeStats(const J
 }
 
 
 } // namespace xpc
 
 class JSMainRuntimeCompartmentsReporter MOZ_FINAL : public MemoryMultiReporter
 {
   public:
-    JSMainRuntimeCompartmentsReporter()
-      : MemoryMultiReporter("js-main-runtime-compartments")
-    {}
+    JSMainRuntimeCompartmentsReporter() {}
 
     typedef js::Vector<nsCString, 0, js::SystemAllocPolicy> Paths;
 
     static void CompartmentCallback(JSRuntime *rt, void* data, JSCompartment *c) {
         // silently ignore OOM errors
         Paths *paths = static_cast<Paths *>(data);
         nsCString path;
         GetCompartmentName(c, path, true);
--- a/modules/libpref/src/Preferences.cpp
+++ b/modules/libpref/src/Preferences.cpp
@@ -221,19 +221,17 @@ Preferences::SizeOfIncludingThisAndOther
   // DMD indicates they are not significant.
   n += pref_SizeOfPrivateData(aMallocSizeOf);
   return n;
 }
 
 class PreferenceServiceReporter MOZ_FINAL : public MemoryMultiReporter
 {
 public:
-  PreferenceServiceReporter()
-    : MemoryMultiReporter("preference-service")
-  {}
+  PreferenceServiceReporter() {}
 
   NS_IMETHOD CollectReports(nsIMemoryReporterCallback* aCallback,
                             nsISupports* aData);
 
 protected:
   static const uint32_t kSuspectReferentCount = 1000;
   static PLDHashOperator CountReferents(PrefCallback* aKey,
                                         nsAutoPtr<PrefCallback>& aCallback,
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -1070,18 +1070,17 @@ private:
  * nsCacheService
  *****************************************************************************/
 nsCacheService *   nsCacheService::gService = nullptr;
 
 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"),
       mInitialized(false),
       mClearingEntries(false),
       mEnableMemoryDevice(true),
       mEnableDiskDevice(true),
       mMemoryDevice(nullptr),
--- a/startupcache/StartupCache.cpp
+++ b/startupcache/StartupCache.cpp
@@ -121,18 +121,17 @@ StartupCache::InitSingleton()
 StaticRefPtr<StartupCache> StartupCache::gStartupCache;
 bool StartupCache::gShutdownInitiated;
 bool StartupCache::gIgnoreDiskCache;
 enum StartupCache::TelemetrifyAge StartupCache::gPostFlushAgeAction = StartupCache::IGNORE_AGE;
 
 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()
 {
   if (mTimer) {
     mTimer->Cancel();
   }
 
--- a/storage/src/mozStorageService.cpp
+++ b/storage/src/mozStorageService.cpp
@@ -273,18 +273,17 @@ int32_t
 Service::getSynchronousPref()
 {
   return sSynchronousPref;
 }
 
 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()
 {
 }
 
 Service::~Service()
 {
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -2560,17 +2560,16 @@ nsCycleCollector::CollectReports(nsIHand
 };
 
 
 ////////////////////////////////////////////////////////////////////////
 // Collector implementation
 ////////////////////////////////////////////////////////////////////////
 
 nsCycleCollector::nsCycleCollector() :
-    MemoryMultiReporter("cycle-collector"),
     mActivelyCollecting(false),
     mScanInProgress(false),
     mJSRuntime(nullptr),
     mIncrementalPhase(IdlePhase),
     mThread(NS_GetCurrentThread()),
     mWhiteNodeCount(0),
     mBeforeUnlinkCB(nullptr),
     mForgetSkippableCB(nullptr),
--- a/xpcom/base/nsIMemoryReporter.idl
+++ b/xpcom/base/nsIMemoryReporter.idl
@@ -495,61 +495,54 @@ void RunReporters();
   {                                                                           \
       return moz_malloc_size_of(aPtr);                                        \
   }
 
 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
 //   reporter is infallible, and GetAmount() otherwise.  (If you fail to
 //   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)
   {}
 
   virtual ~MemoryUniReporter() {}
 
   NS_DECL_THREADSAFE_ISUPPORTS
 
-  NS_IMETHOD GetName(nsACString& aName)
-  {
-    aName.Assign(mNameAndPath);
-    return NS_OK;
-  }
-
   NS_IMETHOD CollectReports(nsIMemoryReporterCallback* aCallback,
                             nsISupports* aData)
   {
     int64_t amount;
     nsresult rv = GetAmount(&amount);
     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);
   }
 
 protected:
   NS_IMETHOD GetAmount(int64_t* aAmount)
   {
     *aAmount = Amount();
     return NS_OK;
@@ -561,17 +554,17 @@ protected:
     MOZ_ASSERT(false);
     return 0;
   }
 
   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 mNameAndPath;
+  const nsCString mPath;
   const int32_t   mKind;
   const int32_t   mUnits;
   const nsCString mDescription;
 };
 
 // The following base class reduces the amount of boilerplate code required for
 // memory multi-reporters.  You just need to provide the following.
 // - The constant value: name.  It is an argument to the MemoryMultiReporter
@@ -582,30 +575,26 @@ protected:
 //
 // The class name of subclasses should match the name, with "Reporter" at
 // the end.  For example:
 // - name == "foo" --> FooMultiReporter
 //
 class MemoryMultiReporter : public nsIMemoryReporter
 {
 public:
-  MemoryMultiReporter(const char* aName)
-    : mName(aName)
-  {}
+  MemoryMultiReporter() {}
 
   virtual ~MemoryMultiReporter() {}
 
   NS_DECL_THREADSAFE_ISUPPORTS
 
   NS_IMETHOD CollectReports(nsIMemoryReporterCallback* aCb,
                             nsISupports* aClosure) = 0;
 
 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
 
 %}
--- a/xpcom/base/nsMemoryReporterManager.cpp
+++ b/xpcom/base/nsMemoryReporterManager.cpp
@@ -794,19 +794,17 @@ private:
 #ifdef MOZ_DMD
 
 namespace mozilla {
 namespace dmd {
 
 class DMDReporter MOZ_FINAL : public MemoryMultiReporter
 {
 public:
-  DMDReporter()
-    : MemoryMultiReporter("dmd")
-  {}
+  DMDReporter() {}
 
   NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
                             nsISupports* aData)
   {
     dmd::Sizes sizes;
     dmd::SizeOf(&sizes);
 
 #define REPORT(_path, _amount, _desc)                                         \
--- a/xpcom/ds/nsObserverService.cpp
+++ b/xpcom/ds/nsObserverService.cpp
@@ -170,17 +170,16 @@ nsObserverService::CollectReports(nsIHan
 
 NS_IMPL_ISUPPORTS_INHERITED2(
     nsObserverService,
     MemoryMultiReporter,
     nsIObserverService,
     nsObserverService)
 
 nsObserverService::nsObserverService() :
-    MemoryMultiReporter("observer-service"),
     mShuttingDown(false)
 {
 }
 
 nsObserverService::~nsObserverService(void)
 {
     Shutdown();
 }