From e6a2b29ebfa592c16af4fa01db9430ee6778aa14 Mon Sep 17 00:00:00 2001 From: "dbaron%dbaron.org" Date: Sat, 22 Feb 2003 15:34:38 +0000 Subject: [PATCH] Remove nsISizeOfHandler and associated SizeOf methods. b=106792 r=bzbarsky sr=jst git-svn-id: svn://10.0.0.236/trunk@138193 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/public/nsIContent.h | 18 - mozilla/content/base/public/nsIStyleRule.h | 4 - .../base/public/nsIStyleRuleProcessor.h | 6 - mozilla/content/base/public/nsIStyleSheet.h | 4 - .../content/base/src/nsDOMAttributeMap.cpp | 13 - mozilla/content/base/src/nsDOMAttributeMap.h | 6 - .../content/base/src/nsDOMDocumentType.cpp | 34 -- mozilla/content/base/src/nsDOMDocumentType.h | 5 - .../content/base/src/nsDocumentFragment.cpp | 10 - .../content/base/src/nsGenericDOMDataNode.cpp | 12 - .../content/base/src/nsGenericDOMDataNode.h | 4 - mozilla/content/base/src/nsGenericElement.cpp | 51 --- mozilla/content/base/src/nsGenericElement.h | 8 - mozilla/content/base/src/nsStyleContext.cpp | 65 ---- mozilla/content/base/src/nsStyleSet.cpp | 192 ----------- mozilla/content/html/content/public/nsIForm.h | 1 - .../content/src/GenericElementCollection.cpp | 13 - .../content/src/GenericElementCollection.h | 7 - .../html/content/src/nsAttributeContent.cpp | 12 - .../html/content/src/nsGenericHTMLElement.cpp | 16 - .../html/content/src/nsGenericHTMLElement.h | 2 - .../html/content/src/nsHTMLAnchorElement.cpp | 15 - .../html/content/src/nsHTMLAppletElement.cpp | 14 - .../html/content/src/nsHTMLAreaElement.cpp | 13 - .../html/content/src/nsHTMLBRElement.cpp | 13 - .../content/src/nsHTMLBaseFontElement.cpp | 14 - .../html/content/src/nsHTMLBodyElement.cpp | 55 --- .../html/content/src/nsHTMLButtonElement.cpp | 14 - .../html/content/src/nsHTMLDListElement.cpp | 13 - .../html/content/src/nsHTMLDelElement.cpp | 15 - .../content/src/nsHTMLDirectoryElement.cpp | 13 - .../html/content/src/nsHTMLDivElement.cpp | 13 - .../content/src/nsHTMLFieldSetElement.cpp | 18 - .../html/content/src/nsHTMLFontElement.cpp | 13 - .../html/content/src/nsHTMLFormElement.cpp | 30 -- .../html/content/src/nsHTMLFrameElement.cpp | 13 - .../content/src/nsHTMLFrameSetElement.cpp | 14 - .../html/content/src/nsHTMLHRElement.cpp | 13 - .../html/content/src/nsHTMLHeadElement.cpp | 15 - .../html/content/src/nsHTMLHeadingElement.cpp | 13 - .../html/content/src/nsHTMLHtmlElement.cpp | 15 - .../html/content/src/nsHTMLIFrameElement.cpp | 13 - .../html/content/src/nsHTMLImageElement.cpp | 13 - .../html/content/src/nsHTMLInputElement.cpp | 18 - .../html/content/src/nsHTMLInsElement.cpp | 15 - .../html/content/src/nsHTMLLIElement.cpp | 13 - .../html/content/src/nsHTMLLabelElement.cpp | 14 - .../html/content/src/nsHTMLLegendElement.cpp | 14 - .../html/content/src/nsHTMLLinkElement.cpp | 13 - .../html/content/src/nsHTMLMapElement.cpp | 13 - .../html/content/src/nsHTMLMenuElement.cpp | 13 - .../html/content/src/nsHTMLMetaElement.cpp | 15 - .../html/content/src/nsHTMLModElement.cpp | 15 - .../html/content/src/nsHTMLOListElement.cpp | 13 - .../html/content/src/nsHTMLObjectElement.cpp | 13 - .../content/src/nsHTMLOptGroupElement.cpp | 15 - .../html/content/src/nsHTMLOptionElement.cpp | 13 - .../content/src/nsHTMLParagraphElement.cpp | 14 - .../html/content/src/nsHTMLPreElement.cpp | 13 - .../html/content/src/nsHTMLQuoteElement.cpp | 15 - .../html/content/src/nsHTMLScriptElement.cpp | 15 - .../html/content/src/nsHTMLSelectElement.cpp | 13 - .../content/src/nsHTMLSharedContainerElem.cpp | 16 - .../html/content/src/nsHTMLSharedElement.cpp | 16 - .../content/src/nsHTMLSharedLeafElement.cpp | 16 - .../content/src/nsHTMLSharedObjectElement.cpp | 13 - .../html/content/src/nsHTMLSpanElement.cpp | 14 - .../html/content/src/nsHTMLStyleElement.cpp | 14 - .../content/src/nsHTMLTableCaptionElement.cpp | 14 - .../content/src/nsHTMLTableCellElement.cpp | 14 - .../content/src/nsHTMLTableColElement.cpp | 14 - .../html/content/src/nsHTMLTableElement.cpp | 19 -- .../content/src/nsHTMLTableRowElement.cpp | 14 - .../content/src/nsHTMLTableSectionElement.cpp | 14 - .../content/src/nsHTMLTextAreaElement.cpp | 18 - .../html/content/src/nsHTMLTitleElement.cpp | 14 - .../html/content/src/nsHTMLUListElement.cpp | 13 - .../html/content/src/nsHTMLUnknownElement.cpp | 13 - .../html/style/src/nsCSSDeclaration.cpp | 97 ------ .../content/html/style/src/nsCSSDeclaration.h | 3 - mozilla/content/html/style/src/nsCSSRules.cpp | 184 ---------- .../content/html/style/src/nsCSSStruct.cpp | 97 ------ mozilla/content/html/style/src/nsCSSStruct.h | 3 - .../content/html/style/src/nsCSSStyleRule.cpp | 250 -------------- .../html/style/src/nsCSSStyleSheet.cpp | 287 ---------------- .../html/style/src/nsHTMLAttributes.cpp | 82 ----- .../content/html/style/src/nsHTMLAttributes.h | 6 - .../html/style/src/nsHTMLCSSStyleSheet.cpp | 96 ------ .../html/style/src/nsHTMLStyleSheet.cpp | 284 ---------------- .../content/html/style/src/nsICSSStyleRule.h | 9 - .../content/shared/public/nsStyleContext.h | 2 - .../content/svg/content/src/nsSVGElement.cpp | 8 - .../content/svg/content/src/nsSVGElement.h | 2 - .../content/xml/content/src/nsXMLElement.cpp | 14 - .../content/xml/content/src/nsXMLElement.h | 3 - .../content/xml/content/src/nsXMLEntity.cpp | 19 -- .../content/xml/content/src/nsXMLNotation.cpp | 18 - .../src/nsXMLProcessingInstruction.cpp | 13 - .../content/src/nsXMLProcessingInstruction.h | 1 - .../content/xul/content/src/nsXULElement.cpp | 24 -- .../content/xul/content/src/nsXULElement.h | 7 - mozilla/layout/base/public/nsIFrame.h | 1 - mozilla/layout/base/public/nsIFrameDebug.h | 20 -- mozilla/layout/base/public/nsIStyleSet.h | 2 - mozilla/layout/base/src/nsSpaceManager.cpp | 31 -- mozilla/layout/base/src/nsSpaceManager.h | 3 - mozilla/layout/generic/nsAreaFrame.cpp | 13 - mozilla/layout/generic/nsAreaFrame.h | 1 - mozilla/layout/generic/nsBlockFrame.cpp | 23 -- mozilla/layout/generic/nsBlockFrame.h | 1 - mozilla/layout/generic/nsContainerFrame.cpp | 11 - mozilla/layout/generic/nsContainerFrame.h | 1 - mozilla/layout/generic/nsFrame.cpp | 20 -- mozilla/layout/generic/nsFrame.h | 2 - mozilla/layout/generic/nsHTMLFrame.cpp | 11 - mozilla/layout/generic/nsIFrame.h | 1 - mozilla/layout/generic/nsIFrameDebug.h | 20 -- mozilla/layout/generic/nsImageFrame.cpp | 30 -- mozilla/layout/generic/nsImageFrame.h | 4 - mozilla/layout/generic/nsImageMap.cpp | 35 -- mozilla/layout/generic/nsImageMap.h | 4 - mozilla/layout/generic/nsInlineFrame.cpp | 12 - mozilla/layout/generic/nsInlineFrame.h | 3 - mozilla/layout/generic/nsLeafFrame.cpp | 13 - mozilla/layout/generic/nsLeafFrame.h | 3 - mozilla/layout/generic/nsLineBox.cpp | 55 --- mozilla/layout/generic/nsLineBox.h | 6 - mozilla/layout/generic/nsPlaceholderFrame.cpp | 11 - mozilla/layout/generic/nsPlaceholderFrame.h | 1 - mozilla/layout/generic/nsSpaceManager.cpp | 31 -- mozilla/layout/generic/nsSpaceManager.h | 3 - mozilla/layout/generic/nsSplittableFrame.cpp | 11 - mozilla/layout/generic/nsSplittableFrame.h | 4 - mozilla/layout/generic/nsTextFrame.cpp | 28 -- mozilla/layout/generic/nsViewportFrame.cpp | 10 - mozilla/layout/generic/nsViewportFrame.h | 1 - mozilla/layout/html/base/src/nsAreaFrame.cpp | 13 - mozilla/layout/html/base/src/nsAreaFrame.h | 1 - mozilla/layout/html/base/src/nsBlockFrame.cpp | 23 -- mozilla/layout/html/base/src/nsBlockFrame.h | 1 - .../layout/html/base/src/nsContainerFrame.cpp | 11 - .../layout/html/base/src/nsContainerFrame.h | 1 - mozilla/layout/html/base/src/nsFrame.cpp | 20 -- mozilla/layout/html/base/src/nsFrame.h | 2 - mozilla/layout/html/base/src/nsHRFrame.cpp | 15 - mozilla/layout/html/base/src/nsHTMLFrame.cpp | 11 - mozilla/layout/html/base/src/nsImageFrame.cpp | 30 -- mozilla/layout/html/base/src/nsImageFrame.h | 4 - mozilla/layout/html/base/src/nsImageMap.cpp | 35 -- mozilla/layout/html/base/src/nsImageMap.h | 4 - .../layout/html/base/src/nsInlineFrame.cpp | 12 - mozilla/layout/html/base/src/nsInlineFrame.h | 3 - mozilla/layout/html/base/src/nsLeafFrame.cpp | 13 - mozilla/layout/html/base/src/nsLeafFrame.h | 3 - mozilla/layout/html/base/src/nsLineBox.cpp | 55 --- mozilla/layout/html/base/src/nsLineBox.h | 6 - .../html/base/src/nsPlaceholderFrame.cpp | 11 - .../layout/html/base/src/nsPlaceholderFrame.h | 1 - .../layout/html/base/src/nsScrollFrame.cpp | 10 - mozilla/layout/html/base/src/nsScrollFrame.h | 1 - .../html/base/src/nsSplittableFrame.cpp | 11 - .../layout/html/base/src/nsSplittableFrame.h | 4 - mozilla/layout/html/base/src/nsTextFrame.cpp | 28 -- .../layout/html/base/src/nsViewportFrame.cpp | 10 - .../layout/html/base/src/nsViewportFrame.h | 1 - .../html/table/src/BasicTableLayoutStrategy.h | 6 - .../html/table/src/FixedTableLayoutStrategy.h | 6 - mozilla/layout/html/table/src/nsCellMap.cpp | 40 --- mozilla/layout/html/table/src/nsCellMap.h | 8 - .../html/table/src/nsITableLayoutStrategy.h | 5 - .../html/table/src/nsTableCellFrame.cpp | 27 -- .../layout/html/table/src/nsTableCellFrame.h | 2 - .../layout/html/table/src/nsTableColFrame.cpp | 11 - .../layout/html/table/src/nsTableColFrame.h | 1 - .../html/table/src/nsTableColGroupFrame.cpp | 11 - .../html/table/src/nsTableColGroupFrame.h | 1 - .../layout/html/table/src/nsTableFrame.cpp | 28 -- mozilla/layout/html/table/src/nsTableFrame.h | 1 - .../html/table/src/nsTableOuterFrame.cpp | 11 - .../layout/html/table/src/nsTableOuterFrame.h | 1 - .../layout/html/table/src/nsTableRowFrame.cpp | 11 - .../layout/html/table/src/nsTableRowFrame.h | 2 - .../html/table/src/nsTableRowGroupFrame.cpp | 11 - .../html/table/src/nsTableRowGroupFrame.h | 1 - mozilla/layout/style/nsCSSDeclaration.cpp | 97 ------ mozilla/layout/style/nsCSSDeclaration.h | 3 - mozilla/layout/style/nsCSSRules.cpp | 184 ---------- mozilla/layout/style/nsCSSStruct.cpp | 97 ------ mozilla/layout/style/nsCSSStruct.h | 3 - mozilla/layout/style/nsCSSStyleRule.cpp | 250 -------------- mozilla/layout/style/nsCSSStyleSheet.cpp | 287 ---------------- mozilla/layout/style/nsHTMLCSSStyleSheet.cpp | 96 ------ mozilla/layout/style/nsHTMLStyleSheet.cpp | 284 ---------------- mozilla/layout/style/nsICSSStyleRule.h | 9 - mozilla/layout/style/nsIStyleRule.h | 4 - mozilla/layout/style/nsIStyleRuleProcessor.h | 6 - mozilla/layout/style/nsIStyleSheet.h | 4 - mozilla/layout/style/nsStyleContext.cpp | 65 ---- mozilla/layout/style/nsStyleContext.h | 2 - mozilla/layout/style/nsStyleSet.cpp | 192 ----------- .../layout/tables/BasicTableLayoutStrategy.h | 6 - .../layout/tables/FixedTableLayoutStrategy.h | 6 - mozilla/layout/tables/nsCellMap.cpp | 40 --- mozilla/layout/tables/nsCellMap.h | 8 - .../layout/tables/nsITableLayoutStrategy.h | 5 - mozilla/layout/tables/nsTableCellFrame.cpp | 27 -- mozilla/layout/tables/nsTableCellFrame.h | 2 - mozilla/layout/tables/nsTableColFrame.cpp | 11 - mozilla/layout/tables/nsTableColFrame.h | 1 - .../layout/tables/nsTableColGroupFrame.cpp | 11 - mozilla/layout/tables/nsTableColGroupFrame.h | 1 - mozilla/layout/tables/nsTableFrame.cpp | 28 -- mozilla/layout/tables/nsTableFrame.h | 1 - mozilla/layout/tables/nsTableOuterFrame.cpp | 11 - mozilla/layout/tables/nsTableOuterFrame.h | 1 - mozilla/layout/tables/nsTableRowFrame.cpp | 11 - mozilla/layout/tables/nsTableRowFrame.h | 2 - .../layout/tables/nsTableRowGroupFrame.cpp | 11 - mozilla/layout/tables/nsTableRowGroupFrame.h | 1 - .../xul/base/src/nsDocElementBoxFrame.cpp | 11 - .../layout/xul/base/src/nsImageBoxFrame.cpp | 1 - .../layout/xul/base/src/nsRootBoxFrame.cpp | 11 - mozilla/string/obsolete/nsString.cpp | 18 - mozilla/string/obsolete/nsString.h | 18 - mozilla/string/obsolete/nsString2.cpp | 18 - mozilla/string/obsolete/nsString2.h | 17 - .../webshell/tests/viewer/nsBrowserWindow.cpp | 321 ------------------ .../webshell/tests/viewer/nsBrowserWindow.h | 3 - mozilla/webshell/tests/viewer/nsMacMain.cpp | 7 - mozilla/webshell/tests/viewer/nsPhMenu.cpp | 4 - mozilla/webshell/tests/viewer/resources.h | 3 - .../tests/viewer/unix/gtk/nsGtkMenu.cpp | 4 - .../tests/viewer/unix/gtk2/nsGtkMenu.cpp | 4 - mozilla/webshell/tests/viewer/viewer.rc | 4 - mozilla/webshell/tests/viewer/vieweros2.rc | 4 - mozilla/xpcom/ds/MANIFEST | 1 - mozilla/xpcom/ds/Makefile.in | 2 - mozilla/xpcom/ds/nsAtomTable.cpp | 11 - mozilla/xpcom/ds/nsIAtom.idl | 7 - mozilla/xpcom/ds/nsISizeOfHandler.h | 119 ------- mozilla/xpcom/ds/nsSizeOfHandler.cpp | 290 ---------------- mozilla/xpcom/ds/nsVoidArray.cpp | 63 ---- mozilla/xpcom/ds/nsVoidArray.h | 17 - mozilla/xpcom/ds/nsVoidBTree.cpp | 38 --- mozilla/xpcom/ds/nsVoidBTree.h | 5 - mozilla/xpcom/macbuild/xpcomPPC.xml | 30 -- mozilla/xpcom/string/obsolete/nsString.cpp | 18 - mozilla/xpcom/string/obsolete/nsString.h | 18 - mozilla/xpcom/string/obsolete/nsString2.cpp | 18 - mozilla/xpcom/string/obsolete/nsString2.h | 17 - 250 files changed, 6676 deletions(-) delete mode 100644 mozilla/xpcom/ds/nsISizeOfHandler.h delete mode 100644 mozilla/xpcom/ds/nsSizeOfHandler.cpp diff --git a/mozilla/content/base/public/nsIContent.h b/mozilla/content/base/public/nsIContent.h index feded8d5276..84c681e16a5 100644 --- a/mozilla/content/base/public/nsIContent.h +++ b/mozilla/content/base/public/nsIContent.h @@ -53,7 +53,6 @@ class nsIDOMEvent; class nsIContent; class nsISupportsArray; class nsIDOMRange; -class nsISizeOfHandler; class nsINodeInfo; class nsIEventListenerManager; @@ -514,23 +513,6 @@ public: NS_IMETHOD DoneCreatingElement() = 0; #ifdef DEBUG - /** - * Get the size of the content object. The size value should include - * all subordinate data referenced by the content that is not - * accounted for by child content. However, this value should not - * include the frame objects, style contexts, views or other data - * that lies logically outside the content model. - * - * If the implementation so chooses, instead of returning the total - * subordinate data it may instead use the sizeof handler to store - * away subordinate data under its own key so that the subordinate - * data may be tabulated independently of the frame itself. - * - * The caller is responsible for recursing over all children that - * the content contains. - */ - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const = 0; - /** * List the content (and anything it contains) out to the given * file stream. Use aIndent as the base indent during formatting. diff --git a/mozilla/content/base/public/nsIStyleRule.h b/mozilla/content/base/public/nsIStyleRule.h index ee251d98d81..d10791c3e38 100644 --- a/mozilla/content/base/public/nsIStyleRule.h +++ b/mozilla/content/base/public/nsIStyleRule.h @@ -42,8 +42,6 @@ #include "nsISupports.h" -class nsISizeOfHandler; - class nsIStyleSheet; class nsIPresContext; class nsIContent; @@ -64,8 +62,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) = 0; #endif }; diff --git a/mozilla/content/base/public/nsIStyleRuleProcessor.h b/mozilla/content/base/public/nsIStyleRuleProcessor.h index ac4a7517775..b392d76f84a 100644 --- a/mozilla/content/base/public/nsIStyleRuleProcessor.h +++ b/mozilla/content/base/public/nsIStyleRuleProcessor.h @@ -45,8 +45,6 @@ #include "nsILinkHandler.h" #include "nsString.h" -class nsISizeOfHandler; - class nsIStyleSheet; class nsIPresContext; class nsIContent; @@ -174,10 +172,6 @@ public: NS_IMETHOD HasStateDependentStyle(StateRuleProcessorData* aData, nsIAtom* aMedium, PRBool* aResult) = 0; - -#ifdef DEBUG - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize) = 0; -#endif }; #endif /* nsIStyleRuleProcessor_h___ */ diff --git a/mozilla/content/base/public/nsIStyleSheet.h b/mozilla/content/base/public/nsIStyleSheet.h index 9e830d71dd3..6752ca94e84 100644 --- a/mozilla/content/base/public/nsIStyleSheet.h +++ b/mozilla/content/base/public/nsIStyleSheet.h @@ -41,8 +41,6 @@ #include #include "nsISupports.h" -class nsISizeOfHandler; - class nsIAtom; class nsString; class nsIURI; @@ -108,8 +106,6 @@ public: #ifdef DEBUG virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; - - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize) = 0; #endif }; diff --git a/mozilla/content/base/src/nsDOMAttributeMap.cpp b/mozilla/content/base/src/nsDOMAttributeMap.cpp index 701086eb108..132c85b83a3 100644 --- a/mozilla/content/base/src/nsDOMAttributeMap.cpp +++ b/mozilla/content/base/src/nsDOMAttributeMap.cpp @@ -439,16 +439,3 @@ nsDOMAttributeMap::RemoveNamedItemNS(const nsAString& aNamespaceURI, return rv; } - - -#ifdef DEBUG -nsresult -nsDOMAttributeMap::SizeOfNamedNodeMap(nsIDOMNamedNodeMap* aMap, - nsISizeOfHandler* aSizer, - PRUint32* aResult) -{ - if (!aResult) return NS_ERROR_NULL_POINTER; - *aResult = sizeof(nsDOMAttributeMap); - return NS_OK; -} -#endif diff --git a/mozilla/content/base/src/nsDOMAttributeMap.h b/mozilla/content/base/src/nsDOMAttributeMap.h index 35d402b231f..6c53b04e9ba 100644 --- a/mozilla/content/base/src/nsDOMAttributeMap.h +++ b/mozilla/content/base/src/nsDOMAttributeMap.h @@ -59,12 +59,6 @@ public: void DropReference(); -#ifdef DEBUG - static nsresult SizeOfNamedNodeMap(nsIDOMNamedNodeMap* aMap, - nsISizeOfHandler* aSizer, - PRUint32* aResult); -#endif - private: nsIContent* mContent; // Weak reference }; diff --git a/mozilla/content/base/src/nsDOMDocumentType.cpp b/mozilla/content/base/src/nsDOMDocumentType.cpp index c4fd07cec24..e6cbc0e1d28 100644 --- a/mozilla/content/base/src/nsDOMDocumentType.cpp +++ b/mozilla/content/base/src/nsDOMDocumentType.cpp @@ -203,37 +203,3 @@ nsDOMDocumentType::CloneNode(PRBool aDeep, nsIDOMNode** aReturn) return CallQueryInterface(it, aReturn); } - -#ifdef DEBUG -NS_IMETHODIMP -nsDOMDocumentType::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - NS_ENSURE_ARG_POINTER(aResult); - - PRUint32 sum; - nsGenericDOMDataNode::SizeOf(aSizer, &sum); - PRUint32 ssize; - mName.SizeOf(aSizer, &ssize); - sum = sum - sizeof(mName) + ssize; - if (mEntities) { - PRBool recorded; - aSizer->RecordObject((void*) mEntities, &recorded); - if (!recorded) { - PRUint32 size; - nsDOMAttributeMap::SizeOfNamedNodeMap(mEntities, aSizer, &size); - aSizer->AddSize(nsLayoutAtoms::xml_document_entities, size); - } - } - if (mNotations) { - PRBool recorded; - aSizer->RecordObject((void*) mNotations, &recorded); - if (!recorded) { - PRUint32 size; - nsDOMAttributeMap::SizeOfNamedNodeMap(mNotations, aSizer, &size); - aSizer->AddSize(nsLayoutAtoms::xml_document_notations, size); - } - } - return NS_OK; -} -#endif - diff --git a/mozilla/content/base/src/nsDOMDocumentType.h b/mozilla/content/base/src/nsDOMDocumentType.h index 037eec6320c..123537fde0c 100644 --- a/mozilla/content/base/src/nsDOMDocumentType.h +++ b/mozilla/content/base/src/nsDOMDocumentType.h @@ -43,7 +43,6 @@ #include "nsIContent.h" #include "nsGenericDOMDataNode.h" #include "nsString.h" -#include "nsISizeOfHandler.h" // XXX DocumentType is currently implemented by inheriting the generic // CharacterData object, even though DocumentType is not character @@ -75,10 +74,6 @@ public: // nsIContent NS_IMETHOD GetTag(nsIAtom*& aResult) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif - protected: nsString mName; nsIDOMNamedNodeMap* mEntities; diff --git a/mozilla/content/base/src/nsDocumentFragment.cpp b/mozilla/content/base/src/nsDocumentFragment.cpp index 57e57cc9b95..bb53f1e5d5d 100644 --- a/mozilla/content/base/src/nsDocumentFragment.cpp +++ b/mozilla/content/base/src/nsDocumentFragment.cpp @@ -177,16 +177,6 @@ public: return NS_OK; } -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const { - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; - } -#endif - protected: nsCOMPtr mOwnerDocument; }; diff --git a/mozilla/content/base/src/nsGenericDOMDataNode.cpp b/mozilla/content/base/src/nsGenericDOMDataNode.cpp index 0be886a465a..789f6d5e9bb 100644 --- a/mozilla/content/base/src/nsGenericDOMDataNode.cpp +++ b/mozilla/content/base/src/nsGenericDOMDataNode.cpp @@ -1067,18 +1067,6 @@ nsGenericDOMDataNode::DumpContent(FILE* out, PRInt32 aIndent, { return NS_OK; } - -NS_IMETHODIMP -nsGenericDOMDataNode::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - sum += mText.GetLength() * (mText.Is2b() ? sizeof(PRUnichar) : sizeof(char)); - *aResult = sum; - return NS_OK; -} #endif //---------------------------------------------------------------------- diff --git a/mozilla/content/base/src/nsGenericDOMDataNode.h b/mozilla/content/base/src/nsGenericDOMDataNode.h index 1557f76724c..f04be465359 100644 --- a/mozilla/content/base/src/nsGenericDOMDataNode.h +++ b/mozilla/content/base/src/nsGenericDOMDataNode.h @@ -214,10 +214,6 @@ public: NS_IMETHOD GetListenerManager(nsIEventListenerManager** aInstancePtrResult); NS_IMETHOD DoneCreatingElement(); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif - NS_IMETHOD GetNodeInfo(nsINodeInfo*& aResult) const; NS_IMETHOD CanContainChildren(PRBool& aResult) const; NS_IMETHOD ChildCount(PRInt32& aResult) const; diff --git a/mozilla/content/base/src/nsGenericElement.cpp b/mozilla/content/base/src/nsGenericElement.cpp index 8158c83fe15..0f50ae77e0d 100644 --- a/mozilla/content/base/src/nsGenericElement.cpp +++ b/mozilla/content/base/src/nsGenericElement.cpp @@ -51,7 +51,6 @@ #include "nsIEventListenerManager.h" #include "nsILinkHandler.h" #include "nsIScriptGlobalObject.h" -#include "nsISizeOfHandler.h" #include "nsISupportsArray.h" #include "nsIURL.h" #include "nsNetUtil.h" @@ -2006,14 +2005,6 @@ nsGenericElement::HandleDOMEvent(nsIPresContext* aPresContext, return ret; } -#ifdef DEBUG -PRUint32 -nsGenericElement::BaseSizeOf(nsISizeOfHandler *aSizer) const -{ - return 0; -} -#endif - NS_IMETHODIMP nsGenericElement::GetContentID(PRUint32* aID) { @@ -3103,20 +3094,6 @@ struct nsGenericAttribute NS_IF_RELEASE(mNodeInfo); } -#ifdef DEBUG - nsresult SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const { - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this) - sizeof(mValue); - PRUint32 ssize; - mValue.SizeOf(aSizer, &ssize); - sum += ssize; - *aResult = sum; - return NS_OK; - } -#endif - nsINodeInfo* mNodeInfo; nsString mValue; }; @@ -3981,31 +3958,3 @@ nsGenericContainerElement::RemoveChildAt(PRInt32 aIndex, PRBool aNotify) return NS_OK; } - -#ifdef DEBUG -PRUint32 -nsGenericContainerElement::BaseSizeOf(nsISizeOfHandler *aSizer) const -{ - PRUint32 sum = 0; - if (mAttributes) { - // Add in array of attributes size - PRUint32 asize; - mAttributes->SizeOf(aSizer, &asize); - sum += asize; - - // Add in each attributes size - PRInt32 i, n = mAttributes->Count(); - for (i = 0; i < n; i++) { - const nsGenericAttribute* attr = (const nsGenericAttribute*) - mAttributes->ElementAt(i); - if (attr) { - PRUint32 asum = 0; - attr->SizeOf(aSizer, &asum); - sum += asum; - } - } - } - - return sum; -} -#endif diff --git a/mozilla/content/base/src/nsGenericElement.h b/mozilla/content/base/src/nsGenericElement.h index fd07bf95684..e9120e84f4f 100644 --- a/mozilla/content/base/src/nsGenericElement.h +++ b/mozilla/content/base/src/nsGenericElement.h @@ -592,10 +592,6 @@ public: static PLDHashTable sRangeListsHash; protected: -#ifdef DEBUG - virtual PRUint32 BaseSizeOf(nsISizeOfHandler *aSizer) const; -#endif - PRBool HasDOMSlots() const { return !(mFlagsOrSlots & GENERIC_ELEMENT_DOESNT_HAVE_DOMSLOTS); @@ -805,10 +801,6 @@ public: #endif protected: -#ifdef DEBUG - virtual PRUint32 BaseSizeOf(nsISizeOfHandler *aSizer) const; -#endif - /** * The attributes (stored as nsGenericAttribute*) * @see nsGenericAttribute diff --git a/mozilla/content/base/src/nsStyleContext.cpp b/mozilla/content/base/src/nsStyleContext.cpp index ed785cfac24..07220fe9c6c 100644 --- a/mozilla/content/base/src/nsStyleContext.cpp +++ b/mozilla/content/base/src/nsStyleContext.cpp @@ -47,7 +47,6 @@ #include "nsCOMPtr.h" #include "nsIStyleSet.h" -#include "nsISizeOfHandler.h" #include "nsIPresShell.h" #include "nsLayoutAtoms.h" #include "prenv.h" @@ -735,70 +734,6 @@ void nsStyleContext::List(FILE* out, PRInt32 aIndent) } } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as nsStyleContext's size): -* 1) sizeof(*this) which gets all of the data members -* 2) adds in the size of the PseudoTag, if there is one -* -* Children / siblings / parents: -* 1) We recurse over the mChild and mEmptyChild instances if they exist. -* These instances will then be accumulated seperately (not part of -* the containing instance's size) -* 2) We recurse over the siblings of the Child and Empty Child instances -* and count then seperately as well. -* 3) We recurse over our direct siblings (if any). -* -******************************************************************************/ -void nsStyleContext::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - - if(! uniqueItems->AddItem((void*)this) ){ - // object has already been accounted for - return; - } - - PRUint32 localSize=0; - - // get or create a tag for this instance - nsCOMPtr tag; - tag = do_GetAtom("nsStyleContext"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - // add in the size of the member mPseudoTag - if (mPseudoTag){ - mPseudoTag->SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - } - aSizeOfHandler->AddSize(tag,aSize); - - // now follow up with the child (and empty child) recursion - if (nsnull != mChild) { - nsStyleContext* child = mChild; - do { - child->SizeOf(aSizeOfHandler, localSize); - child = child->mNextSibling; - } while (mChild != child); - } - if (nsnull != mEmptyChild) { - nsStyleContext* child = mEmptyChild; - do { - child->SizeOf(aSizeOfHandler, localSize); - child = child->mNextSibling; - } while (mEmptyChild != child); - } - // and finally our direct siblings (if any) - if (nsnull != mNextSibling) { - mNextSibling->SizeOf(aSizeOfHandler, localSize); - } -} - static void IndentBy(FILE* out, PRInt32 aIndent) { while (--aIndent >= 0) fputs(" ", out); } diff --git a/mozilla/content/base/src/nsStyleSet.cpp b/mozilla/content/base/src/nsStyleSet.cpp index 9e4c35e439a..8bf3ec2763e 100644 --- a/mozilla/content/base/src/nsStyleSet.cpp +++ b/mozilla/content/base/src/nsStyleSet.cpp @@ -71,8 +71,6 @@ #define STYLESET_STOP_TIMER(a) ((void)0) #endif -#include "nsISizeOfHandler.h" - // ===================================================== // nsRuleNodeList // A class that represents a chain of rule nodes @@ -291,8 +289,6 @@ public: #ifdef DEBUG virtual void List(FILE* out = stdout, PRInt32 aIndent = 0); - - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); #endif virtual void ResetUniqueStyleItems(void); @@ -1966,191 +1962,3 @@ StyleSetImpl::AttributeAffectsStyle(nsIAtom *aAttribute, nsIContent *aContent, return NS_OK; } - -#ifdef DEBUG -/****************************************************************************** -* SizeOf method: -* -* Self (reported as StyleSetImpl's size): -* 1) sizeof(*this) + sizeof (overhead only) each collection that exists -* and the FrameConstructor overhead -* -* Contained / Aggregated data (not reported as StyleSetImpl's size): -* 1) Override Sheets, DocSheets, UserSheets, AgentSheets, RuleProcessors, Recycler -* are all delegated to. -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void StyleSetImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - - if(! uniqueItems->AddItem((void*)this) ){ - NS_ASSERTION(0, "StyleSet has already been conted in SizeOf operation"); - // styleset has already been accounted for - return; - } - // get or create a tag for this instance - nsCOMPtr tag = do_GetAtom("StyleSet"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(StyleSetImpl); - - // Next get the size of the OVERHEAD of objects we will delegate to: - if (mOverrideSheets && uniqueItems->AddItem(mOverrideSheets)){ - aSize += sizeof(*mOverrideSheets); - } - if (mDocSheets && uniqueItems->AddItem(mDocSheets)){ - aSize += sizeof(*mDocSheets); - } - if (mUserSheets && uniqueItems->AddItem(mUserSheets)){ - aSize += sizeof(*mUserSheets); - } - if (mAgentSheets && uniqueItems->AddItem(mAgentSheets)){ - aSize += sizeof(*mAgentSheets); - } - if (mAgentRuleProcessors && uniqueItems->AddItem(mAgentRuleProcessors)){ - aSize += sizeof(*mAgentRuleProcessors); - } - if (mUserRuleProcessors && uniqueItems->AddItem(mUserRuleProcessors)){ - aSize += sizeof(*mUserRuleProcessors); - } - if (mDocRuleProcessors && uniqueItems->AddItem(mDocRuleProcessors)){ - aSize += sizeof(*mDocRuleProcessors); - } - if (mOverrideRuleProcessors && uniqueItems->AddItem(mOverrideRuleProcessors)){ - aSize += sizeof(*mOverrideRuleProcessors); - } - if (mRecycler && uniqueItems->AddItem(mRecycler)){ - aSize += sizeof(*mRecycler); - } - if (mQuirkStyleSheet) { - aSize += sizeof(mQuirkStyleSheet); // just the pointer: the sheet is counted elsewhere - } - /////////////////////////////////////////////// - // now the FrameConstructor - if(mFrameConstructor && uniqueItems->AddItem((void*)mFrameConstructor)){ - aSize += sizeof(mFrameConstructor); - } - aSizeOfHandler->AddSize(tag,aSize); - - /////////////////////////////////////////////// - // Now travers the collections and delegate - PRInt32 numSheets, curSheet; - PRUint32 localSize=0; - numSheets = GetNumberOfOverrideStyleSheets(); - for(curSheet=0; curSheet < numSheets; curSheet++){ - nsIStyleSheet* pSheet = GetOverrideStyleSheetAt(curSheet); //addref - if(pSheet){ - localSize=0; - pSheet->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(pSheet); - } - - numSheets = GetNumberOfDocStyleSheets(); - for(curSheet=0; curSheet < numSheets; curSheet++){ - nsIStyleSheet* pSheet = GetDocStyleSheetAt(curSheet); - if(pSheet){ - localSize=0; - pSheet->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(pSheet); - } - - numSheets = GetNumberOfUserStyleSheets(); - for(curSheet=0; curSheet < numSheets; curSheet++){ - nsIStyleSheet* pSheet = GetUserStyleSheetAt(curSheet); - if(pSheet){ - localSize=0; - pSheet->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(pSheet); - } - - numSheets = GetNumberOfAgentStyleSheets(); - for(curSheet=0; curSheet < numSheets; curSheet++){ - nsIStyleSheet* pSheet = GetAgentStyleSheetAt(curSheet); - if(pSheet){ - localSize=0; - pSheet->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(pSheet); - } - /////////////////////////////////////////////// - // rule processors - PRUint32 numRuleProcessors,curRuleProcessor; - if(mAgentRuleProcessors){ - mAgentRuleProcessors->Count(&numRuleProcessors); - for(curRuleProcessor=0; curRuleProcessor < numRuleProcessors; curRuleProcessor++){ - nsIStyleRuleProcessor* processor = - (nsIStyleRuleProcessor* )mAgentRuleProcessors->ElementAt(curRuleProcessor); - if(processor){ - localSize=0; - processor->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(processor); - } - } - if(mUserRuleProcessors){ - mUserRuleProcessors->Count(&numRuleProcessors); - for(curRuleProcessor=0; curRuleProcessor < numRuleProcessors; curRuleProcessor++){ - nsIStyleRuleProcessor* processor = - (nsIStyleRuleProcessor* )mUserRuleProcessors->ElementAt(curRuleProcessor); - if(processor){ - localSize=0; - processor->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(processor); - } - } - if(mDocRuleProcessors){ - mDocRuleProcessors->Count(&numRuleProcessors); - for(curRuleProcessor=0; curRuleProcessor < numRuleProcessors; curRuleProcessor++){ - nsIStyleRuleProcessor* processor = - (nsIStyleRuleProcessor* )mDocRuleProcessors->ElementAt(curRuleProcessor); - if(processor){ - localSize=0; - processor->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(processor); - } - } - if(mOverrideRuleProcessors){ - mOverrideRuleProcessors->Count(&numRuleProcessors); - for(curRuleProcessor=0; curRuleProcessor < numRuleProcessors; curRuleProcessor++){ - nsIStyleRuleProcessor* processor = - (nsIStyleRuleProcessor* )mOverrideRuleProcessors->ElementAt(curRuleProcessor); - if(processor){ - localSize=0; - processor->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(processor); - } - } - - /////////////////////////////////////////////// - // and the recycled ones too - if(mRecycler){ - mRecycler->Count(&numRuleProcessors); - for(curRuleProcessor=0; curRuleProcessor < numRuleProcessors; curRuleProcessor++){ - nsIStyleRuleProcessor* processor = - (nsIStyleRuleProcessor* )mRecycler->ElementAt(curRuleProcessor); - if(processor && uniqueItems->AddItem((void*)processor)){ - localSize=0; - processor->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(processor); - } - } - - // XXX - do the stylecontext cache too - - // now delegate the sizeof to the larger or more complex aggregated objects - // - none -} -#endif diff --git a/mozilla/content/html/content/public/nsIForm.h b/mozilla/content/html/content/public/nsIForm.h index 2b960b7a3ab..44ccd1ab49c 100644 --- a/mozilla/content/html/content/public/nsIForm.h +++ b/mozilla/content/html/content/public/nsIForm.h @@ -42,7 +42,6 @@ #include "nsAString.h" class nsIFormControl; -class nsISizeOfHandler; class nsIDOMHTMLInputElement; class nsIRadioVisitor; class nsISimpleEnumerator; diff --git a/mozilla/content/html/content/src/GenericElementCollection.cpp b/mozilla/content/html/content/src/GenericElementCollection.cpp index f1332f524b6..99cc1faa40f 100644 --- a/mozilla/content/html/content/src/GenericElementCollection.cpp +++ b/mozilla/content/html/content/src/GenericElementCollection.cpp @@ -131,16 +131,3 @@ GenericElementCollection::ParentDestroyed() return NS_OK; } - -#ifdef DEBUG -nsresult -GenericElementCollection::SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const -{ - NS_ENSURE_ARG_POINTER(aResult); - - *aResult = sizeof(*this); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/GenericElementCollection.h b/mozilla/content/html/content/src/GenericElementCollection.h index 8aaaaa3822f..bb1375909bb 100644 --- a/mozilla/content/html/content/src/GenericElementCollection.h +++ b/mozilla/content/html/content/src/GenericElementCollection.h @@ -43,9 +43,6 @@ #include "nsIAtom.h" class nsIContent; -#ifdef DEBUG -class nsISizeOfHandler; -#endif /** * This class provides a late-bound collection of elements that are @@ -65,10 +62,6 @@ public: NS_IMETHOD ParentDestroyed(); -#ifdef DEBUG - nsresult SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif - protected: nsIContent* mParent; nsCOMPtr mTag; diff --git a/mozilla/content/html/content/src/nsAttributeContent.cpp b/mozilla/content/html/content/src/nsAttributeContent.cpp index c0110287ffa..a09af4b6b79 100644 --- a/mozilla/content/html/content/src/nsAttributeContent.cpp +++ b/mozilla/content/html/content/src/nsAttributeContent.cpp @@ -52,7 +52,6 @@ #include "nsCRT.h" #include "nsIEventStateManager.h" #include "nsIPrivateDOMEvent.h" -#include "nsISizeOfHandler.h" #include "nsIDOMEvent.h" #include "nsIDOMText.h" #include "nsIDOMScriptObjectFactory.h" @@ -157,7 +156,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out, PRInt32 aIndent) const { return NS_OK; } NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const { return NS_OK; } - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif NS_IMETHOD HandleDOMEvent(nsIPresContext* aPresContext, nsEvent* aEvent, @@ -541,13 +539,3 @@ nsAttributeContent::CloneContent(PRBool aCloneText, nsITextContent** aReturn) it->mText = mText; return result; } - -#ifdef DEBUG -NS_IMETHODIMP -nsAttributeContent::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - if (!aResult) return NS_ERROR_NULL_POINTER; - *aResult = sizeof(*this); - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp index 8acc252bbdc..a2f9554266e 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp @@ -64,7 +64,6 @@ #include "nsILink.h" #include "nsILinkHandler.h" #include "nsPIDOMWindow.h" -#include "nsISizeOfHandler.h" #include "nsIStyleRule.h" #include "nsISupportsArray.h" #include "nsIURL.h" @@ -2541,21 +2540,6 @@ nsGenericHTMLElement::IsContentOfType(PRUint32 aFlags) return !(aFlags & ~(eELEMENT | eHTML)); } -#ifdef DEBUG -PRUint32 -nsGenericHTMLElement::BaseSizeOf(nsISizeOfHandler* aSizer) const -{ - PRUint32 sum = 0; - if (mAttributes) { - PRUint32 attrs = 0; - mAttributes->SizeOf(aSizer, attrs); - sum += attrs; - } - return sum; -} -#endif - - //---------------------------------------------------------------------- diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.h b/mozilla/content/html/content/src/nsGenericHTMLElement.h index 5b94713de84..b65a09dc301 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.h +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.h @@ -237,8 +237,6 @@ public: #ifdef DEBUG void ListAttributes(FILE* out) const; - - PRUint32 BaseSizeOf(nsISizeOfHandler* aSizer) const; #endif /** diff --git a/mozilla/content/html/content/src/nsHTMLAnchorElement.cpp b/mozilla/content/html/content/src/nsHTMLAnchorElement.cpp index 290b3d94b6d..00071748ed5 100644 --- a/mozilla/content/html/content/src/nsHTMLAnchorElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLAnchorElement.cpp @@ -128,10 +128,6 @@ public: NS_IMETHOD UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRBool aNotify); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif - protected: // The cached visited state nsLinkState mLinkState; @@ -398,17 +394,6 @@ nsHTMLAnchorElement::SetTarget(const nsAString& aValue) return SetAttr(kNameSpaceID_None, nsHTMLAtoms::target, aValue, PR_TRUE); } -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLAnchorElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif - - NS_IMETHODIMP nsHTMLAnchorElement::GetProtocol(nsAString& aProtocol) { diff --git a/mozilla/content/html/content/src/nsHTMLAppletElement.cpp b/mozilla/content/html/content/src/nsHTMLAppletElement.cpp index c816f30523a..c7302660b97 100644 --- a/mozilla/content/html/content/src/nsHTMLAppletElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLAppletElement.cpp @@ -85,10 +85,6 @@ public: NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif - protected: PRBool mReflectedApplet; }; @@ -253,13 +249,3 @@ nsHTMLAppletElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMap aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLAppletElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLAreaElement.cpp b/mozilla/content/html/content/src/nsHTMLAreaElement.cpp index 39e0667c06b..b7ab2cfdb52 100644 --- a/mozilla/content/html/content/src/nsHTMLAreaElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLAreaElement.cpp @@ -104,9 +104,6 @@ public: PRBool aNotify); NS_IMETHOD UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRBool aNotify); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif protected: // The cached visited state @@ -358,16 +355,6 @@ nsHTMLAreaElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, return nsGenericHTMLElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify); } -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLAreaElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif - NS_IMETHODIMP nsHTMLAreaElement::GetProtocol(nsAString& aProtocol) { diff --git a/mozilla/content/html/content/src/nsHTMLBRElement.cpp b/mozilla/content/html/content/src/nsHTMLBRElement.cpp index 62524c98c0b..8a3c890ae0f 100644 --- a/mozilla/content/html/content/src/nsHTMLBRElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLBRElement.cpp @@ -76,9 +76,6 @@ public: NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -235,13 +232,3 @@ nsHTMLBRElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRule aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLBRElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLBaseFontElement.cpp b/mozilla/content/html/content/src/nsHTMLBaseFontElement.cpp index 94922514c3e..104544a7b2d 100644 --- a/mozilla/content/html/content/src/nsHTMLBaseFontElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLBaseFontElement.cpp @@ -68,9 +68,6 @@ public: NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -220,14 +217,3 @@ nsHTMLBaseFontElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt } return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLBaseFontElement::SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLBodyElement.cpp b/mozilla/content/html/content/src/nsHTMLBodyElement.cpp index 0e91946eeb4..1901f7c29b0 100644 --- a/mozilla/content/html/content/src/nsHTMLBodyElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLBodyElement.cpp @@ -62,7 +62,6 @@ #include "nsIFrameManager.h" #include "nsCOMPtr.h" #include "nsIStyleSet.h" -#include "nsISizeOfHandler.h" #include "nsIView.h" #include "nsLayoutAtoms.h" #include "nsRuleWalker.h" @@ -86,8 +85,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif nsHTMLBodyElement* mPart; // not ref-counted, cleared by content @@ -127,9 +124,6 @@ public: NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker); NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif protected: BodyRule* mContentStyleRule; @@ -278,45 +272,6 @@ BodyRule::List(FILE* out, PRInt32 aIndent) const { return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as BodyRule's size): -* 1) sizeof(*this) -* -* Contained / Aggregated data (not reported as BodyRule's size): -* 1) delegate to mSheet if it exists -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void BodyRule::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag; - tag = do_GetAtom("BodyRule"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - aSizeOfHandler->AddSize(tag, aSize); - - if(mSheet){ - mSheet->SizeOf(aSizeOfHandler, localSize); - } - - return; -} #endif //---------------------------------------------------------------------- @@ -672,13 +627,3 @@ nsHTMLBodyElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 a return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLBodyElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLButtonElement.cpp b/mozilla/content/html/content/src/nsHTMLButtonElement.cpp index 8c1436a4d38..d707ecd714b 100644 --- a/mozilla/content/html/content/src/nsHTMLButtonElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLButtonElement.cpp @@ -55,7 +55,6 @@ #include "nsIEventStateManager.h" #include "nsIDOMEvent.h" #include "nsIDOMNSEvent.h" -#include "nsISizeOfHandler.h" #include "nsIDocument.h" #include "nsGUIEvent.h" #include "nsUnicharUtils.h" @@ -111,9 +110,6 @@ public: nsIDOMEvent** aDOMEvent, PRUint32 aFlags, nsEventStatus* aEventStatus); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif protected: PRInt8 mType; @@ -635,16 +631,6 @@ nsHTMLButtonElement::HandleDOMEvent(nsIPresContext* aPresContext, return ret; } -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLButtonElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif - nsresult nsHTMLButtonElement::GetDefaultValue(nsAString& aDefaultValue) { diff --git a/mozilla/content/html/content/src/nsHTMLDListElement.cpp b/mozilla/content/html/content/src/nsHTMLDListElement.cpp index 6b865907192..59eb07c1377 100644 --- a/mozilla/content/html/content/src/nsHTMLDListElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLDListElement.cpp @@ -74,9 +74,6 @@ public: NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -197,13 +194,3 @@ nsHTMLDListElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapR aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLDListElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLDelElement.cpp b/mozilla/content/html/content/src/nsHTMLDelElement.cpp index 6aa4df25aff..7b6f70d6259 100644 --- a/mozilla/content/html/content/src/nsHTMLDelElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLDelElement.cpp @@ -65,10 +65,6 @@ public: // nsIDOMHTMLModElement NS_DECL_NSIDOMHTMLMODELEMENT - -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -150,14 +146,3 @@ nsHTMLDelElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn) NS_IMPL_STRING_ATTR(nsHTMLDelElement, Cite, cite) NS_IMPL_STRING_ATTR(nsHTMLDelElement, DateTime, datetime) - - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLDelElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLDirectoryElement.cpp b/mozilla/content/html/content/src/nsHTMLDirectoryElement.cpp index eda26d704e5..89259332b2c 100644 --- a/mozilla/content/html/content/src/nsHTMLDirectoryElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLDirectoryElement.cpp @@ -81,9 +81,6 @@ public: NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -244,13 +241,3 @@ nsHTMLDirectoryElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& a aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLDirectoryElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLDivElement.cpp b/mozilla/content/html/content/src/nsHTMLDivElement.cpp index 41296346861..9216595e535 100644 --- a/mozilla/content/html/content/src/nsHTMLDivElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLDivElement.cpp @@ -79,9 +79,6 @@ public: NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -238,13 +235,3 @@ nsHTMLDivElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRul aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLDivElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLFieldSetElement.cpp b/mozilla/content/html/content/src/nsHTMLFieldSetElement.cpp index 512f88ec0cf..889162e3d12 100644 --- a/mozilla/content/html/content/src/nsHTMLFieldSetElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLFieldSetElement.cpp @@ -45,7 +45,6 @@ #include "nsIPresContext.h" #include "nsIForm.h" #include "nsIFormControl.h" -#include "nsISizeOfHandler.h" class nsHTMLFieldSetElement : public nsGenericHTMLContainerFormElement, @@ -75,11 +74,6 @@ public: NS_IMETHOD Reset(); NS_IMETHOD SubmitNamesValues(nsIFormSubmission* aFormSubmission, nsIContent* aSubmitElement); - -#ifdef DEBUG - // nsIContent - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; // construction, destruction @@ -173,18 +167,6 @@ nsHTMLFieldSetElement::GetForm(nsIDOMHTMLFormElement** aForm) // nsIFormControl - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLFieldSetElement::SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif - nsresult nsHTMLFieldSetElement::Reset() { diff --git a/mozilla/content/html/content/src/nsHTMLFontElement.cpp b/mozilla/content/html/content/src/nsHTMLFontElement.cpp index 532704c6efb..e3f901edd73 100644 --- a/mozilla/content/html/content/src/nsHTMLFontElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLFontElement.cpp @@ -79,9 +79,6 @@ public: NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -333,13 +330,3 @@ nsHTMLFontElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRu aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLFontElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLFormElement.cpp b/mozilla/content/html/content/src/nsHTMLFormElement.cpp index 230b47a3b90..3d1802ee013 100644 --- a/mozilla/content/html/content/src/nsHTMLFormElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLFormElement.cpp @@ -53,7 +53,6 @@ #include "nsIPresShell.h" #include "nsIFrame.h" #include "nsIFormControlFrame.h" -#include "nsISizeOfHandler.h" #include "nsIScriptGlobalObject.h" #include "nsDOMError.h" #include "nsContentUtils.h" @@ -178,10 +177,6 @@ public: NS_IMETHOD RemoveFromRadioGroup(const nsAString& aName, nsIFormControl* aRadio); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif - // nsIContent NS_IMETHOD StringToAttribute(nsIAtom* aAttribute, const nsAString& aValue, @@ -348,10 +343,6 @@ public: nsresult IndexOfControl(nsIFormControl* aControl, PRInt32* aIndex); -#ifdef DEBUG - nsresult SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif - nsIDOMHTMLFormElement* mForm; // WEAK - the form owns me nsAutoVoidArray mElements; // Holds WEAK references - bug 36639 @@ -1864,27 +1855,6 @@ nsFormControlList::RemoveElementFromTable(nsIFormControl* aChild, return NS_OK; } -#ifdef DEBUG -nsresult -nsFormControlList::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - if (!aResult) return NS_ERROR_NULL_POINTER; - PRUint32 asize; - mElements.SizeOf(aSizer, &asize); - *aResult = sizeof(*this) - sizeof(mElements) + asize; - return NS_OK; -} - -NS_IMETHODIMP -nsHTMLFormElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} - -#endif - // nsFormControlEnumerator NS_IMPL_ISUPPORTS1(nsFormControlEnumerator, nsISimpleEnumerator); diff --git a/mozilla/content/html/content/src/nsHTMLFrameElement.cpp b/mozilla/content/html/content/src/nsHTMLFrameElement.cpp index 4e78b0ab425..8b8d3d7d2b7 100644 --- a/mozilla/content/html/content/src/nsHTMLFrameElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLFrameElement.cpp @@ -88,9 +88,6 @@ public: NS_IMETHOD AttributeToString(nsIAtom* aAttribute, const nsHTMLValue& aValue, nsAString& aResult) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -287,16 +284,6 @@ nsHTMLFrameElement::AttributeToString(nsIAtom* aAttribute, aResult); } -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLFrameElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif - //***************************************************************************** // nsHTMLFrameElement::nsIChromeEventHandler diff --git a/mozilla/content/html/content/src/nsHTMLFrameSetElement.cpp b/mozilla/content/html/content/src/nsHTMLFrameSetElement.cpp index fca3e687f1d..edb2dd7052f 100644 --- a/mozilla/content/html/content/src/nsHTMLFrameSetElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLFrameSetElement.cpp @@ -89,9 +89,6 @@ public: nsAString& aResult) const; NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif private: nsresult ParseRowCol(const nsAString& aValue, PRInt32& aNumSpecs, @@ -397,17 +394,6 @@ nsHTMLFrameSetElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt return NS_OK; } -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLFrameSetElement::SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif - nsresult nsHTMLFrameSetElement::ParseRowCol(const nsAString & aValue, PRInt32& aNumSpecs, diff --git a/mozilla/content/html/content/src/nsHTMLHRElement.cpp b/mozilla/content/html/content/src/nsHTMLHRElement.cpp index c014b08dfff..8dc188f3440 100644 --- a/mozilla/content/html/content/src/nsHTMLHRElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLHRElement.cpp @@ -76,9 +76,6 @@ public: NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -298,13 +295,3 @@ nsHTMLHRElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRule aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLHRElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLHeadElement.cpp b/mozilla/content/html/content/src/nsHTMLHeadElement.cpp index 7de5423a9e5..20fadb3d47b 100644 --- a/mozilla/content/html/content/src/nsHTMLHeadElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLHeadElement.cpp @@ -65,10 +65,6 @@ public: // nsIDOMHTMLHeadElement NS_DECL_NSIDOMHTMLHEADELEMENT - -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -149,14 +145,3 @@ nsHTMLHeadElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn) NS_IMPL_STRING_ATTR(nsHTMLHeadElement, Profile, profile) - - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLHeadElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLHeadingElement.cpp b/mozilla/content/html/content/src/nsHTMLHeadingElement.cpp index 373c6ef38f9..c3c462f5d99 100644 --- a/mozilla/content/html/content/src/nsHTMLHeadingElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLHeadingElement.cpp @@ -76,9 +76,6 @@ public: NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -222,13 +219,3 @@ nsHTMLHeadingElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMa aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLHeadingElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLHtmlElement.cpp b/mozilla/content/html/content/src/nsHTMLHtmlElement.cpp index 4f7478d69d3..fe60eaf243b 100644 --- a/mozilla/content/html/content/src/nsHTMLHtmlElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLHtmlElement.cpp @@ -66,10 +66,6 @@ public: // nsIDOMHTMLHtmlElement NS_DECL_NSIDOMHTMLHTMLELEMENT - -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; @@ -152,14 +148,3 @@ nsHTMLHtmlElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn) NS_IMPL_STRING_ATTR(nsHTMLHtmlElement, Version, version) - - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLHtmlElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLIFrameElement.cpp b/mozilla/content/html/content/src/nsHTMLIFrameElement.cpp index 811a679824f..53403a0a948 100644 --- a/mozilla/content/html/content/src/nsHTMLIFrameElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLIFrameElement.cpp @@ -117,9 +117,6 @@ public: NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif protected: // This doesn't really ensure a frame loade in all cases, only when @@ -523,16 +520,6 @@ nsHTMLIFrameElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMap return NS_OK; } -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLIFrameElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif - //***************************************************************************** // nsHTMLIFrameElement::nsIChromeEventHandler diff --git a/mozilla/content/html/content/src/nsHTMLImageElement.cpp b/mozilla/content/html/content/src/nsHTMLImageElement.cpp index a52119c62cf..c27e4831b83 100644 --- a/mozilla/content/html/content/src/nsHTMLImageElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLImageElement.cpp @@ -132,9 +132,6 @@ public: NS_IMETHOD HandleDOMEvent(nsIPresContext* aPresContext, nsEvent* aEvent, nsIDOMEvent** aDOMEvent, PRUint32 aFlags, nsEventStatus* aEventStatus); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif protected: nsresult SetSrcInner(nsIURI* aBaseURL, const nsAString& aSrc); @@ -897,16 +894,6 @@ nsHTMLImageElement::SetSrc(const nsAString& aSrc) return rv; } -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLImageElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif - NS_IMETHODIMP nsHTMLImageElement::GetNaturalHeight(PRInt32* aNaturalHeight) { diff --git a/mozilla/content/html/content/src/nsHTMLInputElement.cpp b/mozilla/content/html/content/src/nsHTMLInputElement.cpp index 33a4d29906c..0f36d14b16b 100644 --- a/mozilla/content/html/content/src/nsHTMLInputElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLInputElement.cpp @@ -67,7 +67,6 @@ #include "nsIFormControlFrame.h" #include "nsIFrame.h" #include "nsIEventStateManager.h" -#include "nsISizeOfHandler.h" #include "nsIServiceManager.h" #include "nsIScriptSecurityManager.h" #include "nsDOMError.h" @@ -186,10 +185,6 @@ public: NS_IMETHOD SetDocument(nsIDocument* aDocument, PRBool aDeep, PRBool aCompileEventHandlers); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif - NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, const nsAString& aValue, PRBool aNotify) { BeforeSetAttr(aNameSpaceID, aName, &aValue, aNotify); @@ -2022,19 +2017,6 @@ nsHTMLInputElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapR } -// nsIFormControl - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLInputElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif - - // Controllers Methods NS_IMETHODIMP diff --git a/mozilla/content/html/content/src/nsHTMLInsElement.cpp b/mozilla/content/html/content/src/nsHTMLInsElement.cpp index 08a59c89db0..fcc9dda08af 100644 --- a/mozilla/content/html/content/src/nsHTMLInsElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLInsElement.cpp @@ -65,10 +65,6 @@ public: // nsIDOMHTMLModElement NS_DECL_NSIDOMHTMLMODELEMENT - -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -150,14 +146,3 @@ nsHTMLInsElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn) NS_IMPL_STRING_ATTR(nsHTMLInsElement, Cite, cite) NS_IMPL_STRING_ATTR(nsHTMLInsElement, DateTime, datetime) - - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLInsElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLLIElement.cpp b/mozilla/content/html/content/src/nsHTMLLIElement.cpp index 5b0373f35af..b672799e9ad 100644 --- a/mozilla/content/html/content/src/nsHTMLLIElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLLIElement.cpp @@ -76,9 +76,6 @@ public: NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -261,13 +258,3 @@ nsHTMLLIElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRule aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLLIElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLLabelElement.cpp b/mozilla/content/html/content/src/nsHTMLLabelElement.cpp index abb96bf9aad..7efe240ff80 100644 --- a/mozilla/content/html/content/src/nsHTMLLabelElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLLabelElement.cpp @@ -49,7 +49,6 @@ #include "nsIDOMHTMLDocument.h" #include "nsIDOMXULDocument.h" #include "nsIDocument.h" -#include "nsISizeOfHandler.h" #include "nsIFormControlFrame.h" #include "nsIPresShell.h" #include "nsGUIEvent.h" @@ -187,9 +186,6 @@ public: PRBool aNotify); NS_IMETHOD UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRBool aNotify); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif protected: already_AddRefed GetForContent(); @@ -425,16 +421,6 @@ nsHTMLLabelElement::SetFocus(nsIPresContext* aContext) return NS_OK; } -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLLabelElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif - nsresult nsHTMLLabelElement::Reset() { diff --git a/mozilla/content/html/content/src/nsHTMLLegendElement.cpp b/mozilla/content/html/content/src/nsHTMLLegendElement.cpp index 4bd6e54ae90..0251d48ffc1 100644 --- a/mozilla/content/html/content/src/nsHTMLLegendElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLLegendElement.cpp @@ -45,7 +45,6 @@ #include "nsIPresContext.h" #include "nsIForm.h" #include "nsIFormControl.h" -#include "nsISizeOfHandler.h" class nsHTMLLegendElement : public nsGenericHTMLContainerFormElement, @@ -83,9 +82,6 @@ public: NS_IMETHOD AttributeToString(nsIAtom* aAttribute, const nsHTMLValue& aValue, nsAString& aResult) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -215,16 +211,6 @@ nsHTMLLegendElement::AttributeToString(nsIAtom* aAttribute, aValue, aResult); } -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLLegendElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif - nsresult nsHTMLLegendElement::Reset() { diff --git a/mozilla/content/html/content/src/nsHTMLLinkElement.cpp b/mozilla/content/html/content/src/nsHTMLLinkElement.cpp index 180523c4787..71e29fe8c37 100644 --- a/mozilla/content/html/content/src/nsHTMLLinkElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLLinkElement.cpp @@ -183,9 +183,6 @@ public: NS_IMETHOD HandleDOMEvent(nsIPresContext* aPresContext, nsEvent* aEvent, nsIDOMEvent** aDOMEvent, PRUint32 aFlags, nsEventStatus* aEventStatus); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif protected: virtual void GetStyleSheetURL(PRBool* aIsInline, @@ -362,16 +359,6 @@ nsHTMLLinkElement::HandleDOMEvent(nsIPresContext* aPresContext, aFlags, aEventStatus); } -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLLinkElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif - NS_IMETHODIMP nsHTMLLinkElement::GetLinkState(nsLinkState &aState) { diff --git a/mozilla/content/html/content/src/nsHTMLMapElement.cpp b/mozilla/content/html/content/src/nsHTMLMapElement.cpp index ae19a71843f..c8962e02d4b 100644 --- a/mozilla/content/html/content/src/nsHTMLMapElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLMapElement.cpp @@ -74,9 +74,6 @@ public: nsChangeHint& aHint) const; NS_IMETHOD SetDocument(nsIDocument* aDocument, PRBool aDeep, PRBool aCompileEventHandlers); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif protected: GenericElementCollection* mAreas; @@ -227,13 +224,3 @@ nsHTMLMapElement::GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aM return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLMapElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLMenuElement.cpp b/mozilla/content/html/content/src/nsHTMLMenuElement.cpp index 8984ab4e46a..5559916397e 100644 --- a/mozilla/content/html/content/src/nsHTMLMenuElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLMenuElement.cpp @@ -82,9 +82,6 @@ public: NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -241,13 +238,3 @@ nsHTMLMenuElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRu aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLMenuElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLMetaElement.cpp b/mozilla/content/html/content/src/nsHTMLMetaElement.cpp index 1ce4b3a213e..62b6434cc1c 100644 --- a/mozilla/content/html/content/src/nsHTMLMetaElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLMetaElement.cpp @@ -65,10 +65,6 @@ public: // nsIDOMHTMLMetaElement NS_DECL_NSIDOMHTMLMETAELEMENT - -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -153,14 +149,3 @@ NS_IMPL_STRING_ATTR(nsHTMLMetaElement, Content, content) NS_IMPL_STRING_ATTR(nsHTMLMetaElement, HttpEquiv, httpEquiv) NS_IMPL_STRING_ATTR(nsHTMLMetaElement, Name, name) NS_IMPL_STRING_ATTR(nsHTMLMetaElement, Scheme, scheme) - - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLMetaElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLModElement.cpp b/mozilla/content/html/content/src/nsHTMLModElement.cpp index e1b739705d9..e20faed3ef9 100644 --- a/mozilla/content/html/content/src/nsHTMLModElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLModElement.cpp @@ -65,10 +65,6 @@ public: // nsIDOMHTMLModElement NS_DECL_NSIDOMHTMLMODELEMENT - -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -150,14 +146,3 @@ nsHTMLModElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn) NS_IMPL_STRING_ATTR(nsHTMLModElement, Cite, cite) NS_IMPL_STRING_ATTR(nsHTMLModElement, DateTime, datetime) - - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLModElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLOListElement.cpp b/mozilla/content/html/content/src/nsHTMLOListElement.cpp index d73883686c2..e76aebb46b1 100644 --- a/mozilla/content/html/content/src/nsHTMLOListElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLOListElement.cpp @@ -76,9 +76,6 @@ public: NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -278,13 +275,3 @@ nsHTMLOListElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapR aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLOListElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLObjectElement.cpp b/mozilla/content/html/content/src/nsHTMLObjectElement.cpp index ce31d65f088..4c6a4580508 100644 --- a/mozilla/content/html/content/src/nsHTMLObjectElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLObjectElement.cpp @@ -86,9 +86,6 @@ public: NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -324,13 +321,3 @@ nsHTMLObjectElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMap aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLObjectElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLOptGroupElement.cpp b/mozilla/content/html/content/src/nsHTMLOptGroupElement.cpp index e08aefc430f..0de311b6202 100644 --- a/mozilla/content/html/content/src/nsHTMLOptGroupElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLOptGroupElement.cpp @@ -86,9 +86,6 @@ public: NS_IMETHOD HandleDOMEvent(nsIPresContext* aPresContext, nsEvent* aEvent, nsIDOMEvent** aDOMEvent, PRUint32 aFlags, nsEventStatus* aEventStatus); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif protected: @@ -216,18 +213,6 @@ nsHTMLOptGroupElement::HandleDOMEvent(nsIPresContext* aPresContext, aEventStatus); } -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLOptGroupElement::SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif - - void nsHTMLOptGroupElement::GetSelect(nsISelectElement **aSelectElement) { diff --git a/mozilla/content/html/content/src/nsHTMLOptionElement.cpp b/mozilla/content/html/content/src/nsHTMLOptionElement.cpp index 0d65c62a415..9ded33e7bb7 100644 --- a/mozilla/content/html/content/src/nsHTMLOptionElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLOptionElement.cpp @@ -106,9 +106,6 @@ public: nsHTMLValue& aResult); NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif // nsIOptionElement NS_IMETHOD SetSelectedInternal(PRBool aValue, PRBool aNotify); @@ -800,13 +797,3 @@ nsHTMLOptionElement::Initialize(JSContext* aContext, return result; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLOptionElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLParagraphElement.cpp b/mozilla/content/html/content/src/nsHTMLParagraphElement.cpp index 0ce33506392..9ed2575478e 100644 --- a/mozilla/content/html/content/src/nsHTMLParagraphElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLParagraphElement.cpp @@ -79,9 +79,6 @@ public: NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -224,14 +221,3 @@ nsHTMLParagraphElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& a aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLParagraphElement::SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLPreElement.cpp b/mozilla/content/html/content/src/nsHTMLPreElement.cpp index ece4173684c..3adf8332e01 100644 --- a/mozilla/content/html/content/src/nsHTMLPreElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLPreElement.cpp @@ -78,9 +78,6 @@ public: NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -280,13 +277,3 @@ nsHTMLPreElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRul aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLPreElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLQuoteElement.cpp b/mozilla/content/html/content/src/nsHTMLQuoteElement.cpp index e3c19405de4..b97b667f83a 100644 --- a/mozilla/content/html/content/src/nsHTMLQuoteElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLQuoteElement.cpp @@ -65,10 +65,6 @@ public: // nsIDOMHTMLQuoteElement NS_DECL_NSIDOMHTMLQUOTEELEMENT - -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -148,14 +144,3 @@ nsHTMLQuoteElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn) NS_IMPL_STRING_ATTR(nsHTMLQuoteElement, Cite, cite) - - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLQuoteElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLScriptElement.cpp b/mozilla/content/html/content/src/nsHTMLScriptElement.cpp index 71b908ebd75..08181029704 100644 --- a/mozilla/content/html/content/src/nsHTMLScriptElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLScriptElement.cpp @@ -358,10 +358,6 @@ public: virtual nsresult GetInnerHTML(nsAString& aInnerHTML); virtual nsresult SetInnerHTML(const nsAString& aInnerHTML); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif - protected: PRUint32 mLineNumber; PRPackedBool mIsEvaluated; @@ -597,17 +593,6 @@ nsHTMLScriptElement::SetInnerHTML(const nsAString& aInnerHTML) return ReplaceContentsWithText(aInnerHTML, PR_TRUE); } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLScriptElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif - /* void scriptAvailable (in nsresult aResult, in nsIDOMHTMLScriptElement aElement, in nsIURI aURI, in PRInt32 aLineNo, in PRUint32 aScriptLength, [size_is (aScriptLength)] in wstring aScript); */ NS_IMETHODIMP nsHTMLScriptElement::ScriptAvailable(nsresult aResult, diff --git a/mozilla/content/html/content/src/nsHTMLSelectElement.cpp b/mozilla/content/html/content/src/nsHTMLSelectElement.cpp index f06ff27a3e5..dc728361f10 100644 --- a/mozilla/content/html/content/src/nsHTMLSelectElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLSelectElement.cpp @@ -235,9 +235,6 @@ public: PRUint32 aFlags, nsEventStatus* aEventStatus); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif NS_IMETHOD SetFocus(nsIPresContext* aPresContext); NS_IMETHOD RemoveFocus(nsIPresContext* aPresContext); @@ -2416,13 +2413,3 @@ nsHTMLOptionCollection::IndexOf(nsIContent* aOption) return mElements->IndexOf(aOption); } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLSelectElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLSharedContainerElem.cpp b/mozilla/content/html/content/src/nsHTMLSharedContainerElem.cpp index 656612b598e..66b5b87814f 100644 --- a/mozilla/content/html/content/src/nsHTMLSharedContainerElem.cpp +++ b/mozilla/content/html/content/src/nsHTMLSharedContainerElem.cpp @@ -99,10 +99,6 @@ public: PRInt32 aModType, PRInt32& aHint) const; NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; - -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -448,15 +444,3 @@ nsHTMLSharedContainerElement::GetAttributeMappingFunction(nsMapRuleToAttributesF return nsGenericHTMLContainerElement::GetAttributeMappingFunction(aMapRuleFunc); } - - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLSharedContainerElement::SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLSharedElement.cpp b/mozilla/content/html/content/src/nsHTMLSharedElement.cpp index 6b0d0f4b27b..d40ac7f7d6f 100644 --- a/mozilla/content/html/content/src/nsHTMLSharedElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLSharedElement.cpp @@ -103,10 +103,6 @@ public: NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; - -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -456,15 +452,3 @@ nsHTMLSharedLeafElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& return NS_OK; } - - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLSharedLeafElement::SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLSharedLeafElement.cpp b/mozilla/content/html/content/src/nsHTMLSharedLeafElement.cpp index 6b0d0f4b27b..d40ac7f7d6f 100644 --- a/mozilla/content/html/content/src/nsHTMLSharedLeafElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLSharedLeafElement.cpp @@ -103,10 +103,6 @@ public: NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; - -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -456,15 +452,3 @@ nsHTMLSharedLeafElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& return NS_OK; } - - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLSharedLeafElement::SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLSharedObjectElement.cpp b/mozilla/content/html/content/src/nsHTMLSharedObjectElement.cpp index ce31d65f088..4c6a4580508 100644 --- a/mozilla/content/html/content/src/nsHTMLSharedObjectElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLSharedObjectElement.cpp @@ -86,9 +86,6 @@ public: NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -324,13 +321,3 @@ nsHTMLObjectElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMap aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLObjectElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLSpanElement.cpp b/mozilla/content/html/content/src/nsHTMLSpanElement.cpp index deb465ee6d3..cb7a9c09248 100644 --- a/mozilla/content/html/content/src/nsHTMLSpanElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLSpanElement.cpp @@ -65,10 +65,6 @@ public: nsresult GetInnerHTML(nsAString& aInnerHTML); nsresult SetInnerHTML(const nsAString& aInnerHTML); - -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -169,13 +165,3 @@ nsHTMLSpanElement::SetInnerHTML(const nsAString& aInnerHTML) return nsGenericHTMLContainerElement::SetInnerHTML(aInnerHTML); } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLSpanElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLStyleElement.cpp b/mozilla/content/html/content/src/nsHTMLStyleElement.cpp index e6be993bcd0..f572736a145 100644 --- a/mozilla/content/html/content/src/nsHTMLStyleElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLStyleElement.cpp @@ -165,10 +165,6 @@ public: nsresult GetInnerHTML(nsAString& aInnerHTML); nsresult SetInnerHTML(const nsAString& aInnerHTML); - -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif protected: nsresult GetHrefCString(char* &aBuf); @@ -316,16 +312,6 @@ nsHTMLStyleElement::SetInnerHTML(const nsAString& aInnerHTML) UpdateStyleSheet(); return rv; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLStyleElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif nsresult nsHTMLStyleElement::GetHrefCString(char* &aBuf) diff --git a/mozilla/content/html/content/src/nsHTMLTableCaptionElement.cpp b/mozilla/content/html/content/src/nsHTMLTableCaptionElement.cpp index 105dc4bd292..9aa21d1e9b8 100644 --- a/mozilla/content/html/content/src/nsHTMLTableCaptionElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableCaptionElement.cpp @@ -76,9 +76,6 @@ public: NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -238,14 +235,3 @@ nsHTMLTableCaptionElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLTableCaptionElement::SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLTableCellElement.cpp b/mozilla/content/html/content/src/nsHTMLTableCellElement.cpp index 8018835560f..5337f6272d0 100644 --- a/mozilla/content/html/content/src/nsHTMLTableCellElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableCellElement.cpp @@ -85,9 +85,6 @@ public: NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker); NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif protected: // This does not return a nsresult since all we care about is if we @@ -538,14 +535,3 @@ nsHTMLTableCellElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& a aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLTableCellElement::SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLTableColElement.cpp b/mozilla/content/html/content/src/nsHTMLTableColElement.cpp index 06de940234d..466f46ee658 100644 --- a/mozilla/content/html/content/src/nsHTMLTableColElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableColElement.cpp @@ -85,9 +85,6 @@ public: NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -372,14 +369,3 @@ NS_METHOD nsHTMLTableColElement::GetSpanValue(PRInt32* aSpan) return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLTableColElement::SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLTableElement.cpp b/mozilla/content/html/content/src/nsHTMLTableElement.cpp index bf5b59c7974..6c678542473 100644 --- a/mozilla/content/html/content/src/nsHTMLTableElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableElement.cpp @@ -91,9 +91,6 @@ public: NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif protected: GenericElementCollection *mTBodies; @@ -119,12 +116,6 @@ public: NS_IMETHOD ParentDestroyed(); -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const { - *aResult = sizeof(*this); - } -#endif - protected: nsHTMLTableElement * mParent; }; @@ -1558,13 +1549,3 @@ nsHTMLTableElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapR aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLTableElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLTableRowElement.cpp b/mozilla/content/html/content/src/nsHTMLTableRowElement.cpp index 878b7b936ed..933e814f2d8 100644 --- a/mozilla/content/html/content/src/nsHTMLTableRowElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableRowElement.cpp @@ -187,9 +187,6 @@ public: NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif protected: nsresult GetSection(nsIDOMHTMLTableSectionElement** aSection); @@ -662,14 +659,3 @@ nsHTMLTableRowElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aM aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLTableRowElement::SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLTableSectionElement.cpp b/mozilla/content/html/content/src/nsHTMLTableSectionElement.cpp index 2b33b239ee3..df4cfc8ca1d 100644 --- a/mozilla/content/html/content/src/nsHTMLTableSectionElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableSectionElement.cpp @@ -81,9 +81,6 @@ public: NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif protected: GenericElementCollection *mRows; @@ -418,14 +415,3 @@ nsHTMLTableSectionElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLTableSectionElement::SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLTextAreaElement.cpp b/mozilla/content/html/content/src/nsHTMLTextAreaElement.cpp index 7a786067c5b..f29a2e47a7b 100644 --- a/mozilla/content/html/content/src/nsHTMLTextAreaElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTextAreaElement.cpp @@ -57,7 +57,6 @@ #include "nsIFormControlFrame.h" #include "nsITextControlFrame.h" #include "nsIEventStateManager.h" -#include "nsISizeOfHandler.h" #include "nsLinebreakConverter.h" #include "nsIDocument.h" #include "nsIPresShell.h" @@ -141,10 +140,6 @@ public: nsresult GetInnerHTML(nsAString& aInnerHTML); nsresult SetInnerHTML(const nsAString& aInnerHTML); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif - protected: nsCOMPtr mControllers; /** The current value. This is null if the frame owns the value. */ @@ -785,19 +780,6 @@ nsHTMLTextAreaElement::SetInnerHTML(const nsAString& aInnerHTML) return ReplaceContentsWithText(aInnerHTML, PR_TRUE); } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLTextAreaElement::SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif - - // Controllers Methods NS_IMETHODIMP diff --git a/mozilla/content/html/content/src/nsHTMLTitleElement.cpp b/mozilla/content/html/content/src/nsHTMLTitleElement.cpp index 65a5c73595c..5f1a401b0dc 100644 --- a/mozilla/content/html/content/src/nsHTMLTitleElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTitleElement.cpp @@ -68,10 +68,6 @@ public: // nsIDOMHTMLTitleElement NS_DECL_NSIDOMHTMLTITLEELEMENT - -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -198,13 +194,3 @@ nsHTMLTitleElement::SetText(const nsAString& aTitle) return result; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLTitleElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLUListElement.cpp b/mozilla/content/html/content/src/nsHTMLUListElement.cpp index 2b920dea9d9..bc9699a8542 100644 --- a/mozilla/content/html/content/src/nsHTMLUListElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLUListElement.cpp @@ -79,9 +79,6 @@ public: NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute, PRInt32 aModType, nsChangeHint& aHint) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -259,13 +256,3 @@ nsHTMLUListElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapR aMapRuleFunc = &MapAttributesIntoRule; return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLUListElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/content/src/nsHTMLUnknownElement.cpp b/mozilla/content/html/content/src/nsHTMLUnknownElement.cpp index ebe2e475c66..4b19781b0bc 100644 --- a/mozilla/content/html/content/src/nsHTMLUnknownElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLUnknownElement.cpp @@ -72,9 +72,6 @@ public: NS_IMETHOD SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, const nsAString& aValue, PRBool aNotify); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif }; nsresult @@ -229,13 +226,3 @@ nsHTMLUnknownElement::SetAttribute(PRInt32 aNameSpaceID, return result; } - -#ifdef DEBUG -NS_IMETHODIMP -nsHTMLUnknownElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - *aResult = sizeof(*this) + BaseSizeOf(aSizer); - - return NS_OK; -} -#endif diff --git a/mozilla/content/html/style/src/nsCSSDeclaration.cpp b/mozilla/content/html/style/src/nsCSSDeclaration.cpp index 8697e7235ca..1d79b3710f2 100644 --- a/mozilla/content/html/style/src/nsCSSDeclaration.cpp +++ b/mozilla/content/html/style/src/nsCSSDeclaration.cpp @@ -51,7 +51,6 @@ #include "nsCOMPtr.h" #include "nsIStyleSet.h" -#include "nsISizeOfHandler.h" // #define DEBUG_REFS @@ -6103,102 +6102,6 @@ void nsCSSDeclaration::List(FILE* out, PRInt32 aIndent) const mImportant->List(out, 0); } } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as nsCSSDeclaration's size): -* 1) sizeof(*this) + the sizeof each non-null attribute -* -* Contained / Aggregated data (not reported as nsCSSDeclaration's size): -* none -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void nsCSSDeclaration::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("nsCSSDeclaration"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - - // now add in all of the contained objects, checking for duplicates on all of them - CSS_VARONSTACK_GET(Font); - if(theFont && uniqueItems->AddItem(theFont)){ - aSize += sizeof(*theFont); - } - CSS_VARONSTACK_GET(Color); - if(theColor && uniqueItems->AddItem(theColor)){ - aSize += sizeof(*theColor); - } - CSS_VARONSTACK_GET(Text); - if(theText && uniqueItems->AddItem(theText)){ - aSize += sizeof(*theText); - } - CSS_VARONSTACK_GET(Margin); - if(theMargin && uniqueItems->AddItem(theMargin)){ - aSize += sizeof(*theMargin); - } - CSS_VARONSTACK_GET(Position); - if(thePosition && uniqueItems->AddItem(thePosition)){ - aSize += sizeof(*thePosition); - } - CSS_VARONSTACK_GET(List); - if(theList && uniqueItems->AddItem(theList)){ - aSize += sizeof(*theList); - } - CSS_VARONSTACK_GET(Display); - if(theDisplay && uniqueItems->AddItem(theDisplay)){ - aSize += sizeof(*theDisplay); - } - CSS_VARONSTACK_GET(Table); - if(theTable && uniqueItems->AddItem(theTable)){ - aSize += sizeof(*theTable); - } - CSS_VARONSTACK_GET(Breaks); - if(theBreaks && uniqueItems->AddItem(theBreaks)){ - aSize += sizeof(*theBreaks); - } - CSS_VARONSTACK_GET(Page); - if(thePage && uniqueItems->AddItem(thePage)){ - aSize += sizeof(*thePage); - } - CSS_VARONSTACK_GET(Content); - if(theContent && uniqueItems->AddItem(theContent)){ - aSize += sizeof(*theContent); - } - CSS_VARONSTACK_GET(UserInterface); - if(theUserInterface && uniqueItems->AddItem(theUserInterface)){ - aSize += sizeof(*theUserInterface); - } -#ifdef INCLUDE_XUL - CSS_VARONSTACK_GET(XUL); - if(theXUL && uniqueItems->AddItem(theXUL)){ - aSize += sizeof(*theXUL); - } -#endif -#ifdef MOZ_SVG - CSS_VARONSTACK_GET(SVG); - if(theSVG && uniqueItems->AddItem(theSVG)){ - aSize += sizeof(*theSVG); - } -#endif - CSS_VARONSTACK_GET(Aural); - if(theAural && uniqueItems->AddItem(theAural)){ - aSize += sizeof(*theAural); - } - aSizeOfHandler->AddSize(tag, aSize); -} #endif PRUint32 diff --git a/mozilla/content/html/style/src/nsCSSDeclaration.h b/mozilla/content/html/style/src/nsCSSDeclaration.h index 5b9b17a9620..7d90322fb62 100644 --- a/mozilla/content/html/style/src/nsCSSDeclaration.h +++ b/mozilla/content/html/style/src/nsCSSDeclaration.h @@ -49,7 +49,6 @@ #include "nsVoidArray.h" #include "nsValueArray.h" -class nsISizeOfHandler; class nsStringArray; struct nsCSSStruct { @@ -653,8 +652,6 @@ public: #ifdef DEBUG void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif protected: diff --git a/mozilla/content/html/style/src/nsCSSRules.cpp b/mozilla/content/html/style/src/nsCSSRules.cpp index 7743e516303..5f0cc134d39 100644 --- a/mozilla/content/html/style/src/nsCSSRules.cpp +++ b/mozilla/content/html/style/src/nsCSSRules.cpp @@ -51,7 +51,6 @@ #include "nsCOMPtr.h" #include "nsIStyleSet.h" -#include "nsISizeOfHandler.h" #include "nsIDOMCSSStyleSheet.h" #include "nsIDOMCSSRule.h" #include "nsIDOMCSSImportRule.h" @@ -180,8 +179,6 @@ public: // nsIStyleRule methods #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif // nsICSSRule methods @@ -243,42 +240,6 @@ CSSCharsetRuleImpl::List(FILE* out, PRInt32 aIndent) const return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSCharSetRuleImpl's size): -* 1) sizeof(*this) + the size of the mEncoding string -* -* Contained / Aggregated data (not reported as CSSCharsetRuleImpl's size): -* none -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSCharsetRuleImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSCharsetRuleImpl"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - // add the string for encoding value - mEncoding.SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - aSize -= sizeof(mEncoding); // counted in sizeof(*this) and nsString->SizeOf() - aSizeOfHandler->AddSize(tag,aSize); -} #endif NS_IMETHODIMP @@ -395,8 +356,6 @@ public: // nsIStyleRule methods #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif // nsICSSRule methods @@ -491,44 +450,6 @@ CSSImportRuleImpl::List(FILE* out, PRInt32 aIndent) const return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSImportRuleImpl's size): -* 1) sizeof(*this) + the size of the mURLSpec string -* -* Contained / Aggregated data (not reported as CSSImportRuleImpl's size): -* none -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSImportRuleImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSImportRuleImpl"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - - // add the strings for the URLSpec and the Media - mURLSpec.SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - aSize -= sizeof(mURLSpec); // counted in sizeof(*this) and nsString->SizeOf() - aSizeOfHandler->AddSize(tag,aSize); - -} #endif NS_IMETHODIMP @@ -726,8 +647,6 @@ public: // nsIStyleRule methods #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif // nsICSSRule methods @@ -905,64 +824,6 @@ CSSMediaRuleImpl::List(FILE* out, PRInt32 aIndent) const fputs("}\n", out); return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSMediaRuleImpl's size): -* 1) sizeof(*this) + the size of each unique atom in the mMedia collection -* -* Contained / Aggregated data (not reported as CSSMediaRuleImpl's size): -* 1) Delegate to the rules in the mRules collection to report theri own size -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSMediaRuleImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSMediaRuleImpl"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - - if (mMedia) { - // get the sizes of the media atoms (if unique) - PRUint32 index = 0; - PRUint32 count; - mMedia->Count(&count); - while (index < count) { - nsCOMPtr medium = dont_AddRef((nsIAtom*)mMedia->ElementAt(index++)); - if(medium && uniqueItems->AddItem(medium)){ - medium->SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - } - } - } - // we are done with the size we report for ourself - aSizeOfHandler->AddSize(tag,aSize); - - if (mRules) { - // delegate to the rules themselves (do not sum into our size) - PRUint32 index = 0; - PRUint32 count; - mRules->Count(&count); - while (index < count) { - nsCOMPtr rule = dont_AddRef((nsICSSRule*)mRules->ElementAt(index++)); - rule->SizeOf(aSizeOfHandler, localSize); - } - } -} #endif NS_IMETHODIMP @@ -1269,8 +1130,6 @@ public: // nsIStyleRule methods #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif // nsICSSRule methods @@ -1348,49 +1207,6 @@ CSSNameSpaceRuleImpl::List(FILE* out, PRInt32 aIndent) const fputs(")\n", out); return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSNamespaceRuleImpl's size): -* 1) sizeof(*this) + the size of the mURLSpec string + -* the sizeof the mPrefix atom (if it ieists) -* -* Contained / Aggregated data (not reported as CSSNamespaceRuleImpl's size): -* none -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSNameSpaceRuleImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSNameSpaceRuleImpl"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - - // get the member data as part of this dump - mURLSpec.SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - aSize -= sizeof(mURLSpec); // counted in sizeof(*this) and nsString->SizeOf() - - if(mPrefix && uniqueItems->AddItem(mPrefix)){ - mPrefix->SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - } - aSizeOfHandler->AddSize(tag, aSize); -} #endif NS_IMETHODIMP diff --git a/mozilla/content/html/style/src/nsCSSStruct.cpp b/mozilla/content/html/style/src/nsCSSStruct.cpp index 8697e7235ca..1d79b3710f2 100644 --- a/mozilla/content/html/style/src/nsCSSStruct.cpp +++ b/mozilla/content/html/style/src/nsCSSStruct.cpp @@ -51,7 +51,6 @@ #include "nsCOMPtr.h" #include "nsIStyleSet.h" -#include "nsISizeOfHandler.h" // #define DEBUG_REFS @@ -6103,102 +6102,6 @@ void nsCSSDeclaration::List(FILE* out, PRInt32 aIndent) const mImportant->List(out, 0); } } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as nsCSSDeclaration's size): -* 1) sizeof(*this) + the sizeof each non-null attribute -* -* Contained / Aggregated data (not reported as nsCSSDeclaration's size): -* none -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void nsCSSDeclaration::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("nsCSSDeclaration"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - - // now add in all of the contained objects, checking for duplicates on all of them - CSS_VARONSTACK_GET(Font); - if(theFont && uniqueItems->AddItem(theFont)){ - aSize += sizeof(*theFont); - } - CSS_VARONSTACK_GET(Color); - if(theColor && uniqueItems->AddItem(theColor)){ - aSize += sizeof(*theColor); - } - CSS_VARONSTACK_GET(Text); - if(theText && uniqueItems->AddItem(theText)){ - aSize += sizeof(*theText); - } - CSS_VARONSTACK_GET(Margin); - if(theMargin && uniqueItems->AddItem(theMargin)){ - aSize += sizeof(*theMargin); - } - CSS_VARONSTACK_GET(Position); - if(thePosition && uniqueItems->AddItem(thePosition)){ - aSize += sizeof(*thePosition); - } - CSS_VARONSTACK_GET(List); - if(theList && uniqueItems->AddItem(theList)){ - aSize += sizeof(*theList); - } - CSS_VARONSTACK_GET(Display); - if(theDisplay && uniqueItems->AddItem(theDisplay)){ - aSize += sizeof(*theDisplay); - } - CSS_VARONSTACK_GET(Table); - if(theTable && uniqueItems->AddItem(theTable)){ - aSize += sizeof(*theTable); - } - CSS_VARONSTACK_GET(Breaks); - if(theBreaks && uniqueItems->AddItem(theBreaks)){ - aSize += sizeof(*theBreaks); - } - CSS_VARONSTACK_GET(Page); - if(thePage && uniqueItems->AddItem(thePage)){ - aSize += sizeof(*thePage); - } - CSS_VARONSTACK_GET(Content); - if(theContent && uniqueItems->AddItem(theContent)){ - aSize += sizeof(*theContent); - } - CSS_VARONSTACK_GET(UserInterface); - if(theUserInterface && uniqueItems->AddItem(theUserInterface)){ - aSize += sizeof(*theUserInterface); - } -#ifdef INCLUDE_XUL - CSS_VARONSTACK_GET(XUL); - if(theXUL && uniqueItems->AddItem(theXUL)){ - aSize += sizeof(*theXUL); - } -#endif -#ifdef MOZ_SVG - CSS_VARONSTACK_GET(SVG); - if(theSVG && uniqueItems->AddItem(theSVG)){ - aSize += sizeof(*theSVG); - } -#endif - CSS_VARONSTACK_GET(Aural); - if(theAural && uniqueItems->AddItem(theAural)){ - aSize += sizeof(*theAural); - } - aSizeOfHandler->AddSize(tag, aSize); -} #endif PRUint32 diff --git a/mozilla/content/html/style/src/nsCSSStruct.h b/mozilla/content/html/style/src/nsCSSStruct.h index 5b9b17a9620..7d90322fb62 100644 --- a/mozilla/content/html/style/src/nsCSSStruct.h +++ b/mozilla/content/html/style/src/nsCSSStruct.h @@ -49,7 +49,6 @@ #include "nsVoidArray.h" #include "nsValueArray.h" -class nsISizeOfHandler; class nsStringArray; struct nsCSSStruct { @@ -653,8 +652,6 @@ public: #ifdef DEBUG void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif protected: diff --git a/mozilla/content/html/style/src/nsCSSStyleRule.cpp b/mozilla/content/html/style/src/nsCSSStyleRule.cpp index 3795eb52a37..0b16fcd698e 100644 --- a/mozilla/content/html/style/src/nsCSSStyleRule.cpp +++ b/mozilla/content/html/style/src/nsCSSStyleRule.cpp @@ -70,7 +70,6 @@ #include "nsUnicharUtils.h" #include "nsIStyleSet.h" -#include "nsISizeOfHandler.h" #include "nsContentUtils.h" #include "nsContentErrors.h" @@ -309,51 +308,6 @@ PRBool nsAttrSelector::Equals(const nsAttrSelector* aOther) const return PR_FALSE; } -#ifdef DEBUG -/****************************************************************************** -* SizeOf method: -* -* Self (reported as nsAttrSelector's size): -* 1) sizeof(*this) + the size of mAttr atom (if it exists and is unique) -* -* Contained / Aggregated data (not reported as nsAttrSelector's size): -* none -* -* Children / siblings / parents: -* 1) Recurses to the mMext instance which is reported as a seperate instance -* -******************************************************************************/ -void nsAttrSelector::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("nsAttrSelector"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - - // add in the mAttr atom - if (mAttr && uniqueItems->AddItem(mAttr)){ - mAttr->SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - } - aSizeOfHandler->AddSize(tag,aSize); - - // recurse to the next one... - if(mNext){ - mNext->SizeOf(aSizeOfHandler, localSize); - } -} -#endif - MOZ_DECL_CTOR_COUNTER(nsCSSSelector) #ifdef DEBUG_REFS @@ -625,113 +579,6 @@ PRInt32 nsCSSSelector::CalcWeight(void) const return weight; } -#ifdef DEBUG -/****************************************************************************** -* SizeOf method: -* -* Self (reported as nsCSSSelector's size): -* 1) sizeof(*this) + the size of the mTag -* + the size of the mIDList unique items -* + the size of the mClassList and mPseudoClassList unique items -* -* Contained / Aggregated data (not reported as nsCSSSelector's size): -* 1) AttributeList is called out to seperately if it exists -* -* Children / siblings / parents: -* 1) Recurses to mNext which is counted as it's own instance -* -******************************************************************************/ -void nsCSSSelector::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("nsCSSSelector"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - - // now get the member-atoms and add them in - if(mTag && uniqueItems->AddItem(mTag)){ - localSize = 0; - mTag->SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - } - - - // XXX ???? - - - - // a couple of simple atom lists - if(mIDList && uniqueItems->AddItem(mIDList)){ - aSize += sizeof(*mIDList); - nsAtomList *pNext = nsnull; - pNext = mIDList; - while(pNext){ - if(pNext->mAtom && uniqueItems->AddItem(pNext->mAtom)){ - localSize = 0; - pNext->mAtom->SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - } - pNext = pNext->mNext; - } - } - if(mClassList && uniqueItems->AddItem(mClassList)){ - aSize += sizeof(*mClassList); - nsAtomList *pNext = nsnull; - pNext = mClassList; - while(pNext){ - if(pNext->mAtom && uniqueItems->AddItem(pNext->mAtom)){ - localSize = 0; - pNext->mAtom->SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - } - pNext = pNext->mNext; - } - } - if(mPseudoClassList && uniqueItems->AddItem(mPseudoClassList)){ - nsAtomStringList *pNext = nsnull; - pNext = mPseudoClassList; - while(pNext){ - if(pNext->mAtom && uniqueItems->AddItem(pNext->mAtom)){ - localSize = 0; - pNext->mAtom->SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - } - pNext = pNext->mNext; - } - } - // done with undelegated sizes - aSizeOfHandler->AddSize(tag, aSize); - - // the AttributeList gets its own delegation-call - if(mAttrList){ - localSize = 0; - mAttrList->SizeOf(aSizeOfHandler, localSize); - } - - // don't forget the negated selectors - if(mNegations) { - localSize = 0; - mNegations->SizeOf(aSizeOfHandler, localSize); - } - - // finally chain to the next... - if(mNext){ - localSize = 0; - mNext->SizeOf(aSizeOfHandler, localSize); - } -} -#endif - // pseudo-elements are stored in the selectors' chain using fictional elements; // these fictional elements have mTag starting with a colon static PRBool IsPseudoElement(nsIAtom* aAtom) @@ -950,8 +797,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif protected: @@ -1040,47 +885,6 @@ CSSImportantRule::List(FILE* out, PRInt32 aIndent) const return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSImportantRule's size): -* 1) sizeof(*this) -* -* Contained / Aggregated data (not reported as CSSImportantRule's size): -* 1) mDeclaration is sized seperately -* 2) mSheet is sized seperately -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSImportantRule::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSImportantRule"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(CSSImportantRule); - aSizeOfHandler->AddSize(tag,aSize); - - // now dump the mDeclaration and mSheet - if(mDeclaration){ - mDeclaration->SizeOf(aSizeOfHandler, localSize); - } - if(mSheet){ - mSheet->SizeOf(aSizeOfHandler, localSize); - } -} #endif // -- nsDOMStyleRuleDeclaration ------------------------------- @@ -1429,8 +1233,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif // nsIDOMCSSRule interface @@ -2416,58 +2218,6 @@ CSSStyleRuleImpl::List(FILE* out, PRInt32 aIndent) const return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSStyleRuleImpl's size): -* 1) sizeof(*this) -* + sizeof the DOMDeclaration if it exists and is unique -* -* Contained / Aggregated data (not reported as CSSStyleRuleImpl's size): -* 1) mDeclaration if it exists -* 2) mImportantRule if it exists -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSStyleRuleImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSStyleRuleImpl"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - // remove the sizeof the mSelector's class since we count it seperately below - aSize -= sizeof(mSelector); - - // and add the size of the DOMDeclaration - // XXX - investigate the size and quantity of these - if(mDOMDeclaration && uniqueItems->AddItem(mDOMDeclaration)){ - aSize += sizeof(DOMCSSDeclarationImpl); - } - aSizeOfHandler->AddSize(tag,aSize); - - // now delegate to the Selector, Declaration, and ImportantRule - mSelector.SizeOf(aSizeOfHandler, localSize); - - if(mDeclaration){ - mDeclaration->SizeOf(aSizeOfHandler, localSize); - } - if(mImportantRule){ - mImportantRule->SizeOf(aSizeOfHandler, localSize); - } -} #endif NS_IMETHODIMP diff --git a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp index 820da83ff12..0811681cdb4 100644 --- a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp @@ -97,7 +97,6 @@ #include "prlog.h" #include "nsCOMPtr.h" #include "nsIStyleSet.h" -#include "nsISizeOfHandler.h" #include "nsStyleUtil.h" #include "nsQuickSort.h" #ifdef MOZ_XUL @@ -762,10 +761,6 @@ public: nsIAtom* aMedium, PRBool* aResult); -#ifdef DEBUG - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); -#endif - protected: RuleCascadeData* GetRuleCascade(nsIPresContext* aPresContext, nsIAtom* aMedium); @@ -792,10 +787,6 @@ public: virtual void RebuildNameSpaces(void); -#ifdef DEBUG - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); -#endif - nsAutoVoidArray mSheets; nsIURI* mURL; @@ -897,8 +888,6 @@ public: #ifdef DEBUG virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); #endif // nsIDOMStyleSheet interface @@ -1633,81 +1622,6 @@ CSSStyleSheetInner::RebuildNameSpaces(void) } } -#ifdef DEBUG -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSStyleSheetInner's size): -* 1) sizeof(*this) + sizeof mSheets array (not contents though) -* + size of the mOrderedRules array (not the contents though) -* -* Contained / Aggregated data (not reported as CSSStyleSheetInner's size): -* 1) mSheets: each style sheet is sized seperately -* 2) mOrderedRules: each fule is sized seperately -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSStyleSheetInner::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - // this style sheet is lared accounted for - return; - } - - PRUint32 localSize=0; - PRBool rulesCounted=PR_FALSE; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSStyleSheetInner"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(CSSStyleSheetInner); - - // add in the size of the mSheets array itself - mSheets.SizeOf(aSizeOfHandler,&localSize); - aSize += localSize; - - // and the mOrderedRules array (if there is one) - if(mOrderedRules && uniqueItems->AddItem(mOrderedRules)){ - rulesCounted=PR_TRUE; - // no SizeOf method so we just get the basic object size - aSize += sizeof(*mOrderedRules); - } - aSizeOfHandler->AddSize(tag,aSize); - - - // delegate to the contained containers - // mSheets : nsVoidArray - { - PRUint32 sheetCount, sheetCur; - sheetCount = mSheets.Count(); - for(sheetCur=0; sheetCur < sheetCount; sheetCur++){ - nsICSSStyleSheet* sheet = (nsICSSStyleSheet*)mSheets.ElementAt(sheetCur); - if(sheet){ - sheet->SizeOf(aSizeOfHandler, localSize); - } - } - } - // mOrderedRules : nsISupportsArray* - if(mOrderedRules && rulesCounted){ - PRUint32 ruleCount, ruleCur; - mOrderedRules->Count(&ruleCount); - for(ruleCur=0; ruleCur < ruleCount; ruleCur++){ - nsICSSRule* rule = (nsICSSRule*)mOrderedRules->ElementAt(ruleCur); - if(rule){ - rule->SizeOf(aSizeOfHandler, localSize); - NS_IF_RELEASE(rule); - } - } - } -} -#endif - // ------------------------------- // CSS Style Sheet @@ -2554,58 +2468,6 @@ void CSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const fputs("Rules in source order:\n", out); ListRules(mInner->mOrderedRules, out, aIndent); } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSStyleSheetImpl's size): -* 1) sizeof(*this) + sizeof the mImportsCollection + sizeof mCuleCollection) -* -* Contained / Aggregated data (not reported as CSSStyleSheetImpl's size): -* 1) mInner is delegated to be counted seperately -* -* Children / siblings / parents: -* 1) Recurse to mFirstChild -* -******************************************************************************/ -void CSSStyleSheetImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - // this style sheet is already accounted for - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSStyleSheet"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(CSSStyleSheetImpl); - - // add up the contained objects we won't delegate to: - // NOTE that we just add the sizeof the objects - // since the style data they contain is accounted for elsewhere - // - mImportsCollection - // - mRuleCollection - aSize += sizeof(mImportsCollection); - aSize += sizeof(mRuleCollection); - aSizeOfHandler->AddSize(tag,aSize); - - // size the inner - if(mInner){ - mInner->SizeOf(aSizeOfHandler, localSize); - } - - // now travers the children (recursively, I'm sorry to say) - if(mFirstChild){ - PRUint32 childSize=0; - mFirstChild->SizeOf(aSizeOfHandler, childSize); - } -} #endif static PRBool PR_CALLBACK @@ -4273,155 +4135,6 @@ CSSRuleProcessor::HasStateDependentStyle(StateRuleProcessorData* aData, return NS_OK; } - -#ifdef DEBUG - -struct CascadeSizeEnumData { - - CascadeSizeEnumData(nsISizeOfHandler *aSizeOfHandler, - nsUniqueStyleItems *aUniqueStyleItem, - nsIAtom *aTag) - { - handler = aSizeOfHandler; - uniqueItems = aUniqueStyleItem; - tag = aTag; - } - // weak references all 'round - - nsISizeOfHandler *handler; - nsUniqueStyleItems *uniqueItems; - nsIAtom *tag; -}; - -static -PRBool PR_CALLBACK StateSelectorsSizeEnumFunc( void *aSelector, void *aData ) -{ - nsCSSSelector* selector = (nsCSSSelector*)aSelector; - CascadeSizeEnumData *pData = (CascadeSizeEnumData *)aData; - NS_ASSERTION(selector && pData, "null arguments not supported"); - - if(! pData->uniqueItems->AddItem((void*)selector)){ - return PR_TRUE; - } - - // pass the call to the selector - PRUint32 localSize = 0; - selector->SizeOf(pData->handler, localSize); - - return PR_TRUE; -} - -static -PRBool WeightedRulesSizeEnumFunc( nsISupports *aRule, void *aData ) -{ - nsICSSStyleRule* rule = (nsICSSStyleRule*)aRule; - CascadeSizeEnumData *pData = (CascadeSizeEnumData *)aData; - - NS_ASSERTION(rule && pData, "null arguments not supported"); - - if(! pData->uniqueItems->AddItem((void*)rule)){ - return PR_TRUE; - } - - PRUint32 localSize=0; - - // pass the call to the rule - rule->SizeOf(pData->handler, localSize); - - return PR_TRUE; -} - -static -void CascadeSizeEnumFunc(RuleCascadeData *cascade, CascadeSizeEnumData *pData) -{ - NS_ASSERTION(cascade && pData, "null arguments not supported"); - - // see if the cascade has already been counted - if(!(pData->uniqueItems->AddItem(cascade))){ - return; - } - // record the size of the cascade data itself - PRUint32 localSize = sizeof(RuleCascadeData); - pData->handler->AddSize(pData->tag, localSize); - - // next add up the selectors and the weighted rules for the cascade - nsCOMPtr stateSelectorSizeTag; - stateSelectorSizeTag = do_GetAtom("CascadeStateSelectors"); - CascadeSizeEnumData stateData(pData->handler,pData->uniqueItems,stateSelectorSizeTag); - cascade->mStateSelectors.EnumerateForwards(StateSelectorsSizeEnumFunc, &stateData); - - if(cascade->mWeightedRules){ - nsCOMPtr weightedRulesSizeTag; - weightedRulesSizeTag = do_GetAtom("CascadeWeightedRules"); - CascadeSizeEnumData stateData2(pData->handler,pData->uniqueItems,weightedRulesSizeTag); - cascade->mWeightedRules->EnumerateForwards(WeightedRulesSizeEnumFunc, &stateData2); - } -} - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSRuleProcessor's size): -* 1) sizeof(*this) -* -* Contained / Aggregated data (not reported as CSSRuleProcessor's size): -* 1) Delegate to the StyleSheets in the mSheets collection -* 2) Delegate to the Rules in the CascadeTable -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSRuleProcessor::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSRuleProcessor"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(CSSRuleProcessor); - - // collect sizes for the data - // - mSheets - // - mRuleCascades - - // sheets first - if(mSheets && uniqueItems->AddItem(mSheets)){ - PRUint32 sheetCount, curSheet, localSize2; - mSheets->Count(&sheetCount); - for(curSheet=0; curSheet < sheetCount; curSheet++){ - nsCOMPtr pSheet = - dont_AddRef((nsICSSStyleSheet*)mSheets->ElementAt(curSheet)); - if(pSheet && uniqueItems->AddItem((void*)pSheet)){ - pSheet->SizeOf(aSizeOfHandler, localSize2); - // XXX aSize += localSize2; - } - } - } - - // and for the medium cascade table we account for the hash table overhead, - // and then compute the sizeof each rule-cascade in the table - { - nsCOMPtr tag2 = do_GetAtom("RuleCascade"); - CascadeSizeEnumData data(aSizeOfHandler, uniqueItems, tag2); - for (RuleCascadeData *cascadeData = mRuleCascades; - cascadeData; - cascadeData = cascadeData->mNext) { - CascadeSizeEnumFunc(cascadeData, &data); - } - } - - // now add the size of the RuleProcessor - aSizeOfHandler->AddSize(tag,aSize); -} -#endif - NS_IMETHODIMP CSSRuleProcessor::ClearRuleCascades(void) { diff --git a/mozilla/content/html/style/src/nsHTMLAttributes.cpp b/mozilla/content/html/style/src/nsHTMLAttributes.cpp index 6c925a994cc..8baad62713e 100644 --- a/mozilla/content/html/style/src/nsHTMLAttributes.cpp +++ b/mozilla/content/html/style/src/nsHTMLAttributes.cpp @@ -51,7 +51,6 @@ #include "nsHTMLAtoms.h" #include "nsIHTMLContent.h" #include "nsVoidArray.h" -#include "nsISizeOfHandler.h" #include "nsCOMPtr.h" #include "nsUnicharUtils.h" @@ -291,16 +290,6 @@ struct HTMLAttribute { return PR_FALSE; } -#ifdef DEBUG - nsresult SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const { - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; - } -#endif - nsHTMLAttrName mAttribute; nsHTMLValue mValue; HTMLAttribute* mNext; @@ -358,8 +347,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; - - void SizeOf(nsISizeOfHandler* aSizer, PRUint32 &aResult); #endif nsIHTMLStyleSheet* mSheet; @@ -793,33 +780,6 @@ nsHTMLMappedAttributes::List(FILE* out, PRInt32 aIndent) const } return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as nsHTMLMappedAttributes's size): -* 1) sizeof(*this) -* -* Contained / Aggregated data (not reported as nsHTMLMappedAttributes's size): -* none -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void nsHTMLMappedAttributes::SizeOf(nsISizeOfHandler* aSizer, PRUint32 &aResult) -{ - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - // this is already accounted for - return; - } - nsCOMPtr tag; - tag = do_GetAtom("HTMLMappedAttributes"); - aResult = sizeof(*this); - aSizer->AddSize(tag, aResult); -} #endif //-------------------- @@ -1583,48 +1543,6 @@ nsHTMLAttributes::List(FILE* out, PRInt32 aIndent) const } return NS_OK; } - -void nsHTMLAttributes::SizeOf(nsISizeOfHandler* aSizer, PRUint32 &aResult) -{ - PRUint32 sum = 0; - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - // this is already accounted for - return; - } - - // XXX step through this again - sum = sizeof(*this); - if (mAttrNames != mNameBuffer) { - sum += sizeof(*mAttrNames) * mAttrSize; - } - if (mFirstUnmapped) { - HTMLAttribute* ha = mFirstUnmapped; - while (ha) { - PRUint32 asum = 0; - ha->SizeOf(aSizer, &asum); // XXX Unique??? - sum += asum; - ha = ha->mNext; - } - } - if (mMapped) { - PRBool recorded; - aSizer->RecordObject((void*)mMapped, &recorded); - if (!recorded) { - PRUint32 asum = 0; - mMapped->SizeOf(aSizer, asum); // XXX Unique??? - sum += asum; - } - } - - aResult = sum; - - nsCOMPtr tag; - tag = do_GetAtom("nsHTMLAttributes"); - aSizer->AddSize(tag, aResult); -} #endif nsresult diff --git a/mozilla/content/html/style/src/nsHTMLAttributes.h b/mozilla/content/html/style/src/nsHTMLAttributes.h index 7c7e38e7a8d..77b651d81fa 100644 --- a/mozilla/content/html/style/src/nsHTMLAttributes.h +++ b/mozilla/content/html/style/src/nsHTMLAttributes.h @@ -70,10 +70,6 @@ public: NS_IMETHOD SetUniqued(PRBool aUniqued) = 0; NS_IMETHOD GetUniqued(PRBool& aUniqued) = 0; NS_IMETHOD DropStyleSheetReference(void) = 0; - -#ifdef DEBUG - virtual void SizeOf(nsISizeOfHandler* aSizer, PRUint32 &aResult) = 0; -#endif }; @@ -248,8 +244,6 @@ public: #ifdef DEBUG NS_METHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - void SizeOf(nsISizeOfHandler* aSizer, PRUint32 &aResult); #endif protected: diff --git a/mozilla/content/html/style/src/nsHTMLCSSStyleSheet.cpp b/mozilla/content/html/style/src/nsHTMLCSSStyleSheet.cpp index 3f329c67bde..b3b72e1fdc2 100644 --- a/mozilla/content/html/style/src/nsHTMLCSSStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsHTMLCSSStyleSheet.cpp @@ -56,9 +56,6 @@ #include "nsIStyleSet.h" #include "nsRuleWalker.h" -#include "nsISizeOfHandler.h" - - class CSSFirstLineRule : public nsIStyleRule { public: CSSFirstLineRule(nsIHTMLCSSStyleSheet* aSheet); @@ -73,8 +70,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); #endif nsIHTMLCSSStyleSheet* mSheet; @@ -127,44 +122,6 @@ CSSFirstLineRule::List(FILE* out, PRInt32 aIndent) const { return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSFirstLineRule's size): -* 1) sizeof(*this) -* -* Contained / Aggregated data (not reported as CSSFirstLineRule's size): -* 1) Delegate to mSheet if it exists -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSFirstLineRule::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - - if(! uniqueItems->AddItem((void*)this) ){ - // object has already been accounted for - return; - } - - // get or create a tag for this instance - nsCOMPtr tag; - tag = do_GetAtom("CSSFirstLine-LetterRule"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - aSizeOfHandler->AddSize(tag,aSize); - - if(mSheet){ - PRUint32 localSize=0; - mSheet->SizeOf(aSizeOfHandler, localSize); - } -} #endif // ----------------------------------------------------------- @@ -228,8 +185,6 @@ public: #ifdef DEBUG virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); #endif // If changing the given attribute cannot affect style context, aAffects @@ -490,57 +445,6 @@ void HTMLCSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const } fputs("\n", out); } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as HTMLCSSStyleSheetImpl's size): -* 1) sizeof(*this) -* -* Contained / Aggregated data (not reported as HTMLCSSStyleSheetImpl's size): -* 1) We don't really delegate but count seperately the FirstLineRule and -* the FirstLetterRule if the exist and are unique instances -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void HTMLCSSStyleSheetImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - // this style sheet is lared accounted for - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag; - tag = do_GetAtom("HTMLCSSStyleSheet"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(HTMLCSSStyleSheetImpl); - aSizeOfHandler->AddSize(tag,aSize); - - // Now the associated rules (if they exist) - // - mFirstLineRule - // - mFirstLetterRule - if(mFirstLineRule && uniqueItems->AddItem((void*)mFirstLineRule)){ - localSize = sizeof(*mFirstLineRule); - aSize += localSize; - tag = do_GetAtom("FirstLineRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(mFirstLetterRule && uniqueItems->AddItem((void*)mFirstLetterRule)){ - localSize = sizeof(*mFirstLetterRule); - aSize += localSize; - tag = do_GetAtom("FirstLetterRule"); - aSizeOfHandler->AddSize(tag,localSize); - } -} #endif NS_IMETHODIMP diff --git a/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp b/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp index bd1ff22e153..b6975adbbd4 100644 --- a/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsHTMLStyleSheet.cpp @@ -61,7 +61,6 @@ #include "nsRuleWalker.h" #include "nsIStyleSet.h" -#include "nsISizeOfHandler.h" static NS_DEFINE_CID(kCSSFrameConstructorCID, NS_CSSFRAMECONSTRUCTOR_CID); @@ -79,8 +78,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif nscolor mColor; @@ -94,10 +91,6 @@ public: NS_IMETHOD MapRuleInfoInto(nsRuleData* aRuleData); -#ifdef DEBUG - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); -#endif - void Reset() { mInitialized = PR_FALSE; } @@ -143,43 +136,6 @@ HTMLColorRule::List(FILE* out, PRInt32 aIndent) const { return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as HTMLColorRule's size): -* 1) sizeof(*this) + -* -* Contained / Aggregated data (not reported as HTMLColorRule's size): -* 1) delegate to the mSheet -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void HTMLColorRule::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - - if(! uniqueItems->AddItem((void*)this) ){ - // object has already been accounted for - return; - } - - // get or create a tag for this instance - nsCOMPtr tag = do_GetAtom("HTMLColorRule"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - aSizeOfHandler->AddSize(tag,aSize); - - if(mSheet){ - PRUint32 localSize=0; - mSheet->SizeOf(aSizeOfHandler, localSize); - } -} #endif HTMLDocumentColorRule::HTMLDocumentColorRule(nsIHTMLStyleSheet* aSheet) @@ -230,45 +186,6 @@ HTMLDocumentColorRule::Initialize(nsIPresContext* aPresContext) mColor = bodyColor->mColor; } -#ifdef DEBUG -/****************************************************************************** -* SizeOf method: -* -* Self (reported as HTMLDocumentColorRule's size): -* 1) sizeof(*this) -* -* Contained / Aggregated data (not reported as HTMLDocumentColorRule's size): -* 1) Delegate to the mSheet -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void HTMLDocumentColorRule::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - - if(! uniqueItems->AddItem((void*)this) ){ - // object has already been accounted for - return; - } - - // get or create a tag for this instance - nsCOMPtr tag = do_GetAtom("HTMLDocumentColorRule"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - aSizeOfHandler->AddSize(tag,aSize); - - if(mSheet){ - PRUint32 localSize; - mSheet->SizeOf(aSizeOfHandler, localSize); - } -} -#endif - class GenericTableRule: public nsIStyleRule { public: GenericTableRule(nsIHTMLStyleSheet* aSheet); @@ -283,8 +200,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); #endif void Reset() @@ -325,43 +240,6 @@ GenericTableRule::List(FILE* out, PRInt32 aIndent) const { return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as GenericTableRule's size): -* 1) sizeof(*this) + -* -* Contained / Aggregated data (not reported as GenericTableRule's size): -* 1) Delegate to the mSheet if it exists -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void GenericTableRule::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - - if(! uniqueItems->AddItem((void*)this) ){ - // object has already been accounted for - return; - } - - // get or create a tag for this instance - nsCOMPtr tag = do_GetAtom("GenericTableRule"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - aSizeOfHandler->AddSize(tag,aSize); - - if(mSheet){ - PRUint32 localSize; - mSheet->SizeOf(aSizeOfHandler, localSize); - } -} #endif // ----------------------------------------------------------- @@ -785,8 +663,6 @@ public: #ifdef DEBUG virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); #endif // If changing the given attribute cannot affect style context, aAffects @@ -813,8 +689,6 @@ protected: TableColgroupRule* mTableColgroupRule; TableColRule* mTableColRule; TableTHRule* mTableTHRule; - // NOTE: if adding more rules, be sure to update - // the SizeOf method to include them PLDHashTable mMappedAttrTable; }; @@ -1347,164 +1221,6 @@ void HTMLStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const } fputs("\n", out); } - - -struct MappedAttributeSizeEnumData -{ - MappedAttributeSizeEnumData(nsISizeOfHandler *aSizeOfHandler, - nsUniqueStyleItems *aUniqueStyleItem) - { - aHandler = aSizeOfHandler; - uniqueItems = aUniqueStyleItem; - } - - // weak references all 'round - nsISizeOfHandler *aHandler; - nsUniqueStyleItems *uniqueItems; -}; - -PR_STATIC_CALLBACK(PLDHashOperator) -MappedSizeAttributes(PLDHashTable *table, PLDHashEntryHdr *hdr, - PRUint32 number, void *arg) -{ - MappedAttributeSizeEnumData *pData = (MappedAttributeSizeEnumData *)arg; - NS_ASSERTION(pData,"null closure is not supported"); - MappedAttrTableEntry *entry = NS_STATIC_CAST(MappedAttrTableEntry*, hdr); - nsIHTMLMappedAttributes* mapped = entry->mAttributes; - NS_ASSERTION(mapped, "null item in enumeration fcn is not supported"); - // if there is an attribute and it has not been counted, the get its size - if(mapped){ - PRUint32 size=0; - mapped->SizeOf(pData->aHandler, size); - } - return PL_DHASH_NEXT; -} - - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as HTMLStyleSheetImpl's size): -* 1) sizeof(*this) -* -* Contained / Aggregated data (not reported as HTMLStyleSheetImpl's size): -* 1) Not really delegated, but counted seperately: -* - mLinkRule -* - mVisitedRule -* - mActiveRule -* - mDocumentColorRule -* - mTableTbodyRule -* - mTableRowRule -* - mTableColgroupRule -* - mTableColRule -* - mTableTHRule -* - mMappedAttrTable -* 2) Delegates (really) to the MappedAttributes in the mMappedAttrTable -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void -HTMLStyleSheetImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - // this style sheet is lared accounted for - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("HTMLStyleSheet"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(HTMLStyleSheetImpl); - aSizeOfHandler->AddSize(tag,aSize); - - // now gather up the sizes of the data members - // - mLinkRule : sizeof object - // - mVisitedRule : sizeof object - // - mActiveRule : sizeof object - // - mDocumentColorRule : sizeof object - // - mTableTbodyRule : sizeof object - // - mTableRowRule : sizeof object - // - mTableColgroupRule : sizeof object - // - mTableColRule : sizeof object - // - mTableTHRule : sizeof object - // - mMappedAttrTable - - if(mLinkRule && uniqueItems->AddItem((void*)mLinkRule)){ - localSize = sizeof(*mLinkRule); - tag = do_GetAtom("LinkRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(mVisitedRule && uniqueItems->AddItem((void*)mVisitedRule)){ - localSize = sizeof(*mVisitedRule); - tag = do_GetAtom("VisitedRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(mActiveRule && uniqueItems->AddItem((void*)mActiveRule)){ - localSize = sizeof(*mActiveRule); - tag = do_GetAtom("ActiveRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(uniqueItems->AddItem((void*)mDocumentColorRule)){ - localSize = sizeof(*mDocumentColorRule); - tag = do_GetAtom("DocumentColorRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(uniqueItems->AddItem((void*)mTableTbodyRule)){ - localSize = sizeof(*mTableTbodyRule); - tag = do_GetAtom("TableTbodyRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(uniqueItems->AddItem((void*)mTableRowRule)){ - localSize = sizeof(*mTableRowRule); - tag = do_GetAtom("TableRowRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(uniqueItems->AddItem((void*)mTableColgroupRule)){ - localSize = sizeof(*mTableColgroupRule); - tag = do_GetAtom("TableColgroupRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(uniqueItems->AddItem((void*)mTableColRule)){ - localSize = sizeof(*mTableColRule); - tag = do_GetAtom("TableColRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(uniqueItems->AddItem((void*)mTableTHRule)){ - localSize = sizeof(*mTableTHRule); - tag = do_GetAtom("TableTHRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - - // for the AttrTable it is kindof sleezy: - // We want the hash table overhead as well as the entries it contains - // - // we get the overall size of the hashtable, and if there are entries, - // we calculate a rough overhead estimate as: - // number of entries X sizeof each hash-entry - // + the size of a hash table (see plhash.h and nsHashTable.h) - // then we add up the size of each unique attribute - if (mMappedAttrTable.ops) { - localSize = - PL_DHASH_TABLE_SIZE(&mMappedAttrTable) * mMappedAttrTable.entrySize; - tag = do_GetAtom("MappedAttrTable"); - aSizeOfHandler->AddSize(tag,localSize); - - // now get each unique attribute - MappedAttributeSizeEnumData sizeEnumData(aSizeOfHandler, uniqueItems); - PL_DHashTableEnumerate(&mMappedAttrTable, &MappedSizeAttributes, - &sizeEnumData); - } - - // that's it -} #endif NS_IMETHODIMP diff --git a/mozilla/content/html/style/src/nsICSSStyleRule.h b/mozilla/content/html/style/src/nsICSSStyleRule.h index ab5a0281a4a..bf140f4cf54 100644 --- a/mozilla/content/html/style/src/nsICSSStyleRule.h +++ b/mozilla/content/html/style/src/nsICSSStyleRule.h @@ -47,8 +47,6 @@ #include "nsCSSValue.h" #include "nsIAtom.h" -class nsISizeOfHandler; - class nsIAtom; class nsIArena; class nsCSSDeclaration; @@ -96,10 +94,6 @@ public: ~nsAttrSelector(void); PRBool Equals(const nsAttrSelector* aOther) const; -#ifdef DEBUG - void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); -#endif - PRInt32 mNameSpace; nsIAtom* mAttr; PRUint8 mFunction; @@ -136,9 +130,6 @@ public: PRInt32 CalcWeight(void) const; -#ifdef DEBUG - void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); -#endif nsresult ToString( nsAString& aString, nsICSSStyleSheet* aSheet, PRBool aIsPseudoElem, PRInt8 aNegatedIndex ) const; diff --git a/mozilla/content/shared/public/nsStyleContext.h b/mozilla/content/shared/public/nsStyleContext.h index c132e9ab86e..efb632f1c56 100644 --- a/mozilla/content/shared/public/nsStyleContext.h +++ b/mozilla/content/shared/public/nsStyleContext.h @@ -108,8 +108,6 @@ public: void DumpRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent); void List(FILE* out, PRInt32 aIndent); - - void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif protected: diff --git a/mozilla/content/svg/content/src/nsSVGElement.cpp b/mozilla/content/svg/content/src/nsSVGElement.cpp index 273f2c358f5..682fe02efdb 100644 --- a/mozilla/content/svg/content/src/nsSVGElement.cpp +++ b/mozilla/content/svg/content/src/nsSVGElement.cpp @@ -414,14 +414,6 @@ nsSVGElement::DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const return NS_OK; } -NS_IMETHODIMP -nsSVGElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ -// NS_NOTYETIMPLEMENTED("write me!"); - return NS_ERROR_UNEXPECTED; -} - - //---------------------------------------------------------------------- // nsIStyledContent methods diff --git a/mozilla/content/svg/content/src/nsSVGElement.h b/mozilla/content/svg/content/src/nsSVGElement.h index 321f6e4b261..b50aab3fadd 100644 --- a/mozilla/content/svg/content/src/nsSVGElement.h +++ b/mozilla/content/svg/content/src/nsSVGElement.h @@ -132,8 +132,6 @@ public: // NS_IMETHOD GetBindingParent(nsIContent** aContent); // NS_IMETHOD SetBindingParent(nsIContent* aParent); - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; - // nsIXMLContent // NS_IMETHOD MaybeTriggerAutoLink(nsIWebShell *aShell); diff --git a/mozilla/content/xml/content/src/nsXMLElement.cpp b/mozilla/content/xml/content/src/nsXMLElement.cpp index 69f21fe89cd..564833561e0 100644 --- a/mozilla/content/xml/content/src/nsXMLElement.cpp +++ b/mozilla/content/xml/content/src/nsXMLElement.cpp @@ -794,17 +794,3 @@ nsXMLElement::GetID(nsIAtom*& aResult) const return rv; } - - -#ifdef DEBUG -NS_IMETHODIMP -nsXMLElement::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - - *aResult = sizeof(*this); - return NS_OK; -} -#endif diff --git a/mozilla/content/xml/content/src/nsXMLElement.h b/mozilla/content/xml/content/src/nsXMLElement.h index 6b498c52cc4..771a61b8b07 100644 --- a/mozilla/content/xml/content/src/nsXMLElement.h +++ b/mozilla/content/xml/content/src/nsXMLElement.h @@ -86,9 +86,6 @@ public: nsIDOMEvent** aDOMEvent, PRUint32 aFlags, nsEventStatus* aEventStatus); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; -#endif protected: PRBool mIsLink; diff --git a/mozilla/content/xml/content/src/nsXMLEntity.cpp b/mozilla/content/xml/content/src/nsXMLEntity.cpp index 603b9ac6a69..38af263f403 100644 --- a/mozilla/content/xml/content/src/nsXMLEntity.cpp +++ b/mozilla/content/xml/content/src/nsXMLEntity.cpp @@ -66,7 +66,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent, PRBool aDumpAll) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif protected: @@ -220,22 +219,4 @@ nsXMLEntity::DumpContent(FILE* out, PRInt32 aIndent, PRBool aDumpAll) const { return NS_OK; } - -NS_IMETHODIMP -nsXMLEntity::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - if (!aResult) return NS_ERROR_NULL_POINTER; - PRUint32 sum; - nsGenericDOMDataNode::SizeOf(aSizer, &sum); - PRUint32 ssize; - mName.SizeOf(aSizer, &ssize); - sum = sum - sizeof(mName) + ssize; - mPublicId.SizeOf(aSizer, &ssize); - sum = sum - sizeof(mPublicId) + ssize; - mSystemId.SizeOf(aSizer, &ssize); - sum = sum - sizeof(mSystemId) + ssize; - mNotationName.SizeOf(aSizer, &ssize); - sum = sum - sizeof(mNotationName) + ssize; - return NS_OK; -} #endif diff --git a/mozilla/content/xml/content/src/nsXMLNotation.cpp b/mozilla/content/xml/content/src/nsXMLNotation.cpp index e5a5a6c5289..06d2d94f9ef 100644 --- a/mozilla/content/xml/content/src/nsXMLNotation.cpp +++ b/mozilla/content/xml/content/src/nsXMLNotation.cpp @@ -67,7 +67,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent, PRBool aDumpAll) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif // nsIContent @@ -204,21 +203,4 @@ nsXMLNotation::DumpContent(FILE* out, PRInt32 aIndent, PRBool aDumpAll) const { return NS_OK; } - -NS_IMETHODIMP -nsXMLNotation::SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const -{ - if (!aResult) return NS_ERROR_NULL_POINTER; - PRUint32 sum; - nsGenericDOMDataNode::SizeOf(aSizer, &sum); - PRUint32 ssize; - mName.SizeOf(aSizer, &ssize); - sum = sum - sizeof(mName) + ssize; - mPublicId.SizeOf(aSizer, &ssize); - sum = sum - sizeof(mPublicId) + ssize; - mSystemId.SizeOf(aSizer, &ssize); - sum = sum - sizeof(mSystemId) + ssize; - return NS_OK; -} #endif - diff --git a/mozilla/content/xml/content/src/nsXMLProcessingInstruction.cpp b/mozilla/content/xml/content/src/nsXMLProcessingInstruction.cpp index 1823d576490..6a9f497ab50 100644 --- a/mozilla/content/xml/content/src/nsXMLProcessingInstruction.cpp +++ b/mozilla/content/xml/content/src/nsXMLProcessingInstruction.cpp @@ -175,17 +175,4 @@ nsXMLProcessingInstruction::DumpContent(FILE* out, PRInt32 aIndent, PRBool aDumpAll) const { return NS_OK; } - -NS_IMETHODIMP -nsXMLProcessingInstruction::SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const -{ - if (!aResult) return NS_ERROR_NULL_POINTER; - PRUint32 sum; - nsGenericDOMDataNode::SizeOf(aSizer, &sum); - PRUint32 ssize; - mTarget.SizeOf(aSizer, &ssize); - sum = sum - sizeof(mTarget) + ssize; - return NS_OK; -} #endif diff --git a/mozilla/content/xml/content/src/nsXMLProcessingInstruction.h b/mozilla/content/xml/content/src/nsXMLProcessingInstruction.h index b504621a67b..949c04ab96a 100644 --- a/mozilla/content/xml/content/src/nsXMLProcessingInstruction.h +++ b/mozilla/content/xml/content/src/nsXMLProcessingInstruction.h @@ -69,7 +69,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent, PRBool aDumpAll) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif protected: diff --git a/mozilla/content/xul/content/src/nsXULElement.cpp b/mozilla/content/xul/content/src/nsXULElement.cpp index dcd32f1ee36..99905a79a37 100644 --- a/mozilla/content/xul/content/src/nsXULElement.cpp +++ b/mozilla/content/xul/content/src/nsXULElement.cpp @@ -145,7 +145,6 @@ // The XUL doc interface #include "nsIDOMXULDocument.h" -#include "nsISizeOfHandler.h" #include "nsReadableUtils.h" #include "nsITimelineService.h" #include "nsIFrame.h" @@ -3149,19 +3148,6 @@ nsXULElement::List(FILE* out, PRInt32 aIndent) const return NS_OK; } - - -NS_IMETHODIMP -nsXULElement::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = 0; - sum += (PRUint32) sizeof(*this); - *aResult = sum; - return NS_OK; -} #endif NS_IMETHODIMP @@ -4442,16 +4428,6 @@ nsXULElement::IsContentOfType(PRUint32 aFlags) return !(aFlags & ~(eELEMENT | eXUL)); } -#ifdef DEBUG -void nsXULElement::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - // XXX - implement this if you want the sizes of XUL style rules - // dumped during StyleSize dump - return; -} -#endif - - nsresult nsXULElement::AddPopupListener(nsIAtom* aName) { diff --git a/mozilla/content/xul/content/src/nsXULElement.h b/mozilla/content/xul/content/src/nsXULElement.h index 2779c0b915a..52074148974 100644 --- a/mozilla/content/xul/content/src/nsXULElement.h +++ b/mozilla/content/xul/content/src/nsXULElement.h @@ -82,8 +82,6 @@ #include "nsGenericElement.h" // for nsCheapVoidArray -class nsISizeOfHandler; - class nsIDocument; class nsIRDFService; class nsISupportsArray; @@ -439,7 +437,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const { return NS_OK; } - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif NS_IMETHOD HandleDOMEvent(nsIPresContext* aPresContext, nsEvent* aEvent, @@ -501,10 +498,6 @@ public: void** aHandler); NS_IMETHOD GetCompiledEventHandler(nsIAtom *aName, void** aHandler); -#ifdef DEBUG - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); -#endif - // nsIChromeEventHandler NS_DECL_NSICHROMEEVENTHANDLER diff --git a/mozilla/layout/base/public/nsIFrame.h b/mozilla/layout/base/public/nsIFrame.h index 2850ae5976f..a91d68d6f10 100644 --- a/mozilla/layout/base/public/nsIFrame.h +++ b/mozilla/layout/base/public/nsIFrame.h @@ -75,7 +75,6 @@ class nsIAtom; class nsIPresContext; class nsIPresShell; class nsIRenderingContext; -class nsISizeOfHandler; class nsIView; class nsIWidget; class nsIDOMRange; diff --git a/mozilla/layout/base/public/nsIFrameDebug.h b/mozilla/layout/base/public/nsIFrameDebug.h index c0dd81deaec..591d94247da 100644 --- a/mozilla/layout/base/public/nsIFrameDebug.h +++ b/mozilla/layout/base/public/nsIFrameDebug.h @@ -78,23 +78,6 @@ public: */ NS_IMETHOD DumpRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent, PRBool aIncludeStyleData) = 0; - /** - * Get the size of the frame object. The size value should include - * all subordinate data referenced by the frame that is not - * accounted for by child frames. However, this value should not - * include the content objects, style contexts, views or other data - * that lies logically outside the frame system. - * - * If the implementation so chooses, instead of returning the total - * subordinate data it may instead use the sizeof handler to store - * away subordinate data under its own key so that the subordinate - * data may be tabulated independently of the frame itself. - * - * The caller is responsible for recursing over all child-lists that - * the frame supports. - */ - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const = 0; - NS_IMETHOD VerifyTree() const = 0; /** @@ -140,9 +123,6 @@ public: static void ShowEventTargetFrameBorder(PRBool aEnable); static PRBool GetShowEventTargetFrameBorder(); - virtual void SizeOfStyleContext(nsISizeOfHandler* aSizeOfHandler, - PRUint32& aSize) = 0; - private: NS_IMETHOD_(nsrefcnt) AddRef(void) = 0; NS_IMETHOD_(nsrefcnt) Release(void) = 0; diff --git a/mozilla/layout/base/public/nsIStyleSet.h b/mozilla/layout/base/public/nsIStyleSet.h index 37226cecf00..7d3b210e656 100644 --- a/mozilla/layout/base/public/nsIStyleSet.h +++ b/mozilla/layout/base/public/nsIStyleSet.h @@ -60,7 +60,6 @@ class nsRuleNode; struct nsFindFrameHint; #include "nsVoidArray.h" -class nsISizeOfHandler; class nsICSSPseudoComparator; @@ -314,7 +313,6 @@ public: #ifdef DEBUG virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) = 0; virtual void ListContexts(nsIFrame* aRootFrame, FILE* out = stdout, PRInt32 aIndent = 0) = 0; - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize) = 0; #endif virtual void ResetUniqueStyleItems(void) = 0; diff --git a/mozilla/layout/base/src/nsSpaceManager.cpp b/mozilla/layout/base/src/nsSpaceManager.cpp index 153fe2ffbae..63dbcb0ca10 100644 --- a/mozilla/layout/base/src/nsSpaceManager.cpp +++ b/mozilla/layout/base/src/nsSpaceManager.cpp @@ -1414,34 +1414,3 @@ nsSpaceManager::BandRect::Length() const return len; } - -#ifdef DEBUG -void -nsSpaceManager::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - NS_PRECONDITION(aResult, "null OUT parameter pointer"); - *aResult = sizeof(*this); - - // Add in the size of the band data. Don't count the header which has - // already been taken into account - if (!mBandList.IsEmpty()) { - const BandRect* bandRect = mBandList.Head(); - do { - *aResult += sizeof(*bandRect); - if (bandRect->mNumFrames > 1) { - PRUint32 voidArraySize; - - bandRect->mFrames->SizeOf(aHandler, &voidArraySize); - *aResult += voidArraySize; - } - - bandRect = bandRect->Next(); - } while (bandRect != &mBandList); - } - - // Add in the size of the frame info map - for (FrameInfo* info = mFrameInfoMap; info; info = info->mNext) { - *aResult += sizeof(*info); - } -} -#endif diff --git a/mozilla/layout/base/src/nsSpaceManager.h b/mozilla/layout/base/src/nsSpaceManager.h index 3e6d343ab34..f564ddae73f 100644 --- a/mozilla/layout/base/src/nsSpaceManager.h +++ b/mozilla/layout/base/src/nsSpaceManager.h @@ -47,7 +47,6 @@ class nsIPresShell; class nsIFrame; class nsVoidArray; -class nsISizeOfHandler; struct nsSize; #define NS_SPACE_MANAGER_CACHE_SIZE 4 @@ -320,8 +319,6 @@ public: * Dump the state of the spacemanager out to a file */ nsresult List(FILE* out); - - void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; #endif protected: diff --git a/mozilla/layout/generic/nsAreaFrame.cpp b/mozilla/layout/generic/nsAreaFrame.cpp index 27fd2843e28..9af669c6aa3 100644 --- a/mozilla/layout/generic/nsAreaFrame.cpp +++ b/mozilla/layout/generic/nsAreaFrame.cpp @@ -45,7 +45,6 @@ #include "nsHTMLValue.h" #include "nsHTMLParts.h" #include "nsLayoutAtoms.h" -#include "nsISizeOfHandler.h" #ifdef INCLUDE_XUL #include "nsINameSpaceManager.h" @@ -206,16 +205,4 @@ nsAreaFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("Area"), aResult); } - -NS_IMETHODIMP -nsAreaFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - nsBlockFrame::SizeOf(aHandler, aResult); - *aResult += sizeof(*this) - sizeof(nsBlockFrame); - - return NS_OK; -} #endif diff --git a/mozilla/layout/generic/nsAreaFrame.h b/mozilla/layout/generic/nsAreaFrame.h index add72c3cd9a..701e0df2849 100644 --- a/mozilla/layout/generic/nsAreaFrame.h +++ b/mozilla/layout/generic/nsAreaFrame.h @@ -84,7 +84,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; #endif protected: diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 508cd9989c8..280ac87105f 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -66,7 +66,6 @@ #include "nsLayoutAtoms.h" #include "nsITextContent.h" #include "nsStyleChangeList.h" -#include "nsISizeOfHandler.h" #include "nsIFocusTracker.h" #include "nsIFrameSelection.h" #include "nsSpaceManager.h" @@ -6276,28 +6275,6 @@ nsBlockFrame::VerifyTree() const // XXX rewrite this return NS_OK; } - -NS_IMETHODIMP -nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aHandler || !aResult) { - return NS_ERROR_NULL_POINTER; - } - - PRUint32 sum = sizeof(*this); - - // Add in size of each line object - for (const_line_iterator line = begin_lines(), line_end = end_lines(); - line != line_end; - ++line) { - PRUint32 lineBoxSize; - nsIAtom* atom = line->SizeOf(aHandler, &lineBoxSize); - aHandler->AddSize(atom, lineBoxSize); - } - - *aResult = sum; - return NS_OK; -} #endif // End Debugging diff --git a/mozilla/layout/generic/nsBlockFrame.h b/mozilla/layout/generic/nsBlockFrame.h index 623cff9ad41..d61ac2c64ad 100644 --- a/mozilla/layout/generic/nsBlockFrame.h +++ b/mozilla/layout/generic/nsBlockFrame.h @@ -134,7 +134,6 @@ public: #ifdef DEBUG NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const; NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; NS_IMETHOD VerifyTree() const; #endif NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext, const nsPoint& aPoint, nsFramePaintLayer aWhichLayer, nsIFrame** aFrame); diff --git a/mozilla/layout/generic/nsContainerFrame.cpp b/mozilla/layout/generic/nsContainerFrame.cpp index d7a65cea61c..4a5caec0ee0 100644 --- a/mozilla/layout/generic/nsContainerFrame.cpp +++ b/mozilla/layout/generic/nsContainerFrame.cpp @@ -47,7 +47,6 @@ #include "nsIView.h" #include "nsIScrollableView.h" #include "nsVoidArray.h" -#include "nsISizeOfHandler.h" #include "nsHTMLReflowCommand.h" #include "nsHTMLContainerFrame.h" #include "nsIFrameManager.h" @@ -1361,14 +1360,4 @@ nsContainerFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) return NS_OK; } - -NS_IMETHODIMP -nsContainerFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} #endif diff --git a/mozilla/layout/generic/nsContainerFrame.h b/mozilla/layout/generic/nsContainerFrame.h index 8b859a1701b..87113733e88 100644 --- a/mozilla/layout/generic/nsContainerFrame.h +++ b/mozilla/layout/generic/nsContainerFrame.h @@ -84,7 +84,6 @@ public: #ifdef DEBUG NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; #endif // nsContainerFrame methods diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 5fe6b2a23cd..01cfe66c430 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -56,7 +56,6 @@ #include "prlog.h" #include "prprf.h" #include -#include "nsISizeOfHandler.h" #include "nsIFrameManager.h" #include "nsCSSRendering.h" #ifdef ACCESSIBILITY @@ -2776,15 +2775,6 @@ nsFrame::MakeFrameName(const nsAString& aType, nsAString& aResult) const aResult.Append(NS_ConvertASCIItoUCS2(buf)); return NS_OK; } - -void -nsFrame::SizeOfStyleContext(nsISizeOfHandler* aSizeOfHandler, - PRUint32& aSize) -{ - if (mStyleContext) - mStyleContext->SizeOf(aSizeOfHandler, aSize); -} - #endif void @@ -3053,16 +3043,6 @@ nsFrame::DumpBaseRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 } while (nsnull != list); } -NS_IMETHODIMP -nsFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} - NS_IMETHODIMP nsFrame::VerifyTree() const { diff --git a/mozilla/layout/generic/nsFrame.h b/mozilla/layout/generic/nsFrame.h index 6973021546b..d47453a203b 100644 --- a/mozilla/layout/generic/nsFrame.h +++ b/mozilla/layout/generic/nsFrame.h @@ -255,9 +255,7 @@ public: NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const; NS_IMETHOD GetFrameName(nsAString& aResult) const; NS_IMETHOD DumpRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent, PRBool aIncludeStyleData); - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; NS_IMETHOD VerifyTree() const; - virtual void SizeOfStyleContext(nsISizeOfHandler* aHandler, PRUint32& aSize); #endif NS_IMETHOD SetSelected(nsIPresContext* aPresContext, nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread); diff --git a/mozilla/layout/generic/nsHTMLFrame.cpp b/mozilla/layout/generic/nsHTMLFrame.cpp index 549422003b5..a4924345e4e 100644 --- a/mozilla/layout/generic/nsHTMLFrame.cpp +++ b/mozilla/layout/generic/nsHTMLFrame.cpp @@ -158,7 +158,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; #endif NS_IMETHOD GetContentForEvent(nsIPresContext* aPresContext, nsEvent* aEvent, @@ -756,14 +755,4 @@ CanvasFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("Canvas"), aResult); } - -NS_IMETHODIMP -CanvasFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} #endif diff --git a/mozilla/layout/generic/nsIFrame.h b/mozilla/layout/generic/nsIFrame.h index 2850ae5976f..a91d68d6f10 100644 --- a/mozilla/layout/generic/nsIFrame.h +++ b/mozilla/layout/generic/nsIFrame.h @@ -75,7 +75,6 @@ class nsIAtom; class nsIPresContext; class nsIPresShell; class nsIRenderingContext; -class nsISizeOfHandler; class nsIView; class nsIWidget; class nsIDOMRange; diff --git a/mozilla/layout/generic/nsIFrameDebug.h b/mozilla/layout/generic/nsIFrameDebug.h index c0dd81deaec..591d94247da 100644 --- a/mozilla/layout/generic/nsIFrameDebug.h +++ b/mozilla/layout/generic/nsIFrameDebug.h @@ -78,23 +78,6 @@ public: */ NS_IMETHOD DumpRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent, PRBool aIncludeStyleData) = 0; - /** - * Get the size of the frame object. The size value should include - * all subordinate data referenced by the frame that is not - * accounted for by child frames. However, this value should not - * include the content objects, style contexts, views or other data - * that lies logically outside the frame system. - * - * If the implementation so chooses, instead of returning the total - * subordinate data it may instead use the sizeof handler to store - * away subordinate data under its own key so that the subordinate - * data may be tabulated independently of the frame itself. - * - * The caller is responsible for recursing over all child-lists that - * the frame supports. - */ - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const = 0; - NS_IMETHOD VerifyTree() const = 0; /** @@ -140,9 +123,6 @@ public: static void ShowEventTargetFrameBorder(PRBool aEnable); static PRBool GetShowEventTargetFrameBorder(); - virtual void SizeOfStyleContext(nsISizeOfHandler* aSizeOfHandler, - PRUint32& aSize) = 0; - private: NS_IMETHOD_(nsrefcnt) AddRef(void) = 0; NS_IMETHOD_(nsrefcnt) Release(void) = 0; diff --git a/mozilla/layout/generic/nsImageFrame.cpp b/mozilla/layout/generic/nsImageFrame.cpp index 280c90dc0f8..8916e6c36d4 100644 --- a/mozilla/layout/generic/nsImageFrame.cpp +++ b/mozilla/layout/generic/nsImageFrame.cpp @@ -72,7 +72,6 @@ #include "nsIDOMHTMLMapElement.h" #include "nsIStyleSet.h" #include "nsLayoutAtoms.h" -#include "nsISizeOfHandler.h" #include "nsImageMapUtils.h" #include "nsIFrameManager.h" #include "nsIScriptSecurityManager.h" @@ -2278,35 +2277,6 @@ void nsImageFrame::IconLoad::GetPrefs(nsIPresContext *aPresContext) } } -#ifdef DEBUG -NS_IMETHODIMP -nsImageFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ -#if 0 - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum; - mImageLoader.SizeOf(aHandler, &sum); - sum += sizeof(*this) - sizeof(mImageLoader); - if (mImageMap) { - PRBool recorded; - aHandler->RecordObject((void*) mImageMap, &recorded); - if (!recorded) { - PRUint32 mapSize; - mImageMap->SizeOf(aHandler, &mapSize); - aHandler->AddSize(nsLayoutAtoms::imageMap, mapSize); - } - } - *aResult = sum; -#endif - *aResult = 0; - - return NS_OK; -} -#endif - - NS_IMPL_ISUPPORTS2(nsImageListener, imgIDecoderObserver, imgIContainerObserver) nsImageListener::nsImageListener(nsImageFrame *aFrame) : diff --git a/mozilla/layout/generic/nsImageFrame.h b/mozilla/layout/generic/nsImageFrame.h index fc1093f250e..aa6e244c01a 100644 --- a/mozilla/layout/generic/nsImageFrame.h +++ b/mozilla/layout/generic/nsImageFrame.h @@ -151,10 +151,6 @@ public: NS_IMETHOD IsImageComplete(PRBool* aComplete); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - NS_IMETHOD OnStartDecode(imgIRequest *aRequest, nsIPresContext *aCX); NS_IMETHOD OnStartContainer(imgIRequest *aRequest, nsIPresContext *aCX, imgIContainer *aImage); NS_IMETHOD OnStartFrame(imgIRequest *aRequest, nsIPresContext *aCX, gfxIImageFrame *aFrame); diff --git a/mozilla/layout/generic/nsImageMap.cpp b/mozilla/layout/generic/nsImageMap.cpp index 84f2fea4cb8..671778936e8 100644 --- a/mozilla/layout/generic/nsImageMap.cpp +++ b/mozilla/layout/generic/nsImageMap.cpp @@ -44,7 +44,6 @@ #include "nsIURL.h" #include "nsIServiceManager.h" #include "nsNetUtil.h" -#include "nsISizeOfHandler.h" #include "nsTextFragment.h" #include "nsIContent.h" #include "nsIDOMHTMLElement.h" @@ -91,10 +90,6 @@ public: PRBool GetHasURL() const { return mHasURL; } void GetArea(nsIContent** aArea) const; -#ifdef DEBUG - virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - nsCOMPtr mArea; nscoord* mCoords; PRInt32 mNumCoords; @@ -153,18 +148,6 @@ Area::GetArea(nsIContent** aArea) const NS_IF_ADDREF(*aArea); } -#ifdef DEBUG -void -Area::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (aResult) { - PRUint32 sum = sizeof(*this); - sum += mNumCoords * sizeof(nscoord); - *aResult = sum; - } -} -#endif - #include inline PRBool @@ -1246,21 +1229,3 @@ nsImageMap::Destroy(void) } } } - -#ifdef DEBUG -void -nsImageMap::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (aResult) { - PRUint32 sum = sizeof(*this); - PRInt32 i, n = mAreas.Count(); - for (i = 0; i < n; i++) { - Area* area = (Area*) mAreas.ElementAt(i); - PRUint32 areaSize; - area->SizeOf(aHandler, &areaSize); - sum += areaSize; - } - *aResult = sum; - } -} -#endif diff --git a/mozilla/layout/generic/nsImageMap.h b/mozilla/layout/generic/nsImageMap.h index 59428da4404..76bdd6de66a 100644 --- a/mozilla/layout/generic/nsImageMap.h +++ b/mozilla/layout/generic/nsImageMap.h @@ -90,10 +90,6 @@ public: */ void Destroy(void); -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - // nsISupports NS_DECL_ISUPPORTS diff --git a/mozilla/layout/generic/nsInlineFrame.cpp b/mozilla/layout/generic/nsInlineFrame.cpp index a9bfa4786c7..56ea630be5a 100644 --- a/mozilla/layout/generic/nsInlineFrame.cpp +++ b/mozilla/layout/generic/nsInlineFrame.cpp @@ -1366,15 +1366,3 @@ nsPositionedInlineFrame::Reflow(nsIPresContext* aPresContext, return rv; } - -#ifdef DEBUG -NS_IMETHODIMP -nsPositionedInlineFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} -#endif diff --git a/mozilla/layout/generic/nsInlineFrame.h b/mozilla/layout/generic/nsInlineFrame.h index 090cbed1ff6..17b800b15da 100644 --- a/mozilla/layout/generic/nsInlineFrame.h +++ b/mozilla/layout/generic/nsInlineFrame.h @@ -214,9 +214,6 @@ public: virtual ~nsPositionedInlineFrame() { } // useful for debugging NS_IMETHOD Destroy(nsIPresContext* aPresContext); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext, nsIAtom* aListName, diff --git a/mozilla/layout/generic/nsLeafFrame.cpp b/mozilla/layout/generic/nsLeafFrame.cpp index 4b3b4f90d93..08dfbed874f 100644 --- a/mozilla/layout/generic/nsLeafFrame.cpp +++ b/mozilla/layout/generic/nsLeafFrame.cpp @@ -117,16 +117,3 @@ nsLeafFrame::ContentChanged(nsIPresContext* aPresContext, mState |= NS_FRAME_IS_DIRTY; return mParent->ReflowDirtyChild(shell, this); } - -#ifdef DEBUG -NS_IMETHODIMP -nsLeafFrame::SizeOf(nsISizeOfHandler* aHandler, - PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} -#endif diff --git a/mozilla/layout/generic/nsLeafFrame.h b/mozilla/layout/generic/nsLeafFrame.h index 3fd97f128d1..40702d37a8c 100644 --- a/mozilla/layout/generic/nsLeafFrame.h +++ b/mozilla/layout/generic/nsLeafFrame.h @@ -61,9 +61,6 @@ public: NS_IMETHOD ContentChanged(nsIPresContext* aPresContext, nsIContent* aChild, nsISupports* aSubContent); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif protected: virtual ~nsLeafFrame(); diff --git a/mozilla/layout/generic/nsLineBox.cpp b/mozilla/layout/generic/nsLineBox.cpp index 921b2ed2957..bd924687a90 100644 --- a/mozilla/layout/generic/nsLineBox.cpp +++ b/mozilla/layout/generic/nsLineBox.cpp @@ -45,10 +45,6 @@ #include "nsITextContent.h" #include "nsLayoutAtoms.h" -#ifdef DEBUG -#include "nsISizeOfHandler.h" -#endif - #ifdef DEBUG static PRInt32 ctorCount; PRInt32 nsLineBox::GetCtorCount() { return ctorCount; } @@ -507,43 +503,6 @@ nsLineBox::GetCombinedArea(nsRect* aResult) } } -#ifdef DEBUG -nsIAtom* -nsLineBox::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - NS_PRECONDITION(aResult, "null OUT parameter pointer"); - *aResult = sizeof(*this); - - nsIAtom* atom; - if (IsBlock()) { - atom = nsLayoutAtoms::lineBoxBlockSmall; - if (mBlockData) { - atom = nsLayoutAtoms::lineBoxBlockBig; - *aResult += sizeof(*mBlockData); - } - } - else { - atom = nsLayoutAtoms::lineBoxSmall; - if (mInlineData) { - atom = nsLayoutAtoms::lineBoxBig; - *aResult += sizeof(*mInlineData); - - // Add in the size needed for floaters associated with this line - if (HasFloaters()) { - PRUint32 floatersSize; - mInlineData->mFloaters.SizeOf(aHandler, &floatersSize); - - // Base size of embedded object was included in sizeof(*this) above - floatersSize -= sizeof(mInlineData->mFloaters); - aHandler->AddSize(nsLayoutAtoms::lineBoxFloaters, floatersSize); - } - } - } - - return atom; -} -#endif - //---------------------------------------------------------------------- @@ -1067,20 +1026,6 @@ nsFloaterCacheList::Remove(nsFloaterCache* aElement) } } -#ifdef DEBUG -void -nsFloaterCacheList::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - NS_PRECONDITION(aResult, "null OUT parameter pointer"); - *aResult = sizeof(*this); - - // Add in the space for each floater - for (nsFloaterCache* cache = Head(); cache; cache = cache->Next()) { - *aResult += sizeof(*cache); - } -} -#endif - //---------------------------------------------------------------------- void diff --git a/mozilla/layout/generic/nsLineBox.h b/mozilla/layout/generic/nsLineBox.h index 072be83fdf3..65ac0144f1a 100644 --- a/mozilla/layout/generic/nsLineBox.h +++ b/mozilla/layout/generic/nsLineBox.h @@ -42,7 +42,6 @@ #include "nsVoidArray.h" #include "nsPlaceholderFrame.h" #include "nsILineIterator.h" -#include "nsISizeOfHandler.h" class nsSpaceManager; class nsLineBox; @@ -118,10 +117,6 @@ public: void Append(nsFloaterCacheFreeList& aList); -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - protected: nsFloaterCache* mHead; @@ -405,7 +400,6 @@ public: PRBool *aResult) const; #ifdef DEBUG - nsIAtom* SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; static PRInt32 GetCtorCount(); #endif diff --git a/mozilla/layout/generic/nsPlaceholderFrame.cpp b/mozilla/layout/generic/nsPlaceholderFrame.cpp index 83ee0f7b7a1..da8138765c6 100644 --- a/mozilla/layout/generic/nsPlaceholderFrame.cpp +++ b/mozilla/layout/generic/nsPlaceholderFrame.cpp @@ -157,15 +157,4 @@ nsPlaceholderFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aInden fputs("\n", out); return NS_OK; } - -NS_IMETHODIMP -nsPlaceholderFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} - #endif diff --git a/mozilla/layout/generic/nsPlaceholderFrame.h b/mozilla/layout/generic/nsPlaceholderFrame.h index 78b53a51b9d..e12b8f3269d 100644 --- a/mozilla/layout/generic/nsPlaceholderFrame.h +++ b/mozilla/layout/generic/nsPlaceholderFrame.h @@ -82,7 +82,6 @@ public: NS_IMETHOD GetFrameType(nsIAtom** aType) const; #ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; NS_IMETHOD GetFrameName(nsAString& aResult) const; #endif diff --git a/mozilla/layout/generic/nsSpaceManager.cpp b/mozilla/layout/generic/nsSpaceManager.cpp index 153fe2ffbae..63dbcb0ca10 100644 --- a/mozilla/layout/generic/nsSpaceManager.cpp +++ b/mozilla/layout/generic/nsSpaceManager.cpp @@ -1414,34 +1414,3 @@ nsSpaceManager::BandRect::Length() const return len; } - -#ifdef DEBUG -void -nsSpaceManager::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - NS_PRECONDITION(aResult, "null OUT parameter pointer"); - *aResult = sizeof(*this); - - // Add in the size of the band data. Don't count the header which has - // already been taken into account - if (!mBandList.IsEmpty()) { - const BandRect* bandRect = mBandList.Head(); - do { - *aResult += sizeof(*bandRect); - if (bandRect->mNumFrames > 1) { - PRUint32 voidArraySize; - - bandRect->mFrames->SizeOf(aHandler, &voidArraySize); - *aResult += voidArraySize; - } - - bandRect = bandRect->Next(); - } while (bandRect != &mBandList); - } - - // Add in the size of the frame info map - for (FrameInfo* info = mFrameInfoMap; info; info = info->mNext) { - *aResult += sizeof(*info); - } -} -#endif diff --git a/mozilla/layout/generic/nsSpaceManager.h b/mozilla/layout/generic/nsSpaceManager.h index 3e6d343ab34..f564ddae73f 100644 --- a/mozilla/layout/generic/nsSpaceManager.h +++ b/mozilla/layout/generic/nsSpaceManager.h @@ -47,7 +47,6 @@ class nsIPresShell; class nsIFrame; class nsVoidArray; -class nsISizeOfHandler; struct nsSize; #define NS_SPACE_MANAGER_CACHE_SIZE 4 @@ -320,8 +319,6 @@ public: * Dump the state of the spacemanager out to a file */ nsresult List(FILE* out); - - void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; #endif protected: diff --git a/mozilla/layout/generic/nsSplittableFrame.cpp b/mozilla/layout/generic/nsSplittableFrame.cpp index 2e201b1292d..dfc38f2db21 100644 --- a/mozilla/layout/generic/nsSplittableFrame.cpp +++ b/mozilla/layout/generic/nsSplittableFrame.cpp @@ -38,7 +38,6 @@ #include "nsIContent.h" #include "nsIPresContext.h" #include "nsStyleContext.h" -#include "nsISizeOfHandler.h" NS_IMETHODIMP nsSplittableFrame::Init(nsIPresContext* aPresContext, @@ -183,14 +182,4 @@ nsSplittableFrame::DumpBaseRegressionData(nsIPresContext* aPresContext, FILE* ou } } - -NS_IMETHODIMP -nsSplittableFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} #endif diff --git a/mozilla/layout/generic/nsSplittableFrame.h b/mozilla/layout/generic/nsSplittableFrame.h index f2db6b93a61..83be42d5adf 100644 --- a/mozilla/layout/generic/nsSplittableFrame.h +++ b/mozilla/layout/generic/nsSplittableFrame.h @@ -53,10 +53,6 @@ public: NS_IMETHOD Destroy(nsIPresContext* aPresContext); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - // Flow member functions. NS_IMETHOD GetPrevInFlow(nsIFrame** aPrevInFlow) const; NS_IMETHOD SetPrevInFlow(nsIFrame*); diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index 9864ce512d5..7e76bf08750 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -441,7 +441,6 @@ public: #ifdef DEBUG NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; NS_IMETHOD GetFrameName(nsAString& aResult) const; #endif @@ -890,10 +889,6 @@ public: } virtual nsIFrame* GetFirstInFlow() const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - protected: nsIFrame* mPrevInFlow; }; @@ -971,19 +966,6 @@ nsContinuingTextFrame::GetFirstInFlow() const return firstInFlow; } -#ifdef DEBUG -NS_IMETHODIMP -nsContinuingTextFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} -#endif - - inline nscolor EnsureDifferentColors(nscolor colorA, nscolor colorB) { if (colorA == colorB) @@ -6118,16 +6100,6 @@ nsTextFrame::IsEmpty(nsCompatibility aCompatMode, } #ifdef DEBUG -NS_IMETHODIMP -nsTextFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} - NS_IMETHODIMP nsTextFrame::GetFrameName(nsAString& aResult) const { diff --git a/mozilla/layout/generic/nsViewportFrame.cpp b/mozilla/layout/generic/nsViewportFrame.cpp index 66c9fda2657..a0921565a45 100644 --- a/mozilla/layout/generic/nsViewportFrame.cpp +++ b/mozilla/layout/generic/nsViewportFrame.cpp @@ -366,14 +366,4 @@ ViewportFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("Viewport"), aResult); } - -NS_IMETHODIMP -ViewportFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} #endif diff --git a/mozilla/layout/generic/nsViewportFrame.h b/mozilla/layout/generic/nsViewportFrame.h index 2a64b79d72e..de2b30c36d8 100644 --- a/mozilla/layout/generic/nsViewportFrame.h +++ b/mozilla/layout/generic/nsViewportFrame.h @@ -117,7 +117,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; #endif protected: diff --git a/mozilla/layout/html/base/src/nsAreaFrame.cpp b/mozilla/layout/html/base/src/nsAreaFrame.cpp index 27fd2843e28..9af669c6aa3 100644 --- a/mozilla/layout/html/base/src/nsAreaFrame.cpp +++ b/mozilla/layout/html/base/src/nsAreaFrame.cpp @@ -45,7 +45,6 @@ #include "nsHTMLValue.h" #include "nsHTMLParts.h" #include "nsLayoutAtoms.h" -#include "nsISizeOfHandler.h" #ifdef INCLUDE_XUL #include "nsINameSpaceManager.h" @@ -206,16 +205,4 @@ nsAreaFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("Area"), aResult); } - -NS_IMETHODIMP -nsAreaFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - nsBlockFrame::SizeOf(aHandler, aResult); - *aResult += sizeof(*this) - sizeof(nsBlockFrame); - - return NS_OK; -} #endif diff --git a/mozilla/layout/html/base/src/nsAreaFrame.h b/mozilla/layout/html/base/src/nsAreaFrame.h index add72c3cd9a..701e0df2849 100644 --- a/mozilla/layout/html/base/src/nsAreaFrame.h +++ b/mozilla/layout/html/base/src/nsAreaFrame.h @@ -84,7 +84,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; #endif protected: diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index 508cd9989c8..280ac87105f 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -66,7 +66,6 @@ #include "nsLayoutAtoms.h" #include "nsITextContent.h" #include "nsStyleChangeList.h" -#include "nsISizeOfHandler.h" #include "nsIFocusTracker.h" #include "nsIFrameSelection.h" #include "nsSpaceManager.h" @@ -6276,28 +6275,6 @@ nsBlockFrame::VerifyTree() const // XXX rewrite this return NS_OK; } - -NS_IMETHODIMP -nsBlockFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aHandler || !aResult) { - return NS_ERROR_NULL_POINTER; - } - - PRUint32 sum = sizeof(*this); - - // Add in size of each line object - for (const_line_iterator line = begin_lines(), line_end = end_lines(); - line != line_end; - ++line) { - PRUint32 lineBoxSize; - nsIAtom* atom = line->SizeOf(aHandler, &lineBoxSize); - aHandler->AddSize(atom, lineBoxSize); - } - - *aResult = sum; - return NS_OK; -} #endif // End Debugging diff --git a/mozilla/layout/html/base/src/nsBlockFrame.h b/mozilla/layout/html/base/src/nsBlockFrame.h index 623cff9ad41..d61ac2c64ad 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.h +++ b/mozilla/layout/html/base/src/nsBlockFrame.h @@ -134,7 +134,6 @@ public: #ifdef DEBUG NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const; NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; NS_IMETHOD VerifyTree() const; #endif NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext, const nsPoint& aPoint, nsFramePaintLayer aWhichLayer, nsIFrame** aFrame); diff --git a/mozilla/layout/html/base/src/nsContainerFrame.cpp b/mozilla/layout/html/base/src/nsContainerFrame.cpp index d7a65cea61c..4a5caec0ee0 100644 --- a/mozilla/layout/html/base/src/nsContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsContainerFrame.cpp @@ -47,7 +47,6 @@ #include "nsIView.h" #include "nsIScrollableView.h" #include "nsVoidArray.h" -#include "nsISizeOfHandler.h" #include "nsHTMLReflowCommand.h" #include "nsHTMLContainerFrame.h" #include "nsIFrameManager.h" @@ -1361,14 +1360,4 @@ nsContainerFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) return NS_OK; } - -NS_IMETHODIMP -nsContainerFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} #endif diff --git a/mozilla/layout/html/base/src/nsContainerFrame.h b/mozilla/layout/html/base/src/nsContainerFrame.h index 8b859a1701b..87113733e88 100644 --- a/mozilla/layout/html/base/src/nsContainerFrame.h +++ b/mozilla/layout/html/base/src/nsContainerFrame.h @@ -84,7 +84,6 @@ public: #ifdef DEBUG NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; #endif // nsContainerFrame methods diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index 5fe6b2a23cd..01cfe66c430 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -56,7 +56,6 @@ #include "prlog.h" #include "prprf.h" #include -#include "nsISizeOfHandler.h" #include "nsIFrameManager.h" #include "nsCSSRendering.h" #ifdef ACCESSIBILITY @@ -2776,15 +2775,6 @@ nsFrame::MakeFrameName(const nsAString& aType, nsAString& aResult) const aResult.Append(NS_ConvertASCIItoUCS2(buf)); return NS_OK; } - -void -nsFrame::SizeOfStyleContext(nsISizeOfHandler* aSizeOfHandler, - PRUint32& aSize) -{ - if (mStyleContext) - mStyleContext->SizeOf(aSizeOfHandler, aSize); -} - #endif void @@ -3053,16 +3043,6 @@ nsFrame::DumpBaseRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 } while (nsnull != list); } -NS_IMETHODIMP -nsFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} - NS_IMETHODIMP nsFrame::VerifyTree() const { diff --git a/mozilla/layout/html/base/src/nsFrame.h b/mozilla/layout/html/base/src/nsFrame.h index 6973021546b..d47453a203b 100644 --- a/mozilla/layout/html/base/src/nsFrame.h +++ b/mozilla/layout/html/base/src/nsFrame.h @@ -255,9 +255,7 @@ public: NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const; NS_IMETHOD GetFrameName(nsAString& aResult) const; NS_IMETHOD DumpRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent, PRBool aIncludeStyleData); - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; NS_IMETHOD VerifyTree() const; - virtual void SizeOfStyleContext(nsISizeOfHandler* aHandler, PRUint32& aSize); #endif NS_IMETHOD SetSelected(nsIPresContext* aPresContext, nsIDOMRange *aRange,PRBool aSelected, nsSpread aSpread); diff --git a/mozilla/layout/html/base/src/nsHRFrame.cpp b/mozilla/layout/html/base/src/nsHRFrame.cpp index 4aac9bd333e..c7adb49d23a 100644 --- a/mozilla/layout/html/base/src/nsHRFrame.cpp +++ b/mozilla/layout/html/base/src/nsHRFrame.cpp @@ -69,9 +69,6 @@ public: nsFramePaintLayer aWhichLayer, PRUint32 aFlags); NS_IMETHOD GetFrameType(nsIAtom** aType) const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif protected: PRBool GetNoShade(); @@ -359,15 +356,3 @@ HRuleFrame::GetFrameType(nsIAtom** aType) const NS_ADDREF(*aType); return NS_OK; } - -#ifdef DEBUG -NS_IMETHODIMP -HRuleFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} -#endif diff --git a/mozilla/layout/html/base/src/nsHTMLFrame.cpp b/mozilla/layout/html/base/src/nsHTMLFrame.cpp index 549422003b5..a4924345e4e 100644 --- a/mozilla/layout/html/base/src/nsHTMLFrame.cpp +++ b/mozilla/layout/html/base/src/nsHTMLFrame.cpp @@ -158,7 +158,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; #endif NS_IMETHOD GetContentForEvent(nsIPresContext* aPresContext, nsEvent* aEvent, @@ -756,14 +755,4 @@ CanvasFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("Canvas"), aResult); } - -NS_IMETHODIMP -CanvasFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} #endif diff --git a/mozilla/layout/html/base/src/nsImageFrame.cpp b/mozilla/layout/html/base/src/nsImageFrame.cpp index 280c90dc0f8..8916e6c36d4 100644 --- a/mozilla/layout/html/base/src/nsImageFrame.cpp +++ b/mozilla/layout/html/base/src/nsImageFrame.cpp @@ -72,7 +72,6 @@ #include "nsIDOMHTMLMapElement.h" #include "nsIStyleSet.h" #include "nsLayoutAtoms.h" -#include "nsISizeOfHandler.h" #include "nsImageMapUtils.h" #include "nsIFrameManager.h" #include "nsIScriptSecurityManager.h" @@ -2278,35 +2277,6 @@ void nsImageFrame::IconLoad::GetPrefs(nsIPresContext *aPresContext) } } -#ifdef DEBUG -NS_IMETHODIMP -nsImageFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ -#if 0 - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum; - mImageLoader.SizeOf(aHandler, &sum); - sum += sizeof(*this) - sizeof(mImageLoader); - if (mImageMap) { - PRBool recorded; - aHandler->RecordObject((void*) mImageMap, &recorded); - if (!recorded) { - PRUint32 mapSize; - mImageMap->SizeOf(aHandler, &mapSize); - aHandler->AddSize(nsLayoutAtoms::imageMap, mapSize); - } - } - *aResult = sum; -#endif - *aResult = 0; - - return NS_OK; -} -#endif - - NS_IMPL_ISUPPORTS2(nsImageListener, imgIDecoderObserver, imgIContainerObserver) nsImageListener::nsImageListener(nsImageFrame *aFrame) : diff --git a/mozilla/layout/html/base/src/nsImageFrame.h b/mozilla/layout/html/base/src/nsImageFrame.h index fc1093f250e..aa6e244c01a 100644 --- a/mozilla/layout/html/base/src/nsImageFrame.h +++ b/mozilla/layout/html/base/src/nsImageFrame.h @@ -151,10 +151,6 @@ public: NS_IMETHOD IsImageComplete(PRBool* aComplete); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - NS_IMETHOD OnStartDecode(imgIRequest *aRequest, nsIPresContext *aCX); NS_IMETHOD OnStartContainer(imgIRequest *aRequest, nsIPresContext *aCX, imgIContainer *aImage); NS_IMETHOD OnStartFrame(imgIRequest *aRequest, nsIPresContext *aCX, gfxIImageFrame *aFrame); diff --git a/mozilla/layout/html/base/src/nsImageMap.cpp b/mozilla/layout/html/base/src/nsImageMap.cpp index 84f2fea4cb8..671778936e8 100644 --- a/mozilla/layout/html/base/src/nsImageMap.cpp +++ b/mozilla/layout/html/base/src/nsImageMap.cpp @@ -44,7 +44,6 @@ #include "nsIURL.h" #include "nsIServiceManager.h" #include "nsNetUtil.h" -#include "nsISizeOfHandler.h" #include "nsTextFragment.h" #include "nsIContent.h" #include "nsIDOMHTMLElement.h" @@ -91,10 +90,6 @@ public: PRBool GetHasURL() const { return mHasURL; } void GetArea(nsIContent** aArea) const; -#ifdef DEBUG - virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - nsCOMPtr mArea; nscoord* mCoords; PRInt32 mNumCoords; @@ -153,18 +148,6 @@ Area::GetArea(nsIContent** aArea) const NS_IF_ADDREF(*aArea); } -#ifdef DEBUG -void -Area::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (aResult) { - PRUint32 sum = sizeof(*this); - sum += mNumCoords * sizeof(nscoord); - *aResult = sum; - } -} -#endif - #include inline PRBool @@ -1246,21 +1229,3 @@ nsImageMap::Destroy(void) } } } - -#ifdef DEBUG -void -nsImageMap::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (aResult) { - PRUint32 sum = sizeof(*this); - PRInt32 i, n = mAreas.Count(); - for (i = 0; i < n; i++) { - Area* area = (Area*) mAreas.ElementAt(i); - PRUint32 areaSize; - area->SizeOf(aHandler, &areaSize); - sum += areaSize; - } - *aResult = sum; - } -} -#endif diff --git a/mozilla/layout/html/base/src/nsImageMap.h b/mozilla/layout/html/base/src/nsImageMap.h index 59428da4404..76bdd6de66a 100644 --- a/mozilla/layout/html/base/src/nsImageMap.h +++ b/mozilla/layout/html/base/src/nsImageMap.h @@ -90,10 +90,6 @@ public: */ void Destroy(void); -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - // nsISupports NS_DECL_ISUPPORTS diff --git a/mozilla/layout/html/base/src/nsInlineFrame.cpp b/mozilla/layout/html/base/src/nsInlineFrame.cpp index a9bfa4786c7..56ea630be5a 100644 --- a/mozilla/layout/html/base/src/nsInlineFrame.cpp +++ b/mozilla/layout/html/base/src/nsInlineFrame.cpp @@ -1366,15 +1366,3 @@ nsPositionedInlineFrame::Reflow(nsIPresContext* aPresContext, return rv; } - -#ifdef DEBUG -NS_IMETHODIMP -nsPositionedInlineFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} -#endif diff --git a/mozilla/layout/html/base/src/nsInlineFrame.h b/mozilla/layout/html/base/src/nsInlineFrame.h index 090cbed1ff6..17b800b15da 100644 --- a/mozilla/layout/html/base/src/nsInlineFrame.h +++ b/mozilla/layout/html/base/src/nsInlineFrame.h @@ -214,9 +214,6 @@ public: virtual ~nsPositionedInlineFrame() { } // useful for debugging NS_IMETHOD Destroy(nsIPresContext* aPresContext); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext, nsIAtom* aListName, diff --git a/mozilla/layout/html/base/src/nsLeafFrame.cpp b/mozilla/layout/html/base/src/nsLeafFrame.cpp index 4b3b4f90d93..08dfbed874f 100644 --- a/mozilla/layout/html/base/src/nsLeafFrame.cpp +++ b/mozilla/layout/html/base/src/nsLeafFrame.cpp @@ -117,16 +117,3 @@ nsLeafFrame::ContentChanged(nsIPresContext* aPresContext, mState |= NS_FRAME_IS_DIRTY; return mParent->ReflowDirtyChild(shell, this); } - -#ifdef DEBUG -NS_IMETHODIMP -nsLeafFrame::SizeOf(nsISizeOfHandler* aHandler, - PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} -#endif diff --git a/mozilla/layout/html/base/src/nsLeafFrame.h b/mozilla/layout/html/base/src/nsLeafFrame.h index 3fd97f128d1..40702d37a8c 100644 --- a/mozilla/layout/html/base/src/nsLeafFrame.h +++ b/mozilla/layout/html/base/src/nsLeafFrame.h @@ -61,9 +61,6 @@ public: NS_IMETHOD ContentChanged(nsIPresContext* aPresContext, nsIContent* aChild, nsISupports* aSubContent); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif protected: virtual ~nsLeafFrame(); diff --git a/mozilla/layout/html/base/src/nsLineBox.cpp b/mozilla/layout/html/base/src/nsLineBox.cpp index 921b2ed2957..bd924687a90 100644 --- a/mozilla/layout/html/base/src/nsLineBox.cpp +++ b/mozilla/layout/html/base/src/nsLineBox.cpp @@ -45,10 +45,6 @@ #include "nsITextContent.h" #include "nsLayoutAtoms.h" -#ifdef DEBUG -#include "nsISizeOfHandler.h" -#endif - #ifdef DEBUG static PRInt32 ctorCount; PRInt32 nsLineBox::GetCtorCount() { return ctorCount; } @@ -507,43 +503,6 @@ nsLineBox::GetCombinedArea(nsRect* aResult) } } -#ifdef DEBUG -nsIAtom* -nsLineBox::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - NS_PRECONDITION(aResult, "null OUT parameter pointer"); - *aResult = sizeof(*this); - - nsIAtom* atom; - if (IsBlock()) { - atom = nsLayoutAtoms::lineBoxBlockSmall; - if (mBlockData) { - atom = nsLayoutAtoms::lineBoxBlockBig; - *aResult += sizeof(*mBlockData); - } - } - else { - atom = nsLayoutAtoms::lineBoxSmall; - if (mInlineData) { - atom = nsLayoutAtoms::lineBoxBig; - *aResult += sizeof(*mInlineData); - - // Add in the size needed for floaters associated with this line - if (HasFloaters()) { - PRUint32 floatersSize; - mInlineData->mFloaters.SizeOf(aHandler, &floatersSize); - - // Base size of embedded object was included in sizeof(*this) above - floatersSize -= sizeof(mInlineData->mFloaters); - aHandler->AddSize(nsLayoutAtoms::lineBoxFloaters, floatersSize); - } - } - } - - return atom; -} -#endif - //---------------------------------------------------------------------- @@ -1067,20 +1026,6 @@ nsFloaterCacheList::Remove(nsFloaterCache* aElement) } } -#ifdef DEBUG -void -nsFloaterCacheList::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - NS_PRECONDITION(aResult, "null OUT parameter pointer"); - *aResult = sizeof(*this); - - // Add in the space for each floater - for (nsFloaterCache* cache = Head(); cache; cache = cache->Next()) { - *aResult += sizeof(*cache); - } -} -#endif - //---------------------------------------------------------------------- void diff --git a/mozilla/layout/html/base/src/nsLineBox.h b/mozilla/layout/html/base/src/nsLineBox.h index 072be83fdf3..65ac0144f1a 100644 --- a/mozilla/layout/html/base/src/nsLineBox.h +++ b/mozilla/layout/html/base/src/nsLineBox.h @@ -42,7 +42,6 @@ #include "nsVoidArray.h" #include "nsPlaceholderFrame.h" #include "nsILineIterator.h" -#include "nsISizeOfHandler.h" class nsSpaceManager; class nsLineBox; @@ -118,10 +117,6 @@ public: void Append(nsFloaterCacheFreeList& aList); -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - protected: nsFloaterCache* mHead; @@ -405,7 +400,6 @@ public: PRBool *aResult) const; #ifdef DEBUG - nsIAtom* SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; static PRInt32 GetCtorCount(); #endif diff --git a/mozilla/layout/html/base/src/nsPlaceholderFrame.cpp b/mozilla/layout/html/base/src/nsPlaceholderFrame.cpp index 83ee0f7b7a1..da8138765c6 100644 --- a/mozilla/layout/html/base/src/nsPlaceholderFrame.cpp +++ b/mozilla/layout/html/base/src/nsPlaceholderFrame.cpp @@ -157,15 +157,4 @@ nsPlaceholderFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aInden fputs("\n", out); return NS_OK; } - -NS_IMETHODIMP -nsPlaceholderFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} - #endif diff --git a/mozilla/layout/html/base/src/nsPlaceholderFrame.h b/mozilla/layout/html/base/src/nsPlaceholderFrame.h index 78b53a51b9d..e12b8f3269d 100644 --- a/mozilla/layout/html/base/src/nsPlaceholderFrame.h +++ b/mozilla/layout/html/base/src/nsPlaceholderFrame.h @@ -82,7 +82,6 @@ public: NS_IMETHOD GetFrameType(nsIAtom** aType) const; #ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; NS_IMETHOD GetFrameName(nsAString& aResult) const; #endif diff --git a/mozilla/layout/html/base/src/nsScrollFrame.cpp b/mozilla/layout/html/base/src/nsScrollFrame.cpp index 745f2795af6..a482472758c 100644 --- a/mozilla/layout/html/base/src/nsScrollFrame.cpp +++ b/mozilla/layout/html/base/src/nsScrollFrame.cpp @@ -1154,14 +1154,4 @@ nsScrollFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("Scroll"), aResult); } - -NS_IMETHODIMP -nsScrollFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} #endif diff --git a/mozilla/layout/html/base/src/nsScrollFrame.h b/mozilla/layout/html/base/src/nsScrollFrame.h index c9065a3662e..9ecd0a7f2af 100644 --- a/mozilla/layout/html/base/src/nsScrollFrame.h +++ b/mozilla/layout/html/base/src/nsScrollFrame.h @@ -150,7 +150,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; #endif //nsIStatefulFrame diff --git a/mozilla/layout/html/base/src/nsSplittableFrame.cpp b/mozilla/layout/html/base/src/nsSplittableFrame.cpp index 2e201b1292d..dfc38f2db21 100644 --- a/mozilla/layout/html/base/src/nsSplittableFrame.cpp +++ b/mozilla/layout/html/base/src/nsSplittableFrame.cpp @@ -38,7 +38,6 @@ #include "nsIContent.h" #include "nsIPresContext.h" #include "nsStyleContext.h" -#include "nsISizeOfHandler.h" NS_IMETHODIMP nsSplittableFrame::Init(nsIPresContext* aPresContext, @@ -183,14 +182,4 @@ nsSplittableFrame::DumpBaseRegressionData(nsIPresContext* aPresContext, FILE* ou } } - -NS_IMETHODIMP -nsSplittableFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} #endif diff --git a/mozilla/layout/html/base/src/nsSplittableFrame.h b/mozilla/layout/html/base/src/nsSplittableFrame.h index f2db6b93a61..83be42d5adf 100644 --- a/mozilla/layout/html/base/src/nsSplittableFrame.h +++ b/mozilla/layout/html/base/src/nsSplittableFrame.h @@ -53,10 +53,6 @@ public: NS_IMETHOD Destroy(nsIPresContext* aPresContext); -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - // Flow member functions. NS_IMETHOD GetPrevInFlow(nsIFrame** aPrevInFlow) const; NS_IMETHOD SetPrevInFlow(nsIFrame*); diff --git a/mozilla/layout/html/base/src/nsTextFrame.cpp b/mozilla/layout/html/base/src/nsTextFrame.cpp index 9864ce512d5..7e76bf08750 100644 --- a/mozilla/layout/html/base/src/nsTextFrame.cpp +++ b/mozilla/layout/html/base/src/nsTextFrame.cpp @@ -441,7 +441,6 @@ public: #ifdef DEBUG NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; NS_IMETHOD GetFrameName(nsAString& aResult) const; #endif @@ -890,10 +889,6 @@ public: } virtual nsIFrame* GetFirstInFlow() const; -#ifdef DEBUG - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - protected: nsIFrame* mPrevInFlow; }; @@ -971,19 +966,6 @@ nsContinuingTextFrame::GetFirstInFlow() const return firstInFlow; } -#ifdef DEBUG -NS_IMETHODIMP -nsContinuingTextFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} -#endif - - inline nscolor EnsureDifferentColors(nscolor colorA, nscolor colorB) { if (colorA == colorB) @@ -6118,16 +6100,6 @@ nsTextFrame::IsEmpty(nsCompatibility aCompatMode, } #ifdef DEBUG -NS_IMETHODIMP -nsTextFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} - NS_IMETHODIMP nsTextFrame::GetFrameName(nsAString& aResult) const { diff --git a/mozilla/layout/html/base/src/nsViewportFrame.cpp b/mozilla/layout/html/base/src/nsViewportFrame.cpp index 66c9fda2657..a0921565a45 100644 --- a/mozilla/layout/html/base/src/nsViewportFrame.cpp +++ b/mozilla/layout/html/base/src/nsViewportFrame.cpp @@ -366,14 +366,4 @@ ViewportFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("Viewport"), aResult); } - -NS_IMETHODIMP -ViewportFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} #endif diff --git a/mozilla/layout/html/base/src/nsViewportFrame.h b/mozilla/layout/html/base/src/nsViewportFrame.h index 2a64b79d72e..de2b30c36d8 100644 --- a/mozilla/layout/html/base/src/nsViewportFrame.h +++ b/mozilla/layout/html/base/src/nsViewportFrame.h @@ -117,7 +117,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; #endif protected: diff --git a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.h b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.h index 69883aabd2c..df5ce3a1d2c 100644 --- a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.h +++ b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.h @@ -244,12 +244,6 @@ protected: */ void ContinuingFrameCheck(); -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const { - *aResult = sizeof(*this); - } -#endif - protected: nsTableFrame * mTableFrame; PRInt32 mCols; diff --git a/mozilla/layout/html/table/src/FixedTableLayoutStrategy.h b/mozilla/layout/html/table/src/FixedTableLayoutStrategy.h index bb942f72b66..ad40219b79d 100644 --- a/mozilla/layout/html/table/src/FixedTableLayoutStrategy.h +++ b/mozilla/layout/html/table/src/FixedTableLayoutStrategy.h @@ -85,12 +85,6 @@ public: nscoord aAvailWidth, float aPixelToTwips) {return 0;}; -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const { - *aResult = sizeof(*this); - } -#endif - protected: /* assign the width of all columns * if there is a colframe with a width attribute, use it as the column width. diff --git a/mozilla/layout/html/table/src/nsCellMap.cpp b/mozilla/layout/html/table/src/nsCellMap.cpp index b05fd01d918..4b0d9e99b0b 100644 --- a/mozilla/layout/html/table/src/nsCellMap.cpp +++ b/mozilla/layout/html/table/src/nsCellMap.cpp @@ -966,28 +966,6 @@ nsTableCellMap::SetBCBorderCorner(Corner aCorner, else NS_ASSERTION(PR_FALSE, "program error"); } -#ifdef DEBUG -void nsTableCellMap::SizeOf(nsISizeOfHandler* aHandler, - PRUint32* aResult) const -{ - NS_PRECONDITION(aResult, "null OUT parameter pointer"); - PRUint32 sum = sizeof(*this); - - // Add in the size of the void arrays. Because we have emnbedded objects - // and not pointers to void arrays, we need to subtract out the size of the - // embedded object so it isn't double counted - PRUint32 voidArraySize; - - mCols.SizeOf(aHandler, &voidArraySize); - sum += voidArraySize - sizeof(mCols); - - // XXX need to so something for mBCInfo - *aResult = sum; -} -#endif - -// nsCellMap - nsCellMap::nsCellMap(nsTableRowGroupFrame& aRowGroup) : mRowCount(0), mRowGroupFrame(&aRowGroup), mNextSibling(nsnull) { @@ -2389,21 +2367,3 @@ PRBool nsCellMap::ColHasSpanningCells(nsTableCellMap& aMap, } return PR_FALSE; } - -#ifdef DEBUG -void nsCellMap::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - NS_PRECONDITION(aResult, "null OUT parameter pointer"); - PRUint32 sum = sizeof(*this); - - // Add in the size of the void arrays. Because we have emnbedded objects - // and not pointers to void arrays, we need to subtract out the size of the - // embedded object so it isn't double counted - PRUint32 voidArraySize; - - mRows.SizeOf(aHandler, &voidArraySize); - sum += voidArraySize - sizeof(mRows); - - *aResult = sum; -} -#endif diff --git a/mozilla/layout/html/table/src/nsCellMap.h b/mozilla/layout/html/table/src/nsCellMap.h index a9e1b94c6c3..14d51ad2b3f 100644 --- a/mozilla/layout/html/table/src/nsCellMap.h +++ b/mozilla/layout/html/table/src/nsCellMap.h @@ -193,10 +193,6 @@ public: void Dump(char* aString = nsnull) const; #endif -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - protected: BCData* GetRightMostBorder(PRInt32 aRowIndex); BCData* GetBottomMostBorder(PRInt32 aColIndex); @@ -339,10 +335,6 @@ public: void Dump(PRBool aIsBorderCollapse) const; #endif -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - protected: friend class nsTableCellMap; friend class BCMapCellIterator; diff --git a/mozilla/layout/html/table/src/nsITableLayoutStrategy.h b/mozilla/layout/html/table/src/nsITableLayoutStrategy.h index d8e717faba7..8329a6374a2 100644 --- a/mozilla/layout/html/table/src/nsITableLayoutStrategy.h +++ b/mozilla/layout/html/table/src/nsITableLayoutStrategy.h @@ -46,7 +46,6 @@ struct nsHTMLReflowState; struct nsMargin; class nsTableCellFrame; class nsStyleCoord; -class nsISizeOfHandler; class nsITableLayoutStrategy { @@ -79,10 +78,6 @@ public: const nsHTMLReflowState& aReflowState, nscoord aAvailWidth, float aPixelToTwips)=0; - -#ifdef DEBUG - virtual void SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const = 0; -#endif }; #endif diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.cpp b/mozilla/layout/html/table/src/nsTableCellFrame.cpp index 7b3c7e1d7b9..a4c9884be59 100644 --- a/mozilla/layout/html/table/src/nsTableCellFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableCellFrame.cpp @@ -1425,19 +1425,6 @@ void nsTableCellFrame::GetCollapseOffset(nsIPresContext* aPresContext, } } -#ifdef DEBUG -NS_IMETHODIMP -nsTableCellFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - *aResult = sum; - return NS_OK; -} -#endif - // nsBCTableCellFrame nsBCTableCellFrame::nsBCTableCellFrame() @@ -1561,17 +1548,3 @@ nsBCTableCellFrame::PaintUnderlay(nsIPresContext& aPresContext, // don't paint the children if it's pass1 aPaintChildren = (aFlags & BORDER_COLLAPSE_BACKGROUNDS); } - -#ifdef DEBUG -NS_IMETHODIMP -nsBCTableCellFrame::SizeOf(nsISizeOfHandler* aHandler, - PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - *aResult = sum; - return NS_OK; -} -#endif diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.h b/mozilla/layout/html/table/src/nsTableCellFrame.h index 4db09980812..406cf087301 100644 --- a/mozilla/layout/html/table/src/nsTableCellFrame.h +++ b/mozilla/layout/html/table/src/nsTableCellFrame.h @@ -162,7 +162,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif virtual void VerticallyAlignChild(nsIPresContext* aPresContext, @@ -470,7 +469,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif protected: diff --git a/mozilla/layout/html/table/src/nsTableColFrame.cpp b/mozilla/layout/html/table/src/nsTableColFrame.cpp index 4a12e9da353..831652f7957 100644 --- a/mozilla/layout/html/table/src/nsTableColFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableColFrame.cpp @@ -314,15 +314,4 @@ nsTableColFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("TableCol"), aResult); } - -NS_IMETHODIMP -nsTableColFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - *aResult = sum; - return NS_OK; -} #endif diff --git a/mozilla/layout/html/table/src/nsTableColFrame.h b/mozilla/layout/html/table/src/nsTableColFrame.h index 280efa9933b..cdfffd2782c 100644 --- a/mozilla/layout/html/table/src/nsTableColFrame.h +++ b/mozilla/layout/html/table/src/nsTableColFrame.h @@ -135,7 +135,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif /** return the number of the columns the col represents. always >= 0 */ diff --git a/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp index 9221c4540ca..33c7937157d 100644 --- a/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp @@ -752,15 +752,4 @@ nsTableColGroupFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("TableColGroup"), aResult); } - -NS_IMETHODIMP -nsTableColGroupFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - *aResult = sum; - return NS_OK; -} #endif diff --git a/mozilla/layout/html/table/src/nsTableColGroupFrame.h b/mozilla/layout/html/table/src/nsTableColGroupFrame.h index d0f0f556882..6959263b5d9 100644 --- a/mozilla/layout/html/table/src/nsTableColGroupFrame.h +++ b/mozilla/layout/html/table/src/nsTableColGroupFrame.h @@ -148,7 +148,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif /** returns the number of columns represented by this group. diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index 13d4ee48758..0fd618be141 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -70,7 +70,6 @@ #include "nsIDOMElement.h" #include "nsIDOMHTMLElement.h" #include "nsIDOMHTMLBodyElement.h" -#include "nsISizeOfHandler.h" #include "nsIScrollableFrame.h" #include "nsHTMLReflowCommand.h" #include "nsIFrameManager.h" @@ -7443,33 +7442,6 @@ nsTableFrame::GetProperty(nsIPresContext* aPresContext, } #ifdef DEBUG -NS_IMETHODIMP -nsTableFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - - // Add in size of cell map - PRUint32 cellMapSize; - mCellMap->SizeOf(aHandler, &cellMapSize); - aHandler->AddSize(nsLayoutAtoms::cellMap, cellMapSize); - - // Add in size of col cache - PRUint32 voidArraySize; - mColFrames.SizeOf(aHandler, &voidArraySize); - sum += voidArraySize - sizeof(mColFrames); - - // Add in size of table layout strategy - PRUint32 strategySize; - mTableLayoutStrategy->SizeOf(aHandler, &strategySize); - aHandler->AddSize(nsLayoutAtoms::tableStrategy, strategySize); - - *aResult = sum; - return NS_OK; -} - #define MAX_SIZE 128 #define MIN_INDENT 30 diff --git a/mozilla/layout/html/table/src/nsTableFrame.h b/mozilla/layout/html/table/src/nsTableFrame.h index fef8f6c3f41..6e084af087a 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.h +++ b/mozilla/layout/html/table/src/nsTableFrame.h @@ -408,7 +408,6 @@ public: #ifdef DEBUG /** @see nsIFrame::GetFrameName */ NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif /** return the width of the column at aColIndex */ diff --git a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp index 355b0e716fb..f7fbb26558f 100644 --- a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp @@ -2226,15 +2226,4 @@ nsTableOuterFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("TableOuter"), aResult); } - -NS_IMETHODIMP -nsTableOuterFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - *aResult = sum; - return NS_OK; -} #endif diff --git a/mozilla/layout/html/table/src/nsTableOuterFrame.h b/mozilla/layout/html/table/src/nsTableOuterFrame.h index 351bfe535ba..f63c38d8244 100644 --- a/mozilla/layout/html/table/src/nsTableOuterFrame.h +++ b/mozilla/layout/html/table/src/nsTableOuterFrame.h @@ -161,7 +161,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif /** SetSelected needs to be overridden to talk to inner tableframe diff --git a/mozilla/layout/html/table/src/nsTableRowFrame.cpp b/mozilla/layout/html/table/src/nsTableRowFrame.cpp index 138bc5ca288..a68bc699873 100644 --- a/mozilla/layout/html/table/src/nsTableRowFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableRowFrame.cpp @@ -1677,15 +1677,4 @@ nsTableRowFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("TableRow"), aResult); } - -NS_IMETHODIMP -nsTableRowFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - *aResult = sum; - return NS_OK; -} #endif diff --git a/mozilla/layout/html/table/src/nsTableRowFrame.h b/mozilla/layout/html/table/src/nsTableRowFrame.h index aa46d78af04..85130f9244a 100644 --- a/mozilla/layout/html/table/src/nsTableRowFrame.h +++ b/mozilla/layout/html/table/src/nsTableRowFrame.h @@ -153,8 +153,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const; #endif void UpdateHeight(nscoord aHeight, diff --git a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp index e03dc0f4371..cdae7cc4cab 100644 --- a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp @@ -1895,17 +1895,6 @@ nsTableRowGroupFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("TableRowGroup"), aResult); } - -NS_IMETHODIMP -nsTableRowGroupFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - *aResult = sum; - return NS_OK; -} #endif nsMargin* diff --git a/mozilla/layout/html/table/src/nsTableRowGroupFrame.h b/mozilla/layout/html/table/src/nsTableRowGroupFrame.h index 1b82f15fdec..94d3bae2125 100644 --- a/mozilla/layout/html/table/src/nsTableRowGroupFrame.h +++ b/mozilla/layout/html/table/src/nsTableRowGroupFrame.h @@ -186,7 +186,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif /** return the number of child rows (not necessarily == number of child frames) */ diff --git a/mozilla/layout/style/nsCSSDeclaration.cpp b/mozilla/layout/style/nsCSSDeclaration.cpp index 8697e7235ca..1d79b3710f2 100644 --- a/mozilla/layout/style/nsCSSDeclaration.cpp +++ b/mozilla/layout/style/nsCSSDeclaration.cpp @@ -51,7 +51,6 @@ #include "nsCOMPtr.h" #include "nsIStyleSet.h" -#include "nsISizeOfHandler.h" // #define DEBUG_REFS @@ -6103,102 +6102,6 @@ void nsCSSDeclaration::List(FILE* out, PRInt32 aIndent) const mImportant->List(out, 0); } } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as nsCSSDeclaration's size): -* 1) sizeof(*this) + the sizeof each non-null attribute -* -* Contained / Aggregated data (not reported as nsCSSDeclaration's size): -* none -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void nsCSSDeclaration::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("nsCSSDeclaration"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - - // now add in all of the contained objects, checking for duplicates on all of them - CSS_VARONSTACK_GET(Font); - if(theFont && uniqueItems->AddItem(theFont)){ - aSize += sizeof(*theFont); - } - CSS_VARONSTACK_GET(Color); - if(theColor && uniqueItems->AddItem(theColor)){ - aSize += sizeof(*theColor); - } - CSS_VARONSTACK_GET(Text); - if(theText && uniqueItems->AddItem(theText)){ - aSize += sizeof(*theText); - } - CSS_VARONSTACK_GET(Margin); - if(theMargin && uniqueItems->AddItem(theMargin)){ - aSize += sizeof(*theMargin); - } - CSS_VARONSTACK_GET(Position); - if(thePosition && uniqueItems->AddItem(thePosition)){ - aSize += sizeof(*thePosition); - } - CSS_VARONSTACK_GET(List); - if(theList && uniqueItems->AddItem(theList)){ - aSize += sizeof(*theList); - } - CSS_VARONSTACK_GET(Display); - if(theDisplay && uniqueItems->AddItem(theDisplay)){ - aSize += sizeof(*theDisplay); - } - CSS_VARONSTACK_GET(Table); - if(theTable && uniqueItems->AddItem(theTable)){ - aSize += sizeof(*theTable); - } - CSS_VARONSTACK_GET(Breaks); - if(theBreaks && uniqueItems->AddItem(theBreaks)){ - aSize += sizeof(*theBreaks); - } - CSS_VARONSTACK_GET(Page); - if(thePage && uniqueItems->AddItem(thePage)){ - aSize += sizeof(*thePage); - } - CSS_VARONSTACK_GET(Content); - if(theContent && uniqueItems->AddItem(theContent)){ - aSize += sizeof(*theContent); - } - CSS_VARONSTACK_GET(UserInterface); - if(theUserInterface && uniqueItems->AddItem(theUserInterface)){ - aSize += sizeof(*theUserInterface); - } -#ifdef INCLUDE_XUL - CSS_VARONSTACK_GET(XUL); - if(theXUL && uniqueItems->AddItem(theXUL)){ - aSize += sizeof(*theXUL); - } -#endif -#ifdef MOZ_SVG - CSS_VARONSTACK_GET(SVG); - if(theSVG && uniqueItems->AddItem(theSVG)){ - aSize += sizeof(*theSVG); - } -#endif - CSS_VARONSTACK_GET(Aural); - if(theAural && uniqueItems->AddItem(theAural)){ - aSize += sizeof(*theAural); - } - aSizeOfHandler->AddSize(tag, aSize); -} #endif PRUint32 diff --git a/mozilla/layout/style/nsCSSDeclaration.h b/mozilla/layout/style/nsCSSDeclaration.h index 5b9b17a9620..7d90322fb62 100644 --- a/mozilla/layout/style/nsCSSDeclaration.h +++ b/mozilla/layout/style/nsCSSDeclaration.h @@ -49,7 +49,6 @@ #include "nsVoidArray.h" #include "nsValueArray.h" -class nsISizeOfHandler; class nsStringArray; struct nsCSSStruct { @@ -653,8 +652,6 @@ public: #ifdef DEBUG void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif protected: diff --git a/mozilla/layout/style/nsCSSRules.cpp b/mozilla/layout/style/nsCSSRules.cpp index 7743e516303..5f0cc134d39 100644 --- a/mozilla/layout/style/nsCSSRules.cpp +++ b/mozilla/layout/style/nsCSSRules.cpp @@ -51,7 +51,6 @@ #include "nsCOMPtr.h" #include "nsIStyleSet.h" -#include "nsISizeOfHandler.h" #include "nsIDOMCSSStyleSheet.h" #include "nsIDOMCSSRule.h" #include "nsIDOMCSSImportRule.h" @@ -180,8 +179,6 @@ public: // nsIStyleRule methods #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif // nsICSSRule methods @@ -243,42 +240,6 @@ CSSCharsetRuleImpl::List(FILE* out, PRInt32 aIndent) const return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSCharSetRuleImpl's size): -* 1) sizeof(*this) + the size of the mEncoding string -* -* Contained / Aggregated data (not reported as CSSCharsetRuleImpl's size): -* none -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSCharsetRuleImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSCharsetRuleImpl"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - // add the string for encoding value - mEncoding.SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - aSize -= sizeof(mEncoding); // counted in sizeof(*this) and nsString->SizeOf() - aSizeOfHandler->AddSize(tag,aSize); -} #endif NS_IMETHODIMP @@ -395,8 +356,6 @@ public: // nsIStyleRule methods #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif // nsICSSRule methods @@ -491,44 +450,6 @@ CSSImportRuleImpl::List(FILE* out, PRInt32 aIndent) const return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSImportRuleImpl's size): -* 1) sizeof(*this) + the size of the mURLSpec string -* -* Contained / Aggregated data (not reported as CSSImportRuleImpl's size): -* none -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSImportRuleImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSImportRuleImpl"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - - // add the strings for the URLSpec and the Media - mURLSpec.SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - aSize -= sizeof(mURLSpec); // counted in sizeof(*this) and nsString->SizeOf() - aSizeOfHandler->AddSize(tag,aSize); - -} #endif NS_IMETHODIMP @@ -726,8 +647,6 @@ public: // nsIStyleRule methods #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif // nsICSSRule methods @@ -905,64 +824,6 @@ CSSMediaRuleImpl::List(FILE* out, PRInt32 aIndent) const fputs("}\n", out); return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSMediaRuleImpl's size): -* 1) sizeof(*this) + the size of each unique atom in the mMedia collection -* -* Contained / Aggregated data (not reported as CSSMediaRuleImpl's size): -* 1) Delegate to the rules in the mRules collection to report theri own size -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSMediaRuleImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSMediaRuleImpl"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - - if (mMedia) { - // get the sizes of the media atoms (if unique) - PRUint32 index = 0; - PRUint32 count; - mMedia->Count(&count); - while (index < count) { - nsCOMPtr medium = dont_AddRef((nsIAtom*)mMedia->ElementAt(index++)); - if(medium && uniqueItems->AddItem(medium)){ - medium->SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - } - } - } - // we are done with the size we report for ourself - aSizeOfHandler->AddSize(tag,aSize); - - if (mRules) { - // delegate to the rules themselves (do not sum into our size) - PRUint32 index = 0; - PRUint32 count; - mRules->Count(&count); - while (index < count) { - nsCOMPtr rule = dont_AddRef((nsICSSRule*)mRules->ElementAt(index++)); - rule->SizeOf(aSizeOfHandler, localSize); - } - } -} #endif NS_IMETHODIMP @@ -1269,8 +1130,6 @@ public: // nsIStyleRule methods #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif // nsICSSRule methods @@ -1348,49 +1207,6 @@ CSSNameSpaceRuleImpl::List(FILE* out, PRInt32 aIndent) const fputs(")\n", out); return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSNamespaceRuleImpl's size): -* 1) sizeof(*this) + the size of the mURLSpec string + -* the sizeof the mPrefix atom (if it ieists) -* -* Contained / Aggregated data (not reported as CSSNamespaceRuleImpl's size): -* none -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSNameSpaceRuleImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSNameSpaceRuleImpl"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - - // get the member data as part of this dump - mURLSpec.SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - aSize -= sizeof(mURLSpec); // counted in sizeof(*this) and nsString->SizeOf() - - if(mPrefix && uniqueItems->AddItem(mPrefix)){ - mPrefix->SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - } - aSizeOfHandler->AddSize(tag, aSize); -} #endif NS_IMETHODIMP diff --git a/mozilla/layout/style/nsCSSStruct.cpp b/mozilla/layout/style/nsCSSStruct.cpp index 8697e7235ca..1d79b3710f2 100644 --- a/mozilla/layout/style/nsCSSStruct.cpp +++ b/mozilla/layout/style/nsCSSStruct.cpp @@ -51,7 +51,6 @@ #include "nsCOMPtr.h" #include "nsIStyleSet.h" -#include "nsISizeOfHandler.h" // #define DEBUG_REFS @@ -6103,102 +6102,6 @@ void nsCSSDeclaration::List(FILE* out, PRInt32 aIndent) const mImportant->List(out, 0); } } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as nsCSSDeclaration's size): -* 1) sizeof(*this) + the sizeof each non-null attribute -* -* Contained / Aggregated data (not reported as nsCSSDeclaration's size): -* none -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void nsCSSDeclaration::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("nsCSSDeclaration"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - - // now add in all of the contained objects, checking for duplicates on all of them - CSS_VARONSTACK_GET(Font); - if(theFont && uniqueItems->AddItem(theFont)){ - aSize += sizeof(*theFont); - } - CSS_VARONSTACK_GET(Color); - if(theColor && uniqueItems->AddItem(theColor)){ - aSize += sizeof(*theColor); - } - CSS_VARONSTACK_GET(Text); - if(theText && uniqueItems->AddItem(theText)){ - aSize += sizeof(*theText); - } - CSS_VARONSTACK_GET(Margin); - if(theMargin && uniqueItems->AddItem(theMargin)){ - aSize += sizeof(*theMargin); - } - CSS_VARONSTACK_GET(Position); - if(thePosition && uniqueItems->AddItem(thePosition)){ - aSize += sizeof(*thePosition); - } - CSS_VARONSTACK_GET(List); - if(theList && uniqueItems->AddItem(theList)){ - aSize += sizeof(*theList); - } - CSS_VARONSTACK_GET(Display); - if(theDisplay && uniqueItems->AddItem(theDisplay)){ - aSize += sizeof(*theDisplay); - } - CSS_VARONSTACK_GET(Table); - if(theTable && uniqueItems->AddItem(theTable)){ - aSize += sizeof(*theTable); - } - CSS_VARONSTACK_GET(Breaks); - if(theBreaks && uniqueItems->AddItem(theBreaks)){ - aSize += sizeof(*theBreaks); - } - CSS_VARONSTACK_GET(Page); - if(thePage && uniqueItems->AddItem(thePage)){ - aSize += sizeof(*thePage); - } - CSS_VARONSTACK_GET(Content); - if(theContent && uniqueItems->AddItem(theContent)){ - aSize += sizeof(*theContent); - } - CSS_VARONSTACK_GET(UserInterface); - if(theUserInterface && uniqueItems->AddItem(theUserInterface)){ - aSize += sizeof(*theUserInterface); - } -#ifdef INCLUDE_XUL - CSS_VARONSTACK_GET(XUL); - if(theXUL && uniqueItems->AddItem(theXUL)){ - aSize += sizeof(*theXUL); - } -#endif -#ifdef MOZ_SVG - CSS_VARONSTACK_GET(SVG); - if(theSVG && uniqueItems->AddItem(theSVG)){ - aSize += sizeof(*theSVG); - } -#endif - CSS_VARONSTACK_GET(Aural); - if(theAural && uniqueItems->AddItem(theAural)){ - aSize += sizeof(*theAural); - } - aSizeOfHandler->AddSize(tag, aSize); -} #endif PRUint32 diff --git a/mozilla/layout/style/nsCSSStruct.h b/mozilla/layout/style/nsCSSStruct.h index 5b9b17a9620..7d90322fb62 100644 --- a/mozilla/layout/style/nsCSSStruct.h +++ b/mozilla/layout/style/nsCSSStruct.h @@ -49,7 +49,6 @@ #include "nsVoidArray.h" #include "nsValueArray.h" -class nsISizeOfHandler; class nsStringArray; struct nsCSSStruct { @@ -653,8 +652,6 @@ public: #ifdef DEBUG void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif protected: diff --git a/mozilla/layout/style/nsCSSStyleRule.cpp b/mozilla/layout/style/nsCSSStyleRule.cpp index 3795eb52a37..0b16fcd698e 100644 --- a/mozilla/layout/style/nsCSSStyleRule.cpp +++ b/mozilla/layout/style/nsCSSStyleRule.cpp @@ -70,7 +70,6 @@ #include "nsUnicharUtils.h" #include "nsIStyleSet.h" -#include "nsISizeOfHandler.h" #include "nsContentUtils.h" #include "nsContentErrors.h" @@ -309,51 +308,6 @@ PRBool nsAttrSelector::Equals(const nsAttrSelector* aOther) const return PR_FALSE; } -#ifdef DEBUG -/****************************************************************************** -* SizeOf method: -* -* Self (reported as nsAttrSelector's size): -* 1) sizeof(*this) + the size of mAttr atom (if it exists and is unique) -* -* Contained / Aggregated data (not reported as nsAttrSelector's size): -* none -* -* Children / siblings / parents: -* 1) Recurses to the mMext instance which is reported as a seperate instance -* -******************************************************************************/ -void nsAttrSelector::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("nsAttrSelector"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - - // add in the mAttr atom - if (mAttr && uniqueItems->AddItem(mAttr)){ - mAttr->SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - } - aSizeOfHandler->AddSize(tag,aSize); - - // recurse to the next one... - if(mNext){ - mNext->SizeOf(aSizeOfHandler, localSize); - } -} -#endif - MOZ_DECL_CTOR_COUNTER(nsCSSSelector) #ifdef DEBUG_REFS @@ -625,113 +579,6 @@ PRInt32 nsCSSSelector::CalcWeight(void) const return weight; } -#ifdef DEBUG -/****************************************************************************** -* SizeOf method: -* -* Self (reported as nsCSSSelector's size): -* 1) sizeof(*this) + the size of the mTag -* + the size of the mIDList unique items -* + the size of the mClassList and mPseudoClassList unique items -* -* Contained / Aggregated data (not reported as nsCSSSelector's size): -* 1) AttributeList is called out to seperately if it exists -* -* Children / siblings / parents: -* 1) Recurses to mNext which is counted as it's own instance -* -******************************************************************************/ -void nsCSSSelector::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("nsCSSSelector"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - - // now get the member-atoms and add them in - if(mTag && uniqueItems->AddItem(mTag)){ - localSize = 0; - mTag->SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - } - - - // XXX ???? - - - - // a couple of simple atom lists - if(mIDList && uniqueItems->AddItem(mIDList)){ - aSize += sizeof(*mIDList); - nsAtomList *pNext = nsnull; - pNext = mIDList; - while(pNext){ - if(pNext->mAtom && uniqueItems->AddItem(pNext->mAtom)){ - localSize = 0; - pNext->mAtom->SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - } - pNext = pNext->mNext; - } - } - if(mClassList && uniqueItems->AddItem(mClassList)){ - aSize += sizeof(*mClassList); - nsAtomList *pNext = nsnull; - pNext = mClassList; - while(pNext){ - if(pNext->mAtom && uniqueItems->AddItem(pNext->mAtom)){ - localSize = 0; - pNext->mAtom->SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - } - pNext = pNext->mNext; - } - } - if(mPseudoClassList && uniqueItems->AddItem(mPseudoClassList)){ - nsAtomStringList *pNext = nsnull; - pNext = mPseudoClassList; - while(pNext){ - if(pNext->mAtom && uniqueItems->AddItem(pNext->mAtom)){ - localSize = 0; - pNext->mAtom->SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - } - pNext = pNext->mNext; - } - } - // done with undelegated sizes - aSizeOfHandler->AddSize(tag, aSize); - - // the AttributeList gets its own delegation-call - if(mAttrList){ - localSize = 0; - mAttrList->SizeOf(aSizeOfHandler, localSize); - } - - // don't forget the negated selectors - if(mNegations) { - localSize = 0; - mNegations->SizeOf(aSizeOfHandler, localSize); - } - - // finally chain to the next... - if(mNext){ - localSize = 0; - mNext->SizeOf(aSizeOfHandler, localSize); - } -} -#endif - // pseudo-elements are stored in the selectors' chain using fictional elements; // these fictional elements have mTag starting with a colon static PRBool IsPseudoElement(nsIAtom* aAtom) @@ -950,8 +797,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif protected: @@ -1040,47 +885,6 @@ CSSImportantRule::List(FILE* out, PRInt32 aIndent) const return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSImportantRule's size): -* 1) sizeof(*this) -* -* Contained / Aggregated data (not reported as CSSImportantRule's size): -* 1) mDeclaration is sized seperately -* 2) mSheet is sized seperately -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSImportantRule::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSImportantRule"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(CSSImportantRule); - aSizeOfHandler->AddSize(tag,aSize); - - // now dump the mDeclaration and mSheet - if(mDeclaration){ - mDeclaration->SizeOf(aSizeOfHandler, localSize); - } - if(mSheet){ - mSheet->SizeOf(aSizeOfHandler, localSize); - } -} #endif // -- nsDOMStyleRuleDeclaration ------------------------------- @@ -1429,8 +1233,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif // nsIDOMCSSRule interface @@ -2416,58 +2218,6 @@ CSSStyleRuleImpl::List(FILE* out, PRInt32 aIndent) const return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSStyleRuleImpl's size): -* 1) sizeof(*this) -* + sizeof the DOMDeclaration if it exists and is unique -* -* Contained / Aggregated data (not reported as CSSStyleRuleImpl's size): -* 1) mDeclaration if it exists -* 2) mImportantRule if it exists -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSStyleRuleImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSStyleRuleImpl"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - // remove the sizeof the mSelector's class since we count it seperately below - aSize -= sizeof(mSelector); - - // and add the size of the DOMDeclaration - // XXX - investigate the size and quantity of these - if(mDOMDeclaration && uniqueItems->AddItem(mDOMDeclaration)){ - aSize += sizeof(DOMCSSDeclarationImpl); - } - aSizeOfHandler->AddSize(tag,aSize); - - // now delegate to the Selector, Declaration, and ImportantRule - mSelector.SizeOf(aSizeOfHandler, localSize); - - if(mDeclaration){ - mDeclaration->SizeOf(aSizeOfHandler, localSize); - } - if(mImportantRule){ - mImportantRule->SizeOf(aSizeOfHandler, localSize); - } -} #endif NS_IMETHODIMP diff --git a/mozilla/layout/style/nsCSSStyleSheet.cpp b/mozilla/layout/style/nsCSSStyleSheet.cpp index 820da83ff12..0811681cdb4 100644 --- a/mozilla/layout/style/nsCSSStyleSheet.cpp +++ b/mozilla/layout/style/nsCSSStyleSheet.cpp @@ -97,7 +97,6 @@ #include "prlog.h" #include "nsCOMPtr.h" #include "nsIStyleSet.h" -#include "nsISizeOfHandler.h" #include "nsStyleUtil.h" #include "nsQuickSort.h" #ifdef MOZ_XUL @@ -762,10 +761,6 @@ public: nsIAtom* aMedium, PRBool* aResult); -#ifdef DEBUG - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); -#endif - protected: RuleCascadeData* GetRuleCascade(nsIPresContext* aPresContext, nsIAtom* aMedium); @@ -792,10 +787,6 @@ public: virtual void RebuildNameSpaces(void); -#ifdef DEBUG - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); -#endif - nsAutoVoidArray mSheets; nsIURI* mURL; @@ -897,8 +888,6 @@ public: #ifdef DEBUG virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); #endif // nsIDOMStyleSheet interface @@ -1633,81 +1622,6 @@ CSSStyleSheetInner::RebuildNameSpaces(void) } } -#ifdef DEBUG -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSStyleSheetInner's size): -* 1) sizeof(*this) + sizeof mSheets array (not contents though) -* + size of the mOrderedRules array (not the contents though) -* -* Contained / Aggregated data (not reported as CSSStyleSheetInner's size): -* 1) mSheets: each style sheet is sized seperately -* 2) mOrderedRules: each fule is sized seperately -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSStyleSheetInner::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - // this style sheet is lared accounted for - return; - } - - PRUint32 localSize=0; - PRBool rulesCounted=PR_FALSE; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSStyleSheetInner"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(CSSStyleSheetInner); - - // add in the size of the mSheets array itself - mSheets.SizeOf(aSizeOfHandler,&localSize); - aSize += localSize; - - // and the mOrderedRules array (if there is one) - if(mOrderedRules && uniqueItems->AddItem(mOrderedRules)){ - rulesCounted=PR_TRUE; - // no SizeOf method so we just get the basic object size - aSize += sizeof(*mOrderedRules); - } - aSizeOfHandler->AddSize(tag,aSize); - - - // delegate to the contained containers - // mSheets : nsVoidArray - { - PRUint32 sheetCount, sheetCur; - sheetCount = mSheets.Count(); - for(sheetCur=0; sheetCur < sheetCount; sheetCur++){ - nsICSSStyleSheet* sheet = (nsICSSStyleSheet*)mSheets.ElementAt(sheetCur); - if(sheet){ - sheet->SizeOf(aSizeOfHandler, localSize); - } - } - } - // mOrderedRules : nsISupportsArray* - if(mOrderedRules && rulesCounted){ - PRUint32 ruleCount, ruleCur; - mOrderedRules->Count(&ruleCount); - for(ruleCur=0; ruleCur < ruleCount; ruleCur++){ - nsICSSRule* rule = (nsICSSRule*)mOrderedRules->ElementAt(ruleCur); - if(rule){ - rule->SizeOf(aSizeOfHandler, localSize); - NS_IF_RELEASE(rule); - } - } - } -} -#endif - // ------------------------------- // CSS Style Sheet @@ -2554,58 +2468,6 @@ void CSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const fputs("Rules in source order:\n", out); ListRules(mInner->mOrderedRules, out, aIndent); } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSStyleSheetImpl's size): -* 1) sizeof(*this) + sizeof the mImportsCollection + sizeof mCuleCollection) -* -* Contained / Aggregated data (not reported as CSSStyleSheetImpl's size): -* 1) mInner is delegated to be counted seperately -* -* Children / siblings / parents: -* 1) Recurse to mFirstChild -* -******************************************************************************/ -void CSSStyleSheetImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - // this style sheet is already accounted for - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSStyleSheet"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(CSSStyleSheetImpl); - - // add up the contained objects we won't delegate to: - // NOTE that we just add the sizeof the objects - // since the style data they contain is accounted for elsewhere - // - mImportsCollection - // - mRuleCollection - aSize += sizeof(mImportsCollection); - aSize += sizeof(mRuleCollection); - aSizeOfHandler->AddSize(tag,aSize); - - // size the inner - if(mInner){ - mInner->SizeOf(aSizeOfHandler, localSize); - } - - // now travers the children (recursively, I'm sorry to say) - if(mFirstChild){ - PRUint32 childSize=0; - mFirstChild->SizeOf(aSizeOfHandler, childSize); - } -} #endif static PRBool PR_CALLBACK @@ -4273,155 +4135,6 @@ CSSRuleProcessor::HasStateDependentStyle(StateRuleProcessorData* aData, return NS_OK; } - -#ifdef DEBUG - -struct CascadeSizeEnumData { - - CascadeSizeEnumData(nsISizeOfHandler *aSizeOfHandler, - nsUniqueStyleItems *aUniqueStyleItem, - nsIAtom *aTag) - { - handler = aSizeOfHandler; - uniqueItems = aUniqueStyleItem; - tag = aTag; - } - // weak references all 'round - - nsISizeOfHandler *handler; - nsUniqueStyleItems *uniqueItems; - nsIAtom *tag; -}; - -static -PRBool PR_CALLBACK StateSelectorsSizeEnumFunc( void *aSelector, void *aData ) -{ - nsCSSSelector* selector = (nsCSSSelector*)aSelector; - CascadeSizeEnumData *pData = (CascadeSizeEnumData *)aData; - NS_ASSERTION(selector && pData, "null arguments not supported"); - - if(! pData->uniqueItems->AddItem((void*)selector)){ - return PR_TRUE; - } - - // pass the call to the selector - PRUint32 localSize = 0; - selector->SizeOf(pData->handler, localSize); - - return PR_TRUE; -} - -static -PRBool WeightedRulesSizeEnumFunc( nsISupports *aRule, void *aData ) -{ - nsICSSStyleRule* rule = (nsICSSStyleRule*)aRule; - CascadeSizeEnumData *pData = (CascadeSizeEnumData *)aData; - - NS_ASSERTION(rule && pData, "null arguments not supported"); - - if(! pData->uniqueItems->AddItem((void*)rule)){ - return PR_TRUE; - } - - PRUint32 localSize=0; - - // pass the call to the rule - rule->SizeOf(pData->handler, localSize); - - return PR_TRUE; -} - -static -void CascadeSizeEnumFunc(RuleCascadeData *cascade, CascadeSizeEnumData *pData) -{ - NS_ASSERTION(cascade && pData, "null arguments not supported"); - - // see if the cascade has already been counted - if(!(pData->uniqueItems->AddItem(cascade))){ - return; - } - // record the size of the cascade data itself - PRUint32 localSize = sizeof(RuleCascadeData); - pData->handler->AddSize(pData->tag, localSize); - - // next add up the selectors and the weighted rules for the cascade - nsCOMPtr stateSelectorSizeTag; - stateSelectorSizeTag = do_GetAtom("CascadeStateSelectors"); - CascadeSizeEnumData stateData(pData->handler,pData->uniqueItems,stateSelectorSizeTag); - cascade->mStateSelectors.EnumerateForwards(StateSelectorsSizeEnumFunc, &stateData); - - if(cascade->mWeightedRules){ - nsCOMPtr weightedRulesSizeTag; - weightedRulesSizeTag = do_GetAtom("CascadeWeightedRules"); - CascadeSizeEnumData stateData2(pData->handler,pData->uniqueItems,weightedRulesSizeTag); - cascade->mWeightedRules->EnumerateForwards(WeightedRulesSizeEnumFunc, &stateData2); - } -} - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSRuleProcessor's size): -* 1) sizeof(*this) -* -* Contained / Aggregated data (not reported as CSSRuleProcessor's size): -* 1) Delegate to the StyleSheets in the mSheets collection -* 2) Delegate to the Rules in the CascadeTable -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSRuleProcessor::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - return; - } - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("CSSRuleProcessor"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(CSSRuleProcessor); - - // collect sizes for the data - // - mSheets - // - mRuleCascades - - // sheets first - if(mSheets && uniqueItems->AddItem(mSheets)){ - PRUint32 sheetCount, curSheet, localSize2; - mSheets->Count(&sheetCount); - for(curSheet=0; curSheet < sheetCount; curSheet++){ - nsCOMPtr pSheet = - dont_AddRef((nsICSSStyleSheet*)mSheets->ElementAt(curSheet)); - if(pSheet && uniqueItems->AddItem((void*)pSheet)){ - pSheet->SizeOf(aSizeOfHandler, localSize2); - // XXX aSize += localSize2; - } - } - } - - // and for the medium cascade table we account for the hash table overhead, - // and then compute the sizeof each rule-cascade in the table - { - nsCOMPtr tag2 = do_GetAtom("RuleCascade"); - CascadeSizeEnumData data(aSizeOfHandler, uniqueItems, tag2); - for (RuleCascadeData *cascadeData = mRuleCascades; - cascadeData; - cascadeData = cascadeData->mNext) { - CascadeSizeEnumFunc(cascadeData, &data); - } - } - - // now add the size of the RuleProcessor - aSizeOfHandler->AddSize(tag,aSize); -} -#endif - NS_IMETHODIMP CSSRuleProcessor::ClearRuleCascades(void) { diff --git a/mozilla/layout/style/nsHTMLCSSStyleSheet.cpp b/mozilla/layout/style/nsHTMLCSSStyleSheet.cpp index 3f329c67bde..b3b72e1fdc2 100644 --- a/mozilla/layout/style/nsHTMLCSSStyleSheet.cpp +++ b/mozilla/layout/style/nsHTMLCSSStyleSheet.cpp @@ -56,9 +56,6 @@ #include "nsIStyleSet.h" #include "nsRuleWalker.h" -#include "nsISizeOfHandler.h" - - class CSSFirstLineRule : public nsIStyleRule { public: CSSFirstLineRule(nsIHTMLCSSStyleSheet* aSheet); @@ -73,8 +70,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); #endif nsIHTMLCSSStyleSheet* mSheet; @@ -127,44 +122,6 @@ CSSFirstLineRule::List(FILE* out, PRInt32 aIndent) const { return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as CSSFirstLineRule's size): -* 1) sizeof(*this) -* -* Contained / Aggregated data (not reported as CSSFirstLineRule's size): -* 1) Delegate to mSheet if it exists -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void CSSFirstLineRule::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - - if(! uniqueItems->AddItem((void*)this) ){ - // object has already been accounted for - return; - } - - // get or create a tag for this instance - nsCOMPtr tag; - tag = do_GetAtom("CSSFirstLine-LetterRule"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - aSizeOfHandler->AddSize(tag,aSize); - - if(mSheet){ - PRUint32 localSize=0; - mSheet->SizeOf(aSizeOfHandler, localSize); - } -} #endif // ----------------------------------------------------------- @@ -228,8 +185,6 @@ public: #ifdef DEBUG virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); #endif // If changing the given attribute cannot affect style context, aAffects @@ -490,57 +445,6 @@ void HTMLCSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const } fputs("\n", out); } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as HTMLCSSStyleSheetImpl's size): -* 1) sizeof(*this) -* -* Contained / Aggregated data (not reported as HTMLCSSStyleSheetImpl's size): -* 1) We don't really delegate but count seperately the FirstLineRule and -* the FirstLetterRule if the exist and are unique instances -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void HTMLCSSStyleSheetImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - // this style sheet is lared accounted for - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag; - tag = do_GetAtom("HTMLCSSStyleSheet"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(HTMLCSSStyleSheetImpl); - aSizeOfHandler->AddSize(tag,aSize); - - // Now the associated rules (if they exist) - // - mFirstLineRule - // - mFirstLetterRule - if(mFirstLineRule && uniqueItems->AddItem((void*)mFirstLineRule)){ - localSize = sizeof(*mFirstLineRule); - aSize += localSize; - tag = do_GetAtom("FirstLineRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(mFirstLetterRule && uniqueItems->AddItem((void*)mFirstLetterRule)){ - localSize = sizeof(*mFirstLetterRule); - aSize += localSize; - tag = do_GetAtom("FirstLetterRule"); - aSizeOfHandler->AddSize(tag,localSize); - } -} #endif NS_IMETHODIMP diff --git a/mozilla/layout/style/nsHTMLStyleSheet.cpp b/mozilla/layout/style/nsHTMLStyleSheet.cpp index bd1ff22e153..b6975adbbd4 100644 --- a/mozilla/layout/style/nsHTMLStyleSheet.cpp +++ b/mozilla/layout/style/nsHTMLStyleSheet.cpp @@ -61,7 +61,6 @@ #include "nsRuleWalker.h" #include "nsIStyleSet.h" -#include "nsISizeOfHandler.h" static NS_DEFINE_CID(kCSSFrameConstructorCID, NS_CSSFRAMECONSTRUCTOR_CID); @@ -79,8 +78,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif nscolor mColor; @@ -94,10 +91,6 @@ public: NS_IMETHOD MapRuleInfoInto(nsRuleData* aRuleData); -#ifdef DEBUG - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); -#endif - void Reset() { mInitialized = PR_FALSE; } @@ -143,43 +136,6 @@ HTMLColorRule::List(FILE* out, PRInt32 aIndent) const { return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as HTMLColorRule's size): -* 1) sizeof(*this) + -* -* Contained / Aggregated data (not reported as HTMLColorRule's size): -* 1) delegate to the mSheet -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void HTMLColorRule::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - - if(! uniqueItems->AddItem((void*)this) ){ - // object has already been accounted for - return; - } - - // get or create a tag for this instance - nsCOMPtr tag = do_GetAtom("HTMLColorRule"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - aSizeOfHandler->AddSize(tag,aSize); - - if(mSheet){ - PRUint32 localSize=0; - mSheet->SizeOf(aSizeOfHandler, localSize); - } -} #endif HTMLDocumentColorRule::HTMLDocumentColorRule(nsIHTMLStyleSheet* aSheet) @@ -230,45 +186,6 @@ HTMLDocumentColorRule::Initialize(nsIPresContext* aPresContext) mColor = bodyColor->mColor; } -#ifdef DEBUG -/****************************************************************************** -* SizeOf method: -* -* Self (reported as HTMLDocumentColorRule's size): -* 1) sizeof(*this) -* -* Contained / Aggregated data (not reported as HTMLDocumentColorRule's size): -* 1) Delegate to the mSheet -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void HTMLDocumentColorRule::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - - if(! uniqueItems->AddItem((void*)this) ){ - // object has already been accounted for - return; - } - - // get or create a tag for this instance - nsCOMPtr tag = do_GetAtom("HTMLDocumentColorRule"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - aSizeOfHandler->AddSize(tag,aSize); - - if(mSheet){ - PRUint32 localSize; - mSheet->SizeOf(aSizeOfHandler, localSize); - } -} -#endif - class GenericTableRule: public nsIStyleRule { public: GenericTableRule(nsIHTMLStyleSheet* aSheet); @@ -283,8 +200,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); #endif void Reset() @@ -325,43 +240,6 @@ GenericTableRule::List(FILE* out, PRInt32 aIndent) const { return NS_OK; } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as GenericTableRule's size): -* 1) sizeof(*this) + -* -* Contained / Aggregated data (not reported as GenericTableRule's size): -* 1) Delegate to the mSheet if it exists -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void GenericTableRule::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - - if(! uniqueItems->AddItem((void*)this) ){ - // object has already been accounted for - return; - } - - // get or create a tag for this instance - nsCOMPtr tag = do_GetAtom("GenericTableRule"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - aSizeOfHandler->AddSize(tag,aSize); - - if(mSheet){ - PRUint32 localSize; - mSheet->SizeOf(aSizeOfHandler, localSize); - } -} #endif // ----------------------------------------------------------- @@ -785,8 +663,6 @@ public: #ifdef DEBUG virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const; - - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); #endif // If changing the given attribute cannot affect style context, aAffects @@ -813,8 +689,6 @@ protected: TableColgroupRule* mTableColgroupRule; TableColRule* mTableColRule; TableTHRule* mTableTHRule; - // NOTE: if adding more rules, be sure to update - // the SizeOf method to include them PLDHashTable mMappedAttrTable; }; @@ -1347,164 +1221,6 @@ void HTMLStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const } fputs("\n", out); } - - -struct MappedAttributeSizeEnumData -{ - MappedAttributeSizeEnumData(nsISizeOfHandler *aSizeOfHandler, - nsUniqueStyleItems *aUniqueStyleItem) - { - aHandler = aSizeOfHandler; - uniqueItems = aUniqueStyleItem; - } - - // weak references all 'round - nsISizeOfHandler *aHandler; - nsUniqueStyleItems *uniqueItems; -}; - -PR_STATIC_CALLBACK(PLDHashOperator) -MappedSizeAttributes(PLDHashTable *table, PLDHashEntryHdr *hdr, - PRUint32 number, void *arg) -{ - MappedAttributeSizeEnumData *pData = (MappedAttributeSizeEnumData *)arg; - NS_ASSERTION(pData,"null closure is not supported"); - MappedAttrTableEntry *entry = NS_STATIC_CAST(MappedAttrTableEntry*, hdr); - nsIHTMLMappedAttributes* mapped = entry->mAttributes; - NS_ASSERTION(mapped, "null item in enumeration fcn is not supported"); - // if there is an attribute and it has not been counted, the get its size - if(mapped){ - PRUint32 size=0; - mapped->SizeOf(pData->aHandler, size); - } - return PL_DHASH_NEXT; -} - - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as HTMLStyleSheetImpl's size): -* 1) sizeof(*this) -* -* Contained / Aggregated data (not reported as HTMLStyleSheetImpl's size): -* 1) Not really delegated, but counted seperately: -* - mLinkRule -* - mVisitedRule -* - mActiveRule -* - mDocumentColorRule -* - mTableTbodyRule -* - mTableRowRule -* - mTableColgroupRule -* - mTableColRule -* - mTableTHRule -* - mMappedAttrTable -* 2) Delegates (really) to the MappedAttributes in the mMappedAttrTable -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void -HTMLStyleSheetImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - if(! uniqueItems->AddItem((void*)this)){ - // this style sheet is lared accounted for - return; - } - - PRUint32 localSize=0; - - // create a tag for this instance - nsCOMPtr tag = do_GetAtom("HTMLStyleSheet"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(HTMLStyleSheetImpl); - aSizeOfHandler->AddSize(tag,aSize); - - // now gather up the sizes of the data members - // - mLinkRule : sizeof object - // - mVisitedRule : sizeof object - // - mActiveRule : sizeof object - // - mDocumentColorRule : sizeof object - // - mTableTbodyRule : sizeof object - // - mTableRowRule : sizeof object - // - mTableColgroupRule : sizeof object - // - mTableColRule : sizeof object - // - mTableTHRule : sizeof object - // - mMappedAttrTable - - if(mLinkRule && uniqueItems->AddItem((void*)mLinkRule)){ - localSize = sizeof(*mLinkRule); - tag = do_GetAtom("LinkRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(mVisitedRule && uniqueItems->AddItem((void*)mVisitedRule)){ - localSize = sizeof(*mVisitedRule); - tag = do_GetAtom("VisitedRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(mActiveRule && uniqueItems->AddItem((void*)mActiveRule)){ - localSize = sizeof(*mActiveRule); - tag = do_GetAtom("ActiveRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(uniqueItems->AddItem((void*)mDocumentColorRule)){ - localSize = sizeof(*mDocumentColorRule); - tag = do_GetAtom("DocumentColorRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(uniqueItems->AddItem((void*)mTableTbodyRule)){ - localSize = sizeof(*mTableTbodyRule); - tag = do_GetAtom("TableTbodyRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(uniqueItems->AddItem((void*)mTableRowRule)){ - localSize = sizeof(*mTableRowRule); - tag = do_GetAtom("TableRowRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(uniqueItems->AddItem((void*)mTableColgroupRule)){ - localSize = sizeof(*mTableColgroupRule); - tag = do_GetAtom("TableColgroupRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(uniqueItems->AddItem((void*)mTableColRule)){ - localSize = sizeof(*mTableColRule); - tag = do_GetAtom("TableColRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - if(uniqueItems->AddItem((void*)mTableTHRule)){ - localSize = sizeof(*mTableTHRule); - tag = do_GetAtom("TableTHRule"); - aSizeOfHandler->AddSize(tag,localSize); - } - - // for the AttrTable it is kindof sleezy: - // We want the hash table overhead as well as the entries it contains - // - // we get the overall size of the hashtable, and if there are entries, - // we calculate a rough overhead estimate as: - // number of entries X sizeof each hash-entry - // + the size of a hash table (see plhash.h and nsHashTable.h) - // then we add up the size of each unique attribute - if (mMappedAttrTable.ops) { - localSize = - PL_DHASH_TABLE_SIZE(&mMappedAttrTable) * mMappedAttrTable.entrySize; - tag = do_GetAtom("MappedAttrTable"); - aSizeOfHandler->AddSize(tag,localSize); - - // now get each unique attribute - MappedAttributeSizeEnumData sizeEnumData(aSizeOfHandler, uniqueItems); - PL_DHashTableEnumerate(&mMappedAttrTable, &MappedSizeAttributes, - &sizeEnumData); - } - - // that's it -} #endif NS_IMETHODIMP diff --git a/mozilla/layout/style/nsICSSStyleRule.h b/mozilla/layout/style/nsICSSStyleRule.h index ab5a0281a4a..bf140f4cf54 100644 --- a/mozilla/layout/style/nsICSSStyleRule.h +++ b/mozilla/layout/style/nsICSSStyleRule.h @@ -47,8 +47,6 @@ #include "nsCSSValue.h" #include "nsIAtom.h" -class nsISizeOfHandler; - class nsIAtom; class nsIArena; class nsCSSDeclaration; @@ -96,10 +94,6 @@ public: ~nsAttrSelector(void); PRBool Equals(const nsAttrSelector* aOther) const; -#ifdef DEBUG - void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); -#endif - PRInt32 mNameSpace; nsIAtom* mAttr; PRUint8 mFunction; @@ -136,9 +130,6 @@ public: PRInt32 CalcWeight(void) const; -#ifdef DEBUG - void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); -#endif nsresult ToString( nsAString& aString, nsICSSStyleSheet* aSheet, PRBool aIsPseudoElem, PRInt8 aNegatedIndex ) const; diff --git a/mozilla/layout/style/nsIStyleRule.h b/mozilla/layout/style/nsIStyleRule.h index ee251d98d81..d10791c3e38 100644 --- a/mozilla/layout/style/nsIStyleRule.h +++ b/mozilla/layout/style/nsIStyleRule.h @@ -42,8 +42,6 @@ #include "nsISupports.h" -class nsISizeOfHandler; - class nsIStyleSheet; class nsIPresContext; class nsIContent; @@ -64,8 +62,6 @@ public: #ifdef DEBUG NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; - - virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) = 0; #endif }; diff --git a/mozilla/layout/style/nsIStyleRuleProcessor.h b/mozilla/layout/style/nsIStyleRuleProcessor.h index ac4a7517775..b392d76f84a 100644 --- a/mozilla/layout/style/nsIStyleRuleProcessor.h +++ b/mozilla/layout/style/nsIStyleRuleProcessor.h @@ -45,8 +45,6 @@ #include "nsILinkHandler.h" #include "nsString.h" -class nsISizeOfHandler; - class nsIStyleSheet; class nsIPresContext; class nsIContent; @@ -174,10 +172,6 @@ public: NS_IMETHOD HasStateDependentStyle(StateRuleProcessorData* aData, nsIAtom* aMedium, PRBool* aResult) = 0; - -#ifdef DEBUG - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize) = 0; -#endif }; #endif /* nsIStyleRuleProcessor_h___ */ diff --git a/mozilla/layout/style/nsIStyleSheet.h b/mozilla/layout/style/nsIStyleSheet.h index 9e830d71dd3..6752ca94e84 100644 --- a/mozilla/layout/style/nsIStyleSheet.h +++ b/mozilla/layout/style/nsIStyleSheet.h @@ -41,8 +41,6 @@ #include #include "nsISupports.h" -class nsISizeOfHandler; - class nsIAtom; class nsString; class nsIURI; @@ -108,8 +106,6 @@ public: #ifdef DEBUG virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; - - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize) = 0; #endif }; diff --git a/mozilla/layout/style/nsStyleContext.cpp b/mozilla/layout/style/nsStyleContext.cpp index ed785cfac24..07220fe9c6c 100644 --- a/mozilla/layout/style/nsStyleContext.cpp +++ b/mozilla/layout/style/nsStyleContext.cpp @@ -47,7 +47,6 @@ #include "nsCOMPtr.h" #include "nsIStyleSet.h" -#include "nsISizeOfHandler.h" #include "nsIPresShell.h" #include "nsLayoutAtoms.h" #include "prenv.h" @@ -735,70 +734,6 @@ void nsStyleContext::List(FILE* out, PRInt32 aIndent) } } - -/****************************************************************************** -* SizeOf method: -* -* Self (reported as nsStyleContext's size): -* 1) sizeof(*this) which gets all of the data members -* 2) adds in the size of the PseudoTag, if there is one -* -* Children / siblings / parents: -* 1) We recurse over the mChild and mEmptyChild instances if they exist. -* These instances will then be accumulated seperately (not part of -* the containing instance's size) -* 2) We recurse over the siblings of the Child and Empty Child instances -* and count then seperately as well. -* 3) We recurse over our direct siblings (if any). -* -******************************************************************************/ -void nsStyleContext::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - - if(! uniqueItems->AddItem((void*)this) ){ - // object has already been accounted for - return; - } - - PRUint32 localSize=0; - - // get or create a tag for this instance - nsCOMPtr tag; - tag = do_GetAtom("nsStyleContext"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(*this); - // add in the size of the member mPseudoTag - if (mPseudoTag){ - mPseudoTag->SizeOf(aSizeOfHandler, &localSize); - aSize += localSize; - } - aSizeOfHandler->AddSize(tag,aSize); - - // now follow up with the child (and empty child) recursion - if (nsnull != mChild) { - nsStyleContext* child = mChild; - do { - child->SizeOf(aSizeOfHandler, localSize); - child = child->mNextSibling; - } while (mChild != child); - } - if (nsnull != mEmptyChild) { - nsStyleContext* child = mEmptyChild; - do { - child->SizeOf(aSizeOfHandler, localSize); - child = child->mNextSibling; - } while (mEmptyChild != child); - } - // and finally our direct siblings (if any) - if (nsnull != mNextSibling) { - mNextSibling->SizeOf(aSizeOfHandler, localSize); - } -} - static void IndentBy(FILE* out, PRInt32 aIndent) { while (--aIndent >= 0) fputs(" ", out); } diff --git a/mozilla/layout/style/nsStyleContext.h b/mozilla/layout/style/nsStyleContext.h index c132e9ab86e..efb632f1c56 100644 --- a/mozilla/layout/style/nsStyleContext.h +++ b/mozilla/layout/style/nsStyleContext.h @@ -108,8 +108,6 @@ public: void DumpRegressionData(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent); void List(FILE* out, PRInt32 aIndent); - - void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize); #endif protected: diff --git a/mozilla/layout/style/nsStyleSet.cpp b/mozilla/layout/style/nsStyleSet.cpp index 9e4c35e439a..8bf3ec2763e 100644 --- a/mozilla/layout/style/nsStyleSet.cpp +++ b/mozilla/layout/style/nsStyleSet.cpp @@ -71,8 +71,6 @@ #define STYLESET_STOP_TIMER(a) ((void)0) #endif -#include "nsISizeOfHandler.h" - // ===================================================== // nsRuleNodeList // A class that represents a chain of rule nodes @@ -291,8 +289,6 @@ public: #ifdef DEBUG virtual void List(FILE* out = stdout, PRInt32 aIndent = 0); - - virtual void SizeOf(nsISizeOfHandler *aSizeofHandler, PRUint32 &aSize); #endif virtual void ResetUniqueStyleItems(void); @@ -1966,191 +1962,3 @@ StyleSetImpl::AttributeAffectsStyle(nsIAtom *aAttribute, nsIContent *aContent, return NS_OK; } - -#ifdef DEBUG -/****************************************************************************** -* SizeOf method: -* -* Self (reported as StyleSetImpl's size): -* 1) sizeof(*this) + sizeof (overhead only) each collection that exists -* and the FrameConstructor overhead -* -* Contained / Aggregated data (not reported as StyleSetImpl's size): -* 1) Override Sheets, DocSheets, UserSheets, AgentSheets, RuleProcessors, Recycler -* are all delegated to. -* -* Children / siblings / parents: -* none -* -******************************************************************************/ -void StyleSetImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize) -{ - NS_ASSERTION(aSizeOfHandler, "SizeOf handler cannot be null"); - - // first get the unique items collection - UNIQUE_STYLE_ITEMS(uniqueItems); - - if(! uniqueItems->AddItem((void*)this) ){ - NS_ASSERTION(0, "StyleSet has already been conted in SizeOf operation"); - // styleset has already been accounted for - return; - } - // get or create a tag for this instance - nsCOMPtr tag = do_GetAtom("StyleSet"); - // get the size of an empty instance and add to the sizeof handler - aSize = sizeof(StyleSetImpl); - - // Next get the size of the OVERHEAD of objects we will delegate to: - if (mOverrideSheets && uniqueItems->AddItem(mOverrideSheets)){ - aSize += sizeof(*mOverrideSheets); - } - if (mDocSheets && uniqueItems->AddItem(mDocSheets)){ - aSize += sizeof(*mDocSheets); - } - if (mUserSheets && uniqueItems->AddItem(mUserSheets)){ - aSize += sizeof(*mUserSheets); - } - if (mAgentSheets && uniqueItems->AddItem(mAgentSheets)){ - aSize += sizeof(*mAgentSheets); - } - if (mAgentRuleProcessors && uniqueItems->AddItem(mAgentRuleProcessors)){ - aSize += sizeof(*mAgentRuleProcessors); - } - if (mUserRuleProcessors && uniqueItems->AddItem(mUserRuleProcessors)){ - aSize += sizeof(*mUserRuleProcessors); - } - if (mDocRuleProcessors && uniqueItems->AddItem(mDocRuleProcessors)){ - aSize += sizeof(*mDocRuleProcessors); - } - if (mOverrideRuleProcessors && uniqueItems->AddItem(mOverrideRuleProcessors)){ - aSize += sizeof(*mOverrideRuleProcessors); - } - if (mRecycler && uniqueItems->AddItem(mRecycler)){ - aSize += sizeof(*mRecycler); - } - if (mQuirkStyleSheet) { - aSize += sizeof(mQuirkStyleSheet); // just the pointer: the sheet is counted elsewhere - } - /////////////////////////////////////////////// - // now the FrameConstructor - if(mFrameConstructor && uniqueItems->AddItem((void*)mFrameConstructor)){ - aSize += sizeof(mFrameConstructor); - } - aSizeOfHandler->AddSize(tag,aSize); - - /////////////////////////////////////////////// - // Now travers the collections and delegate - PRInt32 numSheets, curSheet; - PRUint32 localSize=0; - numSheets = GetNumberOfOverrideStyleSheets(); - for(curSheet=0; curSheet < numSheets; curSheet++){ - nsIStyleSheet* pSheet = GetOverrideStyleSheetAt(curSheet); //addref - if(pSheet){ - localSize=0; - pSheet->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(pSheet); - } - - numSheets = GetNumberOfDocStyleSheets(); - for(curSheet=0; curSheet < numSheets; curSheet++){ - nsIStyleSheet* pSheet = GetDocStyleSheetAt(curSheet); - if(pSheet){ - localSize=0; - pSheet->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(pSheet); - } - - numSheets = GetNumberOfUserStyleSheets(); - for(curSheet=0; curSheet < numSheets; curSheet++){ - nsIStyleSheet* pSheet = GetUserStyleSheetAt(curSheet); - if(pSheet){ - localSize=0; - pSheet->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(pSheet); - } - - numSheets = GetNumberOfAgentStyleSheets(); - for(curSheet=0; curSheet < numSheets; curSheet++){ - nsIStyleSheet* pSheet = GetAgentStyleSheetAt(curSheet); - if(pSheet){ - localSize=0; - pSheet->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(pSheet); - } - /////////////////////////////////////////////// - // rule processors - PRUint32 numRuleProcessors,curRuleProcessor; - if(mAgentRuleProcessors){ - mAgentRuleProcessors->Count(&numRuleProcessors); - for(curRuleProcessor=0; curRuleProcessor < numRuleProcessors; curRuleProcessor++){ - nsIStyleRuleProcessor* processor = - (nsIStyleRuleProcessor* )mAgentRuleProcessors->ElementAt(curRuleProcessor); - if(processor){ - localSize=0; - processor->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(processor); - } - } - if(mUserRuleProcessors){ - mUserRuleProcessors->Count(&numRuleProcessors); - for(curRuleProcessor=0; curRuleProcessor < numRuleProcessors; curRuleProcessor++){ - nsIStyleRuleProcessor* processor = - (nsIStyleRuleProcessor* )mUserRuleProcessors->ElementAt(curRuleProcessor); - if(processor){ - localSize=0; - processor->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(processor); - } - } - if(mDocRuleProcessors){ - mDocRuleProcessors->Count(&numRuleProcessors); - for(curRuleProcessor=0; curRuleProcessor < numRuleProcessors; curRuleProcessor++){ - nsIStyleRuleProcessor* processor = - (nsIStyleRuleProcessor* )mDocRuleProcessors->ElementAt(curRuleProcessor); - if(processor){ - localSize=0; - processor->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(processor); - } - } - if(mOverrideRuleProcessors){ - mOverrideRuleProcessors->Count(&numRuleProcessors); - for(curRuleProcessor=0; curRuleProcessor < numRuleProcessors; curRuleProcessor++){ - nsIStyleRuleProcessor* processor = - (nsIStyleRuleProcessor* )mOverrideRuleProcessors->ElementAt(curRuleProcessor); - if(processor){ - localSize=0; - processor->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(processor); - } - } - - /////////////////////////////////////////////// - // and the recycled ones too - if(mRecycler){ - mRecycler->Count(&numRuleProcessors); - for(curRuleProcessor=0; curRuleProcessor < numRuleProcessors; curRuleProcessor++){ - nsIStyleRuleProcessor* processor = - (nsIStyleRuleProcessor* )mRecycler->ElementAt(curRuleProcessor); - if(processor && uniqueItems->AddItem((void*)processor)){ - localSize=0; - processor->SizeOf(aSizeOfHandler, localSize); - } - NS_IF_RELEASE(processor); - } - } - - // XXX - do the stylecontext cache too - - // now delegate the sizeof to the larger or more complex aggregated objects - // - none -} -#endif diff --git a/mozilla/layout/tables/BasicTableLayoutStrategy.h b/mozilla/layout/tables/BasicTableLayoutStrategy.h index 69883aabd2c..df5ce3a1d2c 100644 --- a/mozilla/layout/tables/BasicTableLayoutStrategy.h +++ b/mozilla/layout/tables/BasicTableLayoutStrategy.h @@ -244,12 +244,6 @@ protected: */ void ContinuingFrameCheck(); -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const { - *aResult = sizeof(*this); - } -#endif - protected: nsTableFrame * mTableFrame; PRInt32 mCols; diff --git a/mozilla/layout/tables/FixedTableLayoutStrategy.h b/mozilla/layout/tables/FixedTableLayoutStrategy.h index bb942f72b66..ad40219b79d 100644 --- a/mozilla/layout/tables/FixedTableLayoutStrategy.h +++ b/mozilla/layout/tables/FixedTableLayoutStrategy.h @@ -85,12 +85,6 @@ public: nscoord aAvailWidth, float aPixelToTwips) {return 0;}; -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const { - *aResult = sizeof(*this); - } -#endif - protected: /* assign the width of all columns * if there is a colframe with a width attribute, use it as the column width. diff --git a/mozilla/layout/tables/nsCellMap.cpp b/mozilla/layout/tables/nsCellMap.cpp index b05fd01d918..4b0d9e99b0b 100644 --- a/mozilla/layout/tables/nsCellMap.cpp +++ b/mozilla/layout/tables/nsCellMap.cpp @@ -966,28 +966,6 @@ nsTableCellMap::SetBCBorderCorner(Corner aCorner, else NS_ASSERTION(PR_FALSE, "program error"); } -#ifdef DEBUG -void nsTableCellMap::SizeOf(nsISizeOfHandler* aHandler, - PRUint32* aResult) const -{ - NS_PRECONDITION(aResult, "null OUT parameter pointer"); - PRUint32 sum = sizeof(*this); - - // Add in the size of the void arrays. Because we have emnbedded objects - // and not pointers to void arrays, we need to subtract out the size of the - // embedded object so it isn't double counted - PRUint32 voidArraySize; - - mCols.SizeOf(aHandler, &voidArraySize); - sum += voidArraySize - sizeof(mCols); - - // XXX need to so something for mBCInfo - *aResult = sum; -} -#endif - -// nsCellMap - nsCellMap::nsCellMap(nsTableRowGroupFrame& aRowGroup) : mRowCount(0), mRowGroupFrame(&aRowGroup), mNextSibling(nsnull) { @@ -2389,21 +2367,3 @@ PRBool nsCellMap::ColHasSpanningCells(nsTableCellMap& aMap, } return PR_FALSE; } - -#ifdef DEBUG -void nsCellMap::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - NS_PRECONDITION(aResult, "null OUT parameter pointer"); - PRUint32 sum = sizeof(*this); - - // Add in the size of the void arrays. Because we have emnbedded objects - // and not pointers to void arrays, we need to subtract out the size of the - // embedded object so it isn't double counted - PRUint32 voidArraySize; - - mRows.SizeOf(aHandler, &voidArraySize); - sum += voidArraySize - sizeof(mRows); - - *aResult = sum; -} -#endif diff --git a/mozilla/layout/tables/nsCellMap.h b/mozilla/layout/tables/nsCellMap.h index a9e1b94c6c3..14d51ad2b3f 100644 --- a/mozilla/layout/tables/nsCellMap.h +++ b/mozilla/layout/tables/nsCellMap.h @@ -193,10 +193,6 @@ public: void Dump(char* aString = nsnull) const; #endif -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - protected: BCData* GetRightMostBorder(PRInt32 aRowIndex); BCData* GetBottomMostBorder(PRInt32 aColIndex); @@ -339,10 +335,6 @@ public: void Dump(PRBool aIsBorderCollapse) const; #endif -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - protected: friend class nsTableCellMap; friend class BCMapCellIterator; diff --git a/mozilla/layout/tables/nsITableLayoutStrategy.h b/mozilla/layout/tables/nsITableLayoutStrategy.h index d8e717faba7..8329a6374a2 100644 --- a/mozilla/layout/tables/nsITableLayoutStrategy.h +++ b/mozilla/layout/tables/nsITableLayoutStrategy.h @@ -46,7 +46,6 @@ struct nsHTMLReflowState; struct nsMargin; class nsTableCellFrame; class nsStyleCoord; -class nsISizeOfHandler; class nsITableLayoutStrategy { @@ -79,10 +78,6 @@ public: const nsHTMLReflowState& aReflowState, nscoord aAvailWidth, float aPixelToTwips)=0; - -#ifdef DEBUG - virtual void SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const = 0; -#endif }; #endif diff --git a/mozilla/layout/tables/nsTableCellFrame.cpp b/mozilla/layout/tables/nsTableCellFrame.cpp index 7b3c7e1d7b9..a4c9884be59 100644 --- a/mozilla/layout/tables/nsTableCellFrame.cpp +++ b/mozilla/layout/tables/nsTableCellFrame.cpp @@ -1425,19 +1425,6 @@ void nsTableCellFrame::GetCollapseOffset(nsIPresContext* aPresContext, } } -#ifdef DEBUG -NS_IMETHODIMP -nsTableCellFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - *aResult = sum; - return NS_OK; -} -#endif - // nsBCTableCellFrame nsBCTableCellFrame::nsBCTableCellFrame() @@ -1561,17 +1548,3 @@ nsBCTableCellFrame::PaintUnderlay(nsIPresContext& aPresContext, // don't paint the children if it's pass1 aPaintChildren = (aFlags & BORDER_COLLAPSE_BACKGROUNDS); } - -#ifdef DEBUG -NS_IMETHODIMP -nsBCTableCellFrame::SizeOf(nsISizeOfHandler* aHandler, - PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - *aResult = sum; - return NS_OK; -} -#endif diff --git a/mozilla/layout/tables/nsTableCellFrame.h b/mozilla/layout/tables/nsTableCellFrame.h index 4db09980812..406cf087301 100644 --- a/mozilla/layout/tables/nsTableCellFrame.h +++ b/mozilla/layout/tables/nsTableCellFrame.h @@ -162,7 +162,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif virtual void VerticallyAlignChild(nsIPresContext* aPresContext, @@ -470,7 +469,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif protected: diff --git a/mozilla/layout/tables/nsTableColFrame.cpp b/mozilla/layout/tables/nsTableColFrame.cpp index 4a12e9da353..831652f7957 100644 --- a/mozilla/layout/tables/nsTableColFrame.cpp +++ b/mozilla/layout/tables/nsTableColFrame.cpp @@ -314,15 +314,4 @@ nsTableColFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("TableCol"), aResult); } - -NS_IMETHODIMP -nsTableColFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - *aResult = sum; - return NS_OK; -} #endif diff --git a/mozilla/layout/tables/nsTableColFrame.h b/mozilla/layout/tables/nsTableColFrame.h index 280efa9933b..cdfffd2782c 100644 --- a/mozilla/layout/tables/nsTableColFrame.h +++ b/mozilla/layout/tables/nsTableColFrame.h @@ -135,7 +135,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif /** return the number of the columns the col represents. always >= 0 */ diff --git a/mozilla/layout/tables/nsTableColGroupFrame.cpp b/mozilla/layout/tables/nsTableColGroupFrame.cpp index 9221c4540ca..33c7937157d 100644 --- a/mozilla/layout/tables/nsTableColGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableColGroupFrame.cpp @@ -752,15 +752,4 @@ nsTableColGroupFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("TableColGroup"), aResult); } - -NS_IMETHODIMP -nsTableColGroupFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - *aResult = sum; - return NS_OK; -} #endif diff --git a/mozilla/layout/tables/nsTableColGroupFrame.h b/mozilla/layout/tables/nsTableColGroupFrame.h index d0f0f556882..6959263b5d9 100644 --- a/mozilla/layout/tables/nsTableColGroupFrame.h +++ b/mozilla/layout/tables/nsTableColGroupFrame.h @@ -148,7 +148,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif /** returns the number of columns represented by this group. diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index 13d4ee48758..0fd618be141 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -70,7 +70,6 @@ #include "nsIDOMElement.h" #include "nsIDOMHTMLElement.h" #include "nsIDOMHTMLBodyElement.h" -#include "nsISizeOfHandler.h" #include "nsIScrollableFrame.h" #include "nsHTMLReflowCommand.h" #include "nsIFrameManager.h" @@ -7443,33 +7442,6 @@ nsTableFrame::GetProperty(nsIPresContext* aPresContext, } #ifdef DEBUG -NS_IMETHODIMP -nsTableFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - - // Add in size of cell map - PRUint32 cellMapSize; - mCellMap->SizeOf(aHandler, &cellMapSize); - aHandler->AddSize(nsLayoutAtoms::cellMap, cellMapSize); - - // Add in size of col cache - PRUint32 voidArraySize; - mColFrames.SizeOf(aHandler, &voidArraySize); - sum += voidArraySize - sizeof(mColFrames); - - // Add in size of table layout strategy - PRUint32 strategySize; - mTableLayoutStrategy->SizeOf(aHandler, &strategySize); - aHandler->AddSize(nsLayoutAtoms::tableStrategy, strategySize); - - *aResult = sum; - return NS_OK; -} - #define MAX_SIZE 128 #define MIN_INDENT 30 diff --git a/mozilla/layout/tables/nsTableFrame.h b/mozilla/layout/tables/nsTableFrame.h index fef8f6c3f41..6e084af087a 100644 --- a/mozilla/layout/tables/nsTableFrame.h +++ b/mozilla/layout/tables/nsTableFrame.h @@ -408,7 +408,6 @@ public: #ifdef DEBUG /** @see nsIFrame::GetFrameName */ NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif /** return the width of the column at aColIndex */ diff --git a/mozilla/layout/tables/nsTableOuterFrame.cpp b/mozilla/layout/tables/nsTableOuterFrame.cpp index 355b0e716fb..f7fbb26558f 100644 --- a/mozilla/layout/tables/nsTableOuterFrame.cpp +++ b/mozilla/layout/tables/nsTableOuterFrame.cpp @@ -2226,15 +2226,4 @@ nsTableOuterFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("TableOuter"), aResult); } - -NS_IMETHODIMP -nsTableOuterFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - *aResult = sum; - return NS_OK; -} #endif diff --git a/mozilla/layout/tables/nsTableOuterFrame.h b/mozilla/layout/tables/nsTableOuterFrame.h index 351bfe535ba..f63c38d8244 100644 --- a/mozilla/layout/tables/nsTableOuterFrame.h +++ b/mozilla/layout/tables/nsTableOuterFrame.h @@ -161,7 +161,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif /** SetSelected needs to be overridden to talk to inner tableframe diff --git a/mozilla/layout/tables/nsTableRowFrame.cpp b/mozilla/layout/tables/nsTableRowFrame.cpp index 138bc5ca288..a68bc699873 100644 --- a/mozilla/layout/tables/nsTableRowFrame.cpp +++ b/mozilla/layout/tables/nsTableRowFrame.cpp @@ -1677,15 +1677,4 @@ nsTableRowFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("TableRow"), aResult); } - -NS_IMETHODIMP -nsTableRowFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - *aResult = sum; - return NS_OK; -} #endif diff --git a/mozilla/layout/tables/nsTableRowFrame.h b/mozilla/layout/tables/nsTableRowFrame.h index aa46d78af04..85130f9244a 100644 --- a/mozilla/layout/tables/nsTableRowFrame.h +++ b/mozilla/layout/tables/nsTableRowFrame.h @@ -153,8 +153,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, - PRUint32* aResult) const; #endif void UpdateHeight(nscoord aHeight, diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.cpp b/mozilla/layout/tables/nsTableRowGroupFrame.cpp index e03dc0f4371..cdae7cc4cab 100644 --- a/mozilla/layout/tables/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableRowGroupFrame.cpp @@ -1895,17 +1895,6 @@ nsTableRowGroupFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("TableRowGroup"), aResult); } - -NS_IMETHODIMP -nsTableRowGroupFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - PRUint32 sum = sizeof(*this); - *aResult = sum; - return NS_OK; -} #endif nsMargin* diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.h b/mozilla/layout/tables/nsTableRowGroupFrame.h index 1b82f15fdec..94d3bae2125 100644 --- a/mozilla/layout/tables/nsTableRowGroupFrame.h +++ b/mozilla/layout/tables/nsTableRowGroupFrame.h @@ -186,7 +186,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; #endif /** return the number of child rows (not necessarily == number of child frames) */ diff --git a/mozilla/layout/xul/base/src/nsDocElementBoxFrame.cpp b/mozilla/layout/xul/base/src/nsDocElementBoxFrame.cpp index 88a90faa1c0..a66ba905519 100644 --- a/mozilla/layout/xul/base/src/nsDocElementBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsDocElementBoxFrame.cpp @@ -87,7 +87,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; #endif }; @@ -174,14 +173,4 @@ nsDocElementBoxFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("DocElementBox"), aResult); } - -NS_IMETHODIMP -nsDocElementBoxFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} #endif diff --git a/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp b/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp index 2e354051b5e..d22844f80aa 100644 --- a/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp @@ -75,7 +75,6 @@ #include "nsIViewManager.h" #include "nsHTMLContainerFrame.h" #include "prprf.h" -#include "nsISizeOfHandler.h" #include "nsIFontMetrics.h" #include "nsCSSRendering.h" #include "nsIDOMHTMLImageElement.h" diff --git a/mozilla/layout/xul/base/src/nsRootBoxFrame.cpp b/mozilla/layout/xul/base/src/nsRootBoxFrame.cpp index 3dd47c39e1b..a655caa6139 100644 --- a/mozilla/layout/xul/base/src/nsRootBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsRootBoxFrame.cpp @@ -116,7 +116,6 @@ public: #ifdef DEBUG NS_IMETHOD GetFrameName(nsString& aResult) const; - NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; #endif nsIFrame* mPopupSetFrame; @@ -361,14 +360,4 @@ nsRootBoxFrame::GetFrameName(nsString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("RootBox"), aResult); } - -NS_IMETHODIMP -nsRootBoxFrame::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - *aResult = sizeof(*this); - return NS_OK; -} #endif diff --git a/mozilla/string/obsolete/nsString.cpp b/mozilla/string/obsolete/nsString.cpp index f0dccbcf085..e816e7beee8 100644 --- a/mozilla/string/obsolete/nsString.cpp +++ b/mozilla/string/obsolete/nsString.cpp @@ -52,7 +52,6 @@ #ifndef RICKG_TESTBED #include "prdtoa.h" -#include "nsISizeOfHandler.h" #endif static const char* kPossibleNull = "Error: possible unintended null in string"; @@ -140,14 +139,6 @@ nsCString::nsCString( const nsACString& aReadable ) { Assign(aReadable); } -#ifdef DEBUG -void nsCString::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const { - if (aResult) { - *aResult = sizeof(*this) + GetCapacity() * GetCharSize(); - } -} -#endif - /** * This method truncates this string to given length. * @@ -1272,12 +1263,3 @@ nsCAutoString::nsCAutoString(const CBufDescriptor& aBuffer) : nsCString() { if(!aBuffer.mIsConst) AddNullTerminator(*this); //this isn't really needed, but it guarantees that folks don't pass string constants. } - - -#ifdef DEBUG -void nsCAutoString::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const { - if (aResult) { - *aResult = sizeof(*this) + GetCapacity() * GetCharSize(); - } -} -#endif diff --git a/mozilla/string/obsolete/nsString.h b/mozilla/string/obsolete/nsString.h index d12d81abab4..aaed3069216 100644 --- a/mozilla/string/obsolete/nsString.h +++ b/mozilla/string/obsolete/nsString.h @@ -359,16 +359,6 @@ public: PRBool EqualsIgnoreCase(const char* aString,PRInt32 aCount=-1) const; - - -#ifdef DEBUG - /** - * Retrieve the size of this string - * @return string length - */ - virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - private: // NOT TO BE IMPLEMENTED // these signatures help clients not accidentally call the wrong thing helped by C++ automatic integral promotion @@ -424,14 +414,6 @@ public: nsCAutoString& operator=( const char* aPtr ) { Assign(aPtr); return *this; } nsCAutoString& operator=( char aChar ) { Assign(aChar); return *this; } -#ifdef DEBUG - /** - * Retrieve the size of this string - * @return string length - */ - virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - char mBuffer[kDefaultStringSize]; }; diff --git a/mozilla/string/obsolete/nsString2.cpp b/mozilla/string/obsolete/nsString2.cpp index 7a34069e063..c3d92a8dd9b 100644 --- a/mozilla/string/obsolete/nsString2.cpp +++ b/mozilla/string/obsolete/nsString2.cpp @@ -51,7 +51,6 @@ #ifndef RICKG_TESTBED #include "prdtoa.h" -#include "nsISizeOfHandler.h" #endif static const char* kPossibleNull = "Error: possible unintended null in string"; @@ -155,14 +154,6 @@ nsString::nsString( const nsAString& aReadable ) { Assign(aReadable); } -#ifdef DEBUG -void nsString::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const { - if (aResult) { - *aResult = sizeof(*this) + GetCapacity() * GetCharSize(); - } -} -#endif - /** * This method truncates this string to given length. * @@ -1473,12 +1464,3 @@ nsAutoString::nsAutoString(PRUnichar aChar) : nsString(){ AddNullTerminator(*this); Append(aChar); } - -#ifdef DEBUG -void nsAutoString::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const { - if (aResult) { - *aResult = sizeof(*this) + GetCapacity() * GetCharSize(); - } -} -#endif - diff --git a/mozilla/string/obsolete/nsString2.h b/mozilla/string/obsolete/nsString2.h index 36879063cd2..950b0fcf43c 100644 --- a/mozilla/string/obsolete/nsString2.h +++ b/mozilla/string/obsolete/nsString2.h @@ -92,7 +92,6 @@ class UTF8traits class nsAFlatString { public: virtual ~nsAString() { } }; #endif -class nsISizeOfHandler; class nsCString; @@ -433,14 +432,6 @@ public: */ static PRBool IsSpace(PRUnichar ch); -#ifdef DEBUG - /** - * Retrieve the size of this string - * @return string length - */ - virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - private: // NOT TO BE IMPLEMENTED // these signatures help clients not accidentally call the wrong thing helped by C++ automatic integral promotion @@ -498,14 +489,6 @@ public: nsAutoString& operator=( const PRUnichar* aPtr ) { Assign(aPtr); return *this; } nsAutoString& operator=( PRUnichar aChar ) { Assign(aChar); return *this; } -#ifdef DEBUG - /** - * Retrieve the size of this string - * @return string length - */ - virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - PRUnichar mBuffer[kDefaultStringSize]; }; diff --git a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp index aab8ec6e973..d1e171e6a25 100644 --- a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp +++ b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp @@ -2549,191 +2549,6 @@ nsBrowserWindow::DumpFrames(FILE* out, nsString *aFilterName) //---------------------------------------------------------------------- -#include "nsISizeOfHandler.h" -#include "nsQuickSort.h" - -struct SizeReportEntry { - nsIAtom* mKey; - PRUint32 mCount; - PRUint32 mTotalSize; - PRUint32 mMinSize; - PRUint32 mMaxSize; -}; - -static void -GatherSizeReportData(nsISizeOfHandler* aHandler, - nsIAtom* aKey, - PRUint32 aCount, - PRUint32 aTotalSize, - PRUint32 aMinSize, - PRUint32 aMaxSize, - void* arg) -{ - if (aKey) { - nsVoidArray* array = (nsVoidArray*) arg; - SizeReportEntry* entry = new SizeReportEntry(); - entry->mKey = aKey; - entry->mCount = aCount; - entry->mTotalSize = aTotalSize; - entry->mMinSize = aMinSize; - entry->mMaxSize = aMaxSize; - array->AppendElement((void*) entry); - } -} - -static int PR_CALLBACK CompareEntries(const void* ve1, const void* ve2, void* closure) -{ - SizeReportEntry* e1 = (SizeReportEntry*) ve1; - SizeReportEntry* e2 = (SizeReportEntry*) ve2; - if (e1->mKey == e2->mKey) { - return 0; - } - nsAutoString k1, k2; - e1->mKey->ToString(k1); - e2->mKey->ToString(k2); - if (k1 < k2) { - return -1; - } - return 1; -} - -static SizeReportEntry* -SortFrameSizeList(nsVoidArray& sizeReportData) -{ - // Convert data in void array into a real array, freeing the old data - PRInt32 i, count = sizeReportData.Count(); - SizeReportEntry* all = new SizeReportEntry[count]; - SizeReportEntry* to = all; - for (i = 0; i < count; i++) { - SizeReportEntry* e = (SizeReportEntry*) sizeReportData[i]; - *to = *e; - to++; - sizeReportData.ReplaceElementAt(nsnull, i); - delete e; - } - - // Now sort the array - NS_QuickSort(all, count, sizeof(SizeReportEntry), CompareEntries, nsnull); - - return all; -} - -static void ShowReport(FILE* out, nsISizeOfHandler* aHandler) -{ - nsVoidArray sizeReportData; - aHandler->Report(GatherSizeReportData, (void*) &sizeReportData); - - if (sizeReportData.Count()) { - PRInt32 count = sizeReportData.Count(); - SizeReportEntry* entries = SortFrameSizeList(sizeReportData); - - // Display headers - fprintf(out, "%-20s %-5s %-9s %-7s %-7s %-7s\n", - "Frame Type", "Count", "TotalSize", - "MinSize", "MaxSize", "AvgSize"); - fprintf(out, "%-20s %-5s %-9s %-7s %-7s %-7s\n", - "----------", "-----", "---------", - "-------", "-------", "-------"); - - SizeReportEntry* entry = entries; - SizeReportEntry* end = entries + count; - for (; entry < end; entry++) { - nsAutoString type; - entry->mKey->ToString(type); - - fprintf(out, "%-20s %5d %9d %7d %7d %7d\n", - NS_LossyConvertUCS2toASCII(type).get(), - entry->mCount, entry->mTotalSize, - entry->mMinSize, entry->mMaxSize, - entry->mCount ? entry->mTotalSize / entry->mCount : 0); - } - delete entries; - - // Display totals and trailer - PRUint32 totalCount, totalSize; - aHandler->GetTotals(&totalCount, &totalSize); - fprintf(out, "%-20s %5d %9d\n", - "*** Total ***", totalCount, totalSize); - } -} - -//---------------------------------------- - -static void -GatherFrameDataSizes(nsIPresContext* aPresContext, nsISizeOfHandler* aHandler, nsIFrame* aFrame) -{ - if (aFrame) { - // Add in the frame - nsCOMPtr frameType; - aFrame->GetFrameType(getter_AddRefs(frameType)); - PRUint32 frameDataSize; - nsIFrameDebug* fdbg; - if (NS_SUCCEEDED(aFrame->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**) &fdbg))) { - fdbg->SizeOf(aHandler, &frameDataSize); - aHandler->AddSize(frameType, frameDataSize); - } - - // And all of its children - PRInt32 listIndex = 0; - nsIAtom* listName = nsnull; - do { - nsIFrame* kid; - aFrame->FirstChild(aPresContext, listName, &kid); - while (kid) { - GatherFrameDataSizes(aPresContext, aHandler, kid); - kid->GetNextSibling(&kid); - } - NS_IF_RELEASE(listName); - aFrame->GetAdditionalChildListName(listIndex, &listName); - listIndex++; - } while (nsnull != listName); - } -} - -static void -GatherFrameDataSizes(nsISizeOfHandler* aHandler, nsIDocShell* aDocShell) -{ - if (nsnull != aDocShell) { - nsIPresShell* shell = GetPresShellFor(aDocShell); - if (nsnull != shell) { - nsCOMPtr presContext; - nsIFrame* root; - shell->GetRootFrame(&root); - shell->GetPresContext(getter_AddRefs(presContext)); - if (nsnull != root) { - GatherFrameDataSizes(presContext, aHandler, root); - } - NS_RELEASE(shell); - } - - // dump the frames of the sub documents - PRInt32 i, n; - nsCOMPtr docShellAsNode(do_QueryInterface(aDocShell)); - docShellAsNode->GetChildCount(&n); - for (i = 0; i < n; i++) { - nsCOMPtr child; - docShellAsNode->GetChildAt(i, getter_AddRefs(child)); - nsCOMPtr childAsShell(do_QueryInterface(child)); - if (childAsShell) { - GatherFrameDataSizes(aHandler, childAsShell); - } - } - } -} - -void -nsBrowserWindow::ShowFrameSize(FILE* out) -{ - nsCOMPtr handler; - nsresult rv = NS_NewSizeOfHandler(getter_AddRefs(handler)); - if (NS_SUCCEEDED(rv) && handler) { - GatherFrameDataSizes(handler, mDocShell); - ShowReport(out, handler); - } -} - -//---------------------------------------------------------------------- - static void DumpViewsRecurse(nsIDocShell* aDocShell, FILE* out) @@ -2958,127 +2773,6 @@ nsBrowserWindow::GetStringPref(const char * aPrefName, nsString& aValue) } #ifdef NS_DEBUG - -//---------------------------------------------------------------------- - -static void -GatherContentDataSizes(nsISizeOfHandler* aHandler, nsIContent* aContent) -{ - if (aContent) { - // Add in the content - nsCOMPtr tag; - aContent->GetTag(*getter_AddRefs(tag)); - if (!tag) { - tag = getter_AddRefs(NS_NewAtom(":content-no-tag")); - } - PRUint32 contentDataSize; - aContent->SizeOf(aHandler, &contentDataSize); - aHandler->AddSize(tag, contentDataSize); - - // And all of its children - PRInt32 i, childCount; - aContent->ChildCount(childCount); - for (i = 0; i < childCount; i++) { - nsIContent* kid; - aContent->ChildAt(i, kid); - if (kid) { - GatherContentDataSizes(aHandler, kid); - NS_RELEASE(kid); - } - } - } -} - -static void -GatherContentDataSizes(nsISizeOfHandler* aHandler, nsIDocShell* aDocShell) -{ - if (nsnull != aDocShell) { - nsIPresShell* shell = GetPresShellFor(aDocShell); - if (nsnull != shell) { - nsIDocument* doc; - shell->GetDocument(&doc); - if (doc) { - nsCOMPtr rootContent; - doc->GetRootContent(getter_AddRefs(rootContent)); - if (rootContent) { - GatherContentDataSizes(aHandler, rootContent.get()); - } - NS_RELEASE(doc); - } - NS_RELEASE(shell); - } - - // dump the frames of the sub documents - PRInt32 i, n; - nsCOMPtr docShellAsNode(do_QueryInterface(aDocShell)); - docShellAsNode->GetChildCount(&n); - for (i = 0; i < n; i++) { - nsCOMPtr child; - docShellAsNode->GetChildAt(i, getter_AddRefs(child)); - nsCOMPtr childAsShell(do_QueryInterface(child)); - if (childAsShell) { - GatherContentDataSizes(aHandler, childAsShell); - } - } - } -} - -void -nsBrowserWindow::ShowContentSize(FILE* out) -{ - nsCOMPtr handler; - nsresult rv = NS_NewSizeOfHandler(getter_AddRefs(handler)); - if (NS_SUCCEEDED(rv) && handler) { - GatherContentDataSizes(handler, mDocShell); - ShowReport(out, handler); - } -} - -//---------------------------------------------------------------------- - -static void -GatherStyleDataSizes(nsISizeOfHandler* aHandler, nsIDocShell* aDocShell) -{ - if (nsnull != aDocShell) { - nsIPresShell* shell = GetPresShellFor(aDocShell); - if (nsnull != shell) { - nsIStyleSet *styleSet; - shell->GetStyleSet(&styleSet); - if(styleSet){ - PRUint32 ssSize; - styleSet->ResetUniqueStyleItems(); - // size of the style set - styleSet->SizeOf(aHandler, ssSize); - NS_RELEASE(styleSet); - } - nsIFrame* root; - shell->GetRootFrame(&root); - if (nsnull == root) { - puts("null root frame\n"); - } else { - nsIFrameDebug* fdbg; - if (NS_SUCCEEDED(root->QueryInterface(NS_GET_IID(nsIFrameDebug), - (void**) &fdbg))) { - PRUint32 contextSize; - fdbg->SizeOfStyleContext(aHandler, contextSize); - } - } - NS_RELEASE(shell); - } - } -} - -void -nsBrowserWindow::ShowStyleSize(FILE* out) -{ - nsCOMPtr handler; - nsresult rv = NS_NewSizeOfHandler(getter_AddRefs(handler)); - if (NS_SUCCEEDED(rv) && handler) { - GatherStyleDataSizes(handler, mDocShell); - ShowReport(out, handler); - } -} - void nsBrowserWindow::DoDebugSave() { @@ -3200,21 +2894,6 @@ nsBrowserWindow::DispatchDebugMenu(PRInt32 aID) result = nsEventStatus_eConsumeNoDefault; break; - case VIEWER_SHOW_CONTENT_SIZE: - ShowContentSize(); - result = nsEventStatus_eConsumeNoDefault; - break; - - case VIEWER_SHOW_FRAME_SIZE: - ShowFrameSize(); - result = nsEventStatus_eConsumeNoDefault; - break; - - case VIEWER_SHOW_STYLE_SIZE: - ShowStyleSize(); - result = nsEventStatus_eConsumeNoDefault; - break; - case VIEWER_SHOW_CONTENT_QUALITY: if (nsnull != mDocShell) { nsIPresShell *ps = GetPresShellFor(mDocShell); diff --git a/mozilla/webshell/tests/viewer/nsBrowserWindow.h b/mozilla/webshell/tests/viewer/nsBrowserWindow.h index ac3fc5342d6..08a7bcc0051 100644 --- a/mozilla/webshell/tests/viewer/nsBrowserWindow.h +++ b/mozilla/webshell/tests/viewer/nsBrowserWindow.h @@ -191,9 +191,6 @@ public: void ToggleVisualEventDebugging(); void ToggleBoolPrefAndRefresh(const char * aPrefName); - void ShowContentSize(FILE* out = stdout); - void ShowFrameSize(FILE* out = stdout); - void ShowStyleSize(FILE* out = stdout); void DoDebugSave(); void DoToggleSelection(); void DoDebugRobot(); diff --git a/mozilla/webshell/tests/viewer/nsMacMain.cpp b/mozilla/webshell/tests/viewer/nsMacMain.cpp index ec7c046489e..7024399ea0f 100644 --- a/mozilla/webshell/tests/viewer/nsMacMain.cpp +++ b/mozilla/webshell/tests/viewer/nsMacMain.cpp @@ -118,9 +118,6 @@ enum cmd_DumpViews, cmd_DumpStyleSheets, cmd_DumpStyleContexts, - cmd_ShowContentSize, - cmd_ShowFrameSize, - cmd_ShowStyleSize, cmd_DebugSave, cmd_DebugOutputText, cmd_DebugOutputHTML, @@ -362,10 +359,6 @@ nsNativeBrowserWindow::DispatchMenuItem(PRInt32 aID) case cmd_DumpStyleSheets: xpID = VIEWER_DUMP_STYLE_SHEETS; break; case cmd_DumpStyleContexts: xpID = VIEWER_DUMP_STYLE_CONTEXTS; break; - case cmd_ShowContentSize: xpID = VIEWER_SHOW_CONTENT_SIZE; break; - case cmd_ShowFrameSize: xpID = VIEWER_SHOW_FRAME_SIZE; break; - case cmd_ShowStyleSize: xpID = VIEWER_SHOW_STYLE_SIZE; break; - case cmd_DebugSave: xpID = VIEWER_DEBUGSAVE; break; case cmd_DebugOutputText: xpID = VIEWER_DISPLAYTEXT; break; case cmd_DebugOutputHTML: xpID = VIEWER_DISPLAYHTML; break; diff --git a/mozilla/webshell/tests/viewer/nsPhMenu.cpp b/mozilla/webshell/tests/viewer/nsPhMenu.cpp index ca0a0a000e4..17cf6190061 100644 --- a/mozilla/webshell/tests/viewer/nsPhMenu.cpp +++ b/mozilla/webshell/tests/viewer/nsPhMenu.cpp @@ -231,10 +231,6 @@ struct MenuList_s DemoList[18] = CreateMenuItem(menu, "Dump Style Sheets", VIEWER_DUMP_STYLE_SHEETS); CreateMenuItem(menu, "Dump Style Contexts", VIEWER_DUMP_STYLE_CONTEXTS); CreateMenuItem(menu, NULL, 0); - CreateMenuItem(menu, "Show Content Size", VIEWER_SHOW_CONTENT_SIZE); - CreateMenuItem(menu, "Show Frame Size", VIEWER_SHOW_FRAME_SIZE); - CreateMenuItem(menu, "Show Style Size", VIEWER_SHOW_STYLE_SIZE); - CreateMenuItem(menu, NULL, 0); CreateMenuItem(menu, "Debug Save", VIEWER_DEBUGSAVE); CreateMenuItem(menu, "Debug Output Text", VIEWER_DISPLAYTEXT); CreateMenuItem(menu, "Debug Output HTML", VIEWER_DISPLAYHTML); diff --git a/mozilla/webshell/tests/viewer/resources.h b/mozilla/webshell/tests/viewer/resources.h index d8dabe7ea9d..f31efea12e6 100644 --- a/mozilla/webshell/tests/viewer/resources.h +++ b/mozilla/webshell/tests/viewer/resources.h @@ -82,9 +82,6 @@ #define VIEWER_DUMP_STYLE_SHEETS 40056 #define VIEWER_DUMP_STYLE_CONTEXTS 40057 #define VIEWER_DEBUGROBOT 40058 -#define VIEWER_SHOW_CONTENT_SIZE 40059 -#define VIEWER_SHOW_FRAME_SIZE 40060 -#define VIEWER_SHOW_STYLE_SIZE 40061 #define VIEWER_DEBUGSAVE 40062 #define VIEWER_SHOW_CONTENT_QUALITY 40063 #define VIEWER_TOGGLE_SELECTION 40064 diff --git a/mozilla/webshell/tests/viewer/unix/gtk/nsGtkMenu.cpp b/mozilla/webshell/tests/viewer/unix/gtk/nsGtkMenu.cpp index 51a8261954b..55f69c6e41c 100644 --- a/mozilla/webshell/tests/viewer/unix/gtk/nsGtkMenu.cpp +++ b/mozilla/webshell/tests/viewer/unix/gtk/nsGtkMenu.cpp @@ -124,10 +124,6 @@ GtkItemFactoryEntry menu_items[] = { "/Debug/Dump _Style Sheets", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DUMP_STYLE_SHEETS, nsnull }, { "/Debug/Dump _Style Contexts", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DUMP_STYLE_CONTEXTS, nsnull}, { "/Debug/sep1", nsnull, nsnull, 0, "" }, - { "/Debug/Show Content Size", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_SHOW_CONTENT_SIZE,nsnull }, - { "/Debug/Show Frame Size", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_SHOW_FRAME_SIZE, nsnull }, - { "/Debug/Show Style Size", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_SHOW_STYLE_SIZE, nsnull }, - { "/Debug/sep1", nsnull, nsnull, 0, "" }, { "/Debug/Debug Save", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEBUGSAVE, nsnull }, { "/Debug/Debug Output Text", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DISPLAYTEXT, nsnull }, { "/Debug/Debug Output HTML", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DISPLAYHTML, nsnull }, diff --git a/mozilla/webshell/tests/viewer/unix/gtk2/nsGtkMenu.cpp b/mozilla/webshell/tests/viewer/unix/gtk2/nsGtkMenu.cpp index 2dcc6c810c3..4bae1ad015c 100644 --- a/mozilla/webshell/tests/viewer/unix/gtk2/nsGtkMenu.cpp +++ b/mozilla/webshell/tests/viewer/unix/gtk2/nsGtkMenu.cpp @@ -121,10 +121,6 @@ GtkItemFactoryEntry menu_items[] = { "/Debug/Dump _Style Sheets", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DUMP_STYLE_SHEETS, nsnull }, { "/Debug/Dump _Style Contexts", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DUMP_STYLE_CONTEXTS, nsnull}, { "/Debug/sep1", nsnull, nsnull, 0, "" }, - { "/Debug/Show Content Size", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_SHOW_CONTENT_SIZE,nsnull }, - { "/Debug/Show Frame Size", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_SHOW_FRAME_SIZE, nsnull }, - { "/Debug/Show Style Size", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_SHOW_STYLE_SIZE, nsnull }, - { "/Debug/sep1", nsnull, nsnull, 0, "" }, { "/Debug/Debug Save", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEBUGSAVE, nsnull }, { "/Debug/Debug Output Text", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DISPLAYTEXT, nsnull }, { "/Debug/Debug Output HTML", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DISPLAYHTML, nsnull }, diff --git a/mozilla/webshell/tests/viewer/viewer.rc b/mozilla/webshell/tests/viewer/viewer.rc index bed35f0b90d..ca3e6728555 100644 --- a/mozilla/webshell/tests/viewer/viewer.rc +++ b/mozilla/webshell/tests/viewer/viewer.rc @@ -122,10 +122,6 @@ VIEWER MENU DISCARDABLE MENUITEM "Dump &Style Sheets", VIEWER_DUMP_STYLE_SHEETS MENUITEM "Dump &Style Contexts", VIEWER_DUMP_STYLE_CONTEXTS MENUITEM SEPARATOR - MENUITEM "Show Content Size", VIEWER_SHOW_CONTENT_SIZE - MENUITEM "Show Frame Size", VIEWER_SHOW_FRAME_SIZE - MENUITEM "Show Style Size", VIEWER_SHOW_STYLE_SIZE - MENUITEM SEPARATOR MENUITEM "Debug Save", VIEWER_DEBUGSAVE MENUITEM "Debug Display Text", VIEWER_DISPLAYTEXT MENUITEM "Debug Display HTML", VIEWER_DISPLAYHTML diff --git a/mozilla/webshell/tests/viewer/vieweros2.rc b/mozilla/webshell/tests/viewer/vieweros2.rc index 56ceeea7424..54b062e6591 100644 --- a/mozilla/webshell/tests/viewer/vieweros2.rc +++ b/mozilla/webshell/tests/viewer/vieweros2.rc @@ -104,10 +104,6 @@ MENU IDM_VIEWERBAR MENUITEM "Dump ~Style Sheets", VIEWER_DUMP_STYLE_SHEETS MENUITEM "Dump ~Style Contexts", VIEWER_DUMP_STYLE_CONTEXTS MENUITEM SEPARATOR - MENUITEM "Show Content Size", VIEWER_SHOW_CONTENT_SIZE - MENUITEM "Show Frame Size", VIEWER_SHOW_FRAME_SIZE - MENUITEM "Show Style Size", VIEWER_SHOW_STYLE_SIZE - MENUITEM SEPARATOR MENUITEM "Debug Save", VIEWER_DEBUGSAVE MENUITEM "Debug Display Text", VIEWER_DISPLAYTEXT MENUITEM "Debug Display HTML", VIEWER_DISPLAYHTML diff --git a/mozilla/xpcom/ds/MANIFEST b/mozilla/xpcom/ds/MANIFEST index 764aeb172fb..786d4cc438a 100644 --- a/mozilla/xpcom/ds/MANIFEST +++ b/mozilla/xpcom/ds/MANIFEST @@ -14,7 +14,6 @@ nsHashtable.h nsHashtableEnumerator.h nsIArena.h nsIByteBuffer.h -nsISizeOfHandler.h nsIUnicharBuffer.h nsInt64.h nsObserverService.h diff --git a/mozilla/xpcom/ds/Makefile.in b/mozilla/xpcom/ds/Makefile.in index 336d14cc09a..45016dfce18 100644 --- a/mozilla/xpcom/ds/Makefile.in +++ b/mozilla/xpcom/ds/Makefile.in @@ -61,7 +61,6 @@ CPPSRCS = \ nsPersistentProperties.cpp \ nsQuickSort.cpp \ nsRecyclingAllocator.cpp \ - nsSizeOfHandler.cpp \ nsStaticNameTable.cpp \ nsStatistics.cpp \ nsStringService.cpp \ @@ -93,7 +92,6 @@ EXPORTS = \ nsHashtableEnumerator.h \ nsIArena.h \ nsIByteBuffer.h \ - nsISizeOfHandler.h \ nsIUnicharBuffer.h \ nsInt64.h \ nsObserverService.h \ diff --git a/mozilla/xpcom/ds/nsAtomTable.cpp b/mozilla/xpcom/ds/nsAtomTable.cpp index 1c38d099223..2594a675471 100644 --- a/mozilla/xpcom/ds/nsAtomTable.cpp +++ b/mozilla/xpcom/ds/nsAtomTable.cpp @@ -41,7 +41,6 @@ #include "nsCRT.h" #include "pldhash.h" #include "prenv.h" -#include "nsISizeOfHandler.h" /** * The shared hash table for atom lookups. @@ -244,16 +243,6 @@ AtomImpl::GetUnicode(const PRUnichar **aResult) /*FIX: const */ return NS_OK; } -NS_IMETHODIMP -AtomImpl::SizeOf(nsISizeOfHandler* aHandler, PRUint32* _retval) /*FIX: const */ -{ -#ifdef DEBUG - NS_PRECONDITION(_retval, "null out param"); - *_retval = sizeof(*this) + nsCRT::strlen(mString) * sizeof(PRUnichar); -#endif - return NS_OK; -} - //---------------------------------------------------------------------- NS_COM nsIAtom* NS_NewAtom(const char* isolatin1) diff --git a/mozilla/xpcom/ds/nsIAtom.idl b/mozilla/xpcom/ds/nsIAtom.idl index 966d4ad4988..b6dc7a1e2de 100644 --- a/mozilla/xpcom/ds/nsIAtom.idl +++ b/mozilla/xpcom/ds/nsIAtom.idl @@ -23,8 +23,6 @@ */ #include "nsISupports.idl" -interface nsISizeOfHandler; - %{C++ #include "nsAString.h" #include "nsCOMPtr.h" @@ -48,11 +46,6 @@ interface nsIAtom : nsISupports * Return a pointer to a zero terminated unicode string. */ void GetUnicode([shared, retval] out wstring aResult); - - /** - * Get the size, in bytes, of the atom. - */ - PRUint32 SizeOf(in nsISizeOfHandler aHandler); }; diff --git a/mozilla/xpcom/ds/nsISizeOfHandler.h b/mozilla/xpcom/ds/nsISizeOfHandler.h deleted file mode 100644 index 64e05577c42..00000000000 --- a/mozilla/xpcom/ds/nsISizeOfHandler.h +++ /dev/null @@ -1,119 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Netscape Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef nsISizeOfHandler_h___ -#define nsISizeOfHandler_h___ - -#include "nscore.h" -#include "nsISupports.h" - -/* c028d1f0-fc9e-11d1-89e4-006008911b81 */ -#define NS_ISIZEOF_HANDLER_IID \ -{ 0xc028d1f0, 0xfc9e, 0x11d1, {0x89, 0xe4, 0x00, 0x60, 0x08, 0x91, 0x1b, 0x81}} - -class nsIAtom; -class nsISizeOfHandler; - -/** - * Function used by the Report method to report data gathered during - * a collection of data. - */ -typedef void (*nsISizeofReportFunc)(nsISizeOfHandler* aHandler, - nsIAtom* aKey, - PRUint32 aCount, - PRUint32 aTotalSize, - PRUint32 aMinSize, - PRUint32 aMaxSize, - void* aArg); - -/** - * An API to managing a sizeof computation of an arbitrary graph. - * The handler is responsible for remembering which objects have been - * seen before (using RecordObject). Note that the handler doesn't - * hold references to nsISupport's objects; the assumption is that the - * objects being sized are stationary and will not be modified during - * the sizing computation and therefore do not need an extra reference - * count. - * - * Users of this API are responsible for the actual graph/tree walking. - */ -class nsISizeOfHandler : public nsISupports { -public: - NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISIZEOF_HANDLER_IID) - - /** - * Initialize the handler for a new collection of data. This empties - * out the object prescence table and the keyed size table. - */ - NS_IMETHOD Init() = 0; - - /** - * Record the sizing status of a given object. The first time - * aObject is recorded, aResult will be PR_FALSE. Subsequent times, - * aResult will be PR_TRUE. - */ - NS_IMETHOD RecordObject(void* aObject, PRBool* aResult) = 0; - - /** - * Add size information to the running size data. The atom is used - * as a key to keep type specific running totals of size - * information. This increments the total count and the total size - * as well as updates the minimum, maximum and total size for aKey's - * type. - */ - NS_IMETHOD AddSize(nsIAtom* aKey, PRUint32 aSize) = 0; - - /** - * Enumerate data collected for each type and invoke the - * reporting function with the data gathered. - */ - NS_IMETHOD Report(nsISizeofReportFunc aFunc, void* aArg) = 0; - - /** - * Get the current totals - the number of total objects sized (not - * necessarily anything to do with RecordObject's tracking of - * objects) and the total number of bytes that those object use. The - * counters are not reset by this call (use Init to reset - * everything). - */ - NS_IMETHOD GetTotals(PRUint32* aTotalCountResult, - PRUint32* aTotalSizeResult) = 0; -}; - -extern NS_COM nsresult -NS_NewSizeOfHandler(nsISizeOfHandler** aInstancePtrResult); - -#endif /* nsISizeofHandler_h___ */ diff --git a/mozilla/xpcom/ds/nsSizeOfHandler.cpp b/mozilla/xpcom/ds/nsSizeOfHandler.cpp deleted file mode 100644 index 3004364089a..00000000000 --- a/mozilla/xpcom/ds/nsSizeOfHandler.cpp +++ /dev/null @@ -1,290 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Netscape Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#include "nscore.h" -#include "nsISizeOfHandler.h" -#include "nsIAtom.h" -#include "plhash.h" - -class nsSizeOfHandler : public nsISizeOfHandler { -public: - nsSizeOfHandler(); - virtual ~nsSizeOfHandler(); - - // nsISupports - NS_DECL_ISUPPORTS - - // nsISizeOfHandler - NS_IMETHOD Init(); - NS_IMETHOD RecordObject(void* aObject, PRBool* aResult); - NS_IMETHOD AddSize(nsIAtom* aKey, PRUint32 aSize); - NS_IMETHOD Report(nsISizeofReportFunc aFunc, void* aArg); - NS_IMETHOD GetTotals(PRUint32* aCountResult, PRUint32* aTotalSizeResult); - -protected: - PRUint32 mTotalSize; - PRUint32 mTotalCount; - PLHashTable* mSizeTable; - PLHashTable* mObjectTable; - - static PRIntn PR_CALLBACK RemoveObjectEntry(PLHashEntry* he, PRIntn i, void* arg); - static PRIntn PR_CALLBACK RemoveSizeEntry(PLHashEntry* he, PRIntn i, void* arg); - static PRIntn PR_CALLBACK ReportEntry(PLHashEntry* he, PRIntn i, void* arg); -}; - -class SizeOfDataStats { -public: - SizeOfDataStats(nsIAtom* aType, PRUint32 aSize); - ~SizeOfDataStats(); - - void Update(PRUint32 aSize); - - nsIAtom* mType; // type - PRUint32 mCount; // # of objects of this type - PRUint32 mTotalSize; // total size of all objects of this type - PRUint32 mMinSize; // smallest size for this type - PRUint32 mMaxSize; // largest size for this type -}; - -//---------------------------------------------------------------------- - -MOZ_DECL_CTOR_COUNTER(SizeOfDataStats) - -SizeOfDataStats::SizeOfDataStats(nsIAtom* aType, PRUint32 aSize) - : mType(aType), - mCount(1), - mTotalSize(aSize), - mMinSize(aSize), - mMaxSize(aSize) -{ - MOZ_COUNT_CTOR(SizeOfDataStats); - NS_IF_ADDREF(mType); -} - -SizeOfDataStats::~SizeOfDataStats() -{ - MOZ_COUNT_DTOR(SizeOfDataStats); - NS_IF_RELEASE(mType); -} - -void -SizeOfDataStats::Update(PRUint32 aSize) -{ - mCount++; - if (aSize < mMinSize) mMinSize = aSize; - if (aSize > mMaxSize) mMaxSize = aSize; - mTotalSize += aSize; -} - -//---------------------------------------------------------------------- - -#define POINTER_HASH_KEY(_atom) (PLHashNumber) NS_PTR_TO_INT32(_atom) - -static PLHashNumber -PointerHashKey(nsIAtom* key) -{ - return POINTER_HASH_KEY(key); -} - -static PRIntn -PointerCompareKeys(void* key1, void* key2) -{ - return key1 == key2; -} - -nsSizeOfHandler::nsSizeOfHandler() - : mTotalSize(0), - mTotalCount(0) -{ - mTotalSize = 0; - mSizeTable = PL_NewHashTable(32, (PLHashFunction) PointerHashKey, - (PLHashComparator) PointerCompareKeys, - (PLHashComparator) nsnull, - nsnull, nsnull); - mObjectTable = PL_NewHashTable(32, (PLHashFunction) PointerHashKey, - (PLHashComparator) PointerCompareKeys, - (PLHashComparator) nsnull, - nsnull, nsnull); -} - -PRIntn -nsSizeOfHandler::RemoveObjectEntry(PLHashEntry* he, PRIntn i, void* arg) -{ - // Remove and free this entry and continue enumerating - return HT_ENUMERATE_REMOVE | HT_ENUMERATE_NEXT; -} - -PRIntn -nsSizeOfHandler::RemoveSizeEntry(PLHashEntry* he, PRIntn i, void* arg) -{ - if (he->value) { - SizeOfDataStats* stats = (SizeOfDataStats*) he->value; - he->value = nsnull; - delete stats; - } - - // Remove and free this entry and continue enumerating - return HT_ENUMERATE_REMOVE | HT_ENUMERATE_NEXT; -} - -nsSizeOfHandler::~nsSizeOfHandler() -{ - if (nsnull != mObjectTable) { - PL_HashTableEnumerateEntries(mObjectTable, RemoveObjectEntry, 0); - PL_HashTableDestroy(mObjectTable); - } - if (nsnull != mSizeTable) { - PL_HashTableEnumerateEntries(mSizeTable, RemoveSizeEntry, 0); - PL_HashTableDestroy(mSizeTable); - } -} - -NS_IMPL_ISUPPORTS1(nsSizeOfHandler, nsISizeOfHandler) - -NS_IMETHODIMP -nsSizeOfHandler::Init() -{ - if (mObjectTable) { - PL_HashTableEnumerateEntries(mObjectTable, RemoveObjectEntry, 0); - } - if (mSizeTable) { - PL_HashTableEnumerateEntries(mSizeTable, RemoveSizeEntry, 0); - } - mTotalCount = 0; - mTotalSize = 0; - return NS_OK; -} - -NS_IMETHODIMP -nsSizeOfHandler::RecordObject(void* aAddr, PRBool* aResult) -{ - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - - PRBool result = PR_TRUE; - if (mObjectTable && aAddr) { - PLHashNumber hashCode = POINTER_HASH_KEY(aAddr); - PLHashEntry** hep = PL_HashTableRawLookup(mObjectTable, hashCode, aAddr); - PLHashEntry* he = *hep; - if (!he) { - // We've never seen it before. Add it to the table - (void) PL_HashTableRawAdd(mObjectTable, hep, hashCode, aAddr, aAddr); - result = PR_FALSE; - } - } - - *aResult = result; - return NS_OK; -} - -NS_IMETHODIMP -nsSizeOfHandler::AddSize(nsIAtom* aType, PRUint32 aSize) -{ - PLHashNumber hashCode = POINTER_HASH_KEY(aType); - PLHashEntry** hep = PL_HashTableRawLookup(mSizeTable, hashCode, aType); - PLHashEntry* he = *hep; - if (he) { - // Stats already exist - SizeOfDataStats* stats = (SizeOfDataStats*) he->value; - stats->Update(aSize); - } - else { - // Make new stats for the new frame type - SizeOfDataStats* newStats = new SizeOfDataStats(aType, aSize); - PL_HashTableRawAdd(mSizeTable, hep, hashCode, aType, newStats); - } - mTotalCount++; - mTotalSize += aSize; - return NS_OK; -} - -struct ReportArgs { - nsISizeOfHandler* mHandler; - nsISizeofReportFunc mFunc; - void* mArg; -}; - -PRIntn -nsSizeOfHandler::ReportEntry(PLHashEntry* he, PRIntn i, void* arg) -{ - ReportArgs* ra = (ReportArgs*) arg; - if (he && ra && ra->mFunc) { - SizeOfDataStats* stats = (SizeOfDataStats*) he->value; - if (stats) { - (*ra->mFunc)(ra->mHandler, stats->mType, stats->mCount, - stats->mTotalSize, stats->mMinSize, stats->mMaxSize, - ra->mArg); - } - } - return HT_ENUMERATE_NEXT; -} - -NS_IMETHODIMP -nsSizeOfHandler::Report(nsISizeofReportFunc aFunc, void* aArg) -{ - ReportArgs ra; - ra.mHandler = this; - ra.mFunc = aFunc; - ra.mArg = aArg; - PL_HashTableEnumerateEntries(mSizeTable, ReportEntry, (void*) &ra); - return NS_OK; -} - -NS_IMETHODIMP -nsSizeOfHandler::GetTotals(PRUint32* aTotalCountResult, - PRUint32* aTotalSizeResult) -{ - if (!aTotalCountResult || !aTotalSizeResult) { - return NS_ERROR_NULL_POINTER; - } - *aTotalCountResult = mTotalCount; - *aTotalSizeResult = mTotalSize; - return NS_OK; -} - -NS_COM nsresult -NS_NewSizeOfHandler(nsISizeOfHandler** aInstancePtrResult) -{ - if (!aInstancePtrResult) { - return NS_ERROR_NULL_POINTER; - } - nsISizeOfHandler *it = new nsSizeOfHandler(); - if (it == nsnull) { - return NS_ERROR_OUT_OF_MEMORY; - } - return it->QueryInterface(NS_GET_IID(nsISizeOfHandler), (void **) aInstancePtrResult); -} diff --git a/mozilla/xpcom/ds/nsVoidArray.cpp b/mozilla/xpcom/ds/nsVoidArray.cpp index c54a9fa6312..61e31fec0e6 100644 --- a/mozilla/xpcom/ds/nsVoidArray.cpp +++ b/mozilla/xpcom/ds/nsVoidArray.cpp @@ -38,7 +38,6 @@ #include "nsQuickSort.h" #include "prmem.h" #include "nsCRT.h" -#include "nsISizeOfHandler.h" #include "nsString.h" #include "prbit.h" @@ -362,17 +361,6 @@ nsVoidArray::~nsVoidArray() PR_Free(NS_REINTERPRET_CAST(char*, mImpl)); } -#ifdef DEBUG -void -nsVoidArray::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (aResult) - { - *aResult = sizeof(*this) + (mImpl ? SIZEOF_IMPL(GetArraySize()) : 0); - } -} -#endif - PRInt32 nsVoidArray::IndexOf(void* aPossibleElement) const { if (mImpl) @@ -759,23 +747,6 @@ nsStringArray::operator=(const nsStringArray& other) return *this; } -#ifdef DEBUG -void -nsStringArray::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - PRUint32 sum = 0; - nsVoidArray::SizeOf(aHandler, &sum); - PRInt32 index = Count(); - while (0 <= --index) - { - nsString* string = NS_STATIC_CAST(nsString*, ElementAt(index)); - PRUint32 size; - string->SizeOf(aHandler, &size); - sum += size; - } -} -#endif - void nsStringArray::StringAt(PRInt32 aIndex, nsAString& aString) const { @@ -981,23 +952,6 @@ nsCStringArray::operator=(const nsCStringArray& other) return *this; } -#ifdef DEBUG -void -nsCStringArray::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - PRUint32 sum = 0; - nsVoidArray::SizeOf(aHandler, &sum); - PRInt32 index = Count(); - while (0 <= --index) - { - nsCString* string = NS_STATIC_CAST(nsCString*, mImpl->mArray[index]); - PRUint32 size; - string->SizeOf(aHandler, &size); - sum += size; - } -} -#endif - void nsCStringArray::CStringAt(PRInt32 aIndex, nsCString& aCString) const { @@ -1245,23 +1199,6 @@ nsSmallVoidArray::operator=(nsSmallVoidArray& other) return *this; } -#ifdef DEBUG -void -nsSmallVoidArray::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (aResult) - { - PRUint32 size = 0; - if (HasVector()) - { - nsVoidArray* ourArray = GetChildVector(); - ourArray->SizeOf(aHandler,&size); - } - *aResult = sizeof(*this) + size; - } -} -#endif - PRInt32 nsSmallVoidArray::GetArraySize() const { diff --git a/mozilla/xpcom/ds/nsVoidArray.h b/mozilla/xpcom/ds/nsVoidArray.h index b3cdf7dc5bb..b585de13d79 100644 --- a/mozilla/xpcom/ds/nsVoidArray.h +++ b/mozilla/xpcom/ds/nsVoidArray.h @@ -42,8 +42,6 @@ #include "nscore.h" #include "nsAString.h" -class nsISizeOfHandler; - // Comparator callback function for sorting array values. typedef int (* PR_CALLBACK nsVoidArrayComparatorFunc) (const void* aElement1, const void* aElement2, void* aData); @@ -60,10 +58,6 @@ public: nsVoidArray& operator=(const nsVoidArray& other); -#ifdef DEBUG - virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - inline PRInt32 Count() const { return mImpl ? mImpl->mCount : 0; } @@ -212,10 +206,6 @@ public: nsStringArray& operator=(const nsStringArray& other); -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - PRInt32 Count(void) const { return nsVoidArray::Count(); } @@ -277,10 +267,6 @@ public: // behavior as strtok(). void ParseString(const char* string, const char* delimiter); -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - PRInt32 Count(void) const { return nsVoidArray::Count(); } @@ -355,9 +341,6 @@ public: nsSmallVoidArray& operator=(nsSmallVoidArray& other); void* operator[](PRInt32 aIndex) const { return ElementAt(aIndex); } -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif PRInt32 GetArraySize() const; PRInt32 Count() const; diff --git a/mozilla/xpcom/ds/nsVoidBTree.cpp b/mozilla/xpcom/ds/nsVoidBTree.cpp index c062d32883e..f5c43e687fe 100644 --- a/mozilla/xpcom/ds/nsVoidBTree.cpp +++ b/mozilla/xpcom/ds/nsVoidBTree.cpp @@ -534,44 +534,6 @@ nsVoidBTree::EnumerateBackwards(EnumFunc aFunc, void* aData) const return running; } - -#ifdef DEBUG -void -nsVoidBTree::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const -{ - if (! aResult) - return; - - *aResult = sizeof(*this); - - if (IsSingleElement()) - return; - - Path path; - path.Push(NS_REINTERPRET_CAST(Node*, mRoot & kRoot_PointerMask), 0); - - while (path.Length()) { - Node* current; - PRInt32 index; - path.Pop(¤t, &index); - - if (current->GetType() == Node::eType_Data) { - *aResult += sizeof(Node) + (sizeof(void*) * (kDataCapacity - 1)); - } - else { - *aResult += sizeof(Node) + (sizeof(void*) * (kIndexCapacity - 1)); - - // If we're in an index node, and there are still kids to - // traverse, well, traverse 'em. - if (index < current->GetCount()) { - path.Push(current, index + 1); - path.Push(NS_STATIC_CAST(Node*, current->GetElementAt(index)), 0); - } - } - } -} -#endif - //---------------------------------------------------------------------- nsresult diff --git a/mozilla/xpcom/ds/nsVoidBTree.h b/mozilla/xpcom/ds/nsVoidBTree.h index c67ca3e8d95..865f2974cb9 100644 --- a/mozilla/xpcom/ds/nsVoidBTree.h +++ b/mozilla/xpcom/ds/nsVoidBTree.h @@ -25,7 +25,6 @@ #include "nscore.h" #include "nsDebug.h" #include "nsError.h" -class nsISizeOfHandler; /** * An nsVoidArray-compatible class that is implemented as a B-tree @@ -74,10 +73,6 @@ public: PRBool EnumerateForwards(EnumFunc aFunc, void* aData) const; PRBool EnumerateBackwards(EnumFunc aFunc, void* aData) const; -#ifdef DEBUG - void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - protected: // This is as deep as a tree can ever grow, mostly because we use an // automatic variable to keep track of the path we take through the diff --git a/mozilla/xpcom/macbuild/xpcomPPC.xml b/mozilla/xpcom/macbuild/xpcomPPC.xml index adb3a1c089d..473488e10b0 100644 --- a/mozilla/xpcom/macbuild/xpcomPPC.xml +++ b/mozilla/xpcom/macbuild/xpcomPPC.xml @@ -1282,13 +1282,6 @@ Text Debug - - Name - nsSizeOfHandler.cpp - MacOS - Text - Debug - Name nsUnicharBuffer.cpp @@ -2113,11 +2106,6 @@ nsQuickSort.cpp MacOS - - Name - nsSizeOfHandler.cpp - MacOS - Name nsUnicharBuffer.cpp @@ -3806,13 +3794,6 @@ Text Debug - - Name - nsSizeOfHandler.cpp - MacOS - Text - Debug - Name nsUnicharBuffer.cpp @@ -4642,11 +4623,6 @@ nsQuickSort.cpp MacOS - - Name - nsSizeOfHandler.cpp - MacOS - Name nsUnicharBuffer.cpp @@ -5386,12 +5362,6 @@ nsQuickSort.cpp MacOS - - xpcom.shlb - Name - nsSizeOfHandler.cpp - MacOS - xpcom.shlb Name diff --git a/mozilla/xpcom/string/obsolete/nsString.cpp b/mozilla/xpcom/string/obsolete/nsString.cpp index f0dccbcf085..e816e7beee8 100644 --- a/mozilla/xpcom/string/obsolete/nsString.cpp +++ b/mozilla/xpcom/string/obsolete/nsString.cpp @@ -52,7 +52,6 @@ #ifndef RICKG_TESTBED #include "prdtoa.h" -#include "nsISizeOfHandler.h" #endif static const char* kPossibleNull = "Error: possible unintended null in string"; @@ -140,14 +139,6 @@ nsCString::nsCString( const nsACString& aReadable ) { Assign(aReadable); } -#ifdef DEBUG -void nsCString::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const { - if (aResult) { - *aResult = sizeof(*this) + GetCapacity() * GetCharSize(); - } -} -#endif - /** * This method truncates this string to given length. * @@ -1272,12 +1263,3 @@ nsCAutoString::nsCAutoString(const CBufDescriptor& aBuffer) : nsCString() { if(!aBuffer.mIsConst) AddNullTerminator(*this); //this isn't really needed, but it guarantees that folks don't pass string constants. } - - -#ifdef DEBUG -void nsCAutoString::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const { - if (aResult) { - *aResult = sizeof(*this) + GetCapacity() * GetCharSize(); - } -} -#endif diff --git a/mozilla/xpcom/string/obsolete/nsString.h b/mozilla/xpcom/string/obsolete/nsString.h index d12d81abab4..aaed3069216 100644 --- a/mozilla/xpcom/string/obsolete/nsString.h +++ b/mozilla/xpcom/string/obsolete/nsString.h @@ -359,16 +359,6 @@ public: PRBool EqualsIgnoreCase(const char* aString,PRInt32 aCount=-1) const; - - -#ifdef DEBUG - /** - * Retrieve the size of this string - * @return string length - */ - virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - private: // NOT TO BE IMPLEMENTED // these signatures help clients not accidentally call the wrong thing helped by C++ automatic integral promotion @@ -424,14 +414,6 @@ public: nsCAutoString& operator=( const char* aPtr ) { Assign(aPtr); return *this; } nsCAutoString& operator=( char aChar ) { Assign(aChar); return *this; } -#ifdef DEBUG - /** - * Retrieve the size of this string - * @return string length - */ - virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - char mBuffer[kDefaultStringSize]; }; diff --git a/mozilla/xpcom/string/obsolete/nsString2.cpp b/mozilla/xpcom/string/obsolete/nsString2.cpp index 7a34069e063..c3d92a8dd9b 100644 --- a/mozilla/xpcom/string/obsolete/nsString2.cpp +++ b/mozilla/xpcom/string/obsolete/nsString2.cpp @@ -51,7 +51,6 @@ #ifndef RICKG_TESTBED #include "prdtoa.h" -#include "nsISizeOfHandler.h" #endif static const char* kPossibleNull = "Error: possible unintended null in string"; @@ -155,14 +154,6 @@ nsString::nsString( const nsAString& aReadable ) { Assign(aReadable); } -#ifdef DEBUG -void nsString::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const { - if (aResult) { - *aResult = sizeof(*this) + GetCapacity() * GetCharSize(); - } -} -#endif - /** * This method truncates this string to given length. * @@ -1473,12 +1464,3 @@ nsAutoString::nsAutoString(PRUnichar aChar) : nsString(){ AddNullTerminator(*this); Append(aChar); } - -#ifdef DEBUG -void nsAutoString::SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const { - if (aResult) { - *aResult = sizeof(*this) + GetCapacity() * GetCharSize(); - } -} -#endif - diff --git a/mozilla/xpcom/string/obsolete/nsString2.h b/mozilla/xpcom/string/obsolete/nsString2.h index 36879063cd2..950b0fcf43c 100644 --- a/mozilla/xpcom/string/obsolete/nsString2.h +++ b/mozilla/xpcom/string/obsolete/nsString2.h @@ -92,7 +92,6 @@ class UTF8traits class nsAFlatString { public: virtual ~nsAString() { } }; #endif -class nsISizeOfHandler; class nsCString; @@ -433,14 +432,6 @@ public: */ static PRBool IsSpace(PRUnichar ch); -#ifdef DEBUG - /** - * Retrieve the size of this string - * @return string length - */ - virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - private: // NOT TO BE IMPLEMENTED // these signatures help clients not accidentally call the wrong thing helped by C++ automatic integral promotion @@ -498,14 +489,6 @@ public: nsAutoString& operator=( const PRUnichar* aPtr ) { Assign(aPtr); return *this; } nsAutoString& operator=( PRUnichar aChar ) { Assign(aChar); return *this; } -#ifdef DEBUG - /** - * Retrieve the size of this string - * @return string length - */ - virtual void SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const; -#endif - PRUnichar mBuffer[kDefaultStringSize]; };