No bug - Add a comment to nsStyleSet::SizeOfIncludingThis noting that it does _not_ count the size of the sheets in mSheets, only the size of the mSheets buffer.

This commit is contained in:
Jonathan Watt 2014-05-24 21:37:12 +01:00
parent ec734706e6
commit bdf4d7ea6b

View File

@ -156,6 +156,11 @@ nsStyleSet::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
if (mRuleProcessors[i]) {
n += mRuleProcessors[i]->SizeOfIncludingThis(aMallocSizeOf);
}
// mSheets is a C-style array of nsCOMArrays. We do not own the sheets in
// the nsCOMArrays (either the nsLayoutStyleSheetCache singleton or our
// document owns them) so we do not count the sheets here (we pass nullptr
// as the aSizeOfElementIncludingThis argument). All we're doing here is
// counting the size of the nsCOMArrays' buffers.
n += mSheets[i].SizeOfExcludingThis(nullptr, aMallocSizeOf);
}