From 08292e2c283ee5594fd7fe207aefd5970654ec26 Mon Sep 17 00:00:00 2001 From: Mounir Lamouri Date: Wed, 29 Jun 2011 13:18:54 +0200 Subject: [PATCH] Bug 667485 - Add windows' document size to windows size. r=jst --- content/base/public/nsIDocument.h | 4 ++++ dom/base/nsGlobalWindow.h | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index 98a3e0a9eb7..b0a29b81602 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -1534,6 +1534,10 @@ public: #undef DEPRECATED_OPERATION void WarnOnceAbout(DeprecatedOperations aOperation); + PRInt64 SizeOf() const { + return sizeof(*this); + } + private: PRUint32 mWarnedAbout; diff --git a/dom/base/nsGlobalWindow.h b/dom/base/nsGlobalWindow.h index b513250c67d..92d7ed48cb0 100644 --- a/dom/base/nsGlobalWindow.h +++ b/dom/base/nsGlobalWindow.h @@ -545,7 +545,13 @@ public: } PRInt64 SizeOf() const { - return sizeof(*this); + PRInt64 size = sizeof(*this); + + if (IsInnerWindow() && mDoc) { + size += mDoc->SizeOf(); + } + + return size; } private: