mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-09 08:48:07 +00:00
Bug 1016345 - Add memory reporting for nsHTMLCSSStyleSheet's nsDataHashtable's buffer and the buffers of its nsString keys. r=dbaron
This commit is contained in:
parent
4c5451f6fc
commit
cf11dda286
@ -148,10 +148,26 @@ nsHTMLCSSStyleSheet::MediumFeaturesChanged(nsPresContext* aPresContext)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t
|
||||||
|
SizeOfCachedStyleAttrsEntryExcludingThis(nsStringHashKey::KeyType& aKey,
|
||||||
|
MiscContainer* const& aData,
|
||||||
|
mozilla::MallocSizeOf aMallocSizeOf,
|
||||||
|
void* userArg)
|
||||||
|
{
|
||||||
|
// We don't own the MiscContainers so we don't count them. We do care about
|
||||||
|
// the size of the nsString members in the keys though.
|
||||||
|
return aKey.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||||
|
}
|
||||||
|
|
||||||
/* virtual */ size_t
|
/* virtual */ size_t
|
||||||
nsHTMLCSSStyleSheet::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
nsHTMLCSSStyleSheet::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||||
{
|
{
|
||||||
return 0;
|
// The size of mCachedStyleAttrs's mTable member (a PLDHashTable) is
|
||||||
|
// significant in itself, but more significant is the size of the nsString
|
||||||
|
// members of the nsStringHashKeys.
|
||||||
|
return mCachedStyleAttrs.SizeOfExcludingThis(SizeOfCachedStyleAttrsEntryExcludingThis,
|
||||||
|
aMallocSizeOf,
|
||||||
|
nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* virtual */ size_t
|
/* virtual */ size_t
|
||||||
|
Loading…
x
Reference in New Issue
Block a user