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 412123 3947c1473651b4736840973914f83d655e3acbe3
parent 412122 172218dd971dc5ede35cdb26a706124576c85efd
child 412124 4abbee1979c215ffbf126534d45bf1ca76c0b29b
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [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