Bug 1188745 - Rename nsTArray::SizeOfExcludingThis() as ShallowSizeOfExcludingThis(). r=froydnj.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 28 Jul 2015 23:24:24 -0700
changeset 287081 aecfba7454f14c285a6b9620677da8edb17bb06a
parent 287080 759a1be250b9dc266adff552e0b43e34821fac26
child 287082 8bb282696303be82f87d15e0f36d8c8034e8828a
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1188745
milestone42.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 1188745 - Rename nsTArray::SizeOfExcludingThis() as ShallowSizeOfExcludingThis(). r=froydnj. This makes it clearer that, unlike how SizeOf*() functions usually work, this doesn't measure any children hanging off the array. And do likewise for nsTObserverArray.
dom/base/nsAttrValue.cpp
dom/canvas/WebGLElementArrayCache.cpp
dom/events/EventListenerManager.cpp
dom/media/AudioSegment.h
dom/media/AudioStream.cpp
dom/media/MediaCache.cpp
dom/media/MediaData.cpp
dom/media/MediaSegment.h
dom/media/MediaStreamGraph.cpp
dom/media/MediaStreamGraph.h
dom/media/RtspMediaResource.cpp
dom/media/StreamBuffer.h
dom/media/TimeVarying.h
dom/media/encoder/MediaEncoder.cpp
dom/media/mediasource/ResourceQueue.cpp
dom/media/webaudio/AnalyserNode.cpp
dom/media/webaudio/AudioBuffer.cpp
dom/media/webaudio/AudioContext.cpp
dom/media/webaudio/AudioDestinationNode.cpp
dom/media/webaudio/AudioListener.cpp
dom/media/webaudio/AudioNode.cpp
dom/media/webaudio/AudioNodeEngine.h
dom/media/webaudio/AudioNodeStream.cpp
dom/media/webaudio/AudioParam.h
dom/media/webaudio/BiquadFilterNode.cpp
dom/media/webaudio/DelayBuffer.cpp
dom/media/webaudio/FFTBlock.h
dom/media/webaudio/MediaBufferDecoder.cpp
dom/media/webaudio/PannerNode.cpp
dom/media/webaudio/ScriptProcessorNode.cpp
dom/media/webaudio/WaveShaperNode.cpp
dom/media/webaudio/blink/DirectConvolver.h
dom/media/webaudio/blink/DynamicsCompressor.cpp
dom/media/webaudio/blink/DynamicsCompressorKernel.cpp
dom/media/webaudio/blink/FFTConvolver.cpp
dom/media/webaudio/blink/HRTFDatabase.cpp
dom/media/webaudio/blink/HRTFElevation.cpp
dom/media/webaudio/blink/HRTFPanner.cpp
dom/media/webaudio/blink/PeriodicWave.cpp
dom/media/webaudio/blink/Reverb.cpp
dom/media/webaudio/blink/ReverbAccumulationBuffer.h
dom/media/webaudio/blink/ReverbConvolver.cpp
dom/media/webaudio/blink/ReverbConvolverStage.cpp
dom/media/webaudio/blink/ReverbInputBuffer.h
dom/svg/SVGPathData.cpp
gfx/thebes/gfxDWriteFontList.cpp
gfx/thebes/gfxFont.h
gfx/thebes/gfxFontEntry.cpp
gfx/thebes/gfxFontFamilyList.h
gfx/thebes/gfxFontUtils.h
gfx/thebes/gfxGDIFontList.cpp
gfx/thebes/gfxGlyphExtents.cpp
gfx/thebes/gfxPlatformFontList.cpp
gfx/thebes/gfxTextRun.cpp
image/SourceBuffer.cpp
layout/base/FramePropertyTable.h
layout/base/nsPresArena.h
layout/generic/nsTextRunTransformations.cpp
layout/style/CSSStyleSheet.cpp
layout/style/Declaration.cpp
layout/style/Loader.cpp
layout/style/RuleProcessorCache.cpp
layout/style/nsCSSRuleProcessor.cpp
layout/style/nsCSSValue.cpp
layout/style/nsStyleSet.cpp
modules/libpref/Preferences.cpp
netwerk/cache2/CacheEntry.cpp
netwerk/cache2/CacheFile.cpp
netwerk/cache2/CacheFileUtils.cpp
netwerk/cache2/CacheIOThread.cpp
netwerk/cache2/CacheIndex.cpp
netwerk/cache2/CacheStorageService.cpp
netwerk/cookie/nsCookieService.cpp
netwerk/dns/nsHostResolver.cpp
startupcache/StartupCache.cpp
toolkit/components/places/History.h
toolkit/components/telemetry/Telemetry.cpp
toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp
xpcom/base/nsCycleCollector.cpp
xpcom/components/nsComponentManager.cpp
xpcom/glue/DeadlockDetector.h
xpcom/glue/nsCOMArray.cpp
xpcom/glue/nsTArray.h
xpcom/glue/nsTObserverArray.h
--- a/dom/base/nsAttrValue.cpp
+++ b/dom/base/nsAttrValue.cpp
@@ -1923,17 +1923,17 @@ nsAttrValue::SizeOfExcludingThis(MallocS
       }
 
       if (Type() == eCSSStyleRule && container->mValue.mCSSStyleRule) {
         // TODO: mCSSStyleRule might be owned by another object which would
         //       make us count them twice, bug 677493.
         //n += container->mCSSStyleRule->SizeOfIncludingThis(aMallocSizeOf);
       } else if (Type() == eAtomArray && container->mValue.mAtomArray) {
         // Don't measure each nsIAtom, they are measured separatly.
-        n += container->mValue.mAtomArray->SizeOfIncludingThis(aMallocSizeOf);
+        n += container->mValue.mAtomArray->ShallowSizeOfIncludingThis(aMallocSizeOf);
       }
       break;
     }
     case eAtomBase:    // Atoms are counted separately.
     case eIntegerBase: // The value is in mBits, nothing to do.
       break;
   }
 
--- a/dom/canvas/WebGLElementArrayCache.cpp
+++ b/dom/canvas/WebGLElementArrayCache.cpp
@@ -306,17 +306,18 @@ public:
     }
 
     // Updates the tree from the parent's buffer contents. Fallible, as it
     // may have to resize the tree storage.
     bool Update(size_t firstByte, size_t lastByte);
 
     size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const
     {
-        return mallocSizeOf(this) + mTreeData.SizeOfExcludingThis(mallocSizeOf);
+        return mallocSizeOf(this) +
+               mTreeData.ShallowSizeOfExcludingThis(mallocSizeOf);
     }
 };
 
 // TreeForType: just a template helper to select the right tree object for a given
 // element type.
 template<typename T>
 struct TreeForType {};
 
@@ -619,17 +620,17 @@ SizeOfNullable(mozilla::MallocSizeOf mal
         return 0;
     return obj->SizeOfIncludingThis(mallocSizeOf);
 }
 
 size_t
 WebGLElementArrayCache::SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const
 {
     return mallocSizeOf(this) +
-           mBytes.SizeOfExcludingThis(mallocSizeOf) +
+           mBytes.ShallowSizeOfExcludingThis(mallocSizeOf) +
            SizeOfNullable(mallocSizeOf, mUint8Tree) +
            SizeOfNullable(mallocSizeOf, mUint16Tree) +
            SizeOfNullable(mallocSizeOf, mUint32Tree);
 }
 
 bool
 WebGLElementArrayCache::BeenUsedWithMultipleTypes() const
 {
--- a/dom/events/EventListenerManager.cpp
+++ b/dom/events/EventListenerManager.cpp
@@ -1439,17 +1439,17 @@ EventListenerManager::GetTypedEventHandl
     jsEventHandler->GetTypedEventHandler();
   return typedHandler.HasEventHandler() ? &typedHandler : nullptr;
 }
 
 size_t
 EventListenerManager::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t n = aMallocSizeOf(this);
-  n += mListeners.SizeOfExcludingThis(aMallocSizeOf);
+  n += mListeners.ShallowSizeOfExcludingThis(aMallocSizeOf);
   uint32_t count = mListeners.Length();
   for (uint32_t i = 0; i < count; ++i) {
     JSEventHandler* jsEventHandler =
       mListeners.ElementAt(i).GetJSEventHandler();
     if (jsEventHandler) {
       n += jsEventHandler->SizeOfIncludingThis(aMallocSizeOf);
     }
   }
--- a/dom/media/AudioSegment.h
+++ b/dom/media/AudioSegment.h
@@ -23,19 +23,19 @@ public:
   explicit SharedChannelArrayBuffer(nsTArray<nsTArray<T> >* aBuffers)
   {
     mBuffers.SwapElements(*aBuffers);
   }
 
   virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     size_t amount = 0;
-    amount += mBuffers.SizeOfExcludingThis(aMallocSizeOf);
+    amount += mBuffers.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (size_t i = 0; i < mBuffers.Length(); i++) {
-      amount += mBuffers[i].SizeOfExcludingThis(aMallocSizeOf);
+      amount += mBuffers[i].ShallowSizeOfExcludingThis(aMallocSizeOf);
     }
 
     return amount;
   }
 
   virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
@@ -171,17 +171,17 @@ struct AudioChunk {
     // Possibly owned:
     // - mBuffer - Can hold data that is also in the decoded audio queue. If it
     //             is not shared, or unshared == false it gets counted.
     if (mBuffer && (!aUnshared || !mBuffer->IsShared())) {
       amount += mBuffer->SizeOfIncludingThis(aMallocSizeOf);
     }
 
     // Memory in the array is owned by mBuffer.
-    amount += mChannelData.SizeOfExcludingThis(aMallocSizeOf);
+    amount += mChannelData.ShallowSizeOfExcludingThis(aMallocSizeOf);
     return amount;
   }
 
   StreamTime mDuration; // in frames within the buffer
   nsRefPtr<ThreadSharedObject> mBuffer; // the buffer object whose lifetime is managed; null means data is all zeroes
   nsTArray<const void*> mChannelData; // one pointer per channel; empty if and only if mBuffer is null
   float mVolume; // volume multiplier to apply (1.0f if mBuffer is nonnull)
   SampleFormat mBufferFormat; // format of frames in mBuffer (only meaningful if mBuffer is nonnull)
--- a/dom/media/AudioStream.cpp
+++ b/dom/media/AudioStream.cpp
@@ -162,17 +162,17 @@ AudioStream::SizeOfIncludingThis(MallocS
 {
   size_t amount = aMallocSizeOf(this);
 
   // Possibly add in the future:
   // - mTimeStretcher
   // - mLatencyLog
   // - mCubebStream
 
-  amount += mInserts.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mInserts.ShallowSizeOfExcludingThis(aMallocSizeOf);
   amount += mBuffer.SizeOfExcludingThis(aMallocSizeOf);
 
   return amount;
 }
 
 nsresult AudioStream::EnsureTimeStretcherInitializedUnlocked()
 {
   mMonitor.AssertCurrentThreadOwns();
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -386,17 +386,17 @@ MediaCacheStream::MediaCacheStream(Chann
 }
 
 size_t MediaCacheStream::SizeOfExcludingThis(
                                 MallocSizeOf aMallocSizeOf) const
 {
   // Looks like these are not owned:
   // - mClient
   // - mPrincipal
-  size_t size = mBlocks.SizeOfExcludingThis(aMallocSizeOf);
+  size_t size = mBlocks.ShallowSizeOfExcludingThis(aMallocSizeOf);
   size += mReadaheadBlocks.SizeOfExcludingThis(aMallocSizeOf);
   size += mMetadataBlocks.SizeOfExcludingThis(aMallocSizeOf);
   size += mPlayedBlocks.SizeOfExcludingThis(aMallocSizeOf);
   size += mPartialBlockBuffer.SizeOfExcludingThis(aMallocSizeOf);
 
   return size;
 }
 
--- a/dom/media/MediaData.cpp
+++ b/dom/media/MediaData.cpp
@@ -576,17 +576,17 @@ MediaRawData::~MediaRawData()
 {
 }
 
 size_t
 MediaRawData::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t size = aMallocSizeOf(this);
 
-  size += mBuffer->SizeOfIncludingThis(aMallocSizeOf);
+  size += mBuffer->ShallowSizeOfIncludingThis(aMallocSizeOf);
   return size;
 }
 
 MediaRawDataWriter*
 MediaRawData::CreateWriter()
 {
   return new MediaRawDataWriter(this);
 }
--- a/dom/media/MediaSegment.h
+++ b/dom/media/MediaSegment.h
@@ -286,17 +286,17 @@ public:
 #ifdef MOZILLA_INTERNAL_API
   void GetStartTime(TimeStamp &aTime) {
     aTime = mChunks[0].mTimeStamp;
   }
 #endif
 
   virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
   {
-    size_t amount = mChunks.SizeOfExcludingThis(aMallocSizeOf);
+    size_t amount = mChunks.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (size_t i = 0; i < mChunks.Length(); i++) {
       amount += mChunks[i].SizeOfExcludingThisIfUnshared(aMallocSizeOf);
     }
     return amount;
   }
 
   virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
   {
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -1945,25 +1945,25 @@ MediaStream::SizeOfExcludingThis(MallocS
   // Future:
   // - mWrapper
   // - mVideoOutputs - elements
   // - mLastPlayedVideoFrame
   // - mListeners - elements
   // - mAudioOutputStream - elements
 
   amount += mBuffer.SizeOfExcludingThis(aMallocSizeOf);
-  amount += mAudioOutputs.SizeOfExcludingThis(aMallocSizeOf);
-  amount += mVideoOutputs.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mAudioOutputs.ShallowSizeOfExcludingThis(aMallocSizeOf);
+  amount += mVideoOutputs.ShallowSizeOfExcludingThis(aMallocSizeOf);
   amount += mExplicitBlockerCount.SizeOfExcludingThis(aMallocSizeOf);
-  amount += mListeners.SizeOfExcludingThis(aMallocSizeOf);
-  amount += mMainThreadListeners.SizeOfExcludingThis(aMallocSizeOf);
-  amount += mDisabledTrackIDs.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mListeners.ShallowSizeOfExcludingThis(aMallocSizeOf);
+  amount += mMainThreadListeners.ShallowSizeOfExcludingThis(aMallocSizeOf);
+  amount += mDisabledTrackIDs.ShallowSizeOfExcludingThis(aMallocSizeOf);
   amount += mBlocked.SizeOfExcludingThis(aMallocSizeOf);
   amount += mGraphUpdateIndices.SizeOfExcludingThis(aMallocSizeOf);
-  amount += mConsumers.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mConsumers.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
   return amount;
 }
 
 size_t
 MediaStream::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
--- a/dom/media/MediaStreamGraph.h
+++ b/dom/media/MediaStreamGraph.h
@@ -1194,17 +1194,17 @@ public:
   // true for echo loops, only for muted cycles.
   bool InMutedCycle() const { return mCycleMarker; }
 
   virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     size_t amount = MediaStream::SizeOfExcludingThis(aMallocSizeOf);
     // Not owned:
     // - mInputs elements
-    amount += mInputs.SizeOfExcludingThis(aMallocSizeOf);
+    amount += mInputs.ShallowSizeOfExcludingThis(aMallocSizeOf);
     return amount;
   }
 
   virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 
--- a/dom/media/RtspMediaResource.cpp
+++ b/dom/media/RtspMediaResource.cpp
@@ -541,17 +541,17 @@ void RtspMediaResource::NotifySuspend(bo
     mDecoder->NotifySuspendedStatusChanged();
   }
 }
 
 size_t
 RtspMediaResource::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t size = BaseMediaResource::SizeOfExcludingThis(aMallocSizeOf);
-  size += mTrackBuffer.SizeOfExcludingThis(aMallocSizeOf);
+  size += mTrackBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
   // Include the size of each track buffer.
   for (size_t i = 0; i < mTrackBuffer.Length(); i++) {
     size += mTrackBuffer[i]->SizeOfIncludingThis(aMallocSizeOf);
   }
 
   // Could add in the future:
   // - mMediaStreamController
--- a/dom/media/StreamBuffer.h
+++ b/dom/media/StreamBuffer.h
@@ -172,17 +172,17 @@ public:
   ~StreamBuffer()
   {
     MOZ_COUNT_DTOR(StreamBuffer);
   }
 
   size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
   {
     size_t amount = 0;
-    amount += mTracks.SizeOfExcludingThis(aMallocSizeOf);
+    amount += mTracks.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (size_t i = 0; i < mTracks.Length(); i++) {
       amount += mTracks[i]->SizeOfIncludingThis(aMallocSizeOf);
     }
     return amount;
   }
 
   /**
    * Initialize the graph rate for use in calculating StreamTimes from track
--- a/dom/media/TimeVarying.h
+++ b/dom/media/TimeVarying.h
@@ -212,17 +212,17 @@ public:
     for (uint32_t i = 0; i < aOther.mChanges.Length(); ++i) {
       const Entry& e = aOther.mChanges[i];
       SetAtAndAfter(aTimeOffset + e.mTime, e.mValue);
     }
   }
 
   size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
   {
-    return mChanges.SizeOfExcludingThis(aMallocSizeOf);
+    return mChanges.ShallowSizeOfExcludingThis(aMallocSizeOf);
   }
 
 private:
   struct Entry {
     Entry(Time aTime, const T& aValue) : mTime(aTime), mValue(aValue) {}
 
     // The time at which the value changes to mValue
     Time mTime;
--- a/dom/media/encoder/MediaEncoder.cpp
+++ b/dom/media/encoder/MediaEncoder.cpp
@@ -197,17 +197,17 @@ MediaEncoder::GetEncodedData(nsTArray<ns
       if (NS_FAILED(rv)) {
         LOG(LogLevel::Error, ("Error! Fail to Set Video Metadata"));
         break;
       }
 
       rv = mWriter->GetContainerData(aOutputBufs,
                                      ContainerWriter::GET_HEADER);
       if (aOutputBufs != nullptr) {
-        mSizeOfBuffer = aOutputBufs->SizeOfExcludingThis(MallocSizeOf);
+        mSizeOfBuffer = aOutputBufs->ShallowSizeOfExcludingThis(MallocSizeOf);
       }
       if (NS_FAILED(rv)) {
        LOG(LogLevel::Error,("Error! writer fail to generate header!"));
        mState = ENCODE_ERROR;
        break;
       }
       LOG(LogLevel::Debug, ("Finish ENCODE_METADDATA TimeStamp = %f", GetEncodeTimeStamp()));
       mState = ENCODE_TRACK;
@@ -232,17 +232,17 @@ MediaEncoder::GetEncodedData(nsTArray<ns
       LOG(LogLevel::Debug, ("Video encoded TimeStamp = %f", GetEncodeTimeStamp()));
       // In audio only or video only case, let unavailable track's flag to be true.
       bool isAudioCompleted = (mAudioEncoder && mAudioEncoder->IsEncodingComplete()) || !mAudioEncoder;
       bool isVideoCompleted = (mVideoEncoder && mVideoEncoder->IsEncodingComplete()) || !mVideoEncoder;
       rv = mWriter->GetContainerData(aOutputBufs,
                                      isAudioCompleted && isVideoCompleted ?
                                      ContainerWriter::FLUSH_NEEDED : 0);
       if (aOutputBufs != nullptr) {
-        mSizeOfBuffer = aOutputBufs->SizeOfExcludingThis(MallocSizeOf);
+        mSizeOfBuffer = aOutputBufs->ShallowSizeOfExcludingThis(MallocSizeOf);
       }
       if (NS_SUCCEEDED(rv)) {
         // Successfully get the copy of final container data from writer.
         reloop = false;
       }
       mState = (mWriter->IsWritingComplete()) ? ENCODE_DONE : ENCODE_TRACK;
       LOG(LogLevel::Debug, ("END ENCODE_TRACK TimeStamp = %f "
           "mState = %d aComplete %d vComplete %d",
--- a/dom/media/mediasource/ResourceQueue.cpp
+++ b/dom/media/mediasource/ResourceQueue.cpp
@@ -29,17 +29,17 @@ ResourceItem::ResourceItem(MediaByteBuff
 
 size_t
 ResourceItem::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   // size including this
   size_t size = aMallocSizeOf(this);
 
   // size excluding this
-  size += mData->SizeOfExcludingThis(aMallocSizeOf);
+  size += mData->ShallowSizeOfExcludingThis(aMallocSizeOf);
 
   return size;
 }
 
 class ResourceQueueDeallocator : public nsDequeFunctor {
   virtual void* operator() (void* aObject) {
     delete static_cast<ResourceItem*>(aObject);
     return nullptr;
--- a/dom/media/webaudio/AnalyserNode.cpp
+++ b/dom/media/webaudio/AnalyserNode.cpp
@@ -96,18 +96,18 @@ AnalyserNode::AnalyserNode(AudioContext*
   AllocateBuffer();
 }
 
 size_t
 AnalyserNode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t amount = AudioNode::SizeOfExcludingThis(aMallocSizeOf);
   amount += mAnalysisBlock.SizeOfExcludingThis(aMallocSizeOf);
-  amount += mChunks.SizeOfExcludingThis(aMallocSizeOf);
-  amount += mOutputBuffer.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mChunks.ShallowSizeOfExcludingThis(aMallocSizeOf);
+  amount += mOutputBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
   return amount;
 }
 
 size_t
 AnalyserNode::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
 }
--- a/dom/media/webaudio/AudioBuffer.cpp
+++ b/dom/media/webaudio/AudioBuffer.cpp
@@ -255,17 +255,17 @@ AudioBuffer::GetThreadSharedChannelsForR
 
   return mSharedChannels;
 }
 
 size_t
 AudioBuffer::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t amount = aMallocSizeOf(this);
-  amount += mJSChannels.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mJSChannels.ShallowSizeOfExcludingThis(aMallocSizeOf);
   if (mSharedChannels) {
     amount += mSharedChannels->SizeOfIncludingThis(aMallocSizeOf);
   }
   return amount;
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/media/webaudio/AudioContext.cpp
+++ b/dom/media/webaudio/AudioContext.cpp
@@ -1031,17 +1031,17 @@ AudioContext::SizeOfIncludingThis(mozill
   // AudioNodes are tracked separately because we do not want the AudioContext
   // to track all of the AudioNodes it creates, so we wouldn't be able to
   // traverse them from here.
 
   size_t amount = aMallocSizeOf(this);
   if (mListener) {
     amount += mListener->SizeOfIncludingThis(aMallocSizeOf);
   }
-  amount += mDecodeJobs.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mDecodeJobs.ShallowSizeOfExcludingThis(aMallocSizeOf);
   for (uint32_t i = 0; i < mDecodeJobs.Length(); ++i) {
     amount += mDecodeJobs[i]->SizeOfIncludingThis(aMallocSizeOf);
   }
   amount += mActiveNodes.SizeOfExcludingThis(nullptr, aMallocSizeOf);
   amount += mPannerNodes.SizeOfExcludingThis(nullptr, aMallocSizeOf);
   return amount;
 }
 
--- a/dom/media/webaudio/AudioDestinationNode.cpp
+++ b/dom/media/webaudio/AudioDestinationNode.cpp
@@ -181,17 +181,17 @@ public:
     NS_DispatchToMainThread(onCompleteTask);
 
     context->OnStateChanged(nullptr, AudioContextState::Closed);
   }
 
   virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf);
-    amount += mInputChannels.SizeOfExcludingThis(aMallocSizeOf);
+    amount += mInputChannels.ShallowSizeOfExcludingThis(aMallocSizeOf);
     return amount;
   }
 
   virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 
--- a/dom/media/webaudio/AudioListener.cpp
+++ b/dom/media/webaudio/AudioListener.cpp
@@ -117,15 +117,15 @@ void AudioListener::UpdatePannersVelocit
   }
 }
 
 size_t
 AudioListener::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t amount = aMallocSizeOf(this);
   // AudioNodes are tracked separately
-  amount += mPanners.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mPanners.ShallowSizeOfExcludingThis(aMallocSizeOf);
   return amount;
 }
 
 } // namespace dom
 } // namespace mozilla
 
--- a/dom/media/webaudio/AudioNode.cpp
+++ b/dom/media/webaudio/AudioNode.cpp
@@ -92,26 +92,26 @@ AudioNode::~AudioNode()
 size_t
 AudioNode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
   // Not owned:
   // - mContext
   // - mStream
   size_t amount = 0;
 
-  amount += mInputNodes.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mInputNodes.ShallowSizeOfExcludingThis(aMallocSizeOf);
   for (size_t i = 0; i < mInputNodes.Length(); i++) {
     amount += mInputNodes[i].SizeOfExcludingThis(aMallocSizeOf);
   }
 
   // Just measure the array. The entire audio node graph is measured via the
   // MediaStreamGraph's streams, so we don't want to double-count the elements.
-  amount += mOutputNodes.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mOutputNodes.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
-  amount += mOutputParams.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mOutputParams.ShallowSizeOfExcludingThis(aMallocSizeOf);
   for (size_t i = 0; i < mOutputParams.Length(); i++) {
     amount += mOutputParams[i]->SizeOfIncludingThis(aMallocSizeOf);
   }
 
   return amount;
 }
 
 size_t
--- a/dom/media/webaudio/AudioNodeEngine.h
+++ b/dom/media/webaudio/AudioNodeEngine.h
@@ -91,17 +91,17 @@ public:
   /**
    * Put this object into an error state where there are no channels.
    */
   void Clear() { mContents.Clear(); }
 
   virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override
   {
     size_t amount = ThreadSharedObject::SizeOfExcludingThis(aMallocSizeOf);
-    amount += mContents.SizeOfExcludingThis(aMallocSizeOf);
+    amount += mContents.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (size_t i = 0; i < mContents.Length(); i++) {
       amount += mContents[i].SizeOfExcludingThis(aMallocSizeOf);
     }
 
     return amount;
   }
 
   virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
--- a/dom/media/webaudio/AudioNodeStream.cpp
+++ b/dom/media/webaudio/AudioNodeStream.cpp
@@ -57,17 +57,17 @@ size_t
 AudioNodeStream::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t amount = 0;
 
   // Not reported:
   // - mEngine
 
   amount += ProcessedMediaStream::SizeOfExcludingThis(aMallocSizeOf);
-  amount += mLastChunks.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mLastChunks.ShallowSizeOfExcludingThis(aMallocSizeOf);
   for (size_t i = 0; i < mLastChunks.Length(); i++) {
     // NB: This is currently unshared only as there are instances of
     //     double reporting in DMD otherwise.
     amount += mLastChunks[i].SizeOfExcludingThisIfUnshared(aMallocSizeOf);
   }
 
   return amount;
 }
--- a/dom/media/webaudio/AudioParam.h
+++ b/dom/media/webaudio/AudioParam.h
@@ -164,17 +164,17 @@ public:
 
   virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     size_t amount = AudioParamTimeline::SizeOfExcludingThis(aMallocSizeOf);
     // Not owned:
     // - mNode
 
     // Just count the array, actual nodes are counted in mNode.
-    amount += mInputNodes.SizeOfExcludingThis(aMallocSizeOf);
+    amount += mInputNodes.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
     if (mNodeStreamPort) {
       amount += mNodeStreamPort->SizeOfIncludingThis(aMallocSizeOf);
     }
 
     return amount;
   }
 
--- a/dom/media/webaudio/BiquadFilterNode.cpp
+++ b/dom/media/webaudio/BiquadFilterNode.cpp
@@ -213,17 +213,17 @@ public:
 
   virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     // Not owned:
     // - mSource - probably not owned
     // - mDestination - probably not owned
     // - AudioParamTimelines - counted in the AudioNode
     size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf);
-    amount += mBiquads.SizeOfExcludingThis(aMallocSizeOf);
+    amount += mBiquads.ShallowSizeOfExcludingThis(aMallocSizeOf);
     return amount;
   }
 
   virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 
--- a/dom/media/webaudio/DelayBuffer.cpp
+++ b/dom/media/webaudio/DelayBuffer.cpp
@@ -11,22 +11,22 @@
 #include "AudioNodeEngine.h"
 
 namespace mozilla {
 
 size_t
 DelayBuffer::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t amount = 0;
-  amount += mChunks.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mChunks.ShallowSizeOfExcludingThis(aMallocSizeOf);
   for (size_t i = 0; i < mChunks.Length(); i++) {
     amount += mChunks[i].SizeOfExcludingThis(aMallocSizeOf, false);
   }
 
-  amount += mUpmixChannels.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mUpmixChannels.ShallowSizeOfExcludingThis(aMallocSizeOf);
   return amount;
 }
 
 void
 DelayBuffer::Write(const AudioChunk& aInputChunk)
 {
   // We must have a reference to the buffer if there are channels
   MOZ_ASSERT(aInputChunk.IsNull() == !aInputChunk.mChannelData.Length());
--- a/dom/media/webaudio/FFTBlock.h
+++ b/dom/media/webaudio/FFTBlock.h
@@ -227,17 +227,17 @@ public:
     size_t amount = 0;
 #if defined(MOZ_LIBAV_FFT)
     amount += aMallocSizeOf(mAvRDFT);
     amount += aMallocSizeOf(mAvIRDFT);
 #else
     amount += aMallocSizeOf(mKissFFT);
     amount += aMallocSizeOf(mKissIFFT);
 #endif
-    amount += mOutputBuffer.SizeOfExcludingThis(aMallocSizeOf);
+    amount += mOutputBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
     return amount;
   }
 
   size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
   {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 
--- a/dom/media/webaudio/MediaBufferDecoder.cpp
+++ b/dom/media/webaudio/MediaBufferDecoder.cpp
@@ -609,17 +609,17 @@ WebAudioDecodeJob::SizeOfExcludingThis(M
     amount += mSuccessCallback->SizeOfIncludingThis(aMallocSizeOf);
   }
   if (mFailureCallback) {
     amount += mFailureCallback->SizeOfIncludingThis(aMallocSizeOf);
   }
   if (mOutput) {
     amount += mOutput->SizeOfIncludingThis(aMallocSizeOf);
   }
-  amount += mChannelBuffers.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mChannelBuffers.ShallowSizeOfExcludingThis(aMallocSizeOf);
   for (uint32_t i = 0; i < mChannelBuffers.Length(); ++i) {
     amount += mChannelBuffers[i].SizeOfExcludingThis(aMallocSizeOf);
   }
   return amount;
 }
 
 size_t
 WebAudioDecodeJob::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
--- a/dom/media/webaudio/PannerNode.cpp
+++ b/dom/media/webaudio/PannerNode.cpp
@@ -252,17 +252,17 @@ PannerNode::~PannerNode()
     Context()->UnregisterPannerNode(this);
   }
 }
 
 size_t
 PannerNode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t amount = AudioNode::SizeOfExcludingThis(aMallocSizeOf);
-  amount += mSources.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mSources.ShallowSizeOfExcludingThis(aMallocSizeOf);
   return amount;
 }
 
 size_t
 PannerNode::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
 }
--- a/dom/media/webaudio/ScriptProcessorNode.cpp
+++ b/dom/media/webaudio/ScriptProcessorNode.cpp
@@ -316,17 +316,17 @@ public:
 
   virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     // Not owned:
     // - mSource (probably)
     // - mDestination (probably)
     size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf);
     amount += mSharedBuffers->SizeOfIncludingThis(aMallocSizeOf);
-    amount += mInputChannels.SizeOfExcludingThis(aMallocSizeOf);
+    amount += mInputChannels.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (size_t i = 0; i < mInputChannels.Length(); i++) {
       amount += mInputChannels[i].SizeOfExcludingThis(aMallocSizeOf);
     }
 
     return amount;
   }
 
   virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
--- a/dom/media/webaudio/WaveShaperNode.cpp
+++ b/dom/media/webaudio/WaveShaperNode.cpp
@@ -130,17 +130,17 @@ public:
   }
 
   size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
   {
     size_t amount = 0;
     // Future: properly measure speex memory
     amount += aMallocSizeOf(mUpSampler);
     amount += aMallocSizeOf(mDownSampler);
-    amount += mBuffer.SizeOfExcludingThis(aMallocSizeOf);
+    amount += mBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
     return amount;
   }
 
 private:
   void Destroy()
   {
     if (mUpSampler) {
       speex_resampler_destroy(mUpSampler);
@@ -256,17 +256,17 @@ public:
         NS_NOTREACHED("We should never reach here");
       }
     }
   }
 
   virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf);
-    amount += mCurve.SizeOfExcludingThis(aMallocSizeOf);
+    amount += mCurve.ShallowSizeOfExcludingThis(aMallocSizeOf);
     amount += mResampler.SizeOfExcludingThis(aMallocSizeOf);
     return amount;
   }
 
   virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
--- a/dom/media/webaudio/blink/DirectConvolver.h
+++ b/dom/media/webaudio/blink/DirectConvolver.h
@@ -40,17 +40,17 @@ public:
 
     void process(const nsTArray<float>* convolutionKernel, const float* sourceP, float* destP, size_t framesToProcess);
 
     void reset();
 
     size_t sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
     {
         size_t amount = aMallocSizeOf(this);
-        amount += m_buffer.SizeOfExcludingThis(aMallocSizeOf);
+        amount += m_buffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
         return amount;
     }
 
 
 private:
     size_t m_inputBlockSize;
 
     nsTArray<float> m_buffer;
--- a/dom/media/webaudio/blink/DynamicsCompressor.cpp
+++ b/dom/media/webaudio/blink/DynamicsCompressor.cpp
@@ -50,24 +50,24 @@ DynamicsCompressor::DynamicsCompressor(f
 
     setNumberOfChannels(numberOfChannels);
     initializeParameters();
 }
 
 size_t DynamicsCompressor::sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
     size_t amount = aMallocSizeOf(this);
-    amount += m_preFilterPacks.SizeOfExcludingThis(aMallocSizeOf);
+    amount += m_preFilterPacks.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (size_t i = 0; i < m_preFilterPacks.Length(); i++) {
         if (m_preFilterPacks[i]) {
             amount += m_preFilterPacks[i]->sizeOfIncludingThis(aMallocSizeOf);
         }
     }
 
-    amount += m_postFilterPacks.SizeOfExcludingThis(aMallocSizeOf);
+    amount += m_postFilterPacks.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (size_t i = 0; i < m_postFilterPacks.Length(); i++) {
         if (m_postFilterPacks[i]) {
             amount += m_postFilterPacks[i]->sizeOfIncludingThis(aMallocSizeOf);
         }
     }
 
     amount += m_sourceChannels.SizeOfExcludingThis(aMallocSizeOf);
     amount += m_destinationChannels.SizeOfExcludingThis(aMallocSizeOf);
--- a/dom/media/webaudio/blink/DynamicsCompressorKernel.cpp
+++ b/dom/media/webaudio/blink/DynamicsCompressorKernel.cpp
@@ -71,17 +71,17 @@ DynamicsCompressorKernel::DynamicsCompre
 
     m_meteringReleaseK =
         static_cast<float>(WebAudioUtils::DiscreteTimeConstantForSampleRate(meteringReleaseTimeConstant, sampleRate));
 }
 
 size_t DynamicsCompressorKernel::sizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
     size_t amount = 0;
-    amount += m_preDelayBuffers.SizeOfExcludingThis(aMallocSizeOf);
+    amount += m_preDelayBuffers.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (size_t i = 0; i < m_preDelayBuffers.Length(); i++) {
         amount += m_preDelayBuffers[i].SizeOfExcludingThis(aMallocSizeOf);
     }
 
     return amount;
 }
 
 void DynamicsCompressorKernel::setNumberOfChannels(unsigned numberOfChannels)
--- a/dom/media/webaudio/blink/FFTConvolver.cpp
+++ b/dom/media/webaudio/blink/FFTConvolver.cpp
@@ -44,19 +44,19 @@ FFTConvolver::FFTConvolver(size_t fftSiz
   m_lastOverlapBuffer.SetLength(fftSize / 2);
   PodZero(m_lastOverlapBuffer.Elements(), fftSize / 2);
 }
 
 size_t FFTConvolver::sizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
     size_t amount = 0;
     amount += m_frame.SizeOfExcludingThis(aMallocSizeOf);
-    amount += m_inputBuffer.SizeOfExcludingThis(aMallocSizeOf);
-    amount += m_outputBuffer.SizeOfExcludingThis(aMallocSizeOf);
-    amount += m_lastOverlapBuffer.SizeOfExcludingThis(aMallocSizeOf);
+    amount += m_inputBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
+    amount += m_outputBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
+    amount += m_lastOverlapBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
     return amount;
 }
 
 size_t FFTConvolver::sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
   return aMallocSizeOf(this) + sizeOfExcludingThis(aMallocSizeOf);
 }
 
--- a/dom/media/webaudio/blink/HRTFDatabase.cpp
+++ b/dom/media/webaudio/blink/HRTFDatabase.cpp
@@ -77,17 +77,17 @@ HRTFDatabase::HRTFDatabase(float sampleR
             }
         }
     }
 }
 
 size_t HRTFDatabase::sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
     size_t amount = aMallocSizeOf(this);
-    amount += m_elevations.SizeOfExcludingThis(aMallocSizeOf);
+    amount += m_elevations.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (size_t i = 0; i < m_elevations.Length(); i++) {
       amount += m_elevations[i]->sizeOfIncludingThis(aMallocSizeOf);
     }
 
     return amount;
 }
 
 void HRTFDatabase::getKernelsFromAzimuthElevation(double azimuthBlend, unsigned azimuthIndex, double elevationAngle, HRTFKernel* &kernelL, HRTFKernel* &kernelR,
--- a/dom/media/webaudio/blink/HRTFElevation.cpp
+++ b/dom/media/webaudio/blink/HRTFElevation.cpp
@@ -49,17 +49,17 @@ const int rawSampleRate = irc_composite_
 
 // Number of frames in an individual impulse response.
 const size_t ResponseFrameSize = 256;
 
 size_t HRTFElevation::sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
     size_t amount = aMallocSizeOf(this);
 
-    amount += m_kernelListL.SizeOfExcludingThis(aMallocSizeOf);
+    amount += m_kernelListL.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (size_t i = 0; i < m_kernelListL.Length(); i++) {
         amount += m_kernelListL[i]->sizeOfIncludingThis(aMallocSizeOf);
     }
 
     return amount;
 }
 
 size_t HRTFElevation::fftSizeForSampleRate(float sampleRate)
--- a/dom/media/webaudio/blink/HRTFPanner.cpp
+++ b/dom/media/webaudio/blink/HRTFPanner.cpp
@@ -75,20 +75,20 @@ size_t HRTFPanner::sizeOfIncludingThis(m
     size_t amount = aMallocSizeOf(this);
 
     // NB: m_databaseLoader can be shared, so it is not measured here
     amount += m_convolverL1.sizeOfExcludingThis(aMallocSizeOf);
     amount += m_convolverR1.sizeOfExcludingThis(aMallocSizeOf);
     amount += m_convolverL2.sizeOfExcludingThis(aMallocSizeOf);
     amount += m_convolverR2.sizeOfExcludingThis(aMallocSizeOf);
     amount += m_delayLine.SizeOfExcludingThis(aMallocSizeOf);
-    amount += m_tempL1.SizeOfExcludingThis(aMallocSizeOf);
-    amount += m_tempL2.SizeOfExcludingThis(aMallocSizeOf);
-    amount += m_tempR1.SizeOfExcludingThis(aMallocSizeOf);
-    amount += m_tempR2.SizeOfExcludingThis(aMallocSizeOf);
+    amount += m_tempL1.ShallowSizeOfExcludingThis(aMallocSizeOf);
+    amount += m_tempL2.ShallowSizeOfExcludingThis(aMallocSizeOf);
+    amount += m_tempR1.ShallowSizeOfExcludingThis(aMallocSizeOf);
+    amount += m_tempR2.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
     return amount;
 }
 
 void HRTFPanner::reset()
 {
     m_azimuthIndex1 = UninitializedAzimuth;
     m_azimuthIndex2 = UninitializedAzimuth;
--- a/dom/media/webaudio/blink/PeriodicWave.cpp
+++ b/dom/media/webaudio/blink/PeriodicWave.cpp
@@ -104,20 +104,20 @@ PeriodicWave::PeriodicWave(float sampleR
     m_lowestFundamentalFrequency = nyquist / maxNumberOfPartials();
     m_rateScale = m_periodicWaveSize / m_sampleRate;
 }
 
 size_t PeriodicWave::sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
     size_t amount = aMallocSizeOf(this);
 
-    amount += m_bandLimitedTables.SizeOfExcludingThis(aMallocSizeOf);
+    amount += m_bandLimitedTables.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (size_t i = 0; i < m_bandLimitedTables.Length(); i++) {
         if (m_bandLimitedTables[i]) {
-            amount += m_bandLimitedTables[i]->SizeOfIncludingThis(aMallocSizeOf);
+            amount += m_bandLimitedTables[i]->ShallowSizeOfIncludingThis(aMallocSizeOf);
         }
     }
 
     return amount;
 }
 
 void PeriodicWave::waveDataForFundamentalFrequency(float fundamentalFrequency, float* &lowerWaveData, float* &higherWaveData, float& tableInterpolationFactor)
 {
--- a/dom/media/webaudio/blink/Reverb.cpp
+++ b/dom/media/webaudio/blink/Reverb.cpp
@@ -103,17 +103,17 @@ Reverb::Reverb(ThreadSharedFloatArrayBuf
 
     initialize(irChannels, impulseResponseBufferLength, renderSliceSize,
                maxFFTSize, numberOfChannels, useBackgroundThreads);
 }
 
 size_t Reverb::sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
     size_t amount = aMallocSizeOf(this);
-    amount += m_convolvers.SizeOfExcludingThis(aMallocSizeOf);
+    amount += m_convolvers.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (size_t i = 0; i < m_convolvers.Length(); i++) {
         if (m_convolvers[i]) {
             amount += m_convolvers[i]->sizeOfIncludingThis(aMallocSizeOf);
         }
     }
 
     amount += m_tempBuffer.SizeOfExcludingThis(aMallocSizeOf, false);
     return amount;
--- a/dom/media/webaudio/blink/ReverbAccumulationBuffer.h
+++ b/dom/media/webaudio/blink/ReverbAccumulationBuffer.h
@@ -56,17 +56,17 @@ public:
     void updateReadIndex(int* readIndex, size_t numberOfFrames) const;
 
     size_t readTimeFrame() const { return m_readTimeFrame; }
 
     void reset();
 
     size_t sizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
     {
-        return m_buffer.SizeOfExcludingThis(aMallocSizeOf);
+        return m_buffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
     }
 
 private:
     AudioFloatArray m_buffer;
     size_t m_readIndex;
     size_t m_readTimeFrame; // for debugging (frame on continuous timeline)
 };
 
--- a/dom/media/webaudio/blink/ReverbConvolver.cpp
+++ b/dom/media/webaudio/blink/ReverbConvolver.cpp
@@ -149,24 +149,24 @@ ReverbConvolver::~ReverbConvolver()
 
         m_backgroundThread.Stop();
     }
 }
 
 size_t ReverbConvolver::sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
     size_t amount = aMallocSizeOf(this);
-    amount += m_stages.SizeOfExcludingThis(aMallocSizeOf);
+    amount += m_stages.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (size_t i = 0; i < m_stages.Length(); i++) {
         if (m_stages[i]) {
             amount += m_stages[i]->sizeOfIncludingThis(aMallocSizeOf);
         }
     }
 
-    amount += m_backgroundStages.SizeOfExcludingThis(aMallocSizeOf);
+    amount += m_backgroundStages.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (size_t i = 0; i < m_backgroundStages.Length(); i++) {
         if (m_backgroundStages[i]) {
             amount += m_backgroundStages[i]->sizeOfIncludingThis(aMallocSizeOf);
         }
     }
 
     // NB: The buffer sizes are static, so even though they might be accessed
     //     in another thread it's safe to measure them.
--- a/dom/media/webaudio/blink/ReverbConvolverStage.cpp
+++ b/dom/media/webaudio/blink/ReverbConvolverStage.cpp
@@ -94,19 +94,19 @@ size_t ReverbConvolverStage::sizeOfInclu
     if (m_fftKernel) {
         amount += m_fftKernel->SizeOfIncludingThis(aMallocSizeOf);
     }
 
     if (m_fftConvolver) {
         amount += m_fftConvolver->sizeOfIncludingThis(aMallocSizeOf);
     }
 
-    amount += m_preDelayBuffer.SizeOfExcludingThis(aMallocSizeOf);
-    amount += m_temporaryBuffer.SizeOfExcludingThis(aMallocSizeOf);
-    amount += m_directKernel.SizeOfExcludingThis(aMallocSizeOf);
+    amount += m_preDelayBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
+    amount += m_temporaryBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
+    amount += m_directKernel.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
     if (m_directConvolver) {
         amount += m_directConvolver->sizeOfIncludingThis(aMallocSizeOf);
     }
 
     return amount;
 }
 
--- a/dom/media/webaudio/blink/ReverbInputBuffer.h
+++ b/dom/media/webaudio/blink/ReverbInputBuffer.h
@@ -52,17 +52,17 @@ public:
     // The assumption is that the buffer's length is evenly divisible by numberOfFrames.
     // FIXME: remove numberOfFrames restriction...
     float* directReadFrom(int* readIndex, size_t numberOfFrames);
 
     void reset();
 
     size_t sizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
     {
-        return m_buffer.SizeOfExcludingThis(aMallocSizeOf);
+        return m_buffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
     }
 
 
 private:
     nsTArray<float> m_buffer;
     size_t m_writeIndex;
 };
 
--- a/dom/svg/SVGPathData.cpp
+++ b/dom/svg/SVGPathData.cpp
@@ -856,17 +856,17 @@ SVGPathData::GetMarkerPositioningData(ns
     aMarks->LastElement().type = nsSVGMark::eEnd;
     aMarks->ElementAt(0).type = nsSVGMark::eStart;
   }
 }
 
 size_t
 SVGPathData::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
-  return mData.SizeOfExcludingThis(aMallocSizeOf);
+  return mData.ShallowSizeOfExcludingThis(aMallocSizeOf);
 }
 
 size_t
 SVGPathData::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
 }
 
--- a/gfx/thebes/gfxDWriteFontList.cpp
+++ b/gfx/thebes/gfxDWriteFontList.cpp
@@ -1345,17 +1345,17 @@ gfxDWriteFontList::AddSizeOfExcludingThi
 {
     gfxPlatformFontList::AddSizeOfExcludingThis(aMallocSizeOf, aSizes);
 
     aSizes->mFontListSize +=
         mFontSubstitutes.SizeOfExcludingThis(SizeOfFamilyNameEntryExcludingThis,
                                              aMallocSizeOf);
 
     aSizes->mFontListSize +=
-        mNonExistingFonts.SizeOfExcludingThis(aMallocSizeOf);
+        mNonExistingFonts.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (uint32_t i = 0; i < mNonExistingFonts.Length(); ++i) {
         aSizes->mFontListSize +=
             mNonExistingFonts[i].SizeOfExcludingThisIfUnshared(aMallocSizeOf);
     }
 }
 
 void
 gfxDWriteFontList::AddSizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -1059,18 +1059,18 @@ protected:
                 mOffsetToIndex.InsertElementSorted(DGRec(aOffset, detailIndex),
                                                    CompareRecordOffsets());
             }
             return details;
         }
 
         size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) {
             return aMallocSizeOf(this) +
-                mDetails.SizeOfExcludingThis(aMallocSizeOf) +
-                mOffsetToIndex.SizeOfExcludingThis(aMallocSizeOf);
+                mDetails.ShallowSizeOfExcludingThis(aMallocSizeOf) +
+                mOffsetToIndex.ShallowSizeOfExcludingThis(aMallocSizeOf);
         }
 
     private:
         struct DGRec {
             DGRec(const uint32_t& aOffset, const uint32_t& aIndex)
                 : mOffset(aOffset), mIndex(aIndex) { }
             uint32_t mOffset; // source character offset in the textrun
             uint32_t mIndex;  // index where this char's DetailedGlyphs begin
--- a/gfx/thebes/gfxFontEntry.cpp
+++ b/gfx/thebes/gfxFontEntry.cpp
@@ -557,17 +557,17 @@ public:
     // removed from the hashtable).
     void ForgetHashEntry()
     {
         mHashtable = nullptr;
         mHashKey = 0;
     }
 
     size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const {
-        return mTableData.SizeOfExcludingThis(aMallocSizeOf);
+        return mTableData.ShallowSizeOfExcludingThis(aMallocSizeOf);
     }
     size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
         return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
     }
 
 private:
     // The font table data block, owned (via adoption)
     FallibleTArray<uint8_t> mTableData;
@@ -1814,17 +1814,17 @@ gfxFontFamily::AddSizeOfExcludingThis(Ma
                                       FontListSizes* aSizes) const
 {
     aSizes->mFontListSize +=
         mName.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
     aSizes->mCharMapsSize +=
         mFamilyCharacterMap.SizeOfExcludingThis(aMallocSizeOf);
 
     aSizes->mFontListSize +=
-        mAvailableFonts.SizeOfExcludingThis(aMallocSizeOf);
+        mAvailableFonts.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (uint32_t i = 0; i < mAvailableFonts.Length(); ++i) {
         gfxFontEntry *fe = mAvailableFonts[i];
         if (fe) {
             fe->AddSizeOfIncludingThis(aMallocSizeOf, aSizes);
         }
     }
 }
 
--- a/gfx/thebes/gfxFontFamilyList.h
+++ b/gfx/thebes/gfxFontFamilyList.h
@@ -144,22 +144,22 @@ struct FontFamilyName final {
         } else {
             return FontFamilyName(aFamilyOrGenericName, eUnquotedName);
         }
 
         return FontFamilyName(genericType);
     }
 
     // memory reporting
-    size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
+    size_t SizeOfExcludingThis2(mozilla::MallocSizeOf aMallocSizeOf) const {
         return mName.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
     }
 
-    size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
-        return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
+    size_t SizeOfIncludingThis2(mozilla::MallocSizeOf aMallocSizeOf) const {
+        return aMallocSizeOf(this) + SizeOfExcludingThis2(aMallocSizeOf);
     }
 
     FontFamilyType mType;
     nsString       mName; // empty if mType != eFamily_named
 };
 
 inline bool
 operator==(const FontFamilyName& a, const FontFamilyName& b) {
@@ -332,17 +332,17 @@ public:
         NS_ASSERTION(aType == eFamily_none || aType == eFamily_serif ||
                      aType == eFamily_sans_serif,
                      "default font type must be either serif or sans-serif");
         mDefaultFontType = aType;
     }
 
     // memory reporting
     size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
-        return mFontlist.SizeOfExcludingThis(aMallocSizeOf);
+        return mFontlist.ShallowSizeOfExcludingThis(aMallocSizeOf);
     }
 
     size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
         return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
     }
 
 private:
     nsTArray<FontFamilyName>   mFontlist;
--- a/gfx/thebes/gfxFontUtils.h
+++ b/gfx/thebes/gfxFontUtils.h
@@ -240,17 +240,17 @@ public:
 
             for (uint32_t bit = start; bit <= end; ++bit) {
                 block->mBits[bit>>3] &= ~(1 << (bit & 0x7));
             }
         }
     }
 
     size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
-        size_t total = mBlocks.SizeOfExcludingThis(aMallocSizeOf);
+        size_t total = mBlocks.ShallowSizeOfExcludingThis(aMallocSizeOf);
         for (uint32_t i = 0; i < mBlocks.Length(); i++) {
             if (mBlocks[i]) {
                 total += aMallocSizeOf(mBlocks[i]);
             }
         }
         return total;
     }
 
--- a/gfx/thebes/gfxGDIFontList.cpp
+++ b/gfx/thebes/gfxGDIFontList.cpp
@@ -878,17 +878,17 @@ void
 gfxGDIFontList::AddSizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
                                        FontListSizes* aSizes) const
 {
     gfxPlatformFontList::AddSizeOfExcludingThis(aMallocSizeOf, aSizes);
     aSizes->mFontListSize +=
         mFontSubstitutes.SizeOfExcludingThis(SizeOfFamilyNameEntryExcludingThis,
                                              aMallocSizeOf);
     aSizes->mFontListSize +=
-        mNonExistingFonts.SizeOfExcludingThis(aMallocSizeOf);
+        mNonExistingFonts.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (uint32_t i = 0; i < mNonExistingFonts.Length(); ++i) {
         aSizes->mFontListSize +=
             mNonExistingFonts[i].SizeOfExcludingThisIfUnshared(aMallocSizeOf);
     }
 }
 
 void
 gfxGDIFontList::AddSizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
--- a/gfx/thebes/gfxGlyphExtents.cpp
+++ b/gfx/thebes/gfxGlyphExtents.cpp
@@ -72,17 +72,17 @@ gfxGlyphExtents::GlyphWidths::~GlyphWidt
         }
     }
 }
 
 uint32_t
 gfxGlyphExtents::GlyphWidths::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
     uint32_t i;
-    uint32_t size = mBlocks.SizeOfExcludingThis(aMallocSizeOf);
+    uint32_t size = mBlocks.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (i = 0; i < mBlocks.Length(); ++i) {
         uintptr_t bits = mBlocks[i];
         if (bits && !(bits & 0x1)) {
             size += aMallocSizeOf(reinterpret_cast<void*>(bits));
         }
     }
     return size;
 }
--- a/gfx/thebes/gfxPlatformFontList.cpp
+++ b/gfx/thebes/gfxPlatformFontList.cpp
@@ -1083,17 +1083,17 @@ SizeOfPrefFontEntryExcludingThis
     (const uint32_t&                           aKey,
      const nsTArray<nsRefPtr<gfxFontFamily> >& aList,
      MallocSizeOf                              aMallocSizeOf,
      void*                                     aUserArg)
 {
     // again, we only care about the size of the array itself; we don't follow
     // the refPtrs stored in it, because they point to entries already owned
     // and accounted-for by the main font list
-    return aList.SizeOfExcludingThis(aMallocSizeOf);
+    return aList.ShallowSizeOfExcludingThis(aMallocSizeOf);
 }
 
 static size_t
 SizeOfSharedCmapExcludingThis(CharMapHashKey*   aHashEntry,
                               MallocSizeOf      aMallocSizeOf,
                               void*             aUserArg)
 {
     FontListSizes *sizes = static_cast<FontListSizes*>(aUserArg);
@@ -1125,17 +1125,17 @@ gfxPlatformFontList::AddSizeOfExcludingT
         aSizes->mFontListSize +=
             mExtraNames->mPostscriptNames.SizeOfExcludingThis(SizeOfFontNameEntryExcludingThis,
                                                               aMallocSizeOf);
     }
 
     aSizes->mFontListSize +=
         mCodepointsWithNoFonts.SizeOfExcludingThis(aMallocSizeOf);
     aSizes->mFontListSize +=
-        mFontFamiliesToLoad.SizeOfExcludingThis(aMallocSizeOf);
+        mFontFamiliesToLoad.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
     aSizes->mFontListSize +=
         mPrefFonts.SizeOfExcludingThis(SizeOfPrefFontEntryExcludingThis,
                                        aMallocSizeOf);
 
     aSizes->mFontListSize +=
         mBadUnderlineFamilyNames.SizeOfExcludingThis(aMallocSizeOf);
 
--- a/gfx/thebes/gfxTextRun.cpp
+++ b/gfx/thebes/gfxTextRun.cpp
@@ -1482,17 +1482,17 @@ gfxTextRun::ClusterIterator::ClusterAdva
     return mTextRun->GetAdvanceWidth(mCurrentChar, ClusterLength(), aProvider);
 }
 
 size_t
 gfxTextRun::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf)
 {
     // The second arg is how much gfxTextRun::AllocateStorage would have
     // allocated.
-    size_t total = mGlyphRuns.SizeOfExcludingThis(aMallocSizeOf);
+    size_t total = mGlyphRuns.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
     if (mDetailedGlyphs) {
         total += mDetailedGlyphs->SizeOfIncludingThis(aMallocSizeOf);
     }
 
     return total;
 }
 
--- a/image/SourceBuffer.cpp
+++ b/image/SourceBuffer.cpp
@@ -392,17 +392,17 @@ SourceBuffer::IsComplete()
 
 size_t
 SourceBuffer::SizeOfIncludingThisWithComputedFallback(MallocSizeOf
                                                         aMallocSizeOf) const
 {
   MutexAutoLock lock(mMutex);
 
   size_t n = aMallocSizeOf(this);
-  n += mChunks.SizeOfExcludingThis(aMallocSizeOf);
+  n += mChunks.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
   for (uint32_t i = 0 ; i < mChunks.Length() ; ++i) {
     size_t chunkSize = aMallocSizeOf(mChunks[i].Data());
 
     if (chunkSize == 0) {
       // We're on a platform where moz_malloc_size_of always returns 0.
       chunkSize = mChunks[i].Capacity();
     }
--- a/layout/base/FramePropertyTable.h
+++ b/layout/base/FramePropertyTable.h
@@ -154,17 +154,17 @@ protected:
       size_t n = 0;
       // We don't need to measure mProperty because it always points to static
       // memory.  As for mValue:  if it's a single value we can't measure it,
       // because the type is opaque;  if it's an array, we measure the array
       // storage, but we can't measure the individual values, again because
       // their types are opaque.
       if (IsArray()) {
         nsTArray<PropertyValue>* array = ToArray();
-        n += array->SizeOfExcludingThis(aMallocSizeOf);
+        n += array->ShallowSizeOfExcludingThis(aMallocSizeOf);
       }
       return n;
     }
 
     const FramePropertyDescriptor* mProperty;
     void* mValue;
   };
 
--- a/layout/base/nsPresArena.h
+++ b/layout/base/nsPresArena.h
@@ -132,17 +132,17 @@ private:
 
     static KeyTypePointer KeyToPointer(KeyType aKey)
     { return NS_INT32_TO_PTR(aKey); }
 
     static PLDHashNumber HashKey(KeyTypePointer aKey)
     { return NS_PTR_TO_INT32(aKey); }
 
     size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
-    { return mEntries.SizeOfExcludingThis(aMallocSizeOf); }
+    { return mEntries.ShallowSizeOfExcludingThis(aMallocSizeOf); }
 
     enum { ALLOW_MEMMOVE = false };
   };
 
   nsTHashtable<FreeList> mFreeLists;
   PLArenaPool mPool;
 };
 
--- a/layout/generic/nsTextRunTransformations.cpp
+++ b/layout/generic/nsTextRunTransformations.cpp
@@ -81,18 +81,18 @@ nsTransformedTextRun::SetPotentialLineBr
   }
   return changed;
 }
 
 size_t
 nsTransformedTextRun::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf)
 {
   size_t total = gfxTextRun::SizeOfExcludingThis(aMallocSizeOf);
-  total += mStyles.SizeOfExcludingThis(aMallocSizeOf);
-  total += mCapitalize.SizeOfExcludingThis(aMallocSizeOf);
+  total += mStyles.ShallowSizeOfExcludingThis(aMallocSizeOf);
+  total += mCapitalize.ShallowSizeOfExcludingThis(aMallocSizeOf);
   if (mOwnsFactory) {
     total += aMallocSizeOf(mFactory);
   }
   return total;
 }
 
 size_t
 nsTransformedTextRun::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
--- a/layout/style/CSSStyleSheet.cpp
+++ b/layout/style/CSSStyleSheet.cpp
@@ -415,17 +415,17 @@ nsDocumentRuleResultCacheKey::List(FILE*
   }
 }
 #endif
 
 size_t
 nsDocumentRuleResultCacheKey::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t n = 0;
-  n += mMatchingRules.SizeOfExcludingThis(aMallocSizeOf);
+  n += mMatchingRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
   return n;
 }
 
 void
 nsMediaQuery::AppendToString(nsAString& aString) const
 {
   if (mHadUnknownExpression) {
     aString.AppendLiteral("not all");
--- a/layout/style/Declaration.cpp
+++ b/layout/style/Declaration.cpp
@@ -1387,17 +1387,17 @@ Declaration::EnsureMutable()
     return this;
   }
 }
 
 size_t
 Declaration::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
   size_t n = aMallocSizeOf(this);
-  n += mOrder.SizeOfExcludingThis(aMallocSizeOf);
+  n += mOrder.ShallowSizeOfExcludingThis(aMallocSizeOf);
   n += mData          ? mData         ->SizeOfIncludingThis(aMallocSizeOf) : 0;
   n += mImportantData ? mImportantData->SizeOfIncludingThis(aMallocSizeOf) : 0;
   if (mVariables) {
     n += mVariables->SizeOfIncludingThis(aMallocSizeOf);
   }
   if (mImportantVariables) {
     n += mImportantVariables->SizeOfIncludingThis(aMallocSizeOf);
   }
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -2571,17 +2571,17 @@ CountSheetMemory(URIPrincipalReferrerPol
 size_t
 Loader::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
   size_t s = aMallocSizeOf(this);
 
   if (mSheets) {
     s += mSheets->mCompleteSheets.SizeOfExcludingThis(CountSheetMemory, aMallocSizeOf);
   }
-  s += mObservers.SizeOfExcludingThis(aMallocSizeOf);
+  s += mObservers.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
   // Measurement of the following members may be added later if DMD finds it is
   // worthwhile:
   // - mLoadingDatas: transient, and should be small
   // - mPendingDatas: transient, and should be small
   // - mParsingDatas: transient, and should be small
   // - mPostedEvents: transient, and should be small
   //
--- a/layout/style/RuleProcessorCache.cpp
+++ b/layout/style/RuleProcessorCache.cpp
@@ -254,19 +254,19 @@ RuleProcessorCache::DoStopTracking(nsCSS
 }
 
 size_t
 RuleProcessorCache::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
 {
   size_t n = aMallocSizeOf(this);
 
   int count = 0;
-  n += mEntries.SizeOfExcludingThis(aMallocSizeOf);
+  n += mEntries.ShallowSizeOfExcludingThis(aMallocSizeOf);
   for (Entry& e : mEntries) {
-    n += e.mDocumentEntries.SizeOfExcludingThis(aMallocSizeOf);
+    n += e.mDocumentEntries.ShallowSizeOfExcludingThis(aMallocSizeOf);
     for (DocumentEntry& de : e.mDocumentEntries) {
       count++;
       n += de.mRuleProcessor->SizeOfIncludingThis(aMallocSizeOf);
     }
   }
 
   return n;
 }
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -744,17 +744,17 @@ void RuleHash::EnumerateAllRules(Element
     }
   }
 }
 
 static size_t
 SizeOfRuleHashTableEntry(PLDHashEntryHdr* aHdr, MallocSizeOf aMallocSizeOf, void *)
 {
   RuleHashTableEntry* entry = static_cast<RuleHashTableEntry*>(aHdr);
-  return entry->mRules.SizeOfExcludingThis(aMallocSizeOf);
+  return entry->mRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
 }
 
 size_t
 RuleHash::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t n = 0;
 
   n += PL_DHashTableSizeOfExcludingThis(&mIdTable,
@@ -768,17 +768,17 @@ RuleHash::SizeOfExcludingThis(MallocSize
   n += PL_DHashTableSizeOfExcludingThis(&mTagTable,
                                         SizeOfRuleHashTableEntry,
                                         aMallocSizeOf);
 
   n += PL_DHashTableSizeOfExcludingThis(&mNameSpaceTable,
                                         SizeOfRuleHashTableEntry,
                                         aMallocSizeOf);
 
-  n += mUniversalRules.SizeOfExcludingThis(aMallocSizeOf);
+  n += mUniversalRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
   return n;
 }
 
 size_t
 RuleHash::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
@@ -921,17 +921,17 @@ struct RuleCascadeData {
 
   const bool mQuirksMode;
 };
 
 static size_t
 SizeOfSelectorsEntry(PLDHashEntryHdr* aHdr, MallocSizeOf aMallocSizeOf, void *)
 {
   AtomSelectorEntry* entry = static_cast<AtomSelectorEntry*>(aHdr);
-  return entry->mSelectors.SizeOfExcludingThis(aMallocSizeOf);
+  return entry->mSelectors.ShallowSizeOfExcludingThis(aMallocSizeOf);
 }
 
 static size_t
 SizeOfKeyframesRuleEntryExcludingThis(nsStringHashKey::KeyType aKey,
                                       nsCSSKeyframesRule* const& aData,
                                       mozilla::MallocSizeOf aMallocSizeOf,
                                       void* aUserArg)
 {
@@ -951,40 +951,40 @@ RuleCascadeData::SizeOfIncludingThis(Mal
   size_t n = aMallocSizeOf(this);
 
   n += mRuleHash.SizeOfExcludingThis(aMallocSizeOf);
   for (uint32_t i = 0; i < ArrayLength(mPseudoElementRuleHashes); ++i) {
     if (mPseudoElementRuleHashes[i])
       n += mPseudoElementRuleHashes[i]->SizeOfIncludingThis(aMallocSizeOf);
   }
 
-  n += mStateSelectors.SizeOfExcludingThis(aMallocSizeOf);
+  n += mStateSelectors.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
   n += PL_DHashTableSizeOfExcludingThis(&mIdSelectors,
                                         SizeOfSelectorsEntry, aMallocSizeOf);
   n += PL_DHashTableSizeOfExcludingThis(&mClassSelectors,
                                         SizeOfSelectorsEntry, aMallocSizeOf);
 
-  n += mPossiblyNegatedClassSelectors.SizeOfExcludingThis(aMallocSizeOf);
-  n += mPossiblyNegatedIDSelectors.SizeOfExcludingThis(aMallocSizeOf);
+  n += mPossiblyNegatedClassSelectors.ShallowSizeOfExcludingThis(aMallocSizeOf);
+  n += mPossiblyNegatedIDSelectors.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
   n += PL_DHashTableSizeOfExcludingThis(&mAttributeSelectors,
                                         SizeOfSelectorsEntry, aMallocSizeOf);
   n += PL_DHashTableSizeOfExcludingThis(&mAnonBoxRules,
                                         SizeOfRuleHashTableEntry, aMallocSizeOf);
 #ifdef MOZ_XUL
   n += PL_DHashTableSizeOfExcludingThis(&mXULTreeRules,
                                         SizeOfRuleHashTableEntry, aMallocSizeOf);
 #endif
 
-  n += mFontFaceRules.SizeOfExcludingThis(aMallocSizeOf);
-  n += mKeyframesRules.SizeOfExcludingThis(aMallocSizeOf);
-  n += mFontFeatureValuesRules.SizeOfExcludingThis(aMallocSizeOf);
-  n += mPageRules.SizeOfExcludingThis(aMallocSizeOf);
-  n += mCounterStyleRules.SizeOfExcludingThis(aMallocSizeOf);
+  n += mFontFaceRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
+  n += mKeyframesRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
+  n += mFontFeatureValuesRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
+  n += mPageRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
+  n += mCounterStyleRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
   n += mKeyframesRuleTable.SizeOfExcludingThis(SizeOfKeyframesRuleEntryExcludingThis,
                                                aMallocSizeOf,
                                                nullptr);
 
   return n;
 }
 
 nsTArray<nsCSSSelector*>*
@@ -2901,17 +2901,17 @@ nsCSSRuleProcessor::CloneMQCacheKey()
 
   return MakeUnique<nsMediaQueryResultCacheKey>(c->mCacheKey);
 }
 
 /* virtual */ size_t
 nsCSSRuleProcessor::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t n = 0;
-  n += mSheets.SizeOfExcludingThis(aMallocSizeOf);
+  n += mSheets.ShallowSizeOfExcludingThis(aMallocSizeOf);
   for (RuleCascadeData* cascade = mRuleCascades; cascade;
        cascade = cascade->mNext) {
     n += cascade->SizeOfIncludingThis(aMallocSizeOf);
   }
 
   return n;
 }
 
--- a/layout/style/nsCSSValue.cpp
+++ b/layout/style/nsCSSValue.cpp
@@ -2520,17 +2520,17 @@ nsCSSValueGradient::nsCSSValueGradient(b
 size_t
 nsCSSValueGradient::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
   size_t n = aMallocSizeOf(this);
   n += mBgPos.SizeOfExcludingThis(aMallocSizeOf);
   n += mAngle.SizeOfExcludingThis(aMallocSizeOf);
   n += mRadialValues[0].SizeOfExcludingThis(aMallocSizeOf);
   n += mRadialValues[1].SizeOfExcludingThis(aMallocSizeOf);
-  n += mStops.SizeOfExcludingThis(aMallocSizeOf);
+  n += mStops.ShallowSizeOfExcludingThis(aMallocSizeOf);
   for (uint32_t i = 0; i < mStops.Length(); i++) {
     n += mStops[i].SizeOfExcludingThis(aMallocSizeOf);
   }
   return n;
 }
 
 // --- nsCSSValueTokenStream ------------
 
@@ -2680,12 +2680,12 @@ nsCSSCornerSizes::corners[4] = {
   &nsCSSCornerSizes::mTopRight,
   &nsCSSCornerSizes::mBottomRight,
   &nsCSSCornerSizes::mBottomLeft,
 };
 
 size_t
 mozilla::css::GridTemplateAreasValue::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
-  size_t n = mNamedAreas.SizeOfExcludingThis(aMallocSizeOf);
-  n += mTemplates.SizeOfExcludingThis(aMallocSizeOf);
+  size_t n = mNamedAreas.ShallowSizeOfExcludingThis(aMallocSizeOf);
+  n += mTemplates.ShallowSizeOfExcludingThis(aMallocSizeOf);
   return n;
 }
--- a/layout/style/nsStyleSet.cpp
+++ b/layout/style/nsStyleSet.cpp
@@ -221,20 +221,20 @@ nsStyleSet::SizeOfIncludingThis(MallocSi
     // as the aSizeOfElementIncludingThis argument).  All we're doing here is
     // counting the size of the nsCOMArrays' buffers.
     n += mSheets[i].SizeOfExcludingThis(nullptr, aMallocSizeOf);
   }
 
   for (uint32_t i = 0; i < mScopedDocSheetRuleProcessors.Length(); i++) {
     n += mScopedDocSheetRuleProcessors[i]->SizeOfIncludingThis(aMallocSizeOf);
   }
-  n += mScopedDocSheetRuleProcessors.SizeOfExcludingThis(aMallocSizeOf);
+  n += mScopedDocSheetRuleProcessors.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
-  n += mRoots.SizeOfExcludingThis(aMallocSizeOf);
-  n += mOldRuleTrees.SizeOfExcludingThis(aMallocSizeOf);
+  n += mRoots.ShallowSizeOfExcludingThis(aMallocSizeOf);
+  n += mOldRuleTrees.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
   return n;
 }
 
 void
 nsStyleSet::Init(nsPresContext *aPresContext)
 {
   mFirstLineRule = new nsEmptyStyleRule;
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -221,17 +221,17 @@ AssertNotAlreadyCached(const char* aPref
 static size_t
 SizeOfObserverEntryExcludingThis(ValueObserverHashKey* aKey,
                                  const nsRefPtr<ValueObserver>& aData,
                                  mozilla::MallocSizeOf aMallocSizeOf,
                                  void*)
 {
   size_t n = 0;
   n += aKey->mPrefName.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
-  n += aData->mClosures.SizeOfExcludingThis(aMallocSizeOf);
+  n += aData->mClosures.ShallowSizeOfExcludingThis(aMallocSizeOf);
   return n;
 }
 
 // Although this is a member of Preferences, it measures sPreferences and
 // several other global structures.
 /* static */ int64_t
 Preferences::SizeOfIncludingThisAndOtherStuff(mozilla::MallocSizeOf aMallocSizeOf)
 {
@@ -239,17 +239,17 @@ Preferences::SizeOfIncludingThisAndOther
 
   size_t n = aMallocSizeOf(sPreferences);
   if (gHashTable) {
     // pref keys are allocated in a private arena, which we count elsewhere.
     // pref stringvals are allocated out of the same private arena.
     n += PL_DHashTableSizeOfExcludingThis(gHashTable, nullptr, aMallocSizeOf);
   }
   if (gCacheData) {
-    n += gCacheData->SizeOfIncludingThis(aMallocSizeOf);
+    n += gCacheData->ShallowSizeOfIncludingThis(aMallocSizeOf);
     for (uint32_t i = 0, count = gCacheData->Length(); i < count; ++i) {
       n += aMallocSizeOf((*gCacheData)[i]);
     }
   }
   if (gObserverTable) {
     n += aMallocSizeOf(gObserverTable);
     n += gObserverTable->SizeOfExcludingThis(SizeOfObserverEntryExcludingThis,
                                              aMallocSizeOf);
--- a/netwerk/cache2/CacheEntry.cpp
+++ b/netwerk/cache2/CacheEntry.cpp
@@ -1662,17 +1662,17 @@ NS_IMETHODIMP CacheOutputCloseListener::
 
 // Memory reporting
 
 size_t CacheEntry::SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
 {
   size_t n = 0;
   nsCOMPtr<nsISizeOf> sizeOf;
 
-  n += mCallbacks.SizeOfExcludingThis(mallocSizeOf);
+  n += mCallbacks.ShallowSizeOfExcludingThis(mallocSizeOf);
   if (mFile) {
     n += mFile->SizeOfIncludingThis(mallocSizeOf);
   }
 
   sizeOf = do_QueryInterface(mURI);
   if (sizeOf) {
     n += sizeOf->SizeOfIncludingThis(mallocSizeOf);
   }
--- a/netwerk/cache2/CacheFile.cpp
+++ b/netwerk/cache2/CacheFile.cpp
@@ -2004,29 +2004,29 @@ CacheFile::SizeOfExcludingThis(mozilla::
   n += mKey.SizeOfExcludingThisIfUnshared(mallocSizeOf);
   n += mChunks.SizeOfExcludingThis(CollectChunkSize, mallocSizeOf);
   n += mCachedChunks.SizeOfExcludingThis(CollectChunkSize, mallocSizeOf);
   if (mMetadata) {
     n += mMetadata->SizeOfIncludingThis(mallocSizeOf);
   }
 
   // Input streams are not elsewhere reported.
-  n += mInputs.SizeOfExcludingThis(mallocSizeOf);
+  n += mInputs.ShallowSizeOfExcludingThis(mallocSizeOf);
   for (uint32_t i = 0; i < mInputs.Length(); ++i) {
     n += mInputs[i]->SizeOfIncludingThis(mallocSizeOf);
   }
 
   // Output streams are not elsewhere reported.
   if (mOutput) {
     n += mOutput->SizeOfIncludingThis(mallocSizeOf);
   }
 
   // The listeners are usually classes reported just above.
   n += mChunkListeners.SizeOfExcludingThis(nullptr, mallocSizeOf);
-  n += mObjsToRelease.SizeOfExcludingThis(mallocSizeOf);
+  n += mObjsToRelease.ShallowSizeOfExcludingThis(mallocSizeOf);
 
   // mHandle reported directly from CacheFileIOManager.
 
   return n;
 }
 
 size_t
 CacheFile::SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const
--- a/netwerk/cache2/CacheFileUtils.cpp
+++ b/netwerk/cache2/CacheFileUtils.cpp
@@ -410,17 +410,17 @@ void
 ValidityMap::Clear()
 {
   mMap.Clear();
 }
 
 size_t
 ValidityMap::SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
 {
-  return mMap.SizeOfExcludingThis(mallocSizeOf);
+  return mMap.ShallowSizeOfExcludingThis(mallocSizeOf);
 }
 
 ValidityPair&
 ValidityMap::operator[](uint32_t aIdx)
 {
   return mMap.ElementAt(aIdx);
 }
 
--- a/netwerk/cache2/CacheIOThread.cpp
+++ b/netwerk/cache2/CacheIOThread.cpp
@@ -330,17 +330,17 @@ NS_IMETHODIMP CacheIOThread::AfterProces
 
 size_t CacheIOThread::SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
 {
   MonitorAutoLock lock(const_cast<CacheIOThread*>(this)->mMonitor);
 
   size_t n = 0;
   n += mallocSizeOf(mThread);
   for (uint32_t level = 0; level < LAST_LEVEL; ++level) {
-    n += mEventQueue[level].SizeOfExcludingThis(mallocSizeOf);
+    n += mEventQueue[level].ShallowSizeOfExcludingThis(mallocSizeOf);
     // Events referenced by the queues are arbitrary objects we cannot be sure
     // are reported elsewhere as well as probably not implementing nsISizeOf
     // interface.  Deliberatly omitting them from reporting here.
   }
 
   return n;
 }
 
--- a/netwerk/cache2/CacheIndex.cpp
+++ b/netwerk/cache2/CacheIndex.cpp
@@ -3606,18 +3606,18 @@ CacheIndex::SizeOfExcludingThisInternal(
   n += mallocSizeOf(mRWBuf);
   n += mallocSizeOf(mRWHash);
 
   n += mIndex.SizeOfExcludingThis(mallocSizeOf);
   n += mPendingUpdates.SizeOfExcludingThis(mallocSizeOf);
   n += mTmpJournal.SizeOfExcludingThis(mallocSizeOf);
 
   // mFrecencyArray items are reported by mIndex/mPendingUpdates
-  n += mFrecencyArray.SizeOfExcludingThis(mallocSizeOf);
-  n += mDiskConsumptionObservers.SizeOfExcludingThis(mallocSizeOf);
+  n += mFrecencyArray.ShallowSizeOfExcludingThis(mallocSizeOf);
+  n += mDiskConsumptionObservers.ShallowSizeOfExcludingThis(mallocSizeOf);
 
   return n;
 }
 
 // static
 size_t
 CacheIndex::SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf)
 {
--- a/netwerk/cache2/CacheStorageService.cpp
+++ b/netwerk/cache2/CacheStorageService.cpp
@@ -1965,20 +1965,20 @@ CacheStorageService::TelemetryRecordEntr
 
 size_t
 CacheStorageService::SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
 {
   CacheStorageService::Self()->Lock().AssertCurrentThreadOwns();
 
   size_t n = 0;
   // The elemets are referenced by sGlobalEntryTables and are reported from there
-  n += Pool(true).mFrecencyArray.SizeOfExcludingThis(mallocSizeOf);
-  n += Pool(true).mExpirationArray.SizeOfExcludingThis(mallocSizeOf);
-  n += Pool(false).mFrecencyArray.SizeOfExcludingThis(mallocSizeOf);
-  n += Pool(false).mExpirationArray.SizeOfExcludingThis(mallocSizeOf);
+  n += Pool(true).mFrecencyArray.ShallowSizeOfExcludingThis(mallocSizeOf);
+  n += Pool(true).mExpirationArray.ShallowSizeOfExcludingThis(mallocSizeOf);
+  n += Pool(false).mFrecencyArray.ShallowSizeOfExcludingThis(mallocSizeOf);
+  n += Pool(false).mExpirationArray.ShallowSizeOfExcludingThis(mallocSizeOf);
   // Entries reported manually in CacheStorageService::CollectReports callback
   if (sGlobalEntryTables) {
     n += sGlobalEntryTables->SizeOfIncludingThis(nullptr, mallocSizeOf);
   }
 
   return n;
 }
 
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -599,17 +599,17 @@ nsCookieKey::SizeOfExcludingThis(MallocS
   return mBaseDomain.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
 }
 
 size_t
 nsCookieEntry::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t amount = nsCookieKey::SizeOfExcludingThis(aMallocSizeOf);
 
-  amount += mCookies.SizeOfExcludingThis(aMallocSizeOf);
+  amount += mCookies.ShallowSizeOfExcludingThis(aMallocSizeOf);
   for (uint32_t i = 0; i < mCookies.Length(); ++i) {
     amount += mCookies[i]->SizeOfIncludingThis(aMallocSizeOf);
   }
 
   return amount;
 }
 
 size_t
@@ -625,17 +625,17 @@ CookieDomainTuple::SizeOfExcludingThis(M
 
 size_t
 DBState::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t amount = 0;
 
   amount += aMallocSizeOf(this);
   amount += hostTable.SizeOfExcludingThis(aMallocSizeOf);
-  amount += hostArray.SizeOfExcludingThis(aMallocSizeOf);
+  amount += hostArray.ShallowSizeOfExcludingThis(aMallocSizeOf);
   for (uint32_t i = 0; i < hostArray.Length(); ++i) {
     amount += hostArray[i].SizeOfExcludingThis(aMallocSizeOf);
   }
   amount += readSet.SizeOfExcludingThis(aMallocSizeOf);
 
   return amount;
 }
 
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -342,17 +342,17 @@ nsHostRecord::SizeOfIncludingThis(Malloc
     // memory that is allocated beyond the end of the nsHostRecord (see
     // nsHostRecord::Create()).  So it will be included in the
     // |mallocSizeOf(this)| call above.
 
     n += SizeOfResolveHostCallbackListExcludingHead(&callbacks, mallocSizeOf);
     n += addr_info ? addr_info->SizeOfIncludingThis(mallocSizeOf) : 0;
     n += mallocSizeOf(addr);
 
-    n += mBlacklistedItems.SizeOfExcludingThis(mallocSizeOf);
+    n += mBlacklistedItems.ShallowSizeOfExcludingThis(mallocSizeOf);
     for (size_t i = 0; i < mBlacklistedItems.Length(); i++) {
         n += mBlacklistedItems[i].SizeOfExcludingThisMustBeUnshared(mallocSizeOf);
     }
     return n;
 }
 
 nsHostRecord::DnsPriority
 nsHostRecord::GetPriority(uint16_t aFlags)
--- a/startupcache/StartupCache.cpp
+++ b/startupcache/StartupCache.cpp
@@ -378,17 +378,17 @@ StartupCache::SizeOfMapping()
 
 size_t
 StartupCache::HeapSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
 {
     // This function could measure more members, but they haven't been found by
     // DMD to be significant.  They can be added later if necessary.
     return aMallocSizeOf(this) +
            mTable.SizeOfExcludingThis(SizeOfEntryExcludingThis, aMallocSizeOf) +
-           mPendingWrites.SizeOfExcludingThis(aMallocSizeOf);
+           mPendingWrites.ShallowSizeOfExcludingThis(aMallocSizeOf);
 }
 
 /* static */ size_t
 StartupCache::SizeOfEntryExcludingThis(const nsACString& key, const nsAutoPtr<CacheEntry>& data,
                                        mozilla::MallocSizeOf mallocSizeOf, void *)
 {
     return data->SizeOfExcludingThis(mallocSizeOf);
 }
--- a/toolkit/components/places/History.h
+++ b/toolkit/components/places/History.h
@@ -176,17 +176,17 @@ private:
     }
     KeyClass(const KeyClass& aOther)
     : nsURIHashKey(aOther)
     {
       NS_NOTREACHED("Do not call me!");
     }
     size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
     {
-      return array.SizeOfExcludingThis(aMallocSizeOf);
+      return array.ShallowSizeOfExcludingThis(aMallocSizeOf);
     }
     ObserverArray array;
   };
 
   nsTHashtable<KeyClass> mObservers;
 
   /**
    * mRecentlyVisitedURIs remembers URIs which are recently added to the DB,
--- a/toolkit/components/telemetry/Telemetry.cpp
+++ b/toolkit/components/telemetry/Telemetry.cpp
@@ -397,17 +397,17 @@ public:
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
     size_t size;
     size = mFileStats.SizeOfExcludingThis(SizeOfFileIOEntryTypeExcludingThis,
                                           aMallocSizeOf) +
-           mSafeDirs.SizeOfExcludingThis(aMallocSizeOf);
+           mSafeDirs.ShallowSizeOfExcludingThis(aMallocSizeOf);
     uint32_t safeDirsLen = mSafeDirs.Length();
     for (uint32_t i = 0; i < safeDirsLen; ++i) {
       size += mSafeDirs[i].SizeOfExcludingThis(aMallocSizeOf);
     }
     return size;
   }
 
 private:
--- a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp
@@ -257,21 +257,21 @@ nsUrlClassifierPrefixSet::CollectReports
     aData);
 }
 
 size_t
 nsUrlClassifierPrefixSet::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
 {
   size_t n = 0;
   n += aMallocSizeOf(this);
-  n += mIndexDeltas.SizeOfExcludingThis(aMallocSizeOf);
+  n += mIndexDeltas.ShallowSizeOfExcludingThis(aMallocSizeOf);
   for (uint32_t i = 0; i < mIndexDeltas.Length(); i++) {
-    n += mIndexDeltas[i].SizeOfExcludingThis(aMallocSizeOf);
+    n += mIndexDeltas[i].ShallowSizeOfExcludingThis(aMallocSizeOf);
   }
-  n += mIndexPrefixes.SizeOfExcludingThis(aMallocSizeOf);
+  n += mIndexPrefixes.ShallowSizeOfExcludingThis(aMallocSizeOf);
   return n;
 }
 
 NS_IMETHODIMP
 nsUrlClassifierPrefixSet::IsEmpty(bool * aEmpty)
 {
   *aEmpty = (mIndexPrefixes.Length() == 0);
   return NS_OK;
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -881,17 +881,17 @@ public:
                            size_t* aNodesSize, size_t* aEdgesSize,
                            size_t* aWeakMapsSize) const
   {
     *aNodesSize = mNodes.SizeOfExcludingThis(aMallocSizeOf);
     *aEdgesSize = mEdges.SizeOfExcludingThis(aMallocSizeOf);
 
     // We don't measure what the WeakMappings point to, because the
     // pointers are non-owning.
-    *aWeakMapsSize = mWeakMaps.SizeOfExcludingThis(aMallocSizeOf);
+    *aWeakMapsSize = mWeakMaps.ShallowSizeOfExcludingThis(aMallocSizeOf);
   }
 };
 
 PtrInfo*
 CCGraph::FindNode(void* aPtr)
 {
   PtrToNodeEntry* e =
     static_cast<PtrToNodeEntry*>(PL_DHashTableSearch(&mPtrToNodeMap, aPtr));
--- a/xpcom/components/nsComponentManager.cpp
+++ b/xpcom/components/nsComponentManager.cpp
@@ -1852,25 +1852,25 @@ nsComponentManagerImpl::SizeOfIncludingT
 {
   size_t n = aMallocSizeOf(this);
   n += mLoaderMap.SizeOfExcludingThis(nullptr, aMallocSizeOf);
   n += mFactories.SizeOfExcludingThis(SizeOfFactoriesEntryExcludingThis,
                                       aMallocSizeOf);
   n += mContractIDs.SizeOfExcludingThis(SizeOfContractIDsEntryExcludingThis,
                                         aMallocSizeOf);
 
-  n += sStaticModules->SizeOfIncludingThis(aMallocSizeOf);
-  n += sModuleLocations->SizeOfIncludingThis(aMallocSizeOf);
+  n += sStaticModules->ShallowSizeOfIncludingThis(aMallocSizeOf);
+  n += sModuleLocations->ShallowSizeOfIncludingThis(aMallocSizeOf);
 
-  n += mKnownStaticModules.SizeOfExcludingThis(aMallocSizeOf);
+  n += mKnownStaticModules.ShallowSizeOfExcludingThis(aMallocSizeOf);
   n += mKnownModules.SizeOfExcludingThis(nullptr, aMallocSizeOf);
 
   n += PL_SizeOfArenaPoolExcludingPool(&mArena, aMallocSizeOf);
 
-  n += mPendingServices.SizeOfExcludingThis(aMallocSizeOf);
+  n += mPendingServices.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
   // Measurement of the following members may be added later if DMD finds it is
   // worthwhile:
   // - mLoaderMap's keys and values
   // - mMon
   // - sStaticModules' entries
   // - sModuleLocations' entries
   // - mNativeModuleLoader
--- a/xpcom/glue/DeadlockDetector.h
+++ b/xpcom/glue/DeadlockDetector.h
@@ -92,18 +92,18 @@ private:
     ~OrderingEntry()
     {
     }
 
     size_t
     SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
     {
       size_t n = aMallocSizeOf(this);
-      n += mOrderedLT.SizeOfExcludingThis(aMallocSizeOf);
-      n += mExternalRefs.SizeOfExcludingThis(aMallocSizeOf);
+      n += mOrderedLT.ShallowSizeOfExcludingThis(aMallocSizeOf);
+      n += mExternalRefs.ShallowSizeOfExcludingThis(aMallocSizeOf);
       return n;
     }
 
     HashEntryArray mOrderedLT; // this <_o Other
     HashEntryArray mExternalRefs; // hash entries that reference this
     const T* mResource;
   };
 
--- a/xpcom/glue/nsCOMArray.cpp
+++ b/xpcom/glue/nsCOMArray.cpp
@@ -292,17 +292,17 @@ nsCOMArray_base::SetCount(int32_t aNewCo
   return true;
 }
 
 size_t
 nsCOMArray_base::SizeOfExcludingThis(
     nsBaseArraySizeOfElementIncludingThisFunc aSizeOfElementIncludingThis,
     mozilla::MallocSizeOf aMallocSizeOf, void* aData) const
 {
-  size_t n = mArray.SizeOfExcludingThis(aMallocSizeOf);
+  size_t n = mArray.ShallowSizeOfExcludingThis(aMallocSizeOf);
 
   if (aSizeOfElementIncludingThis) {
     for (uint32_t index = 0; index < mArray.Length(); ++index) {
       n += aSizeOfElementIncludingThis(mArray[index], aMallocSizeOf, aData);
     }
   }
 
   return n;
--- a/xpcom/glue/nsTArray.h
+++ b/xpcom/glue/nsTArray.h
@@ -936,30 +936,34 @@ public:
   self_type& operator=(nsTArray_Impl<E, Allocator>&& aOther)
   {
     Clear();
     SwapElements(aOther);
     return *this;
   }
 
   // @return The amount of memory used by this nsTArray_Impl, excluding
-  // sizeof(*this).
-  size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
+  // sizeof(*this). If you want to measure anything hanging off the array, you
+  // must iterate over the elements and measure them individually; hence the
+  // "Shallow" prefix.
+  size_t ShallowSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
   {
     if (this->UsesAutoArrayBuffer() || Hdr() == EmptyHdr()) {
       return 0;
     }
     return aMallocSizeOf(this->Hdr());
   }
 
   // @return The amount of memory used by this nsTArray_Impl, including
-  // sizeof(*this).
-  size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
+  // sizeof(*this). If you want to measure anything hanging off the array, you
+  // must iterate over the elements and measure them individually; hence the
+  // "Shallow" prefix.
+  size_t ShallowSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
   {
-    return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
+    return aMallocSizeOf(this) + ShallowSizeOfExcludingThis(aMallocSizeOf);
   }
 
   //
   // Accessor methods
   //
 
   // This method provides direct access to the array elements.
   // @return A pointer to the first element of the array.  If the array is
--- a/xpcom/glue/nsTObserverArray.h
+++ b/xpcom/glue/nsTObserverArray.h
@@ -256,20 +256,22 @@ public:
     mArray.Clear();
     ClearIterators();
   }
 
   // Compact the array to minimize the memory it uses
   void Compact() { mArray.Compact(); }
 
   // Returns the number of bytes on the heap taken up by this object, not
-  // including sizeof(*this).
-  size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
+  // including sizeof(*this). If you want to measure anything hanging off the
+  // array, you must iterate over the elements and measure them individually;
+  // hence the "Shallow" prefix.
+  size_t ShallowSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
   {
-    return mArray.SizeOfExcludingThis(aMallocSizeOf);
+    return mArray.ShallowSizeOfExcludingThis(aMallocSizeOf);
   }
 
   //
   // Iterators
   //
 
   // Base class for iterators. Do not use this directly.
   class Iterator : public Iterator_base