Bug 955942 (part 1) - Remove unnecessary nsIMemoryReporter qualifiers from UNITS_* and KIND_* constants. r=mccr8.

--HG--
extra : rebase_source : f760568c08af03d9fec316bf95e7d4388078a03d
This commit is contained in:
Nicholas Nethercote 2013-12-11 11:59:39 -08:00
parent 45623ec7cf
commit 9505172caf
8 changed files with 27 additions and 40 deletions

View File

@ -688,9 +688,7 @@ public:
nsPrintfCString(
"explicit/dom/memory-file-data/large/file(length=%llu, sha1=%s)",
owner->mLength, digestString.get()),
nsIMemoryReporter::KIND_HEAP,
nsIMemoryReporter::UNITS_BYTES,
size,
KIND_HEAP, UNITS_BYTES, size,
nsPrintfCString(
"Memory used to back a memory file of length %llu bytes. The file "
"has a sha1 of %s.\n\n"
@ -707,9 +705,7 @@ public:
nsresult rv = aCallback->Callback(
/* process */ NS_LITERAL_CSTRING(""),
NS_LITERAL_CSTRING("explicit/dom/memory-file-data/small"),
nsIMemoryReporter::KIND_HEAP,
nsIMemoryReporter::UNITS_BYTES,
smallObjectsTotal,
KIND_HEAP, UNITS_BYTES, smallObjectsTotal,
nsPrintfCString(
"Memory used to back small memory files (less than %d bytes each).\n\n"
"Note that the allocator may round up a memory file's length -- "

View File

@ -500,8 +500,7 @@ nsWindowMemoryReporter::CollectReports(nsIMemoryReporterCallback* aCb,
do { \
nsresult rv; \
rv = aCb->Callback(EmptyCString(), NS_LITERAL_CSTRING(_path), \
nsIMemoryReporter::KIND_OTHER, \
nsIMemoryReporter::UNITS_BYTES, _amount, \
KIND_OTHER, UNITS_BYTES, _amount, \
NS_LITERAL_CSTRING(_desc), aClosure); \
NS_ENSURE_SUCCESS(rv, rv); \
} while (0)

View File

@ -246,8 +246,8 @@ ContentParentsMemoryReporter::CollectReports(nsIMemoryReporterCallback* cb,
nsresult rv = cb->Callback(/* process */ EmptyCString(),
path,
nsIMemoryReporter::KIND_OTHER,
nsIMemoryReporter::UNITS_COUNT,
KIND_OTHER,
UNITS_COUNT,
numQueuedMessages,
desc,
aClosure);

View File

@ -1376,15 +1376,13 @@ gfxFontCache::MemoryReporter::CollectReports
aCb->Callback(EmptyCString(),
NS_LITERAL_CSTRING("explicit/gfx/font-cache"),
nsIMemoryReporter::KIND_HEAP, nsIMemoryReporter::UNITS_BYTES,
sizes.mFontInstances,
KIND_HEAP, UNITS_BYTES, sizes.mFontInstances,
NS_LITERAL_CSTRING("Memory used for active font instances."),
aClosure);
aCb->Callback(EmptyCString(),
NS_LITERAL_CSTRING("explicit/gfx/font-shaped-words"),
nsIMemoryReporter::KIND_HEAP, nsIMemoryReporter::UNITS_BYTES,
sizes.mShapedWords,
KIND_HEAP, UNITS_BYTES, sizes.mShapedWords,
NS_LITERAL_CSTRING("Memory used to cache shaped glyph data."),
aClosure);

View File

@ -318,8 +318,7 @@ public:
do { \
nsresult rv; \
rv = aCb->Callback(EmptyCString(), NS_LITERAL_CSTRING(_path), \
nsIMemoryReporter::KIND_OTHER, \
nsIMemoryReporter::UNITS_BYTES, _amount, \
KIND_OTHER, UNITS_BYTES, _amount, \
NS_LITERAL_CSTRING(_desc), aClosure); \
NS_ENSURE_SUCCESS(rv, rv); \
} while (0)

View File

@ -70,57 +70,57 @@ public:
do { \
nsresult rv; \
rv = callback->Callback(EmptyCString(), NS_LITERAL_CSTRING(_path), \
_kind, nsIMemoryReporter::UNITS_BYTES, _amount, \
_kind, UNITS_BYTES, _amount, \
NS_LITERAL_CSTRING(_desc), closure); \
NS_ENSURE_SUCCESS(rv, rv); \
} while (0)
REPORT("explicit/images/chrome/used/raw",
nsIMemoryReporter::KIND_HEAP, chrome.mUsedRaw,
KIND_HEAP, chrome.mUsedRaw,
"Memory used by in-use chrome images (compressed data).");
REPORT("explicit/images/chrome/used/uncompressed-heap",
nsIMemoryReporter::KIND_HEAP, chrome.mUsedUncompressedHeap,
KIND_HEAP, chrome.mUsedUncompressedHeap,
"Memory used by in-use chrome images (uncompressed data).");
REPORT("explicit/images/chrome/used/uncompressed-nonheap",
nsIMemoryReporter::KIND_NONHEAP, chrome.mUsedUncompressedNonheap,
KIND_NONHEAP, chrome.mUsedUncompressedNonheap,
"Memory used by in-use chrome images (uncompressed data).");
REPORT("explicit/images/chrome/unused/raw",
nsIMemoryReporter::KIND_HEAP, chrome.mUnusedRaw,
KIND_HEAP, chrome.mUnusedRaw,
"Memory used by not in-use chrome images (compressed data).");
REPORT("explicit/images/chrome/unused/uncompressed-heap",
nsIMemoryReporter::KIND_HEAP, chrome.mUnusedUncompressedHeap,
KIND_HEAP, chrome.mUnusedUncompressedHeap,
"Memory used by not in-use chrome images (uncompressed data).");
REPORT("explicit/images/chrome/unused/uncompressed-nonheap",
nsIMemoryReporter::KIND_NONHEAP, chrome.mUnusedUncompressedNonheap,
KIND_NONHEAP, chrome.mUnusedUncompressedNonheap,
"Memory used by not in-use chrome images (uncompressed data).");
REPORT("explicit/images/content/used/raw",
nsIMemoryReporter::KIND_HEAP, content.mUsedRaw,
KIND_HEAP, content.mUsedRaw,
"Memory used by in-use content images (compressed data).");
REPORT("explicit/images/content/used/uncompressed-heap",
nsIMemoryReporter::KIND_HEAP, content.mUsedUncompressedHeap,
KIND_HEAP, content.mUsedUncompressedHeap,
"Memory used by in-use content images (uncompressed data).");
REPORT("explicit/images/content/used/uncompressed-nonheap",
nsIMemoryReporter::KIND_NONHEAP, content.mUsedUncompressedNonheap,
KIND_NONHEAP, content.mUsedUncompressedNonheap,
"Memory used by in-use content images (uncompressed data).");
REPORT("explicit/images/content/unused/raw",
nsIMemoryReporter::KIND_HEAP, content.mUnusedRaw,
KIND_HEAP, content.mUnusedRaw,
"Memory used by not in-use content images (compressed data).");
REPORT("explicit/images/content/unused/uncompressed-heap",
nsIMemoryReporter::KIND_HEAP, content.mUnusedUncompressedHeap,
KIND_HEAP, content.mUnusedUncompressedHeap,
"Memory used by not in-use content images (uncompressed data).");
REPORT("explicit/images/content/unused/uncompressed-nonheap",
nsIMemoryReporter::KIND_NONHEAP, content.mUnusedUncompressedNonheap,
KIND_NONHEAP, content.mUnusedUncompressedNonheap,
"Memory used by not in-use content images (uncompressed data).");
#undef REPORT

View File

@ -301,7 +301,7 @@ PreferenceServiceReporter::CollectReports(nsIMemoryReporterCallback* aCb,
} while (0)
REPORT(NS_LITERAL_CSTRING("explicit/preferences"),
nsIMemoryReporter::KIND_HEAP, nsIMemoryReporter::UNITS_BYTES,
KIND_HEAP, UNITS_BYTES,
Preferences::SizeOfIncludingThisAndOtherStuff(PreferenceServiceMallocSizeOf),
"Memory used by the preferences system.");
@ -323,26 +323,22 @@ PreferenceServiceReporter::CollectReports(nsIMemoryReporterCallback* aCb,
"referent(pref=%s)", suspect.get());
REPORT(suspectPath,
nsIMemoryReporter::KIND_OTHER, nsIMemoryReporter::UNITS_COUNT,
totalReferentCount,
KIND_OTHER, UNITS_COUNT, totalReferentCount,
"A preference with a suspiciously large number "
"referents (symptom of a leak).");
}
REPORT(NS_LITERAL_CSTRING("preference-service/referent/strong"),
nsIMemoryReporter::KIND_OTHER, nsIMemoryReporter::UNITS_COUNT,
referentCount.numStrong,
KIND_OTHER, UNITS_COUNT, referentCount.numStrong,
"The number of strong referents held by the preference service.");
REPORT(NS_LITERAL_CSTRING("preference-service/referent/weak/alive"),
nsIMemoryReporter::KIND_OTHER, nsIMemoryReporter::UNITS_COUNT,
referentCount.numWeakAlive,
KIND_OTHER, UNITS_COUNT, referentCount.numWeakAlive,
"The number of weak referents held by the preference service "
"that are still alive.");
REPORT(NS_LITERAL_CSTRING("preference-service/referent/weak/dead"),
nsIMemoryReporter::KIND_OTHER, nsIMemoryReporter::UNITS_COUNT,
referentCount.numWeakDead,
KIND_OTHER, UNITS_COUNT, referentCount.numWeakDead,
"The number of weak referents held by the preference service "
"that are dead.");

View File

@ -813,8 +813,7 @@ public:
do { \
nsresult rv; \
rv = aHandleReport->Callback(EmptyCString(), NS_LITERAL_CSTRING(_path), \
nsIMemoryReporter::KIND_HEAP, \
nsIMemoryReporter::UNITS_BYTES, _amount, \
KIND_HEAP, UNITS_BYTES, _amount, \
NS_LITERAL_CSTRING(_desc), aData); \
if (NS_WARN_IF(NS_FAILED(rv))) \
return rv; \