diff --git a/mozilla/content/base/src/nsHTMLValue.cpp b/mozilla/content/base/src/nsHTMLValue.cpp
index 408130f3853..9e05ead2be9 100644
--- a/mozilla/content/base/src/nsHTMLValue.cpp
+++ b/mozilla/content/base/src/nsHTMLValue.cpp
@@ -19,6 +19,7 @@
#include "nsHTMLValue.h"
#include "nsString.h"
#include "nsCRT.h"
+#include "nsISizeOfHandler.h"
const nsHTMLValue nsHTMLValue::kNull;
@@ -291,3 +292,13 @@ void nsHTMLValue::ToString(nsString& aBuffer) const
AppendToString(aBuffer);
}
+void
+nsHTMLValue::SizeOf(nsISizeOfHandler* aHandler) const
+{
+ aHandler->Add(sizeof(*this));
+ if (eHTMLUnit_String == mUnit) {
+ if (!aHandler->HaveSeen(mValue.mString)) {
+ mValue.mString->SizeOf(aHandler);
+ }
+ }
+}
diff --git a/mozilla/content/base/src/nsHTMLValue.h b/mozilla/content/base/src/nsHTMLValue.h
index cc5f437f953..5e6860f8bb6 100644
--- a/mozilla/content/base/src/nsHTMLValue.h
+++ b/mozilla/content/base/src/nsHTMLValue.h
@@ -22,7 +22,7 @@
#include "nsColor.h"
#include "nsString.h"
#include "nsISupports.h"
-
+class nsISizeOfHandler;
enum nsHTMLUnit {
eHTMLUnit_Null = 0, // (n/a) null unit, value is not specified
@@ -72,6 +72,7 @@ public:
void AppendToString(nsString& aBuffer) const;
void ToString(nsString& aBuffer) const;
+ void SizeOf(nsISizeOfHandler* aHandler) const;
protected:
nsHTMLUnit mUnit;
diff --git a/mozilla/content/html/style/src/nsHTMLAttributes.cpp b/mozilla/content/html/style/src/nsHTMLAttributes.cpp
index 650c95a3417..abdd9f00b7b 100644
--- a/mozilla/content/html/style/src/nsHTMLAttributes.cpp
+++ b/mozilla/content/html/style/src/nsHTMLAttributes.cpp
@@ -123,8 +123,12 @@ struct HTMLAttribute {
void
HTMLAttribute::SizeOf(nsISizeOfHandler* aHandler) const
{
- // XXX mAttribute
+ if (!aHandler->HaveSeen(mAttribute)) {
+ mAttribute->SizeOf(aHandler);
+ }
aHandler->Add(sizeof(*this));
+ aHandler->Add((size_t) (- ((PRInt32) sizeof(mValue)) ) );
+ mValue.SizeOf(aHandler);
if (!aHandler->HaveSeen(mNext)) {
mNext->SizeOf(aHandler);
}
diff --git a/mozilla/content/html/style/src/nsHTMLValue.cpp b/mozilla/content/html/style/src/nsHTMLValue.cpp
index 408130f3853..9e05ead2be9 100644
--- a/mozilla/content/html/style/src/nsHTMLValue.cpp
+++ b/mozilla/content/html/style/src/nsHTMLValue.cpp
@@ -19,6 +19,7 @@
#include "nsHTMLValue.h"
#include "nsString.h"
#include "nsCRT.h"
+#include "nsISizeOfHandler.h"
const nsHTMLValue nsHTMLValue::kNull;
@@ -291,3 +292,13 @@ void nsHTMLValue::ToString(nsString& aBuffer) const
AppendToString(aBuffer);
}
+void
+nsHTMLValue::SizeOf(nsISizeOfHandler* aHandler) const
+{
+ aHandler->Add(sizeof(*this));
+ if (eHTMLUnit_String == mUnit) {
+ if (!aHandler->HaveSeen(mValue.mString)) {
+ mValue.mString->SizeOf(aHandler);
+ }
+ }
+}
diff --git a/mozilla/content/html/style/src/nsHTMLValue.h b/mozilla/content/html/style/src/nsHTMLValue.h
index cc5f437f953..5e6860f8bb6 100644
--- a/mozilla/content/html/style/src/nsHTMLValue.h
+++ b/mozilla/content/html/style/src/nsHTMLValue.h
@@ -22,7 +22,7 @@
#include "nsColor.h"
#include "nsString.h"
#include "nsISupports.h"
-
+class nsISizeOfHandler;
enum nsHTMLUnit {
eHTMLUnit_Null = 0, // (n/a) null unit, value is not specified
@@ -72,6 +72,7 @@ public:
void AppendToString(nsString& aBuffer) const;
void ToString(nsString& aBuffer) const;
+ void SizeOf(nsISizeOfHandler* aHandler) const;
protected:
nsHTMLUnit mUnit;
diff --git a/mozilla/content/shared/public/nsHTMLValue.h b/mozilla/content/shared/public/nsHTMLValue.h
index cc5f437f953..5e6860f8bb6 100644
--- a/mozilla/content/shared/public/nsHTMLValue.h
+++ b/mozilla/content/shared/public/nsHTMLValue.h
@@ -22,7 +22,7 @@
#include "nsColor.h"
#include "nsString.h"
#include "nsISupports.h"
-
+class nsISizeOfHandler;
enum nsHTMLUnit {
eHTMLUnit_Null = 0, // (n/a) null unit, value is not specified
@@ -72,6 +72,7 @@ public:
void AppendToString(nsString& aBuffer) const;
void ToString(nsString& aBuffer) const;
+ void SizeOf(nsISizeOfHandler* aHandler) const;
protected:
nsHTMLUnit mUnit;
diff --git a/mozilla/content/shared/src/nsHTMLValue.cpp b/mozilla/content/shared/src/nsHTMLValue.cpp
index 408130f3853..9e05ead2be9 100644
--- a/mozilla/content/shared/src/nsHTMLValue.cpp
+++ b/mozilla/content/shared/src/nsHTMLValue.cpp
@@ -19,6 +19,7 @@
#include "nsHTMLValue.h"
#include "nsString.h"
#include "nsCRT.h"
+#include "nsISizeOfHandler.h"
const nsHTMLValue nsHTMLValue::kNull;
@@ -291,3 +292,13 @@ void nsHTMLValue::ToString(nsString& aBuffer) const
AppendToString(aBuffer);
}
+void
+nsHTMLValue::SizeOf(nsISizeOfHandler* aHandler) const
+{
+ aHandler->Add(sizeof(*this));
+ if (eHTMLUnit_String == mUnit) {
+ if (!aHandler->HaveSeen(mValue.mString)) {
+ mValue.mString->SizeOf(aHandler);
+ }
+ }
+}
diff --git a/mozilla/layout/generic/nsImageMap.cpp b/mozilla/layout/generic/nsImageMap.cpp
index 362f85aecf0..db80818da81 100644
--- a/mozilla/layout/generic/nsImageMap.cpp
+++ b/mozilla/layout/generic/nsImageMap.cpp
@@ -79,7 +79,11 @@ void
Area::SizeOf(nsISizeOfHandler* aHandler) const
{
aHandler->Add(sizeof(*this));
- // XXX mBase, mHREF, mTarget, mAltText
+ aHandler->Add((size_t) (- ((PRInt32)sizeof(nsString) * 4) ) );
+ mBase.SizeOf(aHandler);
+ mHREF.SizeOf(aHandler);
+ mTarget.SizeOf(aHandler);
+ mAltText.SizeOf(aHandler);
aHandler->Add(mNumCoords * sizeof(nscoord));
}
@@ -712,9 +716,17 @@ NS_IMETHODIMP
ImageMapImpl::SizeOf(nsISizeOfHandler* aHandler) const
{
aHandler->Add(sizeof(*this));
- // XXX mName
- // XXX mTag
- // XXX mAreas array slots
+
+ aHandler->Add((size_t) (- ((PRInt32) sizeof(mName))));
+ mName.SizeOf(aHandler);
+
+ if (!aHandler->HaveSeen(mTag)) {
+ mTag->SizeOf(aHandler);
+ }
+
+ aHandler->Add((size_t) (- ((PRInt32) sizeof(mAreas))));
+ mAreas.SizeOf(aHandler);
+
PRInt32 i, n = mAreas.Count();
for (i = 0; i < n; i++) {
Area* area = (Area*) mAreas[i];
diff --git a/mozilla/layout/html/base/src/nsHTMLContainer.cpp b/mozilla/layout/html/base/src/nsHTMLContainer.cpp
index 10443075d99..66b0624e15e 100644
--- a/mozilla/layout/html/base/src/nsHTMLContainer.cpp
+++ b/mozilla/layout/html/base/src/nsHTMLContainer.cpp
@@ -85,7 +85,8 @@ nsHTMLContainer::SizeOf(nsISizeOfHandler* aHandler) const
void
nsHTMLContainer::SizeOfWithoutThis(nsISizeOfHandler* aHandler) const
{
- // XXX children array's array of pointers
+ aHandler->Add((size_t) (- (PRInt32)sizeof(mChildren) ) );
+ mChildren.SizeOf(aHandler);
PRInt32 i, n = mChildren.Count();
for (i = 0; i < n; i++) {
diff --git a/mozilla/layout/html/base/src/nsHTMLImage.cpp b/mozilla/layout/html/base/src/nsHTMLImage.cpp
index 5e2ee6ca308..a1d9f66f3ff 100644
--- a/mozilla/layout/html/base/src/nsHTMLImage.cpp
+++ b/mozilla/layout/html/base/src/nsHTMLImage.cpp
@@ -165,7 +165,7 @@ nsHTMLImageLoader::SizeOf(nsISizeOfHandler* aHandler) const
{
aHandler->Add(sizeof(*this));
if (!aHandler->HaveSeen(mURLSpec)) {
- aHandler->Add(sizeof(*mURLSpec));/* XXX approximation */
+ mURLSpec->SizeOf(aHandler);
}
if (!aHandler->HaveSeen(mImageLoader)) {
mImageLoader->SizeOf(aHandler);
diff --git a/mozilla/layout/html/base/src/nsHTMLTagContent.cpp b/mozilla/layout/html/base/src/nsHTMLTagContent.cpp
index 43aaaabff80..23ee9b5bbab 100644
--- a/mozilla/layout/html/base/src/nsHTMLTagContent.cpp
+++ b/mozilla/layout/html/base/src/nsHTMLTagContent.cpp
@@ -92,7 +92,9 @@ nsHTMLTagContent::SizeOf(nsISizeOfHandler* aHandler) const
void
nsHTMLTagContent::SizeOfWithoutThis(nsISizeOfHandler* aHandler) const
{
- // XXX tag
+ if (!aHandler->HaveSeen(mTag)) {
+ mTag->SizeOf(aHandler);
+ }
if (!aHandler->HaveSeen(mAttributes)) {
mAttributes->SizeOf(aHandler);
}
diff --git a/mozilla/layout/html/base/src/nsImageMap.cpp b/mozilla/layout/html/base/src/nsImageMap.cpp
index 362f85aecf0..db80818da81 100644
--- a/mozilla/layout/html/base/src/nsImageMap.cpp
+++ b/mozilla/layout/html/base/src/nsImageMap.cpp
@@ -79,7 +79,11 @@ void
Area::SizeOf(nsISizeOfHandler* aHandler) const
{
aHandler->Add(sizeof(*this));
- // XXX mBase, mHREF, mTarget, mAltText
+ aHandler->Add((size_t) (- ((PRInt32)sizeof(nsString) * 4) ) );
+ mBase.SizeOf(aHandler);
+ mHREF.SizeOf(aHandler);
+ mTarget.SizeOf(aHandler);
+ mAltText.SizeOf(aHandler);
aHandler->Add(mNumCoords * sizeof(nscoord));
}
@@ -712,9 +716,17 @@ NS_IMETHODIMP
ImageMapImpl::SizeOf(nsISizeOfHandler* aHandler) const
{
aHandler->Add(sizeof(*this));
- // XXX mName
- // XXX mTag
- // XXX mAreas array slots
+
+ aHandler->Add((size_t) (- ((PRInt32) sizeof(mName))));
+ mName.SizeOf(aHandler);
+
+ if (!aHandler->HaveSeen(mTag)) {
+ mTag->SizeOf(aHandler);
+ }
+
+ aHandler->Add((size_t) (- ((PRInt32) sizeof(mAreas))));
+ mAreas.SizeOf(aHandler);
+
PRInt32 i, n = mAreas.Count();
for (i = 0; i < n; i++) {
Area* area = (Area*) mAreas[i];
diff --git a/mozilla/layout/html/style/src/nsHTMLAttributes.cpp b/mozilla/layout/html/style/src/nsHTMLAttributes.cpp
index 650c95a3417..abdd9f00b7b 100644
--- a/mozilla/layout/html/style/src/nsHTMLAttributes.cpp
+++ b/mozilla/layout/html/style/src/nsHTMLAttributes.cpp
@@ -123,8 +123,12 @@ struct HTMLAttribute {
void
HTMLAttribute::SizeOf(nsISizeOfHandler* aHandler) const
{
- // XXX mAttribute
+ if (!aHandler->HaveSeen(mAttribute)) {
+ mAttribute->SizeOf(aHandler);
+ }
aHandler->Add(sizeof(*this));
+ aHandler->Add((size_t) (- ((PRInt32) sizeof(mValue)) ) );
+ mValue.SizeOf(aHandler);
if (!aHandler->HaveSeen(mNext)) {
mNext->SizeOf(aHandler);
}
diff --git a/mozilla/layout/html/style/src/nsHTMLValue.cpp b/mozilla/layout/html/style/src/nsHTMLValue.cpp
index 408130f3853..9e05ead2be9 100644
--- a/mozilla/layout/html/style/src/nsHTMLValue.cpp
+++ b/mozilla/layout/html/style/src/nsHTMLValue.cpp
@@ -19,6 +19,7 @@
#include "nsHTMLValue.h"
#include "nsString.h"
#include "nsCRT.h"
+#include "nsISizeOfHandler.h"
const nsHTMLValue nsHTMLValue::kNull;
@@ -291,3 +292,13 @@ void nsHTMLValue::ToString(nsString& aBuffer) const
AppendToString(aBuffer);
}
+void
+nsHTMLValue::SizeOf(nsISizeOfHandler* aHandler) const
+{
+ aHandler->Add(sizeof(*this));
+ if (eHTMLUnit_String == mUnit) {
+ if (!aHandler->HaveSeen(mValue.mString)) {
+ mValue.mString->SizeOf(aHandler);
+ }
+ }
+}
diff --git a/mozilla/layout/html/style/src/nsHTMLValue.h b/mozilla/layout/html/style/src/nsHTMLValue.h
index cc5f437f953..5e6860f8bb6 100644
--- a/mozilla/layout/html/style/src/nsHTMLValue.h
+++ b/mozilla/layout/html/style/src/nsHTMLValue.h
@@ -22,7 +22,7 @@
#include "nsColor.h"
#include "nsString.h"
#include "nsISupports.h"
-
+class nsISizeOfHandler;
enum nsHTMLUnit {
eHTMLUnit_Null = 0, // (n/a) null unit, value is not specified
@@ -72,6 +72,7 @@ public:
void AppendToString(nsString& aBuffer) const;
void ToString(nsString& aBuffer) const;
+ void SizeOf(nsISizeOfHandler* aHandler) const;
protected:
nsHTMLUnit mUnit;