Bug 1368654 - pt 2 - (Partially) fix SizeOf method in FrameProperties. r=mats
authorJonathan Kew <jkew@mozilla.com>
Wed, 31 May 2017 19:52:50 +0100
changeset 409765 3947c1473651b4736840973914f83d655e3acbe3
parent 409764 172218dd971dc5ede35cdb26a706124576c85efd
child 409766 4abbee1979c215ffbf126534d45bf1ca76c0b29b
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1368654
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1368654 - pt 2 - (Partially) fix SizeOf method in FrameProperties. r=mats
layout/base/FrameProperties.cpp
--- a/layout/base/FrameProperties.cpp
+++ b/layout/base/FrameProperties.cpp
@@ -93,12 +93,17 @@ FrameProperties::DeleteAll(const nsIFram
   }
 
   mProperties.Clear();
 }
 
 size_t
 FrameProperties::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
-  return mProperties.Length() * sizeof(PropertyValue);
+  // We currently report only the shallow size of the mProperties array.
+  // As for the PropertyValue entries: we don't need to measure the mProperty
+  // field of because it always points to static memory, and we can't measure
+  // mValue because the type is opaque.
+  // XXX Can we do better, e.g. with a method on the descriptor?
+  return mProperties.ShallowSizeOfExcludingThis(aMallocSizeOf);
 }
 
 } // namespace mozilla