Bug 1800582 - Trace mAccessibles rather than mChildren r=Jamie

Differential Revision: https://phabricator.services.mozilla.com/D162080
This commit is contained in:
Paul Bone 2022-11-16 09:55:28 +00:00
parent 712a94ff1f
commit 949432f9a7
2 changed files with 5 additions and 6 deletions

View File

@ -1402,9 +1402,10 @@ size_t DocAccessibleParent::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) {
size += mChildDocs.ShallowSizeOfExcludingThis(aMallocSizeOf);
// We don't recurse into mAccessibles because this is already done when
// RemoteAccessibleBase checked mChildren.
size += mAccessibles.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (auto i = mAccessibles.Iter(); !i.Done(); i.Next()) {
size += i.Get()->mProxy->SizeOfIncludingThis(aMallocSizeOf);
}
size += mPendingOOPChildDocs.ShallowSizeOfExcludingThis(aMallocSizeOf);

View File

@ -1732,11 +1732,9 @@ size_t RemoteAccessibleBase<Derived>::SizeOfExcludingThis(
size += mCachedFields->SizeOfIncludingThis(aMallocSizeOf);
}
// Count children
// We don't recurse into mChildren because they're already counted in their
// document's mAccessibles.
size += mChildren.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (Derived* child : mChildren) {
size += child->SizeOfIncludingThis(aMallocSizeOf);
}
return size;
}