Bug 1350789 - Make CSSStyleSheet::SizeOfIncludingThis correctly check for shared inners. r?bradwerth
MozReview-Commit-ID: 3hsuiR5SwZT
--- a/layout/style/CSSStyleSheet.cpp
+++ b/layout/style/CSSStyleSheet.cpp
@@ -180,18 +180,18 @@ CSSStyleSheet::SizeOfIncludingThis(Mallo
while (s) {
// Each inner can be shared by multiple sheets. So we only count the inner
// if this sheet is the last one in the list of those sharing it. As a
// result, the last such sheet takes all the blame for the memory
// consumption of the inner, which isn't ideal but it's better than
// double-counting the inner. We use last instead of first since the first
// sheet may be held in the nsXULPrototypeCache and not used in a window at
// all.
- if (mInner->mSheets.LastElement() == s) {
- n += Inner()->SizeOfIncludingThis(aMallocSizeOf);
+ if (s->Inner()->mSheets.LastElement() == s) {
+ n += s->Inner()->SizeOfIncludingThis(aMallocSizeOf);
}
// Measurement of the following members may be added later if DMD finds it
// is worthwhile:
// - s->mRuleCollection
// - s->mRuleProcessors
//
// The following members are not measured: