Bug 995880. Correctly include non-heap memory use by VolatileBuffer's in memory use of images. r=mwu, a=lsblakk
authorTimothy Nikkel <tnikkel@gmail.com>
Tue, 15 Apr 2014 00:24:01 -0500
changeset 192962 8fdfcb379dda6f712ab1e3144a05d2046559713e
parent 192961 73afe69f15d32f3f518ba3e09406423377621850
child 192963 6baeb7902e341a3b5bf15e36c9023593a02ad52f
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmwu, lsblakk
bugs995880, 962670
milestone30.0a2
Bug 995880. Correctly include non-heap memory use by VolatileBuffer's in memory use of images. r=mwu, a=lsblakk Bug 962670 added VolatileBuffer's but only included the heap memory use.
image/src/imgFrame.cpp
--- a/image/src/imgFrame.cpp
+++ b/image/src/imgFrame.cpp
@@ -961,16 +961,20 @@ imgFrame::SizeOfExcludingThisWithCompute
     n += n2;
   }
 
   if (mVBuf && aLocation == gfxMemoryLocation::IN_PROCESS_HEAP) {
     n += aMallocSizeOf(mVBuf);
     n += mVBuf->HeapSizeOfExcludingThis(aMallocSizeOf);
   }
 
+  if (mVBuf && aLocation == gfxMemoryLocation::IN_PROCESS_NONHEAP) {
+    n += mVBuf->NonHeapSizeOfExcludingThis();
+  }
+
   if (mOptSurface && aLocation == mOptSurface->GetMemoryLocation()) {
     size_t n2 = 0;
     if (aLocation == gfxMemoryLocation::IN_PROCESS_HEAP &&
         mOptSurface->SizeOfIsMeasured()) {
       // HEAP: measure (but only if the sub-class is capable of measuring)
       n2 = mOptSurface->SizeOfIncludingThis(aMallocSizeOf);
     }
     if (n2 == 0) {  // non-HEAP or computed fallback for HEAP