diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 588dd0472f00..86ba1ffa1be9 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -210,6 +210,7 @@ #include "mozilla/dom/WindowBinding.h" #include "nsITabChild.h" #include "nsIDOMMediaQueryList.h" +#include "mozilla/dom/DOMJSClass.h" #ifdef MOZ_WEBSPEECH #include "mozilla/dom/SpeechSynthesis.h" @@ -12658,6 +12659,12 @@ nsGlobalWindow::AddSizeOfIncludingThis(nsWindowSizes* aWindowSizes) const const_cast >*> (&mEventTargetObjects)->EnumerateEntries(CollectSizeAndListenerCount, aWindowSizes); + + JSObject* global = FastGetGlobalJSObject(); + if (IsInnerWindow() && global) { + JS::Heap* cache = GetProtoAndIfaceArray(global); + aWindowSizes->mProtoIfaceCacheSize += aWindowSizes->mMallocSizeOf(cache); + } } diff --git a/dom/base/nsGlobalWindow.h b/dom/base/nsGlobalWindow.h index 39923deaec40..2924c80f5864 100644 --- a/dom/base/nsGlobalWindow.h +++ b/dom/base/nsGlobalWindow.h @@ -342,7 +342,7 @@ public: // nsIScriptGlobalObject virtual nsIScriptContext *GetContext(); - JSObject *FastGetGlobalJSObject() + JSObject *FastGetGlobalJSObject() const { return mJSObject; }