Bug 1487198 - Measure memory usage of the identifier map in ShadowRoot as well. r=smaug
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 29 Aug 2018 22:49:04 +0000
changeset 433995 48f88e237b4e94be9f85a52abb5cc13071dd8cc0
parent 433994 ac2c1fea89ea57dee4a5b85dd046ca7ef71a9baf
child 433996 76ccb62dd14d57f1fdb8e9448b97eb06500ba9d7
push id68506
push useremilio@crisal.io
push dateWed, 29 Aug 2018 22:53:49 +0000
treeherderautoland@48f88e237b4e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1487198
milestone63.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 1487198 - Measure memory usage of the identifier map in ShadowRoot as well. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D4615
dom/base/DocumentOrShadowRoot.cpp
dom/base/nsDocument.cpp
--- a/dom/base/DocumentOrShadowRoot.cpp
+++ b/dom/base/DocumentOrShadowRoot.cpp
@@ -48,16 +48,18 @@ DocumentOrShadowRoot::AddSizeOfOwnedShee
     aSizes.mLayoutStyleSheetsSize += n;
   }
 }
 
 void
 DocumentOrShadowRoot::AddSizeOfExcludingThis(nsWindowSizes& aSizes) const
 {
   AddSizeOfOwnedSheetArrayExcludingThis(aSizes, mStyleSheets);
+  aSizes.mDOMOtherSize +=
+    mIdentifierMap.SizeOfExcludingThis(aSizes.mState.mMallocSizeOf);
 }
 
 DocumentOrShadowRoot::~DocumentOrShadowRoot()
 {
   for (StyleSheet* sheet : mStyleSheets) {
     sheet->ClearAssociatedDocumentOrShadowRoot();
   }
 }
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -11905,19 +11905,16 @@ nsDocument::DocAddSizeOfExcludingThis(ns
   aWindowSizes.mDOMOtherSize += mAttrStyleSheet
                               ? mAttrStyleSheet->DOMSizeOfIncludingThis(
                                   aWindowSizes.mState.mMallocSizeOf)
                               : 0;
 
   aWindowSizes.mDOMOtherSize +=
     mStyledLinks.ShallowSizeOfExcludingThis(aWindowSizes.mState.mMallocSizeOf);
 
-  aWindowSizes.mDOMOtherSize +=
-    mIdentifierMap.SizeOfExcludingThis(aWindowSizes.mState.mMallocSizeOf);
-
   // Measurement of the following members may be added later if DMD finds it
   // is worthwhile:
   // - many!
 }
 
 already_AddRefed<nsIDocument>
 nsIDocument::Constructor(const GlobalObject& aGlobal,
                          ErrorResult& rv)