State as of now default tip
authorBenjamin Smedberg <benjamin@smedbergs.us>
Sat, 26 Jul 2008 22:49:39 -0400
changeset 167 a4da40849f5436e629c5732f4368c6c48189637f
parent 166 b62b37ca56a049a3e1db7eafc8ec7ad08561dc4f
push id40
push userbsmedberg@mozilla.com
push dateSun, 27 Jul 2008 02:50:20 +0000
State as of now
GCObject.classlist
NOTES
automatic-garburator
automatic-gcobject
automatic-nuker
automatic-remove-addrefs
gcobject-stuff
series
static-check-gc-attributes2
txCore-include
--- a/GCObject.classlist
+++ b/GCObject.classlist
@@ -1,19 +1,25 @@
 nsXBLResourceLoader
 nsXULControllerData
 txObject
 Expr
-txIMatchObject
-txXPathNode
+txIMatchContext
 txPushNewContext::SortKey
+txNodeSorter::SortKey
+txXPathResultComparator
+txStylesheet::ImportFrame
+txToplevelItem
+txInScopeVariable
 MemoryElementSet
 nsAssignmentSet
 RDFBinding
 MemoryElement
 nsAssignmentSet::List
 InstantiationSet
 InstantiationSet::List
 ReteNode
 nsTemplateRule
 nsTemplateQuerySet
 nsXMLBinding
 nsXMLBindingSet
+nsHTMLCSSUtils
+nsWSRunObject::WSFragment
new file mode 100644
--- /dev/null
+++ b/NOTES
@@ -0,0 +1,2 @@
+* editor/txmgr/src/nsTransactionStack.h has a nsDeque... need to paramaterize it or something.
+* the nsAutoPtr-must-be-finalized check in static-checking.js is a little wrong. What you really want is whether that object *was* GC allocated, not whether it could have been GC-allocated.
--- a/automatic-garburator
+++ b/automatic-garburator
@@ -40956,101 +40956,101 @@ diff --git a/content/xslt/src/xpath/txMo
  
 -        nsCOMPtr<nsIDOMElement> element;
 -        document->GetElementById(aID, getter_AddRefs(element));
 +        nsIDOMElement* element = nsnull;
 +        document->GetElementById(aID, &element);
  
          content = do_QueryInterface(element);
      }
-@@ -373,7 +373,7 @@ txXPathNodeUtils::getAttr(const txXPathN
+@@ -364,7 +364,7 @@ txXPathNodeUtils::getAttr(const txXPathN
  }
  
  /* static */
 -already_AddRefed<nsIAtom>
 +nsIAtom*
  txXPathNodeUtils::getLocalName(const txXPathNode& aNode)
  {
      if (aNode.isDocument()) {
-@@ -389,7 +389,7 @@ txXPathNodeUtils::getLocalName(const txX
+@@ -380,7 +380,7 @@ txXPathNodeUtils::getLocalName(const txX
          }
  
          if (aNode.mNode->IsNodeOfType(nsINode::ePROCESSING_INSTRUCTION)) {
 -            nsCOMPtr<nsIDOMNode> node = do_QueryInterface(aNode.mNode);
 +            nsIDOMNode* node = do_QueryInterface(aNode.mNode);
              nsAutoString target;
              node->GetNodeName(target);
  
-@@ -448,7 +448,7 @@ txXPathNodeUtils::getLocalName(const txX
+@@ -439,7 +439,7 @@ txXPathNodeUtils::getLocalName(const txX
  
          if (aNode.mNode->IsNodeOfType(nsINode::ePROCESSING_INSTRUCTION)) {
              // PIs don't have a nodeinfo but do have a name
 -            nsCOMPtr<nsIDOMNode> node = do_QueryInterface(aNode.mNode);
 +            nsIDOMNode* node = do_QueryInterface(aNode.mNode);
              node->GetNodeName(aLocalName);
  
              return;
-@@ -495,7 +495,7 @@ txXPathNodeUtils::getNodeName(const txXP
+@@ -486,7 +486,7 @@ txXPathNodeUtils::getNodeName(const txXP
  
          if (aNode.mNode->IsNodeOfType(nsINode::ePROCESSING_INSTRUCTION)) {
              // PIs don't have a nodeinfo but do have a name
 -            nsCOMPtr<nsIDOMNode> node = do_QueryInterface(aNode.mNode);
 +            nsIDOMNode* node = do_QueryInterface(aNode.mNode);
              node->GetNodeName(aName);
  
              return;
-@@ -547,7 +547,7 @@ txXPathNodeUtils::getNodeType(const txXP
+@@ -538,7 +538,7 @@ txXPathNodeUtils::getNodeType(const txXP
  
      if (aNode.isContent()) {
          PRUint16 type;
 -        nsCOMPtr<nsIDOMNode> node = do_QueryInterface(aNode.mNode);
 +        nsIDOMNode* node = do_QueryInterface(aNode.mNode);
          node->GetNodeType(&type);
  
          return type;
-@@ -646,7 +646,7 @@ void
+@@ -637,7 +637,7 @@ void
  void
  txXPathNodeUtils::getBaseURI(const txXPathNode& aNode, nsAString& aURI)
  {
 -    nsCOMPtr<nsIDOM3Node> node = do_QueryInterface(aNode.mNode);
 +    nsIDOM3Node* node = do_QueryInterface(aNode.mNode);
      if (node) {
          node->GetBaseURI(aURI);
      }
-@@ -778,7 +778,7 @@ txXPathNativeNode::createXPathNode(nsIDO
+@@ -769,7 +769,7 @@ txXPathNativeNode::createXPathNode(nsIDO
      aNode->GetNodeType(&nodeType);
  
      if (nodeType == nsIDOMNode::ATTRIBUTE_NODE) {
 -        nsCOMPtr<nsIAttribute> attr = do_QueryInterface(aNode);
 +        nsIAttribute* attr = do_QueryInterface(aNode);
          NS_ASSERTION(attr, "doesn't implement nsIAttribute");
  
          nsINodeInfo *nodeInfo = attr->NodeInfo();
-@@ -802,9 +802,9 @@ txXPathNativeNode::createXPathNode(nsIDO
+@@ -793,9 +793,9 @@ txXPathNativeNode::createXPathNode(nsIDO
          return nsnull;
      }
  
 -    nsCOMPtr<nsINode> node = do_QueryInterface(aNode);
 +    nsINode* node = do_QueryInterface(aNode);
      PRUint32 index;
 -    nsINode* root = aKeepRootAlive ? node.get() : nsnull;
 +    nsINode* root = aKeepRootAlive ? node : nsnull;
  
      if (nodeType == nsIDOMNode::DOCUMENT_NODE) {
          index = txXPathNode::eDocument;
-@@ -823,7 +823,7 @@ txXPathNode*
+@@ -814,7 +814,7 @@ txXPathNode*
  txXPathNode*
  txXPathNativeNode::createXPathNode(nsIDOMDocument* aDocument)
  {
 -    nsCOMPtr<nsIDocument> document = do_QueryInterface(aDocument);
 +    nsIDocument* document = do_QueryInterface(aDocument);
      return new txXPathNode(document);
  }
  
-@@ -841,10 +841,10 @@ txXPathNativeNode::getNode(const txXPath
+@@ -832,10 +832,10 @@ txXPathNativeNode::getNode(const txXPath
      nsContentUtils::NameSpaceManager()->GetNameSpaceURI(name->NamespaceID(), namespaceURI);
      name->LocalName()->ToString(localname);
  
 -    nsCOMPtr<nsIDOMElement> element = do_QueryInterface(aNode.mNode);
 -    nsCOMPtr<nsIDOMAttr> attr;
 +    nsIDOMElement* element = do_QueryInterface(aNode.mNode);
 +    nsIDOMAttr* attr = nsnull;
      element->GetAttributeNodeNS(namespaceURI, localname,
new file mode 100644
--- /dev/null
+++ b/automatic-gcobject
@@ -0,0 +1,14781 @@
+Automatically generated patch: make all XPCOM objects inherit from XPCOMGCFinalizedObject
+
+diff --git a/accessible/src/atk/nsAccessibleWrap.h b/accessible/src/atk/nsAccessibleWrap.h
+--- a/accessible/src/atk/nsAccessibleWrap.h
++++ b/accessible/src/atk/nsAccessibleWrap.h
+@@ -82,7 +82,7 @@ class MaiHyperlink;
+  * nsAccessibleWrap, and its descendents in atk directory provide the
+  * implementation of AtkObject.
+  */
+-class nsAccessibleWrap: public nsAccessible
++class nsAccessibleWrap: public XPCOMGCFinalizedObject, public nsAccessible
+ {
+ public:
+     nsAccessibleWrap(nsIDOMNode*, nsIWeakReference *aShell);
+diff --git a/accessible/src/atk/nsAppRootAccessible.h b/accessible/src/atk/nsAppRootAccessible.h
+--- a/accessible/src/atk/nsAppRootAccessible.h
++++ b/accessible/src/atk/nsAppRootAccessible.h
+@@ -44,7 +44,7 @@
+ 
+ #include "nsApplicationAccessible.h"
+ 
+-class nsApplicationAccessibleWrap: public nsApplicationAccessible
++class nsApplicationAccessibleWrap: public XPCOMGCFinalizedObject, public nsApplicationAccessible
+ {
+ public:
+     static void Unload();
+diff --git a/accessible/src/atk/nsDocAccessibleWrap.h b/accessible/src/atk/nsDocAccessibleWrap.h
+--- a/accessible/src/atk/nsDocAccessibleWrap.h
++++ b/accessible/src/atk/nsDocAccessibleWrap.h
+@@ -48,7 +48,7 @@
+ 
+ #include "nsDocAccessible.h"
+ 
+-class nsDocAccessibleWrap: public nsDocAccessible
++class nsDocAccessibleWrap: public XPCOMGCFinalizedObject, public nsDocAccessible
+ {
+ public:
+   nsDocAccessibleWrap(nsIDOMNode *aNode, nsIWeakReference *aShell);
+diff --git a/accessible/src/atk/nsXULTreeAccessibleWrap.h b/accessible/src/atk/nsXULTreeAccessibleWrap.h
+--- a/accessible/src/atk/nsXULTreeAccessibleWrap.h
++++ b/accessible/src/atk/nsXULTreeAccessibleWrap.h
+@@ -45,7 +45,8 @@
+ 
+ typedef class nsXULTreeitemAccessible nsXULTreeitemAccessibleWrap;
+ 
+-class nsXULTreeAccessibleWrap : public nsXULTreeAccessible,
++class nsXULTreeAccessibleWrap : public XPCOMGCFinalizedObject,
++                                public nsXULTreeAccessible,
+                                 public nsIAccessibleTable
+ {
+ public:
+@@ -63,7 +64,8 @@ protected:
+                              PRBool *aSelState);
+ };
+ 
+-class nsXULTreeColumnsAccessibleWrap : public nsXULTreeColumnsAccessible,
++class nsXULTreeColumnsAccessibleWrap : public XPCOMGCFinalizedObject,
++                                       public nsXULTreeColumnsAccessible,
+                                        public nsIAccessibleTable
+ {
+ public:
+diff --git a/accessible/src/base/nsAccessNode.h b/accessible/src/base/nsAccessNode.h
+--- a/accessible/src/base/nsAccessNode.h
++++ b/accessible/src/base/nsAccessNode.h
+@@ -72,7 +72,7 @@ typedef nsInterfaceHashtable<nsVoidPtrHa
+ typedef nsInterfaceHashtable<nsVoidPtrHashKey, nsIAccessNode>
+         nsAccessNodeHashtable;
+ 
+-class nsAccessNode: public nsIAccessNode, public nsPIAccessNode
++class nsAccessNode: public XPCOMGCFinalizedObject, public nsIAccessNode, public nsPIAccessNode
+ {
+   public: // construction, destruction
+     nsAccessNode(nsIDOMNode *, nsIWeakReference* aShell);
+diff --git a/accessible/src/base/nsAccessibilityService.h b/accessible/src/base/nsAccessibilityService.h
+--- a/accessible/src/base/nsAccessibilityService.h
++++ b/accessible/src/base/nsAccessibilityService.h
+@@ -56,7 +56,8 @@ class nsIContent;
+ class nsIContent;
+ struct nsRoleMapEntry;
+ 
+-class nsAccessibilityService : public nsIAccessibilityService,
++class nsAccessibilityService : public XPCOMGCFinalizedObject,
++                               public nsIAccessibilityService,
+                                public nsIObserver,
+                                public nsIWebProgressListener,
+                                public nsSupportsWeakReference
+diff --git a/accessible/src/base/nsAccessible.h b/accessible/src/base/nsAccessible.h
+--- a/accessible/src/base/nsAccessible.h
++++ b/accessible/src/base/nsAccessible.h
+@@ -77,7 +77,7 @@ NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODUL
+ // cached children or child count yet
+ enum { eChildCountUninitialized = -1 };
+ 
+-class nsAccessibleDOMStringList : public nsIDOMDOMStringList
++class nsAccessibleDOMStringList : public XPCOMGCFinalizedObject, public nsIDOMDOMStringList
+ {
+ public:
+   nsAccessibleDOMStringList();
+diff --git a/accessible/src/base/nsAccessibleEventData.h b/accessible/src/base/nsAccessibleEventData.h
+--- a/accessible/src/base/nsAccessibleEventData.h
++++ b/accessible/src/base/nsAccessibleEventData.h
+@@ -60,7 +60,7 @@ class nsIPresShell;
+   { 0xba, 0x78, 0xcb, 0xdf, 0x53, 0xa8, 0x69, 0x36 }    \
+ }
+ 
+-class nsAccEvent: public nsIAccessibleEvent
++class nsAccEvent: public XPCOMGCFinalizedObject, public nsIAccessibleEvent
+ {
+ public:
+ 
+diff --git a/accessible/src/base/nsAccessibleRelation.h b/accessible/src/base/nsAccessibleRelation.h
+--- a/accessible/src/base/nsAccessibleRelation.h
++++ b/accessible/src/base/nsAccessibleRelation.h
+@@ -44,7 +44,7 @@
+ 
+ #include "nsCOMPtr.h"
+ 
+-class nsAccessibleRelation: public nsIAccessibleRelation
++class nsAccessibleRelation: public XPCOMGCFinalizedObject, public nsIAccessibleRelation
+ {
+ public:
+   nsAccessibleRelation(PRUint32 aType, nsIAccessible *aTarget);
+diff --git a/accessible/src/base/nsCaretAccessible.h b/accessible/src/base/nsCaretAccessible.h
+--- a/accessible/src/base/nsCaretAccessible.h
++++ b/accessible/src/base/nsCaretAccessible.h
+@@ -70,7 +70,7 @@ class nsIView;
+  * selection listener when the doc goes away via removeDocSelectionListener().
+  */
+ 
+-class nsCaretAccessible : public nsISelectionListener
++class nsCaretAccessible : public XPCOMGCFinalizedObject, public nsISelectionListener
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/accessible/src/html/nsHTMLFormControlAccessible.h b/accessible/src/html/nsHTMLFormControlAccessible.h
+--- a/accessible/src/html/nsHTMLFormControlAccessible.h
++++ b/accessible/src/html/nsHTMLFormControlAccessible.h
+@@ -42,7 +42,7 @@
+ #include "nsFormControlAccessible.h"
+ #include "nsHyperTextAccessibleWrap.h"
+ 
+-class nsHTMLCheckboxAccessible : public nsFormControlAccessible
++class nsHTMLCheckboxAccessible : public XPCOMGCFinalizedObject, public nsFormControlAccessible
+ {
+ 
+ public:
+@@ -56,7 +56,7 @@ public:
+   NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
+ };
+ 
+-class nsHTMLRadioButtonAccessible : public nsRadioButtonAccessible
++class nsHTMLRadioButtonAccessible : public XPCOMGCFinalizedObject, public nsRadioButtonAccessible
+ {
+ 
+ public:
+diff --git a/accessible/src/html/nsHTMLSelectAccessible.h b/accessible/src/html/nsHTMLSelectAccessible.h
+--- a/accessible/src/html/nsHTMLSelectAccessible.h
++++ b/accessible/src/html/nsHTMLSelectAccessible.h
+@@ -120,7 +120,7 @@ protected:
+ /*
+  * The list that contains all the options in the select.
+  */
+-class nsHTMLSelectListAccessible : public nsHTMLSelectableAccessible
++class nsHTMLSelectListAccessible : public XPCOMGCFinalizedObject, public nsHTMLSelectableAccessible
+ {
+ public:
+   
+diff --git a/accessible/src/html/nsHTMLTextAccessible.h b/accessible/src/html/nsHTMLTextAccessible.h
+--- a/accessible/src/html/nsHTMLTextAccessible.h
++++ b/accessible/src/html/nsHTMLTextAccessible.h
+@@ -46,7 +46,7 @@
+ 
+ class nsIWeakReference;
+ 
+-class nsHTMLTextAccessible : public nsTextAccessibleWrap
++class nsHTMLTextAccessible : public XPCOMGCFinalizedObject, public nsTextAccessibleWrap
+ {
+ public:
+   nsHTMLTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
+@@ -58,14 +58,14 @@ public:
+   virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
+ };
+ 
+-class nsHTMLHRAccessible : public nsLeafAccessible
++class nsHTMLHRAccessible : public XPCOMGCFinalizedObject, public nsLeafAccessible
+ {
+ public:
+   nsHTMLHRAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
+   NS_IMETHOD GetRole(PRUint32 *aRole); 
+ };
+ 
+-class nsHTMLBRAccessible : public nsLeafAccessible
++class nsHTMLBRAccessible : public XPCOMGCFinalizedObject, public nsLeafAccessible
+ {
+ public:
+   nsHTMLBRAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
+@@ -74,7 +74,7 @@ public:
+   NS_IMETHOD GetName(nsAString& aName);
+ };
+ 
+-class nsHTMLLabelAccessible : public nsTextAccessible 
++class nsHTMLLabelAccessible : public XPCOMGCFinalizedObject, public nsTextAccessible 
+ {
+ public:
+   nsHTMLLabelAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
+@@ -87,7 +87,7 @@ public:
+   NS_IMETHOD GetChildCount(PRInt32 *aAccChildCount);
+ };
+ 
+-class nsHTMLListBulletAccessible : public nsLeafAccessible
++class nsHTMLListBulletAccessible : public XPCOMGCFinalizedObject, public nsLeafAccessible
+ {
+ public:
+   nsHTMLListBulletAccessible(nsIDOMNode *aDOMNode, nsIWeakReference* aShell,
+diff --git a/accessible/src/xforms/nsXFormsAccessible.h b/accessible/src/xforms/nsXFormsAccessible.h
+--- a/accessible/src/xforms/nsXFormsAccessible.h
++++ b/accessible/src/xforms/nsXFormsAccessible.h
+@@ -122,7 +122,7 @@ protected:
+  * an XForms upload element since it is constructed from textfield and
+  * 'pick up file' and 'clear file' buttons.
+  */
+-class nsXFormsContainerAccessible : public nsXFormsAccessible
++class nsXFormsContainerAccessible : public XPCOMGCFinalizedObject, public nsXFormsAccessible
+ {
+ public:
+   nsXFormsContainerAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
+diff --git a/accessible/src/xforms/nsXFormsFormControlsAccessible.h b/accessible/src/xforms/nsXFormsFormControlsAccessible.h
+--- a/accessible/src/xforms/nsXFormsFormControlsAccessible.h
++++ b/accessible/src/xforms/nsXFormsFormControlsAccessible.h
+@@ -45,7 +45,7 @@
+  * Accessible object for xforms:label.
+  */
+ 
+-class nsXFormsLabelAccessible : public nsXFormsAccessible
++class nsXFormsLabelAccessible : public XPCOMGCFinalizedObject, public nsXFormsAccessible
+ {
+ public:
+   nsXFormsLabelAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
+@@ -59,7 +59,7 @@ public:
+  * Accessible object for xforms:output.
+  */
+ 
+-class nsXFormsOutputAccessible : public nsXFormsAccessible
++class nsXFormsOutputAccessible : public XPCOMGCFinalizedObject, public nsXFormsAccessible
+ {
+ public:
+   nsXFormsOutputAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
+@@ -71,7 +71,7 @@ public:
+  * Accessible object for xforms:trigger and xforms:submit.
+  */
+ 
+-class nsXFormsTriggerAccessible : public nsXFormsAccessible
++class nsXFormsTriggerAccessible : public XPCOMGCFinalizedObject, public nsXFormsAccessible
+ {
+ public:
+   nsXFormsTriggerAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
+@@ -88,7 +88,7 @@ public:
+  * Accessible object for xforms:input and xforms:textarea.
+  */
+ 
+-class nsXFormsInputAccessible : public nsXFormsEditableAccessible
++class nsXFormsInputAccessible : public XPCOMGCFinalizedObject, public nsXFormsEditableAccessible
+ {
+ public:
+   nsXFormsInputAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
+@@ -105,7 +105,7 @@ public:
+  * Accessible object for xforms:input[type="xsd:boolean"].
+  */
+ 
+-class nsXFormsInputBooleanAccessible : public nsXFormsAccessible
++class nsXFormsInputBooleanAccessible : public XPCOMGCFinalizedObject, public nsXFormsAccessible
+ {
+ public:
+   nsXFormsInputBooleanAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
+@@ -148,7 +148,7 @@ public:
+  * Accessible object for xforms:range.
+  */
+ 
+-class nsXFormsRangeAccessible : public nsXFormsAccessible
++class nsXFormsRangeAccessible : public XPCOMGCFinalizedObject, public nsXFormsAccessible
+ {
+ public:
+   nsXFormsRangeAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
+@@ -182,7 +182,7 @@ public:
+  * Accessible object for xforms:choices.
+  */
+ 
+-class nsXFormsChoicesAccessible : public nsXFormsAccessible
++class nsXFormsChoicesAccessible : public XPCOMGCFinalizedObject, public nsXFormsAccessible
+ {
+ public:
+   nsXFormsChoicesAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
+@@ -199,7 +199,7 @@ public:
+  * may be represented by group of checkboxes or radiogroup.
+  */
+ 
+-class nsXFormsSelectFullAccessible : public nsXFormsSelectableAccessible
++class nsXFormsSelectFullAccessible : public XPCOMGCFinalizedObject, public nsXFormsSelectableAccessible
+ {
+ public:
+   nsXFormsSelectFullAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
+@@ -216,7 +216,7 @@ public:
+  * appearance. Such a xforms:select is represented by a checkgroup.
+  */
+ 
+-class nsXFormsItemCheckgroupAccessible : public nsXFormsSelectableItemAccessible
++class nsXFormsItemCheckgroupAccessible : public XPCOMGCFinalizedObject, public nsXFormsSelectableItemAccessible
+ {
+ public:
+   nsXFormsItemCheckgroupAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
+@@ -233,7 +233,7 @@ public:
+  * appearance. Such a xforms:select1 is represented as a radiogroup.
+  */
+ 
+-class nsXFormsItemRadiogroupAccessible : public nsXFormsSelectableItemAccessible
++class nsXFormsItemRadiogroupAccessible : public XPCOMGCFinalizedObject, public nsXFormsSelectableItemAccessible
+ {
+ public:
+   nsXFormsItemRadiogroupAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
+@@ -249,7 +249,7 @@ public:
+  * represented by combobox.
+  */
+ 
+-class nsXFormsSelectComboboxAccessible : public nsXFormsSelectableAccessible
++class nsXFormsSelectComboboxAccessible : public XPCOMGCFinalizedObject, public nsXFormsSelectableAccessible
+ {
+ public:
+   nsXFormsSelectComboboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
+@@ -269,7 +269,7 @@ public:
+  * minimal appearance. Such a xforms:select is represented by a combobox.
+  */
+ 
+-class nsXFormsItemComboboxAccessible : public nsXFormsSelectableItemAccessible
++class nsXFormsItemComboboxAccessible : public XPCOMGCFinalizedObject, public nsXFormsSelectableItemAccessible
+ {
+ public:
+   nsXFormsItemComboboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
+diff --git a/accessible/src/xforms/nsXFormsWidgetsAccessible.h b/accessible/src/xforms/nsXFormsWidgetsAccessible.h
+--- a/accessible/src/xforms/nsXFormsWidgetsAccessible.h
++++ b/accessible/src/xforms/nsXFormsWidgetsAccessible.h
+@@ -47,7 +47,8 @@
+  * of combobox representation. For example, these are xforms:select1,
+  * xforms:input[type="xsd:date"].
+  */
+-class nsXFormsDropmarkerWidgetAccessible : public nsLeafAccessible,
++class nsXFormsDropmarkerWidgetAccessible : public XPCOMGCFinalizedObject,
++                                           public nsLeafAccessible,
+                                            public nsXFormsAccessibleBase
+ {
+ public:
+@@ -79,7 +80,7 @@ public:
+  * Accessible object for popup menu of minimal xforms select1 element that is
+  * represented by combobox.
+  */
+-class nsXFormsComboboxPopupWidgetAccessible : public nsXFormsAccessible
++class nsXFormsComboboxPopupWidgetAccessible : public XPCOMGCFinalizedObject, public nsXFormsAccessible
+ {
+ public:
+   nsXFormsComboboxPopupWidgetAccessible(nsIDOMNode *aNode,
+diff --git a/accessible/src/xul/nsXULColorPickerAccessible.h b/accessible/src/xul/nsXULColorPickerAccessible.h
+--- a/accessible/src/xul/nsXULColorPickerAccessible.h
++++ b/accessible/src/xul/nsXULColorPickerAccessible.h
+@@ -42,7 +42,7 @@
+ // NOTE: alphabetically ordered
+ #include "nsFormControlAccessible.h"
+ 
+-class nsXULColorPickerTileAccessible : public nsFormControlAccessible
++class nsXULColorPickerTileAccessible : public XPCOMGCFinalizedObject, public nsFormControlAccessible
+ {
+ public:
+   nsXULColorPickerTileAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
+diff --git a/accessible/src/xul/nsXULFormControlAccessible.h b/accessible/src/xul/nsXULFormControlAccessible.h
+--- a/accessible/src/xul/nsXULFormControlAccessible.h
++++ b/accessible/src/xul/nsXULFormControlAccessible.h
+@@ -60,7 +60,7 @@ public:
+   void CacheChildren();
+ };
+ 
+-class nsXULCheckboxAccessible : public nsFormControlAccessible
++class nsXULCheckboxAccessible : public XPCOMGCFinalizedObject, public nsFormControlAccessible
+ {
+ public:
+   enum { eAction_Click = 0 };
+@@ -72,7 +72,7 @@ public:
+   NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
+ };
+ 
+-class nsXULDropmarkerAccessible : public nsFormControlAccessible
++class nsXULDropmarkerAccessible : public XPCOMGCFinalizedObject, public nsFormControlAccessible
+ {
+ public:
+   enum { eAction_Click = 0 };
+@@ -96,7 +96,7 @@ public:
+   NS_IMETHOD GetAccessibleRelated(PRUint32 aRelationType, nsIAccessible **aRelated);
+ };
+ 
+-class nsXULProgressMeterAccessible : public nsFormControlAccessible
++class nsXULProgressMeterAccessible : public XPCOMGCFinalizedObject, public nsFormControlAccessible
+ {
+   NS_DECL_ISUPPORTS_INHERITED
+   NS_DECL_NSIACCESSIBLEVALUE
+@@ -107,7 +107,7 @@ public:
+   NS_IMETHOD GetValue(nsAString &aValue);
+ };
+ 
+-class nsXULRadioButtonAccessible : public nsRadioButtonAccessible
++class nsXULRadioButtonAccessible : public XPCOMGCFinalizedObject, public nsRadioButtonAccessible
+ {
+ 
+ public:
+@@ -116,7 +116,7 @@ public:
+   virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
+ };
+ 
+-class nsXULRadioGroupAccessible : public nsXULSelectableAccessible
++class nsXULRadioGroupAccessible : public XPCOMGCFinalizedObject, public nsXULSelectableAccessible
+ {
+ public:
+   nsXULRadioGroupAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
+@@ -146,7 +146,7 @@ public:
+   NS_IMETHOD GetRole(PRUint32 *_retval); 
+ };
+ 
+-class nsXULToolbarSeparatorAccessible : public nsLeafAccessible
++class nsXULToolbarSeparatorAccessible : public XPCOMGCFinalizedObject, public nsLeafAccessible
+ {
+ public:
+   nsXULToolbarSeparatorAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
+diff --git a/accessible/src/xul/nsXULMenuAccessible.h b/accessible/src/xul/nsXULMenuAccessible.h
+--- a/accessible/src/xul/nsXULMenuAccessible.h
++++ b/accessible/src/xul/nsXULMenuAccessible.h
+@@ -102,7 +102,7 @@ public:
+   NS_IMETHOD GetNumActions(PRUint8 *_retval);
+ };
+ 
+-class nsXULMenupopupAccessible : public nsXULSelectableAccessible
++class nsXULMenupopupAccessible : public XPCOMGCFinalizedObject, public nsXULSelectableAccessible
+ {
+ public:
+   nsXULMenupopupAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
+diff --git a/accessible/src/xul/nsXULSelectAccessible.h b/accessible/src/xul/nsXULSelectAccessible.h
+--- a/accessible/src/xul/nsXULSelectAccessible.h
++++ b/accessible/src/xul/nsXULSelectAccessible.h
+@@ -64,7 +64,7 @@ public:
+  * nsXULColumnAccessible are accessibles for list and tree column elements
+  * (xul:listcol and xul:treecol).
+  */
+-class nsXULColumnItemAccessible : public nsLeafAccessible
++class nsXULColumnItemAccessible : public XPCOMGCFinalizedObject, public nsLeafAccessible
+ {
+ public:
+   nsXULColumnItemAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
+@@ -103,7 +103,8 @@ public:
+ /*
+  * A class the represents the XUL Listbox widget.
+  */
+-class nsXULListboxAccessible : public nsXULSelectableAccessible,
++class nsXULListboxAccessible : public XPCOMGCFinalizedObject,
++                               public nsXULSelectableAccessible,
+                                public nsIAccessibleTable
+ {
+ public:
+diff --git a/accessible/src/xul/nsXULTabAccessible.h b/accessible/src/xul/nsXULTabAccessible.h
+--- a/accessible/src/xul/nsXULTabAccessible.h
++++ b/accessible/src/xul/nsXULTabAccessible.h
+@@ -46,7 +46,7 @@
+ /**
+  * An individual tab, xul:tab element
+  */
+-class nsXULTabAccessible : public nsLeafAccessible
++class nsXULTabAccessible : public XPCOMGCFinalizedObject, public nsLeafAccessible
+ {
+ public:
+   enum { eAction_Switch = 0 };
+@@ -81,7 +81,7 @@ public:
+ /**
+  * A container of tab obejcts, xul:tabs element.
+  */
+-class nsXULTabsAccessible : public nsXULSelectableAccessible
++class nsXULTabsAccessible : public XPCOMGCFinalizedObject, public nsXULSelectableAccessible
+ {
+ public:
+   nsXULTabsAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
+diff --git a/accessible/src/xul/nsXULTextAccessible.h b/accessible/src/xul/nsXULTextAccessible.h
+--- a/accessible/src/xul/nsXULTextAccessible.h
++++ b/accessible/src/xul/nsXULTextAccessible.h
+@@ -58,7 +58,7 @@ public:
+                                   nsIAccessible **aRelated);
+ };
+ 
+-class nsXULTooltipAccessible : public nsLeafAccessible
++class nsXULTooltipAccessible : public XPCOMGCFinalizedObject, public nsLeafAccessible
+ {
+ 
+ public:
+diff --git a/accessible/src/xul/nsXULTreeAccessible.h b/accessible/src/xul/nsXULTreeAccessible.h
+--- a/accessible/src/xul/nsXULTreeAccessible.h
++++ b/accessible/src/xul/nsXULTreeAccessible.h
+@@ -93,7 +93,8 @@ protected:
+ /**
+   * Treeitems -- used in Trees
+   */
+-class nsXULTreeitemAccessible : public nsLeafAccessible,
++class nsXULTreeitemAccessible : public XPCOMGCFinalizedObject,
++                                public nsLeafAccessible,
+                                 public nsPIAccessibleTreeItem
+ {
+ public:
+diff --git a/browser/components/dirprovider/nsBrowserDirectoryProvider.cpp b/browser/components/dirprovider/nsBrowserDirectoryProvider.cpp
+--- a/browser/components/dirprovider/nsBrowserDirectoryProvider.cpp
++++ b/browser/components/dirprovider/nsBrowserDirectoryProvider.cpp
+@@ -57,7 +57,7 @@
+ #include "nsXULAppAPI.h"
+ 
+ class nsBrowserDirectoryProvider :
+-  public nsIDirectoryServiceProvider2
++  public XPCOMGCFinalizedObject, public nsIDirectoryServiceProvider2
+ {
+ public:
+   NS_DECL_ISUPPORTS
+@@ -79,7 +79,7 @@ private:
+   void EnsureProfileFile(const nsACString& aLeafName,
+ 			 nsIFile* aParentDir, nsIFile* aTarget);
+ 
+-  class AppendingEnumerator : public nsISimpleEnumerator
++  class AppendingEnumerator : public XPCOMGCFinalizedObject, public nsISimpleEnumerator
+   {
+   public:
+     NS_DECL_ISUPPORTS
+diff --git a/browser/components/feeds/src/nsAboutFeeds.h b/browser/components/feeds/src/nsAboutFeeds.h
+--- a/browser/components/feeds/src/nsAboutFeeds.h
++++ b/browser/components/feeds/src/nsAboutFeeds.h
+@@ -42,7 +42,7 @@
+ 
+ #include "nsIAboutModule.h"
+ 
+-class nsAboutFeeds : public nsIAboutModule
++class nsAboutFeeds : public XPCOMGCFinalizedObject, public nsIAboutModule
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/browser/components/feeds/src/nsFeedSniffer.h b/browser/components/feeds/src/nsFeedSniffer.h
+--- a/browser/components/feeds/src/nsFeedSniffer.h
++++ b/browser/components/feeds/src/nsFeedSniffer.h
+@@ -41,7 +41,7 @@
+ #include "nsIStreamListener.h"
+ #include "nsStringAPI.h"
+ 
+-class nsFeedSniffer : public nsIContentSniffer, nsIStreamListener
++class nsFeedSniffer : public XPCOMGCFinalizedObject, public nsIContentSniffer, nsIStreamListener
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/browser/components/migration/src/nsOperaProfileMigrator.h b/browser/components/migration/src/nsOperaProfileMigrator.h
+--- a/browser/components/migration/src/nsOperaProfileMigrator.h
++++ b/browser/components/migration/src/nsOperaProfileMigrator.h
+@@ -56,7 +56,8 @@ class nsINavBookmarksService;
+ class nsINavBookmarksService;
+ class nsIRDFResource;
+ 
+-class nsOperaProfileMigrator : public nsIBrowserProfileMigrator,
++class nsOperaProfileMigrator : public XPCOMGCFinalizedObject,
++                               public nsIBrowserProfileMigrator,
+                                public nsINavHistoryBatchCallback
+ {
+ public:
+diff --git a/browser/components/migration/src/nsProfileMigrator.h b/browser/components/migration/src/nsProfileMigrator.h
+--- a/browser/components/migration/src/nsProfileMigrator.h
++++ b/browser/components/migration/src/nsProfileMigrator.h
+@@ -45,7 +45,7 @@
+ #define NS_FIREFOX_PROFILEMIGRATOR_CID \
+ { 0x4ca3c946, 0x5408, 0x49f0, { 0x9e, 0xca, 0x3a, 0x97, 0xd5, 0xc6, 0x77, 0x50 } }
+ 
+-class nsProfileMigrator : public nsIProfileMigrator
++class nsProfileMigrator : public XPCOMGCFinalizedObject, public nsIProfileMigrator
+ {
+ public:
+   NS_DECL_NSIPROFILEMIGRATOR
+diff --git a/browser/components/places/src/nsPlacesImportExportService.cpp b/browser/components/places/src/nsPlacesImportExportService.cpp
+--- a/browser/components/places/src/nsPlacesImportExportService.cpp
++++ b/browser/components/places/src/nsPlacesImportExportService.cpp
+@@ -326,7 +326,7 @@ nsPlacesImportExportService::~nsPlacesIm
+ /**
+  * The content sink stuff is based loosely on 
+  */
+-class BookmarkContentSink : public nsIHTMLContentSink
++class BookmarkContentSink : public XPCOMGCFinalizedObject, public nsIHTMLContentSink
+ {
+ public:
+   BookmarkContentSink();
+diff --git a/browser/components/places/src/nsPlacesImportExportService.h b/browser/components/places/src/nsPlacesImportExportService.h
+--- a/browser/components/places/src/nsPlacesImportExportService.h
++++ b/browser/components/places/src/nsPlacesImportExportService.h
+@@ -14,7 +14,8 @@
+ #include "nsIMicrosummaryService.h"
+ #include "nsIChannel.h"
+ 
+-class nsPlacesImportExportService : public nsIPlacesImportExportService,
++class nsPlacesImportExportService : public XPCOMGCFinalizedObject,
++                                    public nsIPlacesImportExportService,
+                                     public nsINavHistoryBatchCallback
+ {
+   public:
+diff --git a/browser/components/shell/src/nsGNOMEShellService.h b/browser/components/shell/src/nsGNOMEShellService.h
+--- a/browser/components/shell/src/nsGNOMEShellService.h
++++ b/browser/components/shell/src/nsGNOMEShellService.h
+@@ -40,7 +40,7 @@
+ #include "nsIShellService.h"
+ #include "nsStringAPI.h"
+ 
+-class nsGNOMEShellService : public nsIShellService
++class nsGNOMEShellService : public XPCOMGCFinalizedObject, public nsIShellService
+ {
+ public:
+   nsGNOMEShellService() : mCheckedThisSession(PR_FALSE) { }
+diff --git a/caps/include/nsNullPrincipal.h b/caps/include/nsNullPrincipal.h
+--- a/caps/include/nsNullPrincipal.h
++++ b/caps/include/nsNullPrincipal.h
+@@ -59,7 +59,7 @@ class nsIURI;
+ 
+ #define NS_NULLPRINCIPAL_SCHEME "moz-nullprincipal"
+ 
+-class nsNullPrincipal : public nsIPrincipal
++class nsNullPrincipal : public XPCOMGCFinalizedObject, public nsIPrincipal
+ {
+ public:
+   nsNullPrincipal();
+diff --git a/caps/include/nsScriptSecurityManager.h b/caps/include/nsScriptSecurityManager.h
+--- a/caps/include/nsScriptSecurityManager.h
++++ b/caps/include/nsScriptSecurityManager.h
+@@ -368,7 +368,8 @@ MoveClassPolicyEntry(PLDHashTable *table
+ { 0x7ee2a4c0, 0x4b93, 0x17d3, \
+ { 0xba, 0x18, 0x00, 0x60, 0xb0, 0xf1, 0x99, 0xa2 }}
+ 
+-class nsScriptSecurityManager : public nsIScriptSecurityManager,
++class nsScriptSecurityManager : public XPCOMGCFinalizedObject,
++                                public nsIScriptSecurityManager,
+                                 public nsIPrefSecurityCheck,
+                                 public nsIChannelEventSink,
+                                 public nsIObserver
+diff --git a/caps/include/nsSystemPrincipal.h b/caps/include/nsSystemPrincipal.h
+--- a/caps/include/nsSystemPrincipal.h
++++ b/caps/include/nsSystemPrincipal.h
+@@ -50,7 +50,7 @@
+ #define NS_SYSTEMPRINCIPAL_CONTRACTID "@mozilla.org/systemprincipal;1"
+ 
+ 
+-class nsSystemPrincipal : public nsIPrincipal
++class nsSystemPrincipal : public XPCOMGCFinalizedObject, public nsIPrincipal
+ {
+ public:
+     // Our refcount is managed by mJSPrincipals.  Use this macro to avoid
+diff --git a/caps/src/nsSecurityManagerFactory.cpp b/caps/src/nsSecurityManagerFactory.cpp
+--- a/caps/src/nsSecurityManagerFactory.cpp
++++ b/caps/src/nsSecurityManagerFactory.cpp
+@@ -66,7 +66,7 @@
+  { 0x99, 0x8d, 0x80, 0xd7, 0x79, 0xc4, 0x85, 0x89 } }
+ #define NS_SECURITYNAMESET_CONTRACTID "@mozilla.org/security/script/nameset;1"
+ 
+-class nsSecurityNameSet : public nsIScriptExternalNameSet 
++class nsSecurityNameSet : public XPCOMGCFinalizedObject, public nsIScriptExternalNameSet 
+ {
+ public:
+     nsSecurityNameSet();
+diff --git a/chrome/src/nsChromeProtocolHandler.cpp b/chrome/src/nsChromeProtocolHandler.cpp
+--- a/chrome/src/nsChromeProtocolHandler.cpp
++++ b/chrome/src/nsChromeProtocolHandler.cpp
+@@ -105,7 +105,7 @@ static NS_DEFINE_CID(kXULPrototypeCacheC
+ { 0x281371d3, 0x6bc2, 0x499f, \
+   { 0x8d, 0x70, 0xcb, 0xfc, 0x01, 0x1b, 0xa0, 0x43 } }
+ 
+-class nsCachedChromeChannel : public nsIChannel
++class nsCachedChromeChannel : public XPCOMGCFinalizedObject, public nsIChannel
+ {
+ protected:
+     ~nsCachedChromeChannel();
+diff --git a/chrome/src/nsChromeProtocolHandler.h b/chrome/src/nsChromeProtocolHandler.h
+--- a/chrome/src/nsChromeProtocolHandler.h
++++ b/chrome/src/nsChromeProtocolHandler.h
+@@ -49,7 +49,7 @@
+     {0x8c, 0xd0, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3} \
+ }
+ 
+-class nsChromeProtocolHandler : public nsIProtocolHandler, public nsSupportsWeakReference
++class nsChromeProtocolHandler : public XPCOMGCFinalizedObject, public nsIProtocolHandler, public nsSupportsWeakReference
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/chrome/src/nsChromeRegistry.h b/chrome/src/nsChromeRegistry.h
+--- a/chrome/src/nsChromeRegistry.h
++++ b/chrome/src/nsChromeRegistry.h
+@@ -72,7 +72,8 @@ class nsIURL;
+ #define NS_CHROMEREGISTRY_CID \
+ { 0x47049e42, 0x1d87, 0x482a, { 0x98, 0x4d, 0x56, 0xae, 0x18, 0x5e, 0x36, 0x7a } }
+ 
+-class nsChromeRegistry : public nsIToolkitChromeRegistry,
++class nsChromeRegistry : public XPCOMGCFinalizedObject,
++public nsIToolkitChromeRegistry,
+ #ifdef MOZ_XUL
+                          public nsIXULOverlayProvider,
+ #endif
+diff --git a/content/base/public/nsDOMFile.h b/content/base/public/nsDOMFile.h
+--- a/content/base/public/nsDOMFile.h
++++ b/content/base/public/nsDOMFile.h
+@@ -51,7 +51,8 @@ class nsIFile;
+ class nsIFile;
+ class nsIInputStream;
+ 
+-class nsDOMFile : public nsIDOMFile,
++class nsDOMFile : public XPCOMGCFinalizedObject,
++                  public nsIDOMFile,
+                   public nsICharsetDetectionObserver
+ {
+ public:
+@@ -77,7 +78,7 @@ private:
+                          nsAString &aResult);
+ };
+ 
+-class nsDOMFileList : public nsIDOMFileList
++class nsDOMFileList : public XPCOMGCFinalizedObject, public nsIDOMFileList
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/content/base/src/mozSanitizingSerializer.h b/content/base/src/mozSanitizingSerializer.h
+--- a/content/base/src/mozSanitizingSerializer.h
++++ b/content/base/src/mozSanitizingSerializer.h
+@@ -58,7 +58,8 @@
+ #include "nsIParser.h"
+ #include "nsHashtable.h"
+ 
+-class mozSanitizingHTMLSerializer : public nsIContentSerializer,
++class mozSanitizingHTMLSerializer : public XPCOMGCFinalizedObject,
++                                    public nsIContentSerializer,
+                                     public nsIHTMLContentSink,
+                                     public mozISanitizingHTMLSerializer
+ {
+diff --git a/content/base/src/nsCCUncollectableMarker.h b/content/base/src/nsCCUncollectableMarker.h
+--- a/content/base/src/nsCCUncollectableMarker.h
++++ b/content/base/src/nsCCUncollectableMarker.h
+@@ -37,7 +37,7 @@
+ 
+ #include "nsIObserver.h"
+ 
+-class nsCCUncollectableMarker : public nsIObserver
++class nsCCUncollectableMarker : public XPCOMGCFinalizedObject, public nsIObserver
+ {
+   NS_DECL_ISUPPORTS
+   NS_DECL_NSIOBSERVER
+diff --git a/content/base/src/nsCommentNode.cpp b/content/base/src/nsCommentNode.cpp
+--- a/content/base/src/nsCommentNode.cpp
++++ b/content/base/src/nsCommentNode.cpp
+@@ -44,7 +44,8 @@
+ #include "nsCOMPtr.h"
+ #include "nsIDocument.h"
+ 
+-class nsCommentNode : public nsGenericDOMDataNode,
++class nsCommentNode : public XPCOMGCFinalizedObject,
++                      public nsGenericDOMDataNode,
+                       public nsIDOMComment
+ {
+ public:
+diff --git a/content/base/src/nsContentAreaDragDrop.h b/content/base/src/nsContentAreaDragDrop.h
+--- a/content/base/src/nsContentAreaDragDrop.h
++++ b/content/base/src/nsContentAreaDragDrop.h
+@@ -75,7 +75,8 @@ class nsISimpleEnumerator;
+ // AddChromeListeners() and removes itself with
+ // RemoveChromeListeners().
+ //
+-class nsContentAreaDragDrop : public nsIDOMDragListener,
++class nsContentAreaDragDrop : public XPCOMGCFinalizedObject,
++                              public nsIDOMDragListener,
+                               public nsIDragDropHandler,
+                               public nsIFlavorDataProvider
+ {
+diff --git a/content/base/src/nsContentIterator.cpp b/content/base/src/nsContentIterator.cpp
+--- a/content/base/src/nsContentIterator.cpp
++++ b/content/base/src/nsContentIterator.cpp
+@@ -121,7 +121,7 @@ ContentIsInTraversalRange(nsIContent *aC
+ /*
+  *  A simple iterator class for traversing the content in "close tag" order
+  */
+-class nsContentIterator : public nsIContentIterator
++class nsContentIterator : public XPCOMGCFinalizedObject, public nsIContentIterator
+                       //, public nsIEnumerator
+ {
+ public:
+diff --git a/content/base/src/nsContentList.h b/content/base/src/nsContentList.h
+--- a/content/base/src/nsContentList.h
++++ b/content/base/src/nsContentList.h
+@@ -73,7 +73,7 @@ class nsIDOMHTMLFormElement;
+ class nsIDOMHTMLFormElement;
+ 
+ 
+-class nsBaseContentList : public nsIDOMNodeList
++class nsBaseContentList : public XPCOMGCFinalizedObject, public nsIDOMNodeList
+ {
+ public:
+   nsBaseContentList();
+diff --git a/content/base/src/nsContentPolicy.h b/content/base/src/nsContentPolicy.h
+--- a/content/base/src/nsContentPolicy.h
++++ b/content/base/src/nsContentPolicy.h
+@@ -47,7 +47,7 @@
+  * Implementation of the "@mozilla.org/layout/content-policy;1" contract.
+  */
+ 
+-class nsContentPolicy : public nsIContentPolicy
++class nsContentPolicy : public XPCOMGCFinalizedObject, public nsIContentPolicy
+ {
+  public:
+     NS_DECL_ISUPPORTS
+diff --git a/content/base/src/nsContentSink.cpp b/content/base/src/nsContentSink.cpp
+--- a/content/base/src/nsContentSink.cpp
++++ b/content/base/src/nsContentSink.cpp
+@@ -97,7 +97,7 @@
+ 
+ PRLogModuleInfo* gContentSinkLogModuleInfo;
+ 
+-class nsScriptLoaderObserverProxy : public nsIScriptLoaderObserver
++class nsScriptLoaderObserverProxy : public XPCOMGCFinalizedObject, public nsIScriptLoaderObserver
+ {
+ public:
+   nsScriptLoaderObserverProxy(nsIScriptLoaderObserver* aInner)
+diff --git a/content/base/src/nsDOMAttribute.h b/content/base/src/nsDOMAttribute.h
+--- a/content/base/src/nsDOMAttribute.h
++++ b/content/base/src/nsDOMAttribute.h
+@@ -59,7 +59,8 @@ class nsDOMAttribute;
+ 
+ // Attribute helper class used to wrap up an attribute with a dom
+ // object that implements nsIDOMAttr, nsIDOM3Attr, nsIDOMNode, nsIDOM3Node
+-class nsDOMAttribute : public nsIAttribute,
++class nsDOMAttribute : public XPCOMGCFinalizedObject,
++                       public nsIAttribute,
+                        public nsIDOMAttr,
+                        public nsIDOM3Attr
+ {
+diff --git a/content/base/src/nsDOMAttributeMap.h b/content/base/src/nsDOMAttributeMap.h
+--- a/content/base/src/nsDOMAttributeMap.h
++++ b/content/base/src/nsDOMAttributeMap.h
+@@ -115,7 +115,7 @@ private:
+ };
+ 
+ // Helper class that implements the nsIDOMNamedNodeMap interface.
+-class nsDOMAttributeMap : public nsIDOMNamedNodeMap
++class nsDOMAttributeMap : public XPCOMGCFinalizedObject, public nsIDOMNamedNodeMap
+ {
+ public:
+   nsDOMAttributeMap(nsIContent* aContent);
+diff --git a/content/base/src/nsDOMDocumentType.h b/content/base/src/nsDOMDocumentType.h
+--- a/content/base/src/nsDOMDocumentType.h
++++ b/content/base/src/nsDOMDocumentType.h
+@@ -53,7 +53,8 @@
+ // data. This is done simply for convenience and should be changed if
+ // this restricts what should be done for character data.
+ 
+-class nsDOMDocumentType : public nsGenericDOMDataNode,
++class nsDOMDocumentType : public XPCOMGCFinalizedObject,
++                          public nsGenericDOMDataNode,
+                           public nsIDOMDocumentType
+ {
+ public:
+diff --git a/content/base/src/nsDOMParser.h b/content/base/src/nsDOMParser.h
+--- a/content/base/src/nsDOMParser.h
++++ b/content/base/src/nsDOMParser.h
+@@ -45,7 +45,8 @@
+ #include "nsWeakReference.h"
+ #include "nsIJSNativeInitializer.h"
+ 
+-class nsDOMParser : public nsIDOMParser,
++class nsDOMParser : public XPCOMGCFinalizedObject,
++                    public nsIDOMParser,
+                     public nsIDOMParserJS,
+                     public nsIDOMLoadListener,
+                     public nsIJSNativeInitializer,
+diff --git a/content/base/src/nsDOMSerializer.h b/content/base/src/nsDOMSerializer.h
+--- a/content/base/src/nsDOMSerializer.h
++++ b/content/base/src/nsDOMSerializer.h
+@@ -40,7 +40,7 @@
+ 
+ #include "nsIDOMSerializer.h"
+ 
+-class nsDOMSerializer : public nsIDOMSerializer
++class nsDOMSerializer : public XPCOMGCFinalizedObject, public nsIDOMSerializer
+ {
+ public:
+   nsDOMSerializer();
+diff --git a/content/base/src/nsDataDocumentContentPolicy.h b/content/base/src/nsDataDocumentContentPolicy.h
+--- a/content/base/src/nsDataDocumentContentPolicy.h
++++ b/content/base/src/nsDataDocumentContentPolicy.h
+@@ -53,7 +53,7 @@
+ 
+ #include "nsIContentPolicy.h"
+ 
+-class nsDataDocumentContentPolicy : public nsIContentPolicy
++class nsDataDocumentContentPolicy : public XPCOMGCFinalizedObject, public nsIContentPolicy
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp
+--- a/content/base/src/nsDocument.cpp
++++ b/content/base/src/nsDocument.cpp
+@@ -711,7 +711,7 @@ nsOnloadBlocker::SetLoadFlags(nsLoadFlag
+ // If we ever have an nsIDocumentObserver notification for stylesheet title
+ // changes, we could make this inherit from nsDOMStringList instead of
+ // reimplementing nsIDOMDOMStringList.
+-class nsDOMStyleSheetSetList : public nsIDOMDOMStringList
++class nsDOMStyleSheetSetList : public XPCOMGCFinalizedObject, public nsIDOMDOMStringList
+                           
+ {
+ public:
+@@ -816,7 +816,8 @@ nsDOMStyleSheetSetList::GetSets(nsString
+ // =
+ // ==================================================================
+ 
+-class nsDOMImplementation : public nsIDOMDOMImplementation,
++class nsDOMImplementation : public XPCOMGCFinalizedObject,
++                            public nsIDOMDOMImplementation,
+                             public nsIPrivateDOMImplementation
+ {
+ public:
+diff --git a/content/base/src/nsDocument.h b/content/base/src/nsDocument.h
+--- a/content/base/src/nsDocument.h
++++ b/content/base/src/nsDocument.h
+@@ -331,7 +331,8 @@ public:
+   nsDocHeaderData*  mNext;
+ };
+ 
+-class nsDOMStyleSheetList : public nsIDOMStyleSheetList,
++class nsDOMStyleSheetList : public XPCOMGCFinalizedObject,
++                            public nsIDOMStyleSheetList,
+                             public nsStubDocumentObserver
+ {
+ public:
+@@ -356,7 +357,7 @@ protected:
+   nsIDocument*  mDocument;
+ };
+ 
+-class nsOnloadBlocker : public nsIRequest
++class nsOnloadBlocker : public XPCOMGCFinalizedObject, public nsIRequest
+ {
+ public:
+   nsOnloadBlocker() {}
+diff --git a/content/base/src/nsDocumentEncoder.cpp b/content/base/src/nsDocumentEncoder.cpp
+--- a/content/base/src/nsDocumentEncoder.cpp
++++ b/content/base/src/nsDocumentEncoder.cpp
+@@ -84,7 +84,7 @@ enum nsRangeIterationDirection {
+   kDirectionIn = 1
+ };
+ 
+-class nsDocumentEncoder : public nsIDocumentEncoder
++class nsDocumentEncoder : public XPCOMGCFinalizedObject, public nsIDocumentEncoder
+ {
+ public:
+   nsDocumentEncoder();
+diff --git a/content/base/src/nsDocumentFragment.cpp b/content/base/src/nsDocumentFragment.cpp
+--- a/content/base/src/nsDocumentFragment.cpp
++++ b/content/base/src/nsDocumentFragment.cpp
+@@ -55,7 +55,8 @@
+ #include "nsDOMString.h"
+ #include "nsIDOMUserDataHandler.h"
+ 
+-class nsDocumentFragment : public nsGenericElement,
++class nsDocumentFragment : public XPCOMGCFinalizedObject,
++                           public nsGenericElement,
+                            public nsIDOMDocumentFragment
+ {
+ public:
+diff --git a/content/base/src/nsFrameLoader.h b/content/base/src/nsFrameLoader.h
+--- a/content/base/src/nsFrameLoader.h
++++ b/content/base/src/nsFrameLoader.h
+@@ -52,7 +52,7 @@ class nsIContent;
+ class nsIContent;
+ class nsIURI;
+ 
+-class nsFrameLoader : public nsIFrameLoader
++class nsFrameLoader : public XPCOMGCFinalizedObject, public nsIFrameLoader
+ {
+ public:
+   nsFrameLoader(nsIContent *aOwner) :
+diff --git a/content/base/src/nsGenericDOMDataNode.h b/content/base/src/nsGenericDOMDataNode.h
+--- a/content/base/src/nsGenericDOMDataNode.h
++++ b/content/base/src/nsGenericDOMDataNode.h
+@@ -348,7 +348,7 @@ private:
+ };
+ 
+ /** Tearoff class for the nsIDOM3Text portion of nsGenericDOMDataNode. */
+-class nsText3Tearoff : public nsIDOM3Text
++class nsText3Tearoff : public XPCOMGCFinalizedObject, public nsIDOM3Text
+ {
+ public:
+   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+diff --git a/content/base/src/nsLoadListenerProxy.h b/content/base/src/nsLoadListenerProxy.h
+--- a/content/base/src/nsLoadListenerProxy.h
++++ b/content/base/src/nsLoadListenerProxy.h
+@@ -53,7 +53,7 @@
+ //
+ /////////////////////////////////////////////
+ 
+-class nsLoadListenerProxy : public nsIDOMLoadListener {
++class nsLoadListenerProxy : public XPCOMGCFinalizedObject, public nsIDOMLoadListener {
+ public:
+   nsLoadListenerProxy(nsWeakPtr aParent);
+   virtual ~nsLoadListenerProxy();
+diff --git a/content/base/src/nsMappedAttributes.h b/content/base/src/nsMappedAttributes.h
+--- a/content/base/src/nsMappedAttributes.h
++++ b/content/base/src/nsMappedAttributes.h
+@@ -52,7 +52,7 @@ class nsHTMLStyleSheet;
+ class nsHTMLStyleSheet;
+ class nsRuleWalker;
+ 
+-class nsMappedAttributes : public nsIStyleRule
++class nsMappedAttributes : public XPCOMGCFinalizedObject, public nsIStyleRule
+ {
+ public:
+   nsMappedAttributes(nsHTMLStyleSheet* aSheet,
+diff --git a/content/base/src/nsNameSpaceManager.cpp b/content/base/src/nsNameSpaceManager.cpp
+--- a/content/base/src/nsNameSpaceManager.cpp
++++ b/content/base/src/nsNameSpaceManager.cpp
+@@ -111,7 +111,7 @@ private:
+   const nsAString* mKey;
+ };
+ 
+-class NameSpaceManagerImpl : public nsINameSpaceManager {
++class NameSpaceManagerImpl : public XPCOMGCFinalizedObject, public nsINameSpaceManager {
+ public:
+   virtual ~NameSpaceManagerImpl()
+   {
+diff --git a/content/base/src/nsNoDataProtocolContentPolicy.h b/content/base/src/nsNoDataProtocolContentPolicy.h
+--- a/content/base/src/nsNoDataProtocolContentPolicy.h
++++ b/content/base/src/nsNoDataProtocolContentPolicy.h
+@@ -53,7 +53,7 @@
+ 
+ #include "nsIContentPolicy.h"
+ 
+-class nsNoDataProtocolContentPolicy : public nsIContentPolicy
++class nsNoDataProtocolContentPolicy : public XPCOMGCFinalizedObject, public nsIContentPolicy
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/content/base/src/nsPlainTextSerializer.h b/content/base/src/nsPlainTextSerializer.h
+--- a/content/base/src/nsPlainTextSerializer.h
++++ b/content/base/src/nsPlainTextSerializer.h
+@@ -57,7 +57,8 @@
+ #include "nsVoidArray.h"
+ 
+ 
+-class nsPlainTextSerializer : public nsIContentSerializer,
++class nsPlainTextSerializer : public XPCOMGCFinalizedObject,
++                              public nsIContentSerializer,
+                               public nsIHTMLContentSink,
+                               public nsIHTMLToTextSink
+ {
+diff --git a/content/base/src/nsRange.h b/content/base/src/nsRange.h
+--- a/content/base/src/nsRange.h
++++ b/content/base/src/nsRange.h
+@@ -55,7 +55,7 @@
+ 
+ // -------------------------------------------------------------------------------
+ 
+-class nsRangeUtils : public nsIRangeUtils
++class nsRangeUtils : public XPCOMGCFinalizedObject, public nsIRangeUtils
+ {
+ public:
+   NS_DECL_ISUPPORTS
+@@ -72,7 +72,8 @@ public:
+ 
+ // -------------------------------------------------------------------------------
+ 
+-class nsRange : public nsIRange,
++class nsRange : public XPCOMGCFinalizedObject,
++                public nsIRange,
+                 public nsIDOMRange,
+                 public nsIDOMNSRange,
+                 public nsStubMutationObserver
+diff --git a/content/base/src/nsScriptEventManager.h b/content/base/src/nsScriptEventManager.h
+--- a/content/base/src/nsScriptEventManager.h
++++ b/content/base/src/nsScriptEventManager.h
+@@ -50,7 +50,7 @@
+ #include "nsIDOMNodeList.h"
+ #include "nsIDOMDocument.h"
+ 
+-class nsScriptEventManager : public nsIScriptEventManager
++class nsScriptEventManager : public XPCOMGCFinalizedObject, public nsIScriptEventManager
+ {
+ 
+ 
+diff --git a/content/base/src/nsScriptLoader.cpp b/content/base/src/nsScriptLoader.cpp
+--- a/content/base/src/nsScriptLoader.cpp
++++ b/content/base/src/nsScriptLoader.cpp
+@@ -74,7 +74,7 @@
+ // Per-request data structure
+ //////////////////////////////////////////////////////////////
+ 
+-class nsScriptLoadRequest : public nsISupports {
++class nsScriptLoadRequest : public XPCOMGCFinalizedObject, public nsISupports {
+ public:
+   nsScriptLoadRequest(nsIScriptElement* aElement,
+                       PRUint32 aVersion)
+diff --git a/content/base/src/nsScriptLoader.h b/content/base/src/nsScriptLoader.h
+--- a/content/base/src/nsScriptLoader.h
++++ b/content/base/src/nsScriptLoader.h
+@@ -58,7 +58,7 @@ class nsScriptLoadRequest;
+ // Script loader implementation
+ //////////////////////////////////////////////////////////////
+ 
+-class nsScriptLoader : public nsIStreamLoaderObserver
++class nsScriptLoader : public XPCOMGCFinalizedObject, public nsIStreamLoaderObserver
+ {
+ public:
+   nsScriptLoader(nsIDocument* aDocument);
+diff --git a/content/base/src/nsSyncLoadService.cpp b/content/base/src/nsSyncLoadService.cpp
+--- a/content/base/src/nsSyncLoadService.cpp
++++ b/content/base/src/nsSyncLoadService.cpp
+@@ -64,7 +64,8 @@
+  * This class manages loading a single XML document
+  */
+ 
+-class nsSyncLoader : public nsIDOMLoadListener,
++class nsSyncLoader : public XPCOMGCFinalizedObject,
++                     public nsIDOMLoadListener,
+                      public nsIChannelEventSink,
+                      public nsIInterfaceRequestor,
+                      public nsSupportsWeakReference
+@@ -100,7 +101,7 @@ private:
+     PRPackedBool mLoadSuccess;
+ };
+ 
+-class nsForceXMLListener : public nsIStreamListener
++class nsForceXMLListener : public XPCOMGCFinalizedObject, public nsIStreamListener
+ {
+ public:
+     nsForceXMLListener(nsIStreamListener* aListener);
+diff --git a/content/base/src/nsSyncLoadService.h b/content/base/src/nsSyncLoadService.h
+--- a/content/base/src/nsSyncLoadService.h
++++ b/content/base/src/nsSyncLoadService.h
+@@ -50,7 +50,7 @@ class nsILoadGroup;
+ class nsILoadGroup;
+ class nsIStreamListener;
+ 
+-class nsSyncLoadService : public nsISyncLoadDOMService
++class nsSyncLoadService : public XPCOMGCFinalizedObject, public nsISyncLoadDOMService
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/content/base/src/nsTextNode.cpp b/content/base/src/nsTextNode.cpp
+--- a/content/base/src/nsTextNode.cpp
++++ b/content/base/src/nsTextNode.cpp
+@@ -53,7 +53,8 @@
+ /**
+  * Class used to implement DOM text nodes
+  */
+-class nsTextNode : public nsGenericDOMDataNode,
++class nsTextNode : public XPCOMGCFinalizedObject,
++                   public nsGenericDOMDataNode,
+                    public nsIDOMText
+ {
+ public:
+diff --git a/content/base/src/nsTreeWalker.h b/content/base/src/nsTreeWalker.h
+--- a/content/base/src/nsTreeWalker.h
++++ b/content/base/src/nsTreeWalker.h
+@@ -54,7 +54,7 @@ class nsIDOMNode;
+ class nsIDOMNode;
+ class nsIDOMNodeFilter;
+ 
+-class nsTreeWalker : public nsIDOMTreeWalker
++class nsTreeWalker : public XPCOMGCFinalizedObject, public nsIDOMTreeWalker
+ {
+ public:
+     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+diff --git a/content/base/src/nsXMLContentSerializer.h b/content/base/src/nsXMLContentSerializer.h
+--- a/content/base/src/nsXMLContentSerializer.h
++++ b/content/base/src/nsXMLContentSerializer.h
+@@ -52,7 +52,7 @@ class nsIDOMNode;
+ class nsIDOMNode;
+ class nsIAtom;
+ 
+-class nsXMLContentSerializer : public nsIContentSerializer {
++class nsXMLContentSerializer : public XPCOMGCFinalizedObject, public nsIContentSerializer {
+  public:
+   nsXMLContentSerializer();
+   virtual ~nsXMLContentSerializer();
+diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp
+--- a/content/base/src/nsXMLHttpRequest.cpp
++++ b/content/base/src/nsXMLHttpRequest.cpp
+@@ -154,7 +154,7 @@ static nsresult IsCapabilityEnabled(cons
+ // Helper proxy class to be used when expecting an
+ // multipart/x-mixed-replace stream of XML documents.
+ 
+-class nsMultipartProxyListener : public nsIStreamListener
++class nsMultipartProxyListener : public XPCOMGCFinalizedObject, public nsIStreamListener
+ {
+ public:
+   nsMultipartProxyListener(nsIStreamListener *dest);
+diff --git a/content/base/src/nsXMLHttpRequest.h b/content/base/src/nsXMLHttpRequest.h
+--- a/content/base/src/nsXMLHttpRequest.h
++++ b/content/base/src/nsXMLHttpRequest.h
+@@ -70,7 +70,8 @@
+ 
+ class nsILoadGroup;
+ 
+-class nsXMLHttpRequest : public nsIXMLHttpRequest,
++class nsXMLHttpRequest : public XPCOMGCFinalizedObject,
++                         public nsIXMLHttpRequest,
+                          public nsIJSXMLHttpRequest,
+                          public nsIDOMLoadListener,
+                          public nsIDOMEventTarget,
+@@ -216,7 +217,7 @@ protected:
+   nsCOMPtr<nsIStreamListener> mXMLParserStreamListener;
+ 
+   // used to implement getAllResponseHeaders()
+-  class nsHeaderVisitor : public nsIHttpHeaderVisitor {
++  class nsHeaderVisitor : public XPCOMGCFinalizedObject, public nsIHttpHeaderVisitor {
+   public:
+     NS_DECL_ISUPPORTS
+     NS_DECL_NSIHTTPHEADERVISITOR
+@@ -254,7 +255,7 @@ protected:
+ 
+ // helper class to expose a progress DOM Event
+ 
+-class nsXMLHttpProgressEvent : public nsIDOMLSProgressEvent
++class nsXMLHttpProgressEvent : public XPCOMGCFinalizedObject, public nsIDOMLSProgressEvent
+ {
+ public:
+   nsXMLHttpProgressEvent(nsIDOMEvent * aInner, PRUint64 aCurrentProgress, PRUint64 aMaxProgress);
+diff --git a/content/canvas/src/nsCanvasRenderingContext2D.cpp b/content/canvas/src/nsCanvasRenderingContext2D.cpp
+--- a/content/canvas/src/nsCanvasRenderingContext2D.cpp
++++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp
+@@ -162,7 +162,7 @@ static PRBool FloatValidate (double f1, 
+  **/
+ #define NS_CANVASGRADIENT_PRIVATE_IID \
+     { 0x491d39d8, 0x4058, 0x42bd, { 0xac, 0x76, 0x70, 0xd5, 0x62, 0x7f, 0x02, 0x10 } }
+-class nsCanvasGradient : public nsIDOMCanvasGradient
++class nsCanvasGradient : public XPCOMGCFinalizedObject, public nsIDOMCanvasGradient
+ {
+ public:
+     NS_DECLARE_STATIC_IID_ACCESSOR(NS_CANVASGRADIENT_PRIVATE_IID)
+@@ -229,7 +229,7 @@ NS_INTERFACE_MAP_END
+  **/
+ #define NS_CANVASPATTERN_PRIVATE_IID \
+     { 0xb85c6c8a, 0x0624, 0x4530, { 0xb8, 0xee, 0xff, 0xdf, 0x42, 0xe8, 0x21, 0x6d } }
+-class nsCanvasPattern : public nsIDOMCanvasPattern
++class nsCanvasPattern : public XPCOMGCFinalizedObject, public nsIDOMCanvasPattern
+ {
+ public:
+     NS_DECLARE_STATIC_IID_ACCESSOR(NS_CANVASPATTERN_PRIVATE_IID)
+@@ -282,7 +282,7 @@ NS_INTERFACE_MAP_END
+  **/
+ #define NS_TEXTMETRICS_PRIVATE_IID \
+     { 0xc5b1c2f9, 0xcb4f, 0x4394, { 0xaf, 0xe0, 0xc6, 0x59, 0x33, 0x80, 0x8b, 0xf3 } }
+-class nsTextMetrics : public nsIDOMTextMetrics
++class nsTextMetrics : public XPCOMGCFinalizedObject, public nsIDOMTextMetrics
+ {
+ public:
+     nsTextMetrics(float w) : width(w) { }
+@@ -318,6 +318,7 @@ NS_INTERFACE_MAP_END
+  ** nsCanvasRenderingContext2D
+  **/
+ class nsCanvasRenderingContext2D :
++    public XPCOMGCFinalizedObject,
+     public nsIDOMCanvasRenderingContext2D,
+     public nsICanvasRenderingContextInternal
+ {
+diff --git a/content/events/src/nsDOMEvent.h b/content/events/src/nsDOMEvent.h
+--- a/content/events/src/nsDOMEvent.h
++++ b/content/events/src/nsDOMEvent.h
+@@ -53,7 +53,8 @@ class nsIContent;
+ class nsIContent;
+ class nsIScrollableView;
+  
+-class nsDOMEvent : public nsIDOMEvent,
++class nsDOMEvent : public XPCOMGCFinalizedObject,
++                   public nsIDOMEvent,
+                    public nsIDOMNSEvent,
+                    public nsIPrivateDOMEvent
+ {
+diff --git a/content/events/src/nsDOMEventGroup.h b/content/events/src/nsDOMEventGroup.h
+--- a/content/events/src/nsDOMEventGroup.h
++++ b/content/events/src/nsDOMEventGroup.h
+@@ -41,7 +41,7 @@
+ #include "nsIDOMEventGroup.h"
+ #include "nsISupports.h"
+ 
+-class nsDOMEventGroup : public nsIDOMEventGroup
++class nsDOMEventGroup : public XPCOMGCFinalizedObject, public nsIDOMEventGroup
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/content/events/src/nsEventListenerManager.h b/content/events/src/nsEventListenerManager.h
+--- a/content/events/src/nsEventListenerManager.h
++++ b/content/events/src/nsEventListenerManager.h
+@@ -75,7 +75,8 @@ nsListenerStruct
+  * Event listener manager
+  */
+ 
+-class nsEventListenerManager : public nsIEventListenerManager,
++class nsEventListenerManager : public XPCOMGCFinalizedObject,
++                               public nsIEventListenerManager,
+                                public nsIDOMEventTarget,
+                                public nsIDOM3EventTarget
+ {
+diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp
+--- a/content/events/src/nsEventStateManager.cpp
++++ b/content/events/src/nsEventStateManager.cpp
+@@ -182,7 +182,7 @@ static nsITimer* gUserInteractionTimer =
+ static nsITimer* gUserInteractionTimer = nsnull;
+ static nsITimerCallback* gUserInteractionTimerCallback = nsnull;
+ 
+-class nsUITimerCallback : public nsITimerCallback
++class nsUITimerCallback : public XPCOMGCFinalizedObject, public nsITimerCallback
+ {
+ public:
+   nsUITimerCallback() : mPreviousCount(0) {}
+diff --git a/content/events/src/nsEventStateManager.h b/content/events/src/nsEventStateManager.h
+--- a/content/events/src/nsEventStateManager.h
++++ b/content/events/src/nsEventStateManager.h
+@@ -71,7 +71,8 @@ class imgIContainer;
+  * Event listener manager
+  */
+ 
+-class nsEventStateManager : public nsSupportsWeakReference,
++class nsEventStateManager : public XPCOMGCFinalizedObject,
++                            public nsSupportsWeakReference,
+                             public nsIEventStateManager,
+                             public nsIObserver
+ {
+diff --git a/content/events/src/nsPrivateTextRange.h b/content/events/src/nsPrivateTextRange.h
+--- a/content/events/src/nsPrivateTextRange.h
++++ b/content/events/src/nsPrivateTextRange.h
+@@ -42,7 +42,7 @@
+ #include "nsTArray.h"
+ #include "nsAutoPtr.h"
+ 
+-class nsPrivateTextRange : public nsIPrivateTextRange 
++class nsPrivateTextRange : public XPCOMGCFinalizedObject, public nsIPrivateTextRange 
+ {
+ 	NS_DECL_ISUPPORTS
+ public:
+@@ -66,7 +66,7 @@ protected:
+ 	PRUint16	mRangeType;
+ };
+ 
+-class nsPrivateTextRangeList: public nsIPrivateTextRangeList 
++class nsPrivateTextRangeList: public XPCOMGCFinalizedObject, public nsIPrivateTextRangeList 
+ {
+ 	NS_DECL_ISUPPORTS
+ public:
+diff --git a/content/events/src/nsXMLEventsManager.h b/content/events/src/nsXMLEventsManager.h
+--- a/content/events/src/nsXMLEventsManager.h
++++ b/content/events/src/nsXMLEventsManager.h
+@@ -52,7 +52,7 @@
+  */
+ 
+ class nsXMLEventsManager;
+-class nsXMLEventsListener : public nsIDOMEventListener {
++class nsXMLEventsListener : public XPCOMGCFinalizedObject, public nsIDOMEventListener {
+ public:
+   static PRBool InitXMLEventsListener(nsIDocument * aDocument, 
+                                       nsXMLEventsManager * aManager, 
+@@ -89,7 +89,7 @@ private:
+   
+ };
+ 
+-class nsXMLEventsManager : public nsIDocumentObserver {
++class nsXMLEventsManager : public XPCOMGCFinalizedObject, public nsIDocumentObserver {
+ public:
+   nsXMLEventsManager();
+   ~nsXMLEventsManager();
+diff --git a/content/html/content/src/nsClientRect.h b/content/html/content/src/nsClientRect.h
+--- a/content/html/content/src/nsClientRect.h
++++ b/content/html/content/src/nsClientRect.h
+@@ -43,7 +43,7 @@
+ #include "nsIDOMClientRectList.h"
+ #include "nsCOMArray.h"
+ 
+-class nsClientRect : public nsIDOMClientRect
++class nsClientRect : public XPCOMGCFinalizedObject, public nsIDOMClientRect
+ {
+ public:
+   NS_DECL_ISUPPORTS
+@@ -60,7 +60,7 @@ protected:
+   float mX, mY, mWidth, mHeight;
+ };
+ 
+-class nsClientRectList : public nsIDOMClientRectList
++class nsClientRectList : public XPCOMGCFinalizedObject, public nsIDOMClientRectList
+ {
+ public:
+   nsClientRectList() {}
+diff --git a/content/html/content/src/nsFormSubmission.cpp b/content/html/content/src/nsFormSubmission.cpp
+--- a/content/html/content/src/nsFormSubmission.cpp
++++ b/content/html/content/src/nsFormSubmission.cpp
+@@ -247,7 +247,7 @@ SendJSWarning(nsIContent* aContent,
+               const PRUnichar** aWarningArgs, PRUint32 aWarningArgsLen);
+ 
+ 
+-class nsFSURLEncoded : public nsFormSubmission
++class nsFSURLEncoded : public XPCOMGCFinalizedObject, public nsFormSubmission
+ {
+ public:
+   /**
+@@ -596,7 +596,7 @@ nsFSURLEncoded::URLEncode(const nsAStrin
+  * Handle multipart/form-data encoding, which does files as well as normal
+  * inputs.  This always does POST.
+  */
+-class nsFSMultipartFormData : public nsFormSubmission
++class nsFSMultipartFormData : public XPCOMGCFinalizedObject, public nsFormSubmission
+ {
+ public:
+   /**
+@@ -915,7 +915,7 @@ nsFSMultipartFormData::AddPostDataStream
+ //
+ // CLASS nsFSTextPlain
+ //
+-class nsFSTextPlain : public nsFormSubmission
++class nsFSTextPlain : public XPCOMGCFinalizedObject, public nsFormSubmission
+ {
+ public:
+   nsFSTextPlain(const nsACString& aCharset,
+diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp
+--- a/content/html/content/src/nsGenericHTMLElement.cpp
++++ b/content/html/content/src/nsGenericHTMLElement.cpp
+@@ -180,7 +180,8 @@ nsGenericHTMLElement::Init(nsINodeInfo *
+ #endif
+ 
+ 
+-class nsGenericHTMLElementTearoff : public nsIDOMNSHTMLElement,
++class nsGenericHTMLElementTearoff : public XPCOMGCFinalizedObject,
++                                    public nsIDOMNSHTMLElement,
+                                     public nsIDOMElementCSSInlineStyle
+ {
+   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+diff --git a/content/html/content/src/nsHTMLAnchorElement.cpp b/content/html/content/src/nsHTMLAnchorElement.cpp
+--- a/content/html/content/src/nsHTMLAnchorElement.cpp
++++ b/content/html/content/src/nsHTMLAnchorElement.cpp
+@@ -66,7 +66,8 @@
+ 
+ nsresult NS_NewContentIterator(nsIContentIterator** aInstancePtrResult);
+ 
+-class nsHTMLAnchorElement : public nsGenericHTMLElement,
++class nsHTMLAnchorElement : public XPCOMGCFinalizedObject,
++                            public nsGenericHTMLElement,
+                             public nsIDOMHTMLAnchorElement,
+                             public nsIDOMNSHTMLAnchorElement2,
+                             public nsILink
+diff --git a/content/html/content/src/nsHTMLAreaElement.cpp b/content/html/content/src/nsHTMLAreaElement.cpp
+--- a/content/html/content/src/nsHTMLAreaElement.cpp
++++ b/content/html/content/src/nsHTMLAreaElement.cpp
+@@ -50,7 +50,8 @@
+ #include "nsReadableUtils.h"
+ #include "nsIDocument.h"
+ 
+-class nsHTMLAreaElement : public nsGenericHTMLElement,
++class nsHTMLAreaElement : public XPCOMGCFinalizedObject,
++                          public nsGenericHTMLElement,
+                           public nsIDOMHTMLAreaElement,
+                           public nsIDOMNSHTMLAreaElement2,
+                           public nsILink
+diff --git a/content/html/content/src/nsHTMLBRElement.cpp b/content/html/content/src/nsHTMLBRElement.cpp
+--- a/content/html/content/src/nsHTMLBRElement.cpp
++++ b/content/html/content/src/nsHTMLBRElement.cpp
+@@ -43,7 +43,8 @@
+ #include "nsMappedAttributes.h"
+ #include "nsRuleData.h"
+ 
+-class nsHTMLBRElement : public nsGenericHTMLElement,
++class nsHTMLBRElement : public XPCOMGCFinalizedObject,
++                        public nsGenericHTMLElement,
+                         public nsIDOMHTMLBRElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLBodyElement.cpp b/content/html/content/src/nsHTMLBodyElement.cpp
+--- a/content/html/content/src/nsHTMLBodyElement.cpp
++++ b/content/html/content/src/nsHTMLBodyElement.cpp
+@@ -63,7 +63,7 @@
+ 
+ class nsHTMLBodyElement;
+ 
+-class BodyRule: public nsIStyleRule {
++class BodyRule: public XPCOMGCFinalizedObject, public nsIStyleRule {
+ public:
+   BodyRule(nsHTMLBodyElement* aPart);
+   virtual ~BodyRule();
+@@ -81,7 +81,8 @@ public:
+ 
+ //----------------------------------------------------------------------
+ 
+-class nsHTMLBodyElement : public nsGenericHTMLElement,
++class nsHTMLBodyElement : public XPCOMGCFinalizedObject,
++                          public nsGenericHTMLElement,
+                           public nsIDOMHTMLBodyElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLButtonElement.cpp b/content/html/content/src/nsHTMLButtonElement.cpp
+--- a/content/html/content/src/nsHTMLButtonElement.cpp
++++ b/content/html/content/src/nsHTMLButtonElement.cpp
+@@ -64,7 +64,8 @@
+ #define NS_IN_SUBMIT_CLICK      (1 << 0)
+ #define NS_OUTER_ACTIVATE_EVENT (1 << 1)
+ 
+-class nsHTMLButtonElement : public nsGenericHTMLFormElement,
++class nsHTMLButtonElement : public XPCOMGCFinalizedObject,
++                            public nsGenericHTMLFormElement,
+                             public nsIDOMHTMLButtonElement,
+                             public nsIDOMNSHTMLButtonElement
+ {
+diff --git a/content/html/content/src/nsHTMLCanvasElement.cpp b/content/html/content/src/nsHTMLCanvasElement.cpp
+--- a/content/html/content/src/nsHTMLCanvasElement.cpp
++++ b/content/html/content/src/nsHTMLCanvasElement.cpp
+@@ -62,7 +62,8 @@
+ #define DEFAULT_CANVAS_WIDTH 300
+ #define DEFAULT_CANVAS_HEIGHT 150
+ 
+-class nsHTMLCanvasElement : public nsGenericHTMLElement,
++class nsHTMLCanvasElement : public XPCOMGCFinalizedObject,
++                            public nsGenericHTMLElement,
+                             public nsIDOMHTMLCanvasElement,
+                             public nsICanvasElement
+ {
+diff --git a/content/html/content/src/nsHTMLDelElement.cpp b/content/html/content/src/nsHTMLDelElement.cpp
+--- a/content/html/content/src/nsHTMLDelElement.cpp
++++ b/content/html/content/src/nsHTMLDelElement.cpp
+@@ -42,7 +42,8 @@
+ #include "nsPresContext.h"
+ 
+ 
+-class nsHTMLModElement : public nsGenericHTMLElement,
++class nsHTMLModElement : public XPCOMGCFinalizedObject,
++                         public nsGenericHTMLElement,
+                          public nsIDOMHTMLModElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLDivElement.cpp b/content/html/content/src/nsHTMLDivElement.cpp
+--- a/content/html/content/src/nsHTMLDivElement.cpp
++++ b/content/html/content/src/nsHTMLDivElement.cpp
+@@ -42,7 +42,8 @@
+ #include "nsPresContext.h"
+ #include "nsMappedAttributes.h"
+ 
+-class nsHTMLDivElement : public nsGenericHTMLElement,
++class nsHTMLDivElement : public XPCOMGCFinalizedObject,
++                         public nsGenericHTMLElement,
+                          public nsIDOMHTMLDivElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLFieldSetElement.cpp b/content/html/content/src/nsHTMLFieldSetElement.cpp
+--- a/content/html/content/src/nsHTMLFieldSetElement.cpp
++++ b/content/html/content/src/nsHTMLFieldSetElement.cpp
+@@ -44,7 +44,8 @@
+ #include "nsIFormControl.h"
+ 
+ 
+-class nsHTMLFieldSetElement : public nsGenericHTMLFormElement,
++class nsHTMLFieldSetElement : public XPCOMGCFinalizedObject,
++                              public nsGenericHTMLFormElement,
+                               public nsIDOMHTMLFieldSetElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLFontElement.cpp b/content/html/content/src/nsHTMLFontElement.cpp
+--- a/content/html/content/src/nsHTMLFontElement.cpp
++++ b/content/html/content/src/nsHTMLFontElement.cpp
+@@ -47,7 +47,8 @@
+ #include "nsRuleData.h"
+ #include "nsIDocument.h"
+ 
+-class nsHTMLFontElement : public nsGenericHTMLElement,
++class nsHTMLFontElement : public XPCOMGCFinalizedObject,
++                          public nsGenericHTMLElement,
+                           public nsIDOMHTMLFontElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLFormElement.cpp b/content/html/content/src/nsHTMLFormElement.cpp
+--- a/content/html/content/src/nsHTMLFormElement.cpp
++++ b/content/html/content/src/nsHTMLFormElement.cpp
+@@ -131,7 +131,8 @@ private:
+ 
+ // nsHTMLFormElement
+ 
+-class nsHTMLFormElement : public nsGenericHTMLElement,
++class nsHTMLFormElement : public XPCOMGCFinalizedObject,
++                          public nsGenericHTMLElement,
+                           public nsIDOMHTMLFormElement,
+                           public nsIDOMNSHTMLFormElement,
+                           public nsIWebProgressListener,
+@@ -351,7 +352,8 @@ PRBool nsHTMLFormElement::gPasswordManag
+ 
+ 
+ // nsFormControlList
+-class nsFormControlList : public nsIDOMNSHTMLFormControlList,
++class nsFormControlList : public XPCOMGCFinalizedObject,
++                          public nsIDOMNSHTMLFormControlList,
+                           public nsIDOMHTMLCollection
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLFrameElement.cpp b/content/html/content/src/nsHTMLFrameElement.cpp
+--- a/content/html/content/src/nsHTMLFrameElement.cpp
++++ b/content/html/content/src/nsHTMLFrameElement.cpp
+@@ -43,7 +43,8 @@
+ #include "nsDOMError.h"
+ 
+ 
+-class nsHTMLFrameElement : public nsGenericHTMLFrameElement,
++class nsHTMLFrameElement : public XPCOMGCFinalizedObject,
++                           public nsGenericHTMLFrameElement,
+                            public nsIDOMHTMLFrameElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLFrameSetElement.cpp b/content/html/content/src/nsHTMLFrameSetElement.cpp
+--- a/content/html/content/src/nsHTMLFrameSetElement.cpp
++++ b/content/html/content/src/nsHTMLFrameSetElement.cpp
+@@ -44,7 +44,8 @@
+ #include "nsIHTMLDocument.h"
+ #include "nsIDocument.h"
+ 
+-class nsHTMLFrameSetElement : public nsGenericHTMLElement,
++class nsHTMLFrameSetElement : public XPCOMGCFinalizedObject,
++                              public nsGenericHTMLElement,
+                               public nsIDOMHTMLFrameSetElement,
+                               public nsIFrameSetElement
+ {
+diff --git a/content/html/content/src/nsHTMLHRElement.cpp b/content/html/content/src/nsHTMLHRElement.cpp
+--- a/content/html/content/src/nsHTMLHRElement.cpp
++++ b/content/html/content/src/nsHTMLHRElement.cpp
+@@ -44,7 +44,8 @@
+ #include "nsMappedAttributes.h"
+ #include "nsRuleData.h"
+ 
+-class nsHTMLHRElement : public nsGenericHTMLElement,
++class nsHTMLHRElement : public XPCOMGCFinalizedObject,
++                        public nsGenericHTMLElement,
+                         public nsIDOMHTMLHRElement,
+                         public nsIDOMNSHTMLHRElement
+ {
+diff --git a/content/html/content/src/nsHTMLHeadElement.cpp b/content/html/content/src/nsHTMLHeadElement.cpp
+--- a/content/html/content/src/nsHTMLHeadElement.cpp
++++ b/content/html/content/src/nsHTMLHeadElement.cpp
+@@ -42,7 +42,8 @@
+ #include "nsPresContext.h"
+ 
+ 
+-class nsHTMLHeadElement : public nsGenericHTMLElement,
++class nsHTMLHeadElement : public XPCOMGCFinalizedObject,
++                          public nsGenericHTMLElement,
+                           public nsIDOMHTMLHeadElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLHeadingElement.cpp b/content/html/content/src/nsHTMLHeadingElement.cpp
+--- a/content/html/content/src/nsHTMLHeadingElement.cpp
++++ b/content/html/content/src/nsHTMLHeadingElement.cpp
+@@ -44,7 +44,8 @@
+ #include "nsRuleData.h"
+ #include "mozAutoDocUpdate.h"
+ 
+-class nsHTMLHeadingElement : public nsGenericHTMLElement,
++class nsHTMLHeadingElement : public XPCOMGCFinalizedObject,
++                             public nsGenericHTMLElement,
+                              public nsIDOMHTMLHeadingElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLHtmlElement.cpp b/content/html/content/src/nsHTMLHtmlElement.cpp
+--- a/content/html/content/src/nsHTMLHtmlElement.cpp
++++ b/content/html/content/src/nsHTMLHtmlElement.cpp
+@@ -43,7 +43,8 @@
+ #include "nsIDocument.h"
+ 
+ 
+-class nsHTMLHtmlElement : public nsGenericHTMLElement,
++class nsHTMLHtmlElement : public XPCOMGCFinalizedObject,
++                          public nsGenericHTMLElement,
+                           public nsIDOMHTMLHtmlElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLIFrameElement.cpp b/content/html/content/src/nsHTMLIFrameElement.cpp
+--- a/content/html/content/src/nsHTMLIFrameElement.cpp
++++ b/content/html/content/src/nsHTMLIFrameElement.cpp
+@@ -48,7 +48,8 @@
+ #include "nsRuleData.h"
+ #include "nsStyleConsts.h"
+ 
+-class nsHTMLIFrameElement : public nsGenericHTMLFrameElement,
++class nsHTMLIFrameElement : public XPCOMGCFinalizedObject,
++                            public nsGenericHTMLFrameElement,
+                             public nsIDOMHTMLIFrameElement
+ #ifdef MOZ_SVG
+                             , public nsIDOMGetSVGDocument
+diff --git a/content/html/content/src/nsHTMLImageElement.cpp b/content/html/content/src/nsHTMLImageElement.cpp
+--- a/content/html/content/src/nsHTMLImageElement.cpp
++++ b/content/html/content/src/nsHTMLImageElement.cpp
+@@ -79,7 +79,8 @@
+ 
+ // XXX nav attrs: suppress
+ 
+-class nsHTMLImageElement : public nsGenericHTMLElement,
++class nsHTMLImageElement : public XPCOMGCFinalizedObject,
++                           public nsGenericHTMLElement,
+                            public nsImageLoadingContent,
+                            public nsIDOMHTMLImageElement,
+                            public nsIDOMNSHTMLImageElement,
+diff --git a/content/html/content/src/nsHTMLLIElement.cpp b/content/html/content/src/nsHTMLLIElement.cpp
+--- a/content/html/content/src/nsHTMLLIElement.cpp
++++ b/content/html/content/src/nsHTMLLIElement.cpp
+@@ -43,7 +43,8 @@
+ #include "nsMappedAttributes.h"
+ #include "nsRuleData.h"
+ 
+-class nsHTMLLIElement : public nsGenericHTMLElement,
++class nsHTMLLIElement : public XPCOMGCFinalizedObject,
++                        public nsGenericHTMLElement,
+                         public nsIDOMHTMLLIElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLLabelElement.cpp b/content/html/content/src/nsHTMLLabelElement.cpp
+--- a/content/html/content/src/nsHTMLLabelElement.cpp
++++ b/content/html/content/src/nsHTMLLabelElement.cpp
+@@ -54,7 +54,8 @@
+ #include "nsEventDispatcher.h"
+ #include "nsPIDOMWindow.h"
+ 
+-class nsHTMLLabelElement : public nsGenericHTMLFormElement,
++class nsHTMLLabelElement : public XPCOMGCFinalizedObject,
++                           public nsGenericHTMLFormElement,
+                            public nsIDOMHTMLLabelElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLLegendElement.cpp b/content/html/content/src/nsHTMLLegendElement.cpp
+--- a/content/html/content/src/nsHTMLLegendElement.cpp
++++ b/content/html/content/src/nsHTMLLegendElement.cpp
+@@ -50,7 +50,8 @@
+ #include "nsPIDOMWindow.h"
+ 
+ 
+-class nsHTMLLegendElement : public nsGenericHTMLFormElement,
++class nsHTMLLegendElement : public XPCOMGCFinalizedObject,
++                            public nsGenericHTMLFormElement,
+                             public nsIDOMHTMLLegendElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLLinkElement.cpp b/content/html/content/src/nsHTMLLinkElement.cpp
+--- a/content/html/content/src/nsHTMLLinkElement.cpp
++++ b/content/html/content/src/nsHTMLLinkElement.cpp
+@@ -60,7 +60,8 @@
+ #include "nsPIDOMWindow.h"
+ #include "nsPLDOMEvent.h"
+ 
+-class nsHTMLLinkElement : public nsGenericHTMLElement,
++class nsHTMLLinkElement : public XPCOMGCFinalizedObject,
++                          public nsGenericHTMLElement,
+                           public nsIDOMHTMLLinkElement,
+                           public nsILink,
+                           public nsStyleLinkElement
+diff --git a/content/html/content/src/nsHTMLMapElement.cpp b/content/html/content/src/nsHTMLMapElement.cpp
+--- a/content/html/content/src/nsHTMLMapElement.cpp
++++ b/content/html/content/src/nsHTMLMapElement.cpp
+@@ -46,7 +46,8 @@
+ #include "nsCOMPtr.h"
+ 
+ 
+-class nsHTMLMapElement : public nsGenericHTMLElement,
++class nsHTMLMapElement : public XPCOMGCFinalizedObject,
++                         public nsGenericHTMLElement,
+                          public nsIDOMHTMLMapElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLMetaElement.cpp b/content/html/content/src/nsHTMLMetaElement.cpp
+--- a/content/html/content/src/nsHTMLMetaElement.cpp
++++ b/content/html/content/src/nsHTMLMetaElement.cpp
+@@ -42,7 +42,8 @@
+ #include "nsPresContext.h"
+ 
+ 
+-class nsHTMLMetaElement : public nsGenericHTMLElement,
++class nsHTMLMetaElement : public XPCOMGCFinalizedObject,
++                          public nsGenericHTMLElement,
+                           public nsIDOMHTMLMetaElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLOListElement.cpp b/content/html/content/src/nsHTMLOListElement.cpp
+--- a/content/html/content/src/nsHTMLOListElement.cpp
++++ b/content/html/content/src/nsHTMLOListElement.cpp
+@@ -45,7 +45,8 @@
+ #include "nsMappedAttributes.h"
+ #include "nsRuleData.h"
+ 
+-class nsHTMLSharedListElement : public nsGenericHTMLElement,
++class nsHTMLSharedListElement : public XPCOMGCFinalizedObject,
++                                public nsGenericHTMLElement,
+                                 public nsIDOMHTMLOListElement,
+                                 public nsIDOMHTMLDListElement,
+                                 public nsIDOMHTMLUListElement
+diff --git a/content/html/content/src/nsHTMLObjectElement.cpp b/content/html/content/src/nsHTMLObjectElement.cpp
+--- a/content/html/content/src/nsHTMLObjectElement.cpp
++++ b/content/html/content/src/nsHTMLObjectElement.cpp
+@@ -50,7 +50,8 @@
+ #include "nsIPluginInstance.h"
+ #include "nsIPluginInstanceInternal.h"
+ 
+-class nsHTMLObjectElement : public nsGenericHTMLFormElement,
++class nsHTMLObjectElement : public XPCOMGCFinalizedObject,
++                            public nsGenericHTMLFormElement,
+                             public nsObjectLoadingContent,
+                             public nsIDOMHTMLObjectElement
+ #ifdef MOZ_SVG
+diff --git a/content/html/content/src/nsHTMLOptGroupElement.cpp b/content/html/content/src/nsHTMLOptGroupElement.cpp
+--- a/content/html/content/src/nsHTMLOptGroupElement.cpp
++++ b/content/html/content/src/nsHTMLOptGroupElement.cpp
+@@ -53,7 +53,8 @@
+ /**
+  * The implementation of &lt;optgroup&gt;
+  */
+-class nsHTMLOptGroupElement : public nsGenericHTMLElement,
++class nsHTMLOptGroupElement : public XPCOMGCFinalizedObject,
++                              public nsGenericHTMLElement,
+                               public nsIDOMHTMLOptGroupElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLOptionElement.cpp b/content/html/content/src/nsHTMLOptionElement.cpp
+--- a/content/html/content/src/nsHTMLOptionElement.cpp
++++ b/content/html/content/src/nsHTMLOptionElement.cpp
+@@ -74,7 +74,8 @@
+ /**
+  * Implementation of &lt;option&gt;
+  */
+-class nsHTMLOptionElement : public nsGenericHTMLElement,
++class nsHTMLOptionElement : public XPCOMGCFinalizedObject,
++                            public nsGenericHTMLElement,
+                             public nsIDOMHTMLOptionElement,
+                             public nsIDOMNSHTMLOptionElement,
+                             public nsIJSNativeInitializer,
+diff --git a/content/html/content/src/nsHTMLParagraphElement.cpp b/content/html/content/src/nsHTMLParagraphElement.cpp
+--- a/content/html/content/src/nsHTMLParagraphElement.cpp
++++ b/content/html/content/src/nsHTMLParagraphElement.cpp
+@@ -46,7 +46,8 @@
+ // XXX missing nav attributes
+ 
+ 
+-class nsHTMLParagraphElement : public nsGenericHTMLElement,
++class nsHTMLParagraphElement : public XPCOMGCFinalizedObject,
++                               public nsGenericHTMLElement,
+                                public nsIDOMHTMLParagraphElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLPreElement.cpp b/content/html/content/src/nsHTMLPreElement.cpp
+--- a/content/html/content/src/nsHTMLPreElement.cpp
++++ b/content/html/content/src/nsHTMLPreElement.cpp
+@@ -47,7 +47,8 @@
+ // XXX wrap, variable, cols, tabstop
+ 
+ 
+-class nsHTMLPreElement : public nsGenericHTMLElement,
++class nsHTMLPreElement : public XPCOMGCFinalizedObject,
++                         public nsGenericHTMLElement,
+                          public nsIDOMHTMLPreElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLScriptElement.cpp b/content/html/content/src/nsHTMLScriptElement.cpp
+--- a/content/html/content/src/nsHTMLScriptElement.cpp
++++ b/content/html/content/src/nsHTMLScriptElement.cpp
+@@ -61,7 +61,7 @@
+ // Helper class used to support <SCRIPT FOR=object EVENT=handler ...>
+ // style script tags...
+ //
+-class nsHTMLScriptEventHandler : public nsIScriptEventHandler
++class nsHTMLScriptEventHandler : public XPCOMGCFinalizedObject, public nsIScriptEventHandler
+ {
+ public:
+   nsHTMLScriptEventHandler(nsIDOMHTMLScriptElement *aOuter);
+@@ -310,7 +310,8 @@ nsHTMLScriptEventHandler::Invoke(nsISupp
+ }
+ 
+ 
+-class nsHTMLScriptElement : public nsGenericHTMLElement,
++class nsHTMLScriptElement : public XPCOMGCFinalizedObject,
++                            public nsGenericHTMLElement,
+                             public nsIDOMHTMLScriptElement,
+                             public nsScriptElement
+ {
+diff --git a/content/html/content/src/nsHTMLSelectElement.h b/content/html/content/src/nsHTMLSelectElement.h
+--- a/content/html/content/src/nsHTMLSelectElement.h
++++ b/content/html/content/src/nsHTMLSelectElement.h
+@@ -68,7 +68,8 @@ class nsHTMLSelectElement;
+  * The collection of options in the select (what you get back when you do
+  * select.options in DOM)
+  */
+-class nsHTMLOptionCollection: public nsIDOMHTMLOptionsCollection,
++class nsHTMLOptionCollection: public XPCOMGCFinalizedObject,
++                              public nsIDOMHTMLOptionsCollection,
+                               public nsIDOMNSHTMLOptionCollection,
+                               public nsIDOMHTMLCollection
+ {
+@@ -159,7 +160,7 @@ private:
+ /**
+  * The restore state used by select
+  */
+-class nsSelectState : public nsISupports {
++class nsSelectState : public XPCOMGCFinalizedObject, public nsISupports {
+ public:
+   nsSelectState()
+   {
+@@ -222,7 +223,8 @@ private:
+ /**
+  * Implementation of &lt;select&gt;
+  */
+-class nsHTMLSelectElement : public nsGenericHTMLFormElement,
++class nsHTMLSelectElement : public XPCOMGCFinalizedObject,
++                            public nsGenericHTMLFormElement,
+                             public nsIDOMHTMLSelectElement,
+                             public nsIDOMNSHTMLSelectElement,
+                             public nsIDOMNSXBLFormControl,
+diff --git a/content/html/content/src/nsHTMLSharedElement.cpp b/content/html/content/src/nsHTMLSharedElement.cpp
+--- a/content/html/content/src/nsHTMLSharedElement.cpp
++++ b/content/html/content/src/nsHTMLSharedElement.cpp
+@@ -52,7 +52,8 @@
+ // XXX nav4 has type= start= (same as OL/UL)
+ extern nsAttrValue::EnumTable kListTypeTable[];
+ 
+-class nsHTMLSharedElement : public nsGenericHTMLElement,
++class nsHTMLSharedElement : public XPCOMGCFinalizedObject,
++                            public nsGenericHTMLElement,
+                             public nsIDOMHTMLIsIndexElement,
+                             public nsIDOMHTMLParamElement,
+                             public nsIDOMHTMLBaseElement,
+diff --git a/content/html/content/src/nsHTMLSharedObjectElement.cpp b/content/html/content/src/nsHTMLSharedObjectElement.cpp
+--- a/content/html/content/src/nsHTMLSharedObjectElement.cpp
++++ b/content/html/content/src/nsHTMLSharedObjectElement.cpp
+@@ -56,7 +56,8 @@
+ #undef GetObject
+ #endif
+ 
+-class nsHTMLSharedObjectElement : public nsGenericHTMLElement,
++class nsHTMLSharedObjectElement : public XPCOMGCFinalizedObject,
++                                  public nsGenericHTMLElement,
+                                   public nsObjectLoadingContent,
+                                   public nsIDOMHTMLAppletElement,
+                                   public nsIDOMHTMLEmbedElement
+diff --git a/content/html/content/src/nsHTMLSpanElement.cpp b/content/html/content/src/nsHTMLSpanElement.cpp
+--- a/content/html/content/src/nsHTMLSpanElement.cpp
++++ b/content/html/content/src/nsHTMLSpanElement.cpp
+@@ -43,7 +43,8 @@
+ #include "nsIAtom.h"
+ #include "nsRuleData.h"
+ 
+-class nsHTMLSpanElement : public nsGenericHTMLElement,
++class nsHTMLSpanElement : public XPCOMGCFinalizedObject,
++                          public nsGenericHTMLElement,
+                           public nsIDOMHTMLElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLStyleElement.cpp b/content/html/content/src/nsHTMLStyleElement.cpp
+--- a/content/html/content/src/nsHTMLStyleElement.cpp
++++ b/content/html/content/src/nsHTMLStyleElement.cpp
+@@ -51,7 +51,8 @@
+ #include "nsParserUtils.h"
+ 
+ 
+-class nsHTMLStyleElement : public nsGenericHTMLElement,
++class nsHTMLStyleElement : public XPCOMGCFinalizedObject,
++                           public nsGenericHTMLElement,
+                            public nsIDOMHTMLStyleElement,
+                            public nsStyleLinkElement,
+                            public nsStubMutationObserver
+diff --git a/content/html/content/src/nsHTMLTableCaptionElement.cpp b/content/html/content/src/nsHTMLTableCaptionElement.cpp
+--- a/content/html/content/src/nsHTMLTableCaptionElement.cpp
++++ b/content/html/content/src/nsHTMLTableCaptionElement.cpp
+@@ -43,7 +43,8 @@
+ #include "nsMappedAttributes.h"
+ #include "nsRuleData.h"
+ 
+-class nsHTMLTableCaptionElement :  public nsGenericHTMLElement,
++class nsHTMLTableCaptionElement :  public XPCOMGCFinalizedObject,
++                                   public nsGenericHTMLElement,
+                                    public nsIDOMHTMLTableCaptionElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLTableCellElement.cpp b/content/html/content/src/nsHTMLTableCellElement.cpp
+--- a/content/html/content/src/nsHTMLTableCellElement.cpp
++++ b/content/html/content/src/nsHTMLTableCellElement.cpp
+@@ -46,7 +46,8 @@
+ #include "nsRuleData.h"
+ #include "nsIDocument.h"
+ 
+-class nsHTMLTableCellElement : public nsGenericHTMLElement,
++class nsHTMLTableCellElement : public XPCOMGCFinalizedObject,
++                               public nsGenericHTMLElement,
+                                public nsIDOMHTMLTableCellElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLTableColElement.cpp b/content/html/content/src/nsHTMLTableColElement.cpp
+--- a/content/html/content/src/nsHTMLTableColElement.cpp
++++ b/content/html/content/src/nsHTMLTableColElement.cpp
+@@ -47,7 +47,8 @@
+ // http://lxr.mozilla.org/classic/source/lib/layout/laytable.c#46
+ #define MAX_COLSPAN 1000
+ 
+-class nsHTMLTableColElement : public nsGenericHTMLElement,
++class nsHTMLTableColElement : public XPCOMGCFinalizedObject,
++                              public nsGenericHTMLElement,
+                               public nsIDOMHTMLTableColElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLTableElement.cpp b/content/html/content/src/nsHTMLTableElement.cpp
+--- a/content/html/content/src/nsHTMLTableElement.cpp
++++ b/content/html/content/src/nsHTMLTableElement.cpp
+@@ -58,7 +58,8 @@
+ 
+ class TableRowsCollection;
+ 
+-class nsHTMLTableElement :  public nsGenericHTMLElement,
++class nsHTMLTableElement :  public XPCOMGCFinalizedObject,
++                            public nsGenericHTMLElement,
+                             public nsIDOMHTMLTableElement
+ {
+ public:
+@@ -105,7 +106,7 @@ protected:
+  * This class provides a late-bound collection of rows in a table.
+  * mParent is NOT ref-counted to avoid circular references
+  */
+-class TableRowsCollection : public nsIDOMHTMLCollection 
++class TableRowsCollection : public XPCOMGCFinalizedObject, public nsIDOMHTMLCollection 
+ {
+ public:
+   TableRowsCollection(nsHTMLTableElement *aParent);
+diff --git a/content/html/content/src/nsHTMLTableRowElement.cpp b/content/html/content/src/nsHTMLTableRowElement.cpp
+--- a/content/html/content/src/nsHTMLTableRowElement.cpp
++++ b/content/html/content/src/nsHTMLTableRowElement.cpp
+@@ -49,7 +49,8 @@
+ #include "nsHTMLParts.h"
+ #include "nsRuleData.h"
+ 
+-class nsHTMLTableRowElement : public nsGenericHTMLElement,
++class nsHTMLTableRowElement : public XPCOMGCFinalizedObject,
++                              public nsGenericHTMLElement,
+                               public nsIDOMHTMLTableRowElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLTableSectionElement.cpp b/content/html/content/src/nsHTMLTableSectionElement.cpp
+--- a/content/html/content/src/nsHTMLTableSectionElement.cpp
++++ b/content/html/content/src/nsHTMLTableSectionElement.cpp
+@@ -49,7 +49,8 @@
+ 
+ // you will see the phrases "rowgroup" and "section" used interchangably
+ 
+-class nsHTMLTableSectionElement : public nsGenericHTMLElement,
++class nsHTMLTableSectionElement : public XPCOMGCFinalizedObject,
++                                  public nsGenericHTMLElement,
+                                   public nsIDOMHTMLTableSectionElement
+ {
+ public:
+diff --git a/content/html/content/src/nsHTMLTextAreaElement.cpp b/content/html/content/src/nsHTMLTextAreaElement.cpp
+--- a/content/html/content/src/nsHTMLTextAreaElement.cpp
++++ b/content/html/content/src/nsHTMLTextAreaElement.cpp
+@@ -81,7 +81,8 @@ static NS_DEFINE_CID(kXULControllersCID,
+ 
+ #define NS_NO_CONTENT_DISPATCH (1 << 0)
+ 
+-class nsHTMLTextAreaElement : public nsGenericHTMLFormElement,
++class nsHTMLTextAreaElement : public XPCOMGCFinalizedObject,
++                              public nsGenericHTMLFormElement,
+                               public nsIDOMHTMLTextAreaElement,
+                               public nsIDOMNSHTMLTextAreaElement,
+                               public nsITextControlElement,
+diff --git a/content/html/content/src/nsHTMLTitleElement.cpp b/content/html/content/src/nsHTMLTitleElement.cpp
+--- a/content/html/content/src/nsHTMLTitleElement.cpp
++++ b/content/html/content/src/nsHTMLTitleElement.cpp
+@@ -44,7 +44,8 @@
+ #include "nsIDOMHTMLDocument.h"
+ 
+ 
+-class nsHTMLTitleElement : public nsGenericHTMLElement,
++class nsHTMLTitleElement : public XPCOMGCFinalizedObject,
++                           public nsGenericHTMLElement,
+                            public nsIDOMHTMLTitleElement
+ {
+ public:
+diff --git a/content/html/document/src/nsHTMLContentSink.cpp b/content/html/document/src/nsHTMLContentSink.cpp
+--- a/content/html/document/src/nsHTMLContentSink.cpp
++++ b/content/html/document/src/nsHTMLContentSink.cpp
+@@ -159,7 +159,8 @@ class HTMLContentSink;
+ 
+ static void MaybeSetForm(nsGenericHTMLElement*, nsHTMLTag, HTMLContentSink*);
+ 
+-class HTMLContentSink : public nsContentSink,
++class HTMLContentSink : public XPCOMGCFinalizedObject,
++public nsContentSink,
+ #ifdef DEBUG
+                         public nsIDebugDumpContent,
+ #endif
+diff --git a/content/html/document/src/nsHTMLDocument.h b/content/html/document/src/nsHTMLDocument.h
+--- a/content/html/document/src/nsHTMLDocument.h
++++ b/content/html/document/src/nsHTMLDocument.h
+@@ -67,7 +67,8 @@ class nsIDocumentCharsetInfo;
+ class nsIDocumentCharsetInfo;
+ class nsICacheEntryDescriptor;
+ 
+-class nsHTMLDocument : public nsDocument,
++class nsHTMLDocument : public XPCOMGCFinalizedObject,
++                       public nsDocument,
+                        public nsIHTMLDocument,
+                        public nsIDOMHTMLDocument,
+                        public nsIDOMNSHTMLDocument
+diff --git a/content/html/document/src/nsHTMLFragmentContentSink.cpp b/content/html/document/src/nsHTMLFragmentContentSink.cpp
+--- a/content/html/document/src/nsHTMLFragmentContentSink.cpp
++++ b/content/html/document/src/nsHTMLFragmentContentSink.cpp
+@@ -73,7 +73,8 @@
+ // at some pointe really soon!
+ //
+ 
+-class nsHTMLFragmentContentSink : public nsIFragmentContentSink,
++class nsHTMLFragmentContentSink : public XPCOMGCFinalizedObject,
++                                  public nsIFragmentContentSink,
+                                   public nsIHTMLContentSink {
+ public:
+   nsHTMLFragmentContentSink(PRBool aAllContent = PR_FALSE);
+diff --git a/content/html/document/src/nsImageDocument.cpp b/content/html/document/src/nsImageDocument.cpp
+--- a/content/html/document/src/nsImageDocument.cpp
++++ b/content/html/document/src/nsImageDocument.cpp
+@@ -77,7 +77,7 @@
+ 
+ class nsImageDocument;
+ 
+-class ImageListener: public nsMediaDocumentStreamListener
++class ImageListener: public XPCOMGCFinalizedObject, public nsMediaDocumentStreamListener
+ {
+ public:
+   ImageListener(nsImageDocument* aDocument);
+@@ -86,7 +86,8 @@ public:
+   NS_DECL_NSIREQUESTOBSERVER
+ };
+ 
+-class nsImageDocument : public nsMediaDocument,
++class nsImageDocument : public XPCOMGCFinalizedObject,
++                        public nsMediaDocument,
+                         public nsIImageDocument,
+                         public nsStubImageDecoderObserver,
+                         public nsIDOMEventListener
+diff --git a/content/html/document/src/nsPluginDocument.cpp b/content/html/document/src/nsPluginDocument.cpp
+--- a/content/html/document/src/nsPluginDocument.cpp
++++ b/content/html/document/src/nsPluginDocument.cpp
+@@ -47,7 +47,8 @@
+ #include "nsContentPolicyUtils.h"
+ #include "nsIPropertyBag2.h"
+ 
+-class nsPluginDocument : public nsMediaDocument,
++class nsPluginDocument : public XPCOMGCFinalizedObject,
++                         public nsMediaDocument,
+                          public nsIPluginDocument
+ {
+ public:
+@@ -79,7 +80,7 @@ protected:
+   nsCString                                mMimeType;
+ };
+ 
+-class nsPluginStreamListener : public nsMediaDocumentStreamListener
++class nsPluginStreamListener : public XPCOMGCFinalizedObject, public nsMediaDocumentStreamListener
+ {
+   public:
+     nsPluginStreamListener(nsPluginDocument* doc) :
+diff --git a/content/html/document/src/nsWyciwygChannel.h b/content/html/document/src/nsWyciwygChannel.h
+--- a/content/html/document/src/nsWyciwygChannel.h
++++ b/content/html/document/src/nsWyciwygChannel.h
+@@ -61,7 +61,8 @@ extern PRLogModuleInfo * gWyciwygLog;
+ 
+ //-----------------------------------------------------------------------------
+ 
+-class nsWyciwygChannel: public nsIWyciwygChannel,
++class nsWyciwygChannel: public XPCOMGCFinalizedObject,
++                        public nsIWyciwygChannel,
+                         public nsIStreamListener,
+                         public nsICacheListener
+ {
+diff --git a/content/html/document/src/nsWyciwygProtocolHandler.h b/content/html/document/src/nsWyciwygProtocolHandler.h
+--- a/content/html/document/src/nsWyciwygProtocolHandler.h
++++ b/content/html/document/src/nsWyciwygProtocolHandler.h
+@@ -43,7 +43,7 @@
+ #include "nsIProtocolHandler.h"
+ 
+             
+-class nsWyciwygProtocolHandler : public nsIProtocolHandler
++class nsWyciwygProtocolHandler : public XPCOMGCFinalizedObject, public nsIProtocolHandler
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/content/mathml/content/src/nsMathMLElement.h b/content/mathml/content/src/nsMathMLElement.h
+--- a/content/mathml/content/src/nsMathMLElement.h
++++ b/content/mathml/content/src/nsMathMLElement.h
+@@ -50,7 +50,8 @@ typedef nsMappedAttributeElement nsMathM
+ /*
+  * The base class for MathML elements.
+  */
+-class nsMathMLElement : public nsMathMLElementBase
++class nsMathMLElement : public XPCOMGCFinalizedObject
++                      , public nsMathMLElementBase
+                       , public nsIDOMElement
+ {
+ public:
+diff --git a/content/svg/content/src/nsSVGAElement.cpp b/content/svg/content/src/nsSVGAElement.cpp
+--- a/content/svg/content/src/nsSVGAElement.cpp
++++ b/content/svg/content/src/nsSVGAElement.cpp
+@@ -45,7 +45,8 @@
+ 
+ typedef nsSVGGraphicElement nsSVGAElementBase;
+ 
+-class nsSVGAElement : public nsSVGAElementBase,
++class nsSVGAElement : public XPCOMGCFinalizedObject,
++                      public nsSVGAElementBase,
+                       public nsIDOMSVGAElement,
+                       public nsIDOMSVGURIReference,
+                       public nsILink
+diff --git a/content/svg/content/src/nsSVGAngle.cpp b/content/svg/content/src/nsSVGAngle.cpp
+--- a/content/svg/content/src/nsSVGAngle.cpp
++++ b/content/svg/content/src/nsSVGAngle.cpp
+@@ -39,7 +39,7 @@
+ #include "nsTextFormatter.h"
+ #include "nsSVGUtils.h"
+ 
+-class DOMSVGAngle : public nsIDOMSVGAngle
++class DOMSVGAngle : public XPCOMGCFinalizedObject, public nsIDOMSVGAngle
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/content/svg/content/src/nsSVGAngle.h b/content/svg/content/src/nsSVGAngle.h
+--- a/content/svg/content/src/nsSVGAngle.h
++++ b/content/svg/content/src/nsSVGAngle.h
+@@ -91,7 +91,7 @@ private:
+   nsresult ToDOMBaseVal(nsIDOMSVGAngle **aResult, nsSVGElement* aSVGElement);
+   nsresult ToDOMAnimVal(nsIDOMSVGAngle **aResult, nsSVGElement* aSVGElement);
+ 
+-  struct DOMBaseVal : public nsIDOMSVGAngle
++  struct DOMBaseVal : public XPCOMGCFinalizedObject, public nsIDOMSVGAngle
+   {
+     NS_DECL_ISUPPORTS
+ 
+@@ -130,7 +130,7 @@ private:
+       { mVal->ConvertToSpecifiedUnits(unitType, mSVGElement); return NS_OK; }
+   };
+ 
+-  struct DOMAnimVal : public nsIDOMSVGAngle
++  struct DOMAnimVal : public XPCOMGCFinalizedObject, public nsIDOMSVGAngle
+   {
+     NS_DECL_ISUPPORTS
+ 
+@@ -166,7 +166,7 @@ private:
+       { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
+   };
+ 
+-  struct DOMAnimatedAngle : public nsIDOMSVGAnimatedAngle
++  struct DOMAnimatedAngle : public XPCOMGCFinalizedObject, public nsIDOMSVGAnimatedAngle
+   {
+     NS_DECL_ISUPPORTS
+ 
+diff --git a/content/svg/content/src/nsSVGAnimatedLengthList.cpp b/content/svg/content/src/nsSVGAnimatedLengthList.cpp
+--- a/content/svg/content/src/nsSVGAnimatedLengthList.cpp
++++ b/content/svg/content/src/nsSVGAnimatedLengthList.cpp
+@@ -45,7 +45,8 @@
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGAnimatedTransformList
+ 
+-class nsSVGAnimatedLengthList : public nsIDOMSVGAnimatedLengthList,
++class nsSVGAnimatedLengthList : public XPCOMGCFinalizedObject,
++                                public nsIDOMSVGAnimatedLengthList,
+                                 public nsSVGValue,
+                                 public nsISVGValueObserver
+ {  
+diff --git a/content/svg/content/src/nsSVGAnimatedNumberList.cpp b/content/svg/content/src/nsSVGAnimatedNumberList.cpp
+--- a/content/svg/content/src/nsSVGAnimatedNumberList.cpp
++++ b/content/svg/content/src/nsSVGAnimatedNumberList.cpp
+@@ -45,7 +45,8 @@
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGAnimatedNumberList
+ 
+-class nsSVGAnimatedNumberList : public nsIDOMSVGAnimatedNumberList,
++class nsSVGAnimatedNumberList : public XPCOMGCFinalizedObject,
++                                public nsIDOMSVGAnimatedNumberList,
+                                 public nsSVGValue,
+                                 public nsISVGValueObserver
+ {  
+diff --git a/content/svg/content/src/nsSVGAnimatedPreserveAspectRatio.cpp b/content/svg/content/src/nsSVGAnimatedPreserveAspectRatio.cpp
+--- a/content/svg/content/src/nsSVGAnimatedPreserveAspectRatio.cpp
++++ b/content/svg/content/src/nsSVGAnimatedPreserveAspectRatio.cpp
+@@ -45,7 +45,8 @@
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGAnimatedPreserveAspectRatio
+ 
+-class nsSVGAnimatedPreserveAspectRatio : public nsIDOMSVGAnimatedPreserveAspectRatio,
++class nsSVGAnimatedPreserveAspectRatio : public XPCOMGCFinalizedObject,
++                                         public nsIDOMSVGAnimatedPreserveAspectRatio,
+                                          public nsSVGValue,
+                                          public nsISVGValueObserver
+ {
+diff --git a/content/svg/content/src/nsSVGAnimatedRect.cpp b/content/svg/content/src/nsSVGAnimatedRect.cpp
+--- a/content/svg/content/src/nsSVGAnimatedRect.cpp
++++ b/content/svg/content/src/nsSVGAnimatedRect.cpp
+@@ -45,7 +45,8 @@
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGAnimatedRect
+ 
+-class nsSVGAnimatedRect : public nsIDOMSVGAnimatedRect,
++class nsSVGAnimatedRect : public XPCOMGCFinalizedObject,
++                          public nsIDOMSVGAnimatedRect,
+                           public nsSVGValue,
+                           public nsISVGValueObserver
+ {  
+diff --git a/content/svg/content/src/nsSVGAnimatedTransformList.cpp b/content/svg/content/src/nsSVGAnimatedTransformList.cpp
+--- a/content/svg/content/src/nsSVGAnimatedTransformList.cpp
++++ b/content/svg/content/src/nsSVGAnimatedTransformList.cpp
+@@ -45,7 +45,8 @@
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGAnimatedTransformList
+ 
+-class nsSVGAnimatedTransformList : public nsIDOMSVGAnimatedTransformList,
++class nsSVGAnimatedTransformList : public XPCOMGCFinalizedObject,
++                                   public nsIDOMSVGAnimatedTransformList,
+                                    public nsSVGValue,
+                                    public nsISVGValueObserver
+ {  
+diff --git a/content/svg/content/src/nsSVGBoolean.h b/content/svg/content/src/nsSVGBoolean.h
+--- a/content/svg/content/src/nsSVGBoolean.h
++++ b/content/svg/content/src/nsSVGBoolean.h
+@@ -70,7 +70,7 @@ private:
+   PRPackedBool mBaseVal;
+   PRUint8 mAttrEnum; // element specified tracking for attribute
+ 
+-  struct DOMAnimatedBoolean : public nsIDOMSVGAnimatedBoolean
++  struct DOMAnimatedBoolean : public XPCOMGCFinalizedObject, public nsIDOMSVGAnimatedBoolean
+   {
+     NS_DECL_ISUPPORTS
+ 
+diff --git a/content/svg/content/src/nsSVGCircleElement.cpp b/content/svg/content/src/nsSVGCircleElement.cpp
+--- a/content/svg/content/src/nsSVGCircleElement.cpp
++++ b/content/svg/content/src/nsSVGCircleElement.cpp
+@@ -45,7 +45,8 @@
+ 
+ typedef nsSVGPathGeometryElement nsSVGCircleElementBase;
+ 
+-class nsSVGCircleElement : public nsSVGCircleElementBase,
++class nsSVGCircleElement : public XPCOMGCFinalizedObject,
++                           public nsSVGCircleElementBase,
+                            public nsIDOMSVGCircleElement
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGClassValue.h b/content/svg/content/src/nsSVGClassValue.h
+--- a/content/svg/content/src/nsSVGClassValue.h
++++ b/content/svg/content/src/nsSVGClassValue.h
+@@ -43,7 +43,8 @@
+ #include "nsSVGValue.h"
+ #include "nsAttrValue.h"
+ 
+-class nsSVGClassValue : public nsIDOMSVGAnimatedString,
++class nsSVGClassValue : public XPCOMGCFinalizedObject,
++                        public nsIDOMSVGAnimatedString,
+                         public nsSVGValue
+ {
+ public:
+diff --git a/content/svg/content/src/nsSVGClipPathElement.h b/content/svg/content/src/nsSVGClipPathElement.h
+--- a/content/svg/content/src/nsSVGClipPathElement.h
++++ b/content/svg/content/src/nsSVGClipPathElement.h
+@@ -44,7 +44,8 @@
+ 
+ typedef nsSVGGraphicElement nsSVGClipPathElementBase;
+ 
+-class nsSVGClipPathElement : public nsSVGClipPathElementBase,
++class nsSVGClipPathElement : public XPCOMGCFinalizedObject,
++                             public nsSVGClipPathElementBase,
+                              public nsIDOMSVGClipPathElement,
+                              public nsIDOMSVGUnitTypes
+ {
+diff --git a/content/svg/content/src/nsSVGDefsElement.cpp b/content/svg/content/src/nsSVGDefsElement.cpp
+--- a/content/svg/content/src/nsSVGDefsElement.cpp
++++ b/content/svg/content/src/nsSVGDefsElement.cpp
+@@ -41,7 +41,8 @@
+ 
+ typedef nsSVGGraphicElement nsSVGDefsElementBase;
+ 
+-class nsSVGDefsElement : public nsSVGDefsElementBase,
++class nsSVGDefsElement : public XPCOMGCFinalizedObject,
++                         public nsSVGDefsElementBase,
+                          public nsIDOMSVGDefsElement
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGDescElement.cpp b/content/svg/content/src/nsSVGDescElement.cpp
+--- a/content/svg/content/src/nsSVGDescElement.cpp
++++ b/content/svg/content/src/nsSVGDescElement.cpp
+@@ -41,7 +41,8 @@
+ 
+ typedef nsSVGStylableElement nsSVGDescElementBase;
+ 
+-class nsSVGDescElement : public nsSVGDescElementBase,
++class nsSVGDescElement : public XPCOMGCFinalizedObject,
++                         public nsSVGDescElementBase,
+                          public nsIDOMSVGDescElement
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGEllipseElement.cpp b/content/svg/content/src/nsSVGEllipseElement.cpp
+--- a/content/svg/content/src/nsSVGEllipseElement.cpp
++++ b/content/svg/content/src/nsSVGEllipseElement.cpp
+@@ -46,7 +46,8 @@
+ 
+ typedef nsSVGPathGeometryElement nsSVGEllipseElementBase;
+ 
+-class nsSVGEllipseElement : public nsSVGEllipseElementBase,
++class nsSVGEllipseElement : public XPCOMGCFinalizedObject,
++                            public nsSVGEllipseElementBase,
+                             public nsIDOMSVGEllipseElement
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGEnum.h b/content/svg/content/src/nsSVGEnum.h
+--- a/content/svg/content/src/nsSVGEnum.h
++++ b/content/svg/content/src/nsSVGEnum.h
+@@ -81,7 +81,7 @@ private:
+ 
+   nsSVGEnumMapping *GetMapping(nsSVGElement *aSVGElement);
+ 
+-  struct DOMAnimatedEnum : public nsIDOMSVGAnimatedEnumeration
++  struct DOMAnimatedEnum : public XPCOMGCFinalizedObject, public nsIDOMSVGAnimatedEnumeration
+   {
+     NS_DECL_ISUPPORTS
+ 
+diff --git a/content/svg/content/src/nsSVGFilterElement.h b/content/svg/content/src/nsSVGFilterElement.h
+--- a/content/svg/content/src/nsSVGFilterElement.h
++++ b/content/svg/content/src/nsSVGFilterElement.h
+@@ -48,7 +48,8 @@
+ 
+ typedef nsSVGGraphicElement nsSVGFilterElementBase;
+ 
+-class nsSVGFilterElement : public nsSVGFilterElementBase,
++class nsSVGFilterElement : public XPCOMGCFinalizedObject,
++                           public nsSVGFilterElementBase,
+                            public nsIDOMSVGFilterElement,
+                            public nsIDOMSVGURIReference,
+                            public nsIDOMSVGUnitTypes
+diff --git a/content/svg/content/src/nsSVGFilters.cpp b/content/svg/content/src/nsSVGFilters.cpp
+--- a/content/svg/content/src/nsSVGFilters.cpp
++++ b/content/svg/content/src/nsSVGFilters.cpp
+@@ -497,7 +497,8 @@ nsSVGFE::GetLengthInfo()
+ 
+ typedef nsSVGFE nsSVGFEGaussianBlurElementBase;
+ 
+-class nsSVGFEGaussianBlurElement : public nsSVGFEGaussianBlurElementBase,
++class nsSVGFEGaussianBlurElement : public XPCOMGCFinalizedObject,
++                                   public nsSVGFEGaussianBlurElementBase,
+                                    public nsIDOMSVGFEGaussianBlurElement
+ {
+   friend nsresult NS_NewSVGFEGaussianBlurElement(nsIContent **aResult,
+@@ -871,7 +872,8 @@ nsSVGFEGaussianBlurElement::GetStringInf
+ 
+ typedef nsSVGFE nsSVGFEBlendElementBase;
+ 
+-class nsSVGFEBlendElement : public nsSVGFEBlendElementBase,
++class nsSVGFEBlendElement : public XPCOMGCFinalizedObject,
++                            public nsSVGFEBlendElementBase,
+                             public nsIDOMSVGFEBlendElement
+ {
+   friend nsresult NS_NewSVGFEBlendElement(nsIContent **aResult,
+@@ -1081,7 +1083,8 @@ nsSVGFEBlendElement::GetStringInfo()
+ 
+ typedef nsSVGFE nsSVGFEColorMatrixElementBase;
+ 
+-class nsSVGFEColorMatrixElement : public nsSVGFEColorMatrixElementBase,
++class nsSVGFEColorMatrixElement : public XPCOMGCFinalizedObject,
++                                  public nsSVGFEColorMatrixElementBase,
+                                   public nsIDOMSVGFEColorMatrixElement
+ {
+   friend nsresult NS_NewSVGFEColorMatrixElement(nsIContent **aResult,
+@@ -1409,7 +1412,8 @@ nsSVGFEColorMatrixElement::GetStringInfo
+ 
+ typedef nsSVGFE nsSVGFECompositeElementBase;
+ 
+-class nsSVGFECompositeElement : public nsSVGFECompositeElementBase,
++class nsSVGFECompositeElement : public XPCOMGCFinalizedObject,
++                                public nsSVGFECompositeElementBase,
+                                 public nsIDOMSVGFECompositeElement
+ {
+   friend nsresult NS_NewSVGFECompositeElement(nsIContent **aResult,
+@@ -1718,7 +1722,8 @@ nsSVGFECompositeElement::GetStringInfo()
+ 
+ typedef nsSVGFE nsSVGFEComponentTransferElementBase;
+ 
+-class nsSVGFEComponentTransferElement : public nsSVGFEComponentTransferElementBase,
++class nsSVGFEComponentTransferElement : public XPCOMGCFinalizedObject,
++                                        public nsSVGFEComponentTransferElementBase,
+                                         public nsIDOMSVGFEComponentTransferElement
+ {
+   friend nsresult NS_NewSVGFEComponentTransferElement(nsIContent **aResult,
+@@ -2133,7 +2138,8 @@ nsSVGComponentTransferFunctionElement::G
+                               NS_ARRAY_LENGTH(sNumberInfo));
+ }
+ 
+-class nsSVGFEFuncRElement : public nsSVGComponentTransferFunctionElement,
++class nsSVGFEFuncRElement : public XPCOMGCFinalizedObject,
++                            public nsSVGComponentTransferFunctionElement,
+                             public nsIDOMSVGFEFuncRElement
+ {
+   friend nsresult NS_NewSVGFEFuncRElement(nsIContent **aResult,
+@@ -2175,7 +2181,8 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGFEF
+ NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGFEFuncRElement)
+ 
+ 
+-class nsSVGFEFuncGElement : public nsSVGComponentTransferFunctionElement,
++class nsSVGFEFuncGElement : public XPCOMGCFinalizedObject,
++                            public nsSVGComponentTransferFunctionElement,
+                             public nsIDOMSVGFEFuncGElement
+ {
+   friend nsresult NS_NewSVGFEFuncGElement(nsIContent **aResult,
+@@ -2217,7 +2224,8 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGFEF
+ NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGFEFuncGElement)
+ 
+ 
+-class nsSVGFEFuncBElement : public nsSVGComponentTransferFunctionElement,
++class nsSVGFEFuncBElement : public XPCOMGCFinalizedObject,
++                            public nsSVGComponentTransferFunctionElement,
+                             public nsIDOMSVGFEFuncBElement
+ {
+   friend nsresult NS_NewSVGFEFuncBElement(nsIContent **aResult,
+@@ -2259,7 +2267,8 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGFEF
+ NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGFEFuncBElement)
+ 
+ 
+-class nsSVGFEFuncAElement : public nsSVGComponentTransferFunctionElement,
++class nsSVGFEFuncAElement : public XPCOMGCFinalizedObject,
++                            public nsSVGComponentTransferFunctionElement,
+                             public nsIDOMSVGFEFuncAElement
+ {
+   friend nsresult NS_NewSVGFEFuncAElement(nsIContent **aResult,
+@@ -2304,7 +2313,8 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGFEF
+ 
+ typedef nsSVGFE nsSVGFEMergeElementBase;
+ 
+-class nsSVGFEMergeElement : public nsSVGFEMergeElementBase,
++class nsSVGFEMergeElement : public XPCOMGCFinalizedObject,
++                            public nsSVGFEMergeElementBase,
+                             public nsIDOMSVGFEMergeElement
+ {
+   friend nsresult NS_NewSVGFEMergeElement(nsIContent **aResult,
+@@ -2349,7 +2359,8 @@ typedef nsSVGStylableElement nsSVGFEMerg
+     { 0x413687ec, 0x77fd, 0x4077, \
+   { 0x9d, 0x7a, 0x97, 0x51, 0xa8, 0x4b, 0x7b, 0x40 } }
+ 
+-class nsSVGFEMergeNodeElement : public nsSVGFEMergeNodeElementBase,
++class nsSVGFEMergeNodeElement : public XPCOMGCFinalizedObject,
++                                public nsSVGFEMergeNodeElementBase,
+                                 public nsIDOMSVGFEMergeNodeElement
+ {
+   friend nsresult NS_NewSVGFEMergeNodeElement(nsIContent **aResult,
+@@ -2527,7 +2538,8 @@ nsSVGFEMergeNodeElement::GetStringInfo()
+ 
+ typedef nsSVGFE nsSVGFEOffsetElementBase;
+ 
+-class nsSVGFEOffsetElement : public nsSVGFEOffsetElementBase,
++class nsSVGFEOffsetElement : public XPCOMGCFinalizedObject,
++                             public nsSVGFEOffsetElementBase,
+                              public nsIDOMSVGFEOffsetElement
+ {
+   friend nsresult NS_NewSVGFEOffsetElement(nsIContent **aResult,
+@@ -2726,7 +2738,8 @@ nsSVGFEOffsetElement::GetStringInfo()
+ 
+ typedef nsSVGFE nsSVGFEFloodElementBase;
+ 
+-class nsSVGFEFloodElement : public nsSVGFEFloodElementBase,
++class nsSVGFEFloodElement : public XPCOMGCFinalizedObject,
++                            public nsSVGFEFloodElementBase,
+                             public nsIDOMSVGFEFloodElement
+ {
+   friend nsresult NS_NewSVGFEFloodElement(nsIContent **aResult,
+@@ -2870,7 +2883,8 @@ nsSVGFEFloodElement::GetStringInfo()
+ 
+ typedef nsSVGFE nsSVGFETileElementBase;
+ 
+-class nsSVGFETileElement : public nsSVGFETileElementBase,
++class nsSVGFETileElement : public XPCOMGCFinalizedObject,
++                           public nsSVGFETileElementBase,
+                            public nsIDOMSVGFETileElement
+ {
+   friend nsresult NS_NewSVGFETileElement(nsIContent **aResult,
+@@ -3037,7 +3051,8 @@ nsSVGFETileElement::GetStringInfo()
+ 
+ typedef nsSVGFE nsSVGFETurbulenceElementBase;
+ 
+-class nsSVGFETurbulenceElement : public nsSVGFETurbulenceElementBase,
++class nsSVGFETurbulenceElement : public XPCOMGCFinalizedObject,
++                                 public nsSVGFETurbulenceElementBase,
+                                  public nsIDOMSVGFETurbulenceElement
+ {
+   friend nsresult NS_NewSVGFETurbulenceElement(nsIContent **aResult,
+@@ -3547,7 +3562,8 @@ nsSVGFETurbulenceElement::GetStringInfo(
+ 
+ typedef nsSVGFE nsSVGFEMorphologyElementBase;
+ 
+-class nsSVGFEMorphologyElement : public nsSVGFEMorphologyElementBase,
++class nsSVGFEMorphologyElement : public XPCOMGCFinalizedObject,
++                                 public nsSVGFEMorphologyElementBase,
+                                  public nsIDOMSVGFEMorphologyElement
+ {
+   friend nsresult NS_NewSVGFEMorphologyElement(nsIContent **aResult,
+@@ -3863,7 +3879,8 @@ nsSVGFEMorphologyElement::GetStringInfo(
+ 
+ typedef nsSVGFE nsSVGFEConvolveMatrixElementBase;
+ 
+-class nsSVGFEConvolveMatrixElement : public nsSVGFEConvolveMatrixElementBase,
++class nsSVGFEConvolveMatrixElement : public XPCOMGCFinalizedObject,
++                                     public nsSVGFEConvolveMatrixElementBase,
+                                      public nsIDOMSVGFEConvolveMatrixElement
+ {
+   friend nsresult NS_NewSVGFEConvolveMatrixElement(nsIContent **aResult,
+@@ -4338,7 +4355,8 @@ nsSVGFEConvolveMatrixElement::GetStringI
+ 
+ typedef nsSVGElement nsSVGFEDistantLightElementBase;
+ 
+-class nsSVGFEDistantLightElement : public nsSVGFEDistantLightElementBase,
++class nsSVGFEDistantLightElement : public XPCOMGCFinalizedObject,
++                                   public nsSVGFEDistantLightElementBase,
+                                    public nsIDOMSVGFEDistantLightElement
+ {
+   friend nsresult NS_NewSVGFEDistantLightElement(nsIContent **aResult,
+@@ -4424,7 +4442,8 @@ nsSVGFEDistantLightElement::GetNumberInf
+ 
+ typedef nsSVGElement nsSVGFEPointLightElementBase;
+ 
+-class nsSVGFEPointLightElement : public nsSVGFEPointLightElementBase,
++class nsSVGFEPointLightElement : public XPCOMGCFinalizedObject,
++                                 public nsSVGFEPointLightElementBase,
+                                  public nsIDOMSVGFEPointLightElement
+ {
+   friend nsresult NS_NewSVGFEPointLightElement(nsIContent **aResult,
+@@ -4515,7 +4534,8 @@ nsSVGFEPointLightElement::GetNumberInfo(
+ 
+ typedef nsSVGElement nsSVGFESpotLightElementBase;
+ 
+-class nsSVGFESpotLightElement : public nsSVGFESpotLightElementBase,
++class nsSVGFESpotLightElement : public XPCOMGCFinalizedObject,
++                                public nsSVGFESpotLightElementBase,
+                                 public nsIDOMSVGFESpotLightElement
+ {
+   friend nsresult NS_NewSVGFESpotLightElement(nsIContent **aResult,
+@@ -4987,7 +5007,8 @@ nsSVGFELightingElement::GetStringInfo()
+ 
+ typedef nsSVGFELightingElement nsSVGFEDiffuseLightingElementBase;
+ 
+-class nsSVGFEDiffuseLightingElement : public nsSVGFEDiffuseLightingElementBase,
++class nsSVGFEDiffuseLightingElement : public XPCOMGCFinalizedObject,
++                                      public nsSVGFEDiffuseLightingElementBase,
+                                       public nsIDOMSVGFEDiffuseLightingElement
+ {
+   friend nsresult NS_NewSVGFEDiffuseLightingElement(nsIContent **aResult,
+@@ -5105,7 +5126,8 @@ nsSVGFEDiffuseLightingElement::LightPixe
+ 
+ typedef nsSVGFELightingElement nsSVGFESpecularLightingElementBase;
+ 
+-class nsSVGFESpecularLightingElement : public nsSVGFESpecularLightingElementBase,
++class nsSVGFESpecularLightingElement : public XPCOMGCFinalizedObject,
++                                       public nsSVGFESpecularLightingElementBase,
+                                        public nsIDOMSVGFESpecularLightingElement
+ {
+   friend nsresult NS_NewSVGFESpecularLightingElement(nsIContent **aResult,
+@@ -5258,7 +5280,8 @@ nsSVGFESpecularLightingElement::LightPix
+ 
+ typedef nsSVGFE nsSVGFEImageElementBase;
+ 
+-class nsSVGFEImageElement : public nsSVGFEImageElementBase,
++class nsSVGFEImageElement : public XPCOMGCFinalizedObject,
++                            public nsSVGFEImageElementBase,
+                             public nsIDOMSVGFEImageElement,
+                             public nsIDOMSVGURIReference,
+                             public nsImageLoadingContent
+@@ -5588,7 +5611,8 @@ nsSVGFEImageElement::Invalidate()
+ 
+ typedef nsSVGFE nsSVGFEDisplacementMapElementBase;
+ 
+-class nsSVGFEDisplacementMapElement : public nsSVGFEDisplacementMapElementBase,
++class nsSVGFEDisplacementMapElement : public XPCOMGCFinalizedObject,
++                                      public nsSVGFEDisplacementMapElementBase,
+                                       public nsIDOMSVGFEDisplacementMapElement
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGForeignObjectElement.h b/content/svg/content/src/nsSVGForeignObjectElement.h
+--- a/content/svg/content/src/nsSVGForeignObjectElement.h
++++ b/content/svg/content/src/nsSVGForeignObjectElement.h
+@@ -45,7 +45,8 @@
+ 
+ typedef nsSVGGraphicElement nsSVGForeignObjectElementBase;
+ 
+-class nsSVGForeignObjectElement : public nsSVGForeignObjectElementBase,
++class nsSVGForeignObjectElement : public XPCOMGCFinalizedObject,
++                                  public nsSVGForeignObjectElementBase,
+                                   public nsIDOMSVGForeignObjectElement
+ {
+   friend class nsSVGForeignObjectFrame;
+diff --git a/content/svg/content/src/nsSVGGElement.cpp b/content/svg/content/src/nsSVGGElement.cpp
+--- a/content/svg/content/src/nsSVGGElement.cpp
++++ b/content/svg/content/src/nsSVGGElement.cpp
+@@ -41,7 +41,8 @@
+ 
+ typedef nsSVGGraphicElement nsSVGGElementBase;
+ 
+-class nsSVGGElement : public nsSVGGElementBase,
++class nsSVGGElement : public XPCOMGCFinalizedObject,
++                      public nsSVGGElementBase,
+                       public nsIDOMSVGGElement
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGGradientElement.h b/content/svg/content/src/nsSVGGradientElement.h
+--- a/content/svg/content/src/nsSVGGradientElement.h
++++ b/content/svg/content/src/nsSVGGradientElement.h
+@@ -95,7 +95,8 @@ protected:
+ 
+ typedef nsSVGGradientElement nsSVGLinearGradientElementBase;
+ 
+-class nsSVGLinearGradientElement : public nsSVGLinearGradientElementBase,
++class nsSVGLinearGradientElement : public XPCOMGCFinalizedObject,
++                                   public nsSVGLinearGradientElementBase,
+                                    public nsIDOMSVGLinearGradientElement
+ {
+   friend class nsSVGLinearGradientFrame;
+@@ -137,7 +138,8 @@ protected:
+ 
+ typedef nsSVGGradientElement nsSVGRadialGradientElementBase;
+ 
+-class nsSVGRadialGradientElement : public nsSVGRadialGradientElementBase,
++class nsSVGRadialGradientElement : public XPCOMGCFinalizedObject,
++                                   public nsSVGRadialGradientElementBase,
+                                    public nsIDOMSVGRadialGradientElement
+ {
+   friend class nsSVGRadialGradientFrame;
+diff --git a/content/svg/content/src/nsSVGImageElement.cpp b/content/svg/content/src/nsSVGImageElement.cpp
+--- a/content/svg/content/src/nsSVGImageElement.cpp
++++ b/content/svg/content/src/nsSVGImageElement.cpp
+@@ -57,7 +57,8 @@ class nsIDOMSVGAnimatedPreserveAspectRat
+ 
+ typedef nsSVGPathGeometryElement nsSVGImageElementBase;
+ 
+-class nsSVGImageElement : public nsSVGImageElementBase,
++class nsSVGImageElement : public XPCOMGCFinalizedObject,
++                          public nsSVGImageElementBase,
+                           public nsIDOMSVGImageElement,
+                           public nsIDOMSVGURIReference,
+                           public nsImageLoadingContent
+diff --git a/content/svg/content/src/nsSVGInteger.h b/content/svg/content/src/nsSVGInteger.h
+--- a/content/svg/content/src/nsSVGInteger.h
++++ b/content/svg/content/src/nsSVGInteger.h
+@@ -70,7 +70,7 @@ private:
+   PRInt32 mBaseVal;
+   PRUint8 mAttrEnum; // element specified tracking for attribute
+ 
+-  struct DOMAnimatedInteger : public nsIDOMSVGAnimatedInteger
++  struct DOMAnimatedInteger : public XPCOMGCFinalizedObject, public nsIDOMSVGAnimatedInteger
+   {
+     NS_DECL_ISUPPORTS
+ 
+diff --git a/content/svg/content/src/nsSVGLength.cpp b/content/svg/content/src/nsSVGLength.cpp
+--- a/content/svg/content/src/nsSVGLength.cpp
++++ b/content/svg/content/src/nsSVGLength.cpp
+@@ -55,7 +55,8 @@
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGLength class
+ 
+-class nsSVGLength : public nsISVGLength,
++class nsSVGLength : public XPCOMGCFinalizedObject,
++                    public nsISVGLength,
+                     public nsSVGValue,
+                     public nsISVGValueObserver
+ {
+diff --git a/content/svg/content/src/nsSVGLength2.h b/content/svg/content/src/nsSVGLength2.h
+--- a/content/svg/content/src/nsSVGLength2.h
++++ b/content/svg/content/src/nsSVGLength2.h
+@@ -109,7 +109,7 @@ private:
+   nsresult ToDOMBaseVal(nsIDOMSVGLength **aResult, nsSVGElement* aSVGElement);
+   nsresult ToDOMAnimVal(nsIDOMSVGLength **aResult, nsSVGElement* aSVGElement);
+ 
+-  struct DOMBaseVal : public nsIDOMSVGLength
++  struct DOMBaseVal : public XPCOMGCFinalizedObject, public nsIDOMSVGLength
+   {
+     NS_DECL_ISUPPORTS
+ 
+@@ -148,7 +148,7 @@ private:
+       { mVal->ConvertToSpecifiedUnits(unitType, mSVGElement); return NS_OK; }
+   };
+ 
+-  struct DOMAnimVal : public nsIDOMSVGLength
++  struct DOMAnimVal : public XPCOMGCFinalizedObject, public nsIDOMSVGLength
+   {
+     NS_DECL_ISUPPORTS
+ 
+@@ -184,7 +184,7 @@ private:
+       { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
+   };
+ 
+-  struct DOMAnimatedLength : public nsIDOMSVGAnimatedLength
++  struct DOMAnimatedLength : public XPCOMGCFinalizedObject, public nsIDOMSVGAnimatedLength
+   {
+     NS_DECL_ISUPPORTS
+ 
+diff --git a/content/svg/content/src/nsSVGLengthList.cpp b/content/svg/content/src/nsSVGLengthList.cpp
+--- a/content/svg/content/src/nsSVGLengthList.cpp
++++ b/content/svg/content/src/nsSVGLengthList.cpp
+@@ -51,7 +51,8 @@
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGLengthList
+ 
+-class nsSVGLengthList : public nsIDOMSVGLengthList,
++class nsSVGLengthList : public XPCOMGCFinalizedObject,
++                        public nsIDOMSVGLengthList,
+                         public nsSVGValue,
+                         public nsISVGValueObserver
+ {  
+diff --git a/content/svg/content/src/nsSVGLineElement.cpp b/content/svg/content/src/nsSVGLineElement.cpp
+--- a/content/svg/content/src/nsSVGLineElement.cpp
++++ b/content/svg/content/src/nsSVGLineElement.cpp
+@@ -45,7 +45,8 @@
+ 
+ typedef nsSVGPathGeometryElement nsSVGLineElementBase;
+ 
+-class nsSVGLineElement : public nsSVGLineElementBase,
++class nsSVGLineElement : public XPCOMGCFinalizedObject,
++                         public nsSVGLineElementBase,
+                          public nsIDOMSVGLineElement
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGMarkerElement.h b/content/svg/content/src/nsSVGMarkerElement.h
+--- a/content/svg/content/src/nsSVGMarkerElement.h
++++ b/content/svg/content/src/nsSVGMarkerElement.h
+@@ -69,7 +69,7 @@ private:
+   nsSVGEnumValue mAnimVal;
+   nsSVGEnumValue mBaseVal;
+ 
+-  struct DOMAnimatedEnum : public nsIDOMSVGAnimatedEnumeration
++  struct DOMAnimatedEnum : public XPCOMGCFinalizedObject, public nsIDOMSVGAnimatedEnumeration
+   {
+     NS_DECL_ISUPPORTS
+ 
+@@ -91,7 +91,8 @@ private:
+ 
+ typedef nsSVGGraphicElement nsSVGMarkerElementBase;
+ 
+-class nsSVGMarkerElement : public nsSVGMarkerElementBase,
++class nsSVGMarkerElement : public XPCOMGCFinalizedObject,
++                           public nsSVGMarkerElementBase,
+                            public nsIDOMSVGMarkerElement,
+                            public nsIDOMSVGFitToViewBox
+ {
+diff --git a/content/svg/content/src/nsSVGMaskElement.h b/content/svg/content/src/nsSVGMaskElement.h
+--- a/content/svg/content/src/nsSVGMaskElement.h
++++ b/content/svg/content/src/nsSVGMaskElement.h
+@@ -47,7 +47,8 @@
+ 
+ typedef nsSVGStylableElement nsSVGMaskElementBase;
+ 
+-class nsSVGMaskElement : public nsSVGMaskElementBase,
++class nsSVGMaskElement : public XPCOMGCFinalizedObject,
++                         public nsSVGMaskElementBase,
+                          public nsIDOMSVGMaskElement,
+                          public nsIDOMSVGUnitTypes
+ {
+diff --git a/content/svg/content/src/nsSVGMatrix.cpp b/content/svg/content/src/nsSVGMatrix.cpp
+--- a/content/svg/content/src/nsSVGMatrix.cpp
++++ b/content/svg/content/src/nsSVGMatrix.cpp
+@@ -44,7 +44,8 @@
+ 
+ const double radPerDegree = 2.0*3.1415926535 / 360.0;
+ 
+-class nsSVGMatrix : public nsIDOMSVGMatrix,
++class nsSVGMatrix : public XPCOMGCFinalizedObject,
++                    public nsIDOMSVGMatrix,
+                     public nsSVGValue
+ {
+ public:
+diff --git a/content/svg/content/src/nsSVGMetadataElement.cpp b/content/svg/content/src/nsSVGMetadataElement.cpp
+--- a/content/svg/content/src/nsSVGMetadataElement.cpp
++++ b/content/svg/content/src/nsSVGMetadataElement.cpp
+@@ -41,7 +41,8 @@
+ 
+ typedef nsSVGElement nsSVGMetadataElementBase;
+ 
+-class nsSVGMetadataElement : public nsSVGMetadataElementBase,
++class nsSVGMetadataElement : public XPCOMGCFinalizedObject,
++                             public nsSVGMetadataElementBase,
+                              public nsIDOMSVGMetadataElement
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGNumber.cpp b/content/svg/content/src/nsSVGNumber.cpp
+--- a/content/svg/content/src/nsSVGNumber.cpp
++++ b/content/svg/content/src/nsSVGNumber.cpp
+@@ -46,7 +46,8 @@
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGNumber class
+ 
+-class nsSVGNumber : public nsIDOMSVGNumber,
++class nsSVGNumber : public XPCOMGCFinalizedObject,
++                    public nsIDOMSVGNumber,
+                     public nsSVGValue
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGNumber2.h b/content/svg/content/src/nsSVGNumber2.h
+--- a/content/svg/content/src/nsSVGNumber2.h
++++ b/content/svg/content/src/nsSVGNumber2.h
+@@ -71,7 +71,7 @@ private:
+   float mBaseVal;
+   PRUint8 mAttrEnum; // element specified tracking for attribute
+ 
+-  struct DOMAnimatedNumber : public nsIDOMSVGAnimatedNumber
++  struct DOMAnimatedNumber : public XPCOMGCFinalizedObject, public nsIDOMSVGAnimatedNumber
+   {
+     NS_DECL_ISUPPORTS
+ 
+diff --git a/content/svg/content/src/nsSVGNumberList.cpp b/content/svg/content/src/nsSVGNumberList.cpp
+--- a/content/svg/content/src/nsSVGNumberList.cpp
++++ b/content/svg/content/src/nsSVGNumberList.cpp
+@@ -51,7 +51,8 @@
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGNumberList
+ 
+-class nsSVGNumberList : public nsIDOMSVGNumberList,
++class nsSVGNumberList : public XPCOMGCFinalizedObject,
++                        public nsIDOMSVGNumberList,
+                         public nsSVGValue,
+                         public nsISVGValueObserver
+ {  
+diff --git a/content/svg/content/src/nsSVGPathElement.h b/content/svg/content/src/nsSVGPathElement.h
+--- a/content/svg/content/src/nsSVGPathElement.h
++++ b/content/svg/content/src/nsSVGPathElement.h
+@@ -66,7 +66,8 @@ protected:
+ 
+ typedef nsSVGPathGeometryElement nsSVGPathElementBase;
+ 
+-class nsSVGPathElement : public nsSVGPathElementBase,
++class nsSVGPathElement : public XPCOMGCFinalizedObject,
++                         public nsSVGPathElementBase,
+                          public nsIDOMSVGPathElement,
+                          public nsIDOMSVGAnimatedPathData
+ {
+diff --git a/content/svg/content/src/nsSVGPathSeg.cpp b/content/svg/content/src/nsSVGPathSeg.cpp
+--- a/content/svg/content/src/nsSVGPathSeg.cpp
++++ b/content/svg/content/src/nsSVGPathSeg.cpp
+@@ -197,7 +197,8 @@ NS_INTERFACE_MAP_END
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegClosePath
+ 
+-class nsSVGPathSegClosePath : public nsIDOMSVGPathSegClosePath,
++class nsSVGPathSegClosePath : public XPCOMGCFinalizedObject,
++                              public nsIDOMSVGPathSegClosePath,
+                               public nsSVGPathSeg
+ {
+ public:
+@@ -250,7 +251,8 @@ nsSVGPathSegClosePath::GetLength(nsSVGPa
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegMovetoAbs
+ 
+-class nsSVGPathSegMovetoAbs : public nsIDOMSVGPathSegMovetoAbs,
++class nsSVGPathSegMovetoAbs : public XPCOMGCFinalizedObject,
++                              public nsIDOMSVGPathSegMovetoAbs,
+                               public nsSVGPathSeg
+ {
+ public:
+@@ -346,7 +348,8 @@ NS_IMETHODIMP nsSVGPathSegMovetoAbs::Set
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegMovetoRel
+ 
+-class nsSVGPathSegMovetoRel : public nsIDOMSVGPathSegMovetoRel,
++class nsSVGPathSegMovetoRel : public XPCOMGCFinalizedObject,
++                              public nsIDOMSVGPathSegMovetoRel,
+                               public nsSVGPathSeg
+ {
+ public:
+@@ -441,7 +444,8 @@ NS_IMETHODIMP nsSVGPathSegMovetoRel::Set
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegLinetoAbs
+ 
+-class nsSVGPathSegLinetoAbs : public nsIDOMSVGPathSegLinetoAbs,
++class nsSVGPathSegLinetoAbs : public XPCOMGCFinalizedObject,
++                              public nsIDOMSVGPathSegLinetoAbs,
+                               public nsSVGPathSeg
+ {
+ public:
+@@ -539,7 +543,8 @@ NS_IMETHODIMP nsSVGPathSegLinetoAbs::Set
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegLinetoRel
+ 
+-class nsSVGPathSegLinetoRel : public nsIDOMSVGPathSegLinetoRel,
++class nsSVGPathSegLinetoRel : public XPCOMGCFinalizedObject,
++                              public nsIDOMSVGPathSegLinetoRel,
+                               public nsSVGPathSeg
+ {
+ public:
+@@ -635,7 +640,8 @@ NS_IMETHODIMP nsSVGPathSegLinetoRel::Set
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegCurvetoCubicAbs
+ 
+-class nsSVGPathSegCurvetoCubicAbs : public nsIDOMSVGPathSegCurvetoCubicAbs,
++class nsSVGPathSegCurvetoCubicAbs : public XPCOMGCFinalizedObject,
++                                    public nsIDOMSVGPathSegCurvetoCubicAbs,
+                                     public nsSVGPathSeg
+ {
+ public:
+@@ -802,7 +808,8 @@ NS_IMETHODIMP nsSVGPathSegCurvetoCubicAb
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegCurvetoCubicRel
+ 
+-class nsSVGPathSegCurvetoCubicRel : public nsIDOMSVGPathSegCurvetoCubicRel,
++class nsSVGPathSegCurvetoCubicRel : public XPCOMGCFinalizedObject,
++                                    public nsIDOMSVGPathSegCurvetoCubicRel,
+                                     public nsSVGPathSeg
+ {
+ public:
+@@ -965,7 +972,8 @@ NS_IMETHODIMP nsSVGPathSegCurvetoCubicRe
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegCurvetoQuadraticAbs
+ 
+-class nsSVGPathSegCurvetoQuadraticAbs : public nsIDOMSVGPathSegCurvetoQuadraticAbs,
++class nsSVGPathSegCurvetoQuadraticAbs : public XPCOMGCFinalizedObject,
++                                        public nsIDOMSVGPathSegCurvetoQuadraticAbs,
+                                         public nsSVGPathSeg
+ {
+ public:
+@@ -1099,7 +1107,8 @@ NS_IMETHODIMP nsSVGPathSegCurvetoQuadrat
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegCurvetoQuadraticRel
+ 
+-class nsSVGPathSegCurvetoQuadraticRel : public nsIDOMSVGPathSegCurvetoQuadraticRel,
++class nsSVGPathSegCurvetoQuadraticRel : public XPCOMGCFinalizedObject,
++                                        public nsIDOMSVGPathSegCurvetoQuadraticRel,
+                                         public nsSVGPathSeg
+ {
+ public:
+@@ -1234,7 +1243,8 @@ NS_IMETHODIMP nsSVGPathSegCurvetoQuadrat
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegArcAbs
+ 
+-class nsSVGPathSegArcAbs : public nsIDOMSVGPathSegArcAbs,
++class nsSVGPathSegArcAbs : public XPCOMGCFinalizedObject,
++                           public nsIDOMSVGPathSegArcAbs,
+                            public nsSVGPathSeg
+ {
+ public:
+@@ -1420,7 +1430,8 @@ NS_IMETHODIMP nsSVGPathSegArcAbs::SetSwe
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegArcRel
+ 
+-class nsSVGPathSegArcRel : public nsIDOMSVGPathSegArcRel,
++class nsSVGPathSegArcRel : public XPCOMGCFinalizedObject,
++                           public nsIDOMSVGPathSegArcRel,
+                            public nsSVGPathSeg
+ {
+ public:
+@@ -1606,7 +1617,8 @@ NS_IMETHODIMP nsSVGPathSegArcRel::SetSwe
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegLinetoHorizontalAbs
+ 
+-class nsSVGPathSegLinetoHorizontalAbs : public nsIDOMSVGPathSegLinetoHorizontalAbs,
++class nsSVGPathSegLinetoHorizontalAbs : public XPCOMGCFinalizedObject,
++                                        public nsIDOMSVGPathSegLinetoHorizontalAbs,
+                                         public nsSVGPathSeg
+ {
+ public:
+@@ -1689,7 +1701,8 @@ NS_IMETHODIMP nsSVGPathSegLinetoHorizont
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegLinetoHorizontalRel
+ 
+-class nsSVGPathSegLinetoHorizontalRel : public nsIDOMSVGPathSegLinetoHorizontalRel,
++class nsSVGPathSegLinetoHorizontalRel : public XPCOMGCFinalizedObject,
++                                        public nsIDOMSVGPathSegLinetoHorizontalRel,
+                                         public nsSVGPathSeg
+ {
+ public:
+@@ -1771,7 +1784,8 @@ NS_IMETHODIMP nsSVGPathSegLinetoHorizont
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegLinetoVerticalAbs
+ 
+-class nsSVGPathSegLinetoVerticalAbs : public nsIDOMSVGPathSegLinetoVerticalAbs,
++class nsSVGPathSegLinetoVerticalAbs : public XPCOMGCFinalizedObject,
++                                      public nsIDOMSVGPathSegLinetoVerticalAbs,
+                                       public nsSVGPathSeg
+ {
+ public:
+@@ -1854,7 +1868,8 @@ NS_IMETHODIMP nsSVGPathSegLinetoVertical
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegLinetoVerticalRel
+ 
+-class nsSVGPathSegLinetoVerticalRel : public nsIDOMSVGPathSegLinetoVerticalRel,
++class nsSVGPathSegLinetoVerticalRel : public XPCOMGCFinalizedObject,
++                                      public nsIDOMSVGPathSegLinetoVerticalRel,
+                                       public nsSVGPathSeg
+ {
+ public:
+@@ -1937,7 +1952,8 @@ NS_IMETHODIMP nsSVGPathSegLinetoVertical
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegCurvetoCubicSmoothAbs
+ 
+-class nsSVGPathSegCurvetoCubicSmoothAbs : public nsIDOMSVGPathSegCurvetoCubicSmoothAbs,
++class nsSVGPathSegCurvetoCubicSmoothAbs : public XPCOMGCFinalizedObject,
++                                          public nsIDOMSVGPathSegCurvetoCubicSmoothAbs,
+                                           public nsSVGPathSeg
+ {
+ public:
+@@ -2076,7 +2092,8 @@ NS_IMETHODIMP nsSVGPathSegCurvetoCubicSm
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegCurvetoCubicSmoothRel
+ 
+-class nsSVGPathSegCurvetoCubicSmoothRel : public nsIDOMSVGPathSegCurvetoCubicSmoothRel,
++class nsSVGPathSegCurvetoCubicSmoothRel : public XPCOMGCFinalizedObject,
++                                          public nsIDOMSVGPathSegCurvetoCubicSmoothRel,
+                                           public nsSVGPathSeg
+ {
+ public:
+@@ -2213,7 +2230,8 @@ NS_IMETHODIMP nsSVGPathSegCurvetoCubicSm
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegCurvetoQuadraticSmoothAbs
+ 
+-class nsSVGPathSegCurvetoQuadraticSmoothAbs : public nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs,
++class nsSVGPathSegCurvetoQuadraticSmoothAbs : public XPCOMGCFinalizedObject,
++                                              public nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs,
+                                               public nsSVGPathSeg
+ {
+ public:
+@@ -2316,7 +2334,8 @@ NS_IMETHODIMP nsSVGPathSegCurvetoQuadrat
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegCurvetoQuadraticSmoothRel
+ 
+-class nsSVGPathSegCurvetoQuadraticSmoothRel : public nsIDOMSVGPathSegCurvetoQuadraticSmoothRel,
++class nsSVGPathSegCurvetoQuadraticSmoothRel : public XPCOMGCFinalizedObject,
++                                              public nsIDOMSVGPathSegCurvetoQuadraticSmoothRel,
+                                               public nsSVGPathSeg
+ {
+ public:
+diff --git a/content/svg/content/src/nsSVGPathSegList.cpp b/content/svg/content/src/nsSVGPathSegList.cpp
+--- a/content/svg/content/src/nsSVGPathSegList.cpp
++++ b/content/svg/content/src/nsSVGPathSegList.cpp
+@@ -50,7 +50,8 @@
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPathSegList
+ 
+-class nsSVGPathSegList : public nsIDOMSVGPathSegList,
++class nsSVGPathSegList : public XPCOMGCFinalizedObject,
++                         public nsIDOMSVGPathSegList,
+                          public nsSVGValue,
+                          public nsISVGValueObserver
+ {  
+diff --git a/content/svg/content/src/nsSVGPatternElement.h b/content/svg/content/src/nsSVGPatternElement.h
+--- a/content/svg/content/src/nsSVGPatternElement.h
++++ b/content/svg/content/src/nsSVGPatternElement.h
+@@ -53,7 +53,8 @@
+ 
+ typedef nsSVGStylableElement nsSVGPatternElementBase;
+ 
+-class nsSVGPatternElement : public nsSVGPatternElementBase,
++class nsSVGPatternElement : public XPCOMGCFinalizedObject,
++                            public nsSVGPatternElementBase,
+                             public nsIDOMSVGURIReference,
+                             public nsIDOMSVGFitToViewBox,
+                             public nsIDOMSVGPatternElement,
+diff --git a/content/svg/content/src/nsSVGPoint.cpp b/content/svg/content/src/nsSVGPoint.cpp
+--- a/content/svg/content/src/nsSVGPoint.cpp
++++ b/content/svg/content/src/nsSVGPoint.cpp
+@@ -43,7 +43,8 @@
+ #include "nsContentUtils.h"
+ #include "nsDOMError.h"
+ 
+-class nsSVGPoint : public nsIDOMSVGPoint,
++class nsSVGPoint : public XPCOMGCFinalizedObject,
++                   public nsIDOMSVGPoint,
+                    public nsSVGValue
+ {
+ public:
+diff --git a/content/svg/content/src/nsSVGPointList.h b/content/svg/content/src/nsSVGPointList.h
+--- a/content/svg/content/src/nsSVGPointList.h
++++ b/content/svg/content/src/nsSVGPointList.h
+@@ -46,7 +46,8 @@
+ #include "nsVoidArray.h"
+ 
+ 
+-class nsSVGPointList : public nsSVGValue,
++class nsSVGPointList : public XPCOMGCFinalizedObject,
++                       public nsSVGValue,
+                        public nsIDOMSVGPointList,
+                        public nsISVGValueObserver
+ {
+diff --git a/content/svg/content/src/nsSVGPolygonElement.cpp b/content/svg/content/src/nsSVGPolygonElement.cpp
+--- a/content/svg/content/src/nsSVGPolygonElement.cpp
++++ b/content/svg/content/src/nsSVGPolygonElement.cpp
+@@ -42,7 +42,8 @@
+ 
+ typedef nsSVGPolyElement nsSVGPolygonElementBase;
+ 
+-class nsSVGPolygonElement : public nsSVGPolygonElementBase,
++class nsSVGPolygonElement : public XPCOMGCFinalizedObject,
++                            public nsSVGPolygonElementBase,
+                             public nsIDOMSVGPolygonElement
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGPolylineElement.cpp b/content/svg/content/src/nsSVGPolylineElement.cpp
+--- a/content/svg/content/src/nsSVGPolylineElement.cpp
++++ b/content/svg/content/src/nsSVGPolylineElement.cpp
+@@ -41,7 +41,8 @@
+ 
+ typedef nsSVGPolyElement nsSVGPolylineElementBase;
+ 
+-class nsSVGPolylineElement : public nsSVGPolylineElementBase,
++class nsSVGPolylineElement : public XPCOMGCFinalizedObject,
++                             public nsSVGPolylineElementBase,
+                              public nsIDOMSVGPolylineElement
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGPreserveAspectRatio.cpp b/content/svg/content/src/nsSVGPreserveAspectRatio.cpp
+--- a/content/svg/content/src/nsSVGPreserveAspectRatio.cpp
++++ b/content/svg/content/src/nsSVGPreserveAspectRatio.cpp
+@@ -44,7 +44,8 @@
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGPreserveAspectRatio class
+ 
+-class nsSVGPreserveAspectRatio : public nsIDOMSVGPreserveAspectRatio,
++class nsSVGPreserveAspectRatio : public XPCOMGCFinalizedObject,
++                                 public nsIDOMSVGPreserveAspectRatio,
+                                  public nsSVGValue
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGRect.h b/content/svg/content/src/nsSVGRect.h
+--- a/content/svg/content/src/nsSVGRect.h
++++ b/content/svg/content/src/nsSVGRect.h
+@@ -60,7 +60,8 @@ NS_NewSVGReadonlyRect(nsIDOMSVGRect** re
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGRect class
+ 
+-class nsSVGRect : public nsIDOMSVGRect,
++class nsSVGRect : public XPCOMGCFinalizedObject,
++                  public nsIDOMSVGRect,
+                   public nsSVGValue
+ {
+ public:
+diff --git a/content/svg/content/src/nsSVGRectElement.cpp b/content/svg/content/src/nsSVGRectElement.cpp
+--- a/content/svg/content/src/nsSVGRectElement.cpp
++++ b/content/svg/content/src/nsSVGRectElement.cpp
+@@ -45,7 +45,8 @@
+ 
+ typedef nsSVGPathGeometryElement nsSVGRectElementBase;
+ 
+-class nsSVGRectElement : public nsSVGRectElementBase,
++class nsSVGRectElement : public XPCOMGCFinalizedObject,
++                         public nsSVGRectElementBase,
+                          public nsIDOMSVGRectElement
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGSVGElement.h b/content/svg/content/src/nsSVGSVGElement.h
+--- a/content/svg/content/src/nsSVGSVGElement.h
++++ b/content/svg/content/src/nsSVGSVGElement.h
+@@ -64,7 +64,8 @@ public:
+   float height;
+ };
+ 
+-class nsSVGSVGElement : public nsSVGSVGElementBase,
++class nsSVGSVGElement : public XPCOMGCFinalizedObject,
++                        public nsSVGSVGElementBase,
+                         public nsIDOMSVGSVGElement,
+                         public nsIDOMSVGFitToViewBox,
+                         public nsIDOMSVGLocatable,
+diff --git a/content/svg/content/src/nsSVGScriptElement.cpp b/content/svg/content/src/nsSVGScriptElement.cpp
+--- a/content/svg/content/src/nsSVGScriptElement.cpp
++++ b/content/svg/content/src/nsSVGScriptElement.cpp
+@@ -51,7 +51,8 @@
+ 
+ typedef nsSVGElement nsSVGScriptElementBase;
+ 
+-class nsSVGScriptElement : public nsSVGScriptElementBase,
++class nsSVGScriptElement : public XPCOMGCFinalizedObject,
++                           public nsSVGScriptElementBase,
+                            public nsIDOMSVGScriptElement, 
+                            public nsIDOMSVGURIReference,
+                            public nsScriptElement
+diff --git a/content/svg/content/src/nsSVGStopElement.cpp b/content/svg/content/src/nsSVGStopElement.cpp
+--- a/content/svg/content/src/nsSVGStopElement.cpp
++++ b/content/svg/content/src/nsSVGStopElement.cpp
+@@ -45,7 +45,8 @@
+ 
+ typedef nsSVGStylableElement nsSVGStopElementBase;
+ 
+-class nsSVGStopElement : public nsSVGStopElementBase,
++class nsSVGStopElement : public XPCOMGCFinalizedObject,
++                         public nsSVGStopElementBase,
+                          public nsIDOMSVGStopElement
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGString.h b/content/svg/content/src/nsSVGString.h
+--- a/content/svg/content/src/nsSVGString.h
++++ b/content/svg/content/src/nsSVGString.h
+@@ -68,7 +68,7 @@ private:
+   nsString mBaseVal;
+   PRUint8 mAttrEnum; // element specified tracking for attribute
+ 
+-  struct DOMAnimatedString : public nsIDOMSVGAnimatedString
++  struct DOMAnimatedString : public XPCOMGCFinalizedObject, public nsIDOMSVGAnimatedString
+   {
+     NS_DECL_ISUPPORTS
+ 
+diff --git a/content/svg/content/src/nsSVGStringProxyValue.cpp b/content/svg/content/src/nsSVGStringProxyValue.cpp
+--- a/content/svg/content/src/nsSVGStringProxyValue.cpp
++++ b/content/svg/content/src/nsSVGStringProxyValue.cpp
+@@ -56,7 +56,8 @@
+ // will also return the proxied object's GetValueString().
+ 
+ 
+-class nsSVGStringProxyValue : public nsSVGValue,
++class nsSVGStringProxyValue : public XPCOMGCFinalizedObject,
++                              public nsSVGValue,
+                               public nsISVGValueObserver
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGStyleElement.cpp b/content/svg/content/src/nsSVGStyleElement.cpp
+--- a/content/svg/content/src/nsSVGStyleElement.cpp
++++ b/content/svg/content/src/nsSVGStyleElement.cpp
+@@ -45,7 +45,8 @@
+ 
+ typedef nsSVGElement nsSVGStyleElementBase;
+ 
+-class nsSVGStyleElement : public nsSVGStyleElementBase,
++class nsSVGStyleElement : public XPCOMGCFinalizedObject,
++                          public nsSVGStyleElementBase,
+                           public nsIDOMSVGStyleElement,
+                           public nsStyleLinkElement,
+                           public nsStubMutationObserver
+diff --git a/content/svg/content/src/nsSVGSwitchElement.cpp b/content/svg/content/src/nsSVGSwitchElement.cpp
+--- a/content/svg/content/src/nsSVGSwitchElement.cpp
++++ b/content/svg/content/src/nsSVGSwitchElement.cpp
+@@ -39,7 +39,8 @@
+ 
+ typedef nsSVGGraphicElement nsSVGSwitchElementBase;
+ 
+-class nsSVGSwitchElement : public nsSVGSwitchElementBase,
++class nsSVGSwitchElement : public XPCOMGCFinalizedObject,
++                           public nsSVGSwitchElementBase,
+                            public nsIDOMSVGSwitchElement
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGSymbolElement.cpp b/content/svg/content/src/nsSVGSymbolElement.cpp
+--- a/content/svg/content/src/nsSVGSymbolElement.cpp
++++ b/content/svg/content/src/nsSVGSymbolElement.cpp
+@@ -47,7 +47,8 @@
+ 
+ typedef nsSVGStylableElement nsSVGSymbolElementBase;
+ 
+-class nsSVGSymbolElement : public nsSVGSymbolElementBase,
++class nsSVGSymbolElement : public XPCOMGCFinalizedObject,
++                           public nsSVGSymbolElementBase,
+                            public nsIDOMSVGFitToViewBox,
+                            public nsIDOMSVGSymbolElement
+ {
+diff --git a/content/svg/content/src/nsSVGTSpanElement.cpp b/content/svg/content/src/nsSVGTSpanElement.cpp
+--- a/content/svg/content/src/nsSVGTSpanElement.cpp
++++ b/content/svg/content/src/nsSVGTSpanElement.cpp
+@@ -49,7 +49,8 @@
+ 
+ typedef nsSVGStylableElement nsSVGTSpanElementBase;
+ 
+-class nsSVGTSpanElement : public nsSVGTSpanElementBase
++class nsSVGTSpanElement : public XPCOMGCFinalizedObject
++                        , public nsSVGTSpanElementBase
+                         , public nsIDOMSVGTSpanElement
+                      // , nsIDOMSVGTextPositioningElement
+                      // , nsIDOMSVGTextContentElement
+diff --git a/content/svg/content/src/nsSVGTextElement.cpp b/content/svg/content/src/nsSVGTextElement.cpp
+--- a/content/svg/content/src/nsSVGTextElement.cpp
++++ b/content/svg/content/src/nsSVGTextElement.cpp
+@@ -49,7 +49,8 @@
+ 
+ typedef nsSVGGraphicElement nsSVGTextElementBase;
+ 
+-class nsSVGTextElement : public nsSVGTextElementBase
++class nsSVGTextElement : public XPCOMGCFinalizedObject
++                       , public nsSVGTextElementBase
+                        , public nsIDOMSVGTextElement
+                     // , nsIDOMSVGTextPositioningElement
+                     // , nsIDOMSVGTextContentElement
+diff --git a/content/svg/content/src/nsSVGTextPathElement.h b/content/svg/content/src/nsSVGTextPathElement.h
+--- a/content/svg/content/src/nsSVGTextPathElement.h
++++ b/content/svg/content/src/nsSVGTextPathElement.h
+@@ -44,7 +44,8 @@
+ 
+ typedef nsSVGStylableElement nsSVGTextPathElementBase;
+ 
+-class nsSVGTextPathElement : public nsSVGTextPathElementBase,
++class nsSVGTextPathElement : public XPCOMGCFinalizedObject,
++                             public nsSVGTextPathElementBase,
+                              public nsIDOMSVGTextPathElement,
+                              public nsIDOMSVGURIReference
+ {
+diff --git a/content/svg/content/src/nsSVGTitleElement.cpp b/content/svg/content/src/nsSVGTitleElement.cpp
+--- a/content/svg/content/src/nsSVGTitleElement.cpp
++++ b/content/svg/content/src/nsSVGTitleElement.cpp
+@@ -41,7 +41,8 @@
+ 
+ typedef nsSVGStylableElement nsSVGTitleElementBase;
+ 
+-class nsSVGTitleElement : public nsSVGTitleElementBase,
++class nsSVGTitleElement : public XPCOMGCFinalizedObject,
++                          public nsSVGTitleElementBase,
+                           public nsIDOMSVGTitleElement
+ {
+ protected:
+diff --git a/content/svg/content/src/nsSVGTransform.cpp b/content/svg/content/src/nsSVGTransform.cpp
+--- a/content/svg/content/src/nsSVGTransform.cpp
++++ b/content/svg/content/src/nsSVGTransform.cpp
+@@ -52,7 +52,8 @@
+ ////////////////////////////////////////////////////////////////////////
+ // nsSVGTransform
+ 
+-class nsSVGTransform : public nsIDOMSVGTransform,
++class nsSVGTransform : public XPCOMGCFinalizedObject,
++                       public nsIDOMSVGTransform,
+                        public nsSVGValue,
+                        public nsISVGValueObserver
+ {
+diff --git a/content/svg/content/src/nsSVGTransformList.h b/content/svg/content/src/nsSVGTransformList.h
+--- a/content/svg/content/src/nsSVGTransformList.h
++++ b/content/svg/content/src/nsSVGTransformList.h
+@@ -45,7 +45,8 @@
+ #include "nsIDOMSVGTransformList.h"
+ #include "nsVoidArray.h"
+ 
+-class nsSVGTransformList : public nsSVGValue,
++class nsSVGTransformList : public XPCOMGCFinalizedObject,
++                           public nsSVGValue,
+                            public nsIDOMSVGTransformList,
+                            public nsISVGValueObserver
+ {
+diff --git a/content/svg/content/src/nsSVGUseElement.h b/content/svg/content/src/nsSVGUseElement.h
+--- a/content/svg/content/src/nsSVGUseElement.h
++++ b/content/svg/content/src/nsSVGUseElement.h
+@@ -59,7 +59,8 @@ NS_NewSVGSVGElement(nsIContent **aResult
+ 
+ typedef nsSVGGraphicElement nsSVGUseElementBase;
+ 
+-class nsSVGUseElement : public nsSVGUseElementBase,
++class nsSVGUseElement : public XPCOMGCFinalizedObject,
++                        public nsSVGUseElementBase,
+                         public nsIDOMSVGURIReference,
+                         public nsIDOMSVGUseElement,
+                         public nsStubMutationObserver
+diff --git a/content/xbl/src/nsBindingManager.cpp b/content/xbl/src/nsBindingManager.cpp
+--- a/content/xbl/src/nsBindingManager.cpp
++++ b/content/xbl/src/nsBindingManager.cpp
+@@ -91,7 +91,7 @@
+   { 0xa29df1f8, 0xaeca, 0x4356, \
+     { 0xa8, 0xc2, 0xa7, 0x24, 0xa2, 0x11, 0x73, 0xac } }
+ 
+-class nsAnonymousContentList : public nsIDOMNodeList
++class nsAnonymousContentList : public XPCOMGCFinalizedObject, public nsIDOMNodeList
+ {
+ public:
+   nsAnonymousContentList(nsInsertionPointList* aElements);
+diff --git a/content/xbl/src/nsBindingManager.h b/content/xbl/src/nsBindingManager.h
+--- a/content/xbl/src/nsBindingManager.h
++++ b/content/xbl/src/nsBindingManager.h
+@@ -64,7 +64,7 @@ template<class T> class nsRunnableMethod
+ template<class T> class nsRunnableMethod;
+ class nsIPrincipal;
+ 
+-class nsBindingManager : public nsStubMutationObserver
++class nsBindingManager : public XPCOMGCFinalizedObject, public nsStubMutationObserver
+ {
+ public:
+   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+diff --git a/content/xbl/src/nsXBLDocumentInfo.cpp b/content/xbl/src/nsXBLDocumentInfo.cpp
+--- a/content/xbl/src/nsXBLDocumentInfo.cpp
++++ b/content/xbl/src/nsXBLDocumentInfo.cpp
+@@ -59,7 +59,8 @@ static NS_DEFINE_CID(kDOMScriptObjectFac
+ 
+ // An XBLDocumentInfo object has a special context associated with it which we can use to pre-compile 
+ // properties and methods of XBL bindings against.
+-class nsXBLDocGlobalObject : public nsIScriptGlobalObject,
++class nsXBLDocGlobalObject : public XPCOMGCFinalizedObject,
++                             public nsIScriptGlobalObject,
+                              public nsIScriptObjectPrincipal
+ {
+ public:
+diff --git a/content/xbl/src/nsXBLDocumentInfo.h b/content/xbl/src/nsXBLDocumentInfo.h
+--- a/content/xbl/src/nsXBLDocumentInfo.h
++++ b/content/xbl/src/nsXBLDocumentInfo.h
+@@ -46,7 +46,7 @@ class nsObjectHashtable;
+ class nsObjectHashtable;
+ class nsXBLDocGlobalObject;
+ 
+-class nsXBLDocumentInfo : public nsIXBLDocumentInfo, public nsIScriptGlobalObjectOwner, public nsSupportsWeakReference
++class nsXBLDocumentInfo : public XPCOMGCFinalizedObject, public nsIXBLDocumentInfo, public nsIScriptGlobalObjectOwner, public nsSupportsWeakReference
+ {
+ public:
+   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+diff --git a/content/xbl/src/nsXBLEventHandler.h b/content/xbl/src/nsXBLEventHandler.h
+--- a/content/xbl/src/nsXBLEventHandler.h
++++ b/content/xbl/src/nsXBLEventHandler.h
+@@ -50,7 +50,7 @@ class nsPIDOMEventTarget;
+ class nsPIDOMEventTarget;
+ class nsXBLPrototypeHandler;
+ 
+-class nsXBLEventHandler : public nsIDOMEventListener
++class nsXBLEventHandler : public XPCOMGCFinalizedObject, public nsIDOMEventListener
+ {
+ public:
+   nsXBLEventHandler(nsXBLPrototypeHandler* aHandler);
+@@ -81,7 +81,7 @@ private:
+   PRBool EventMatched(nsIDOMEvent* aEvent);
+ };
+ 
+-class nsXBLKeyEventHandler : public nsIDOMEventListener
++class nsXBLKeyEventHandler : public XPCOMGCFinalizedObject, public nsIDOMEventListener
+ {
+ public:
+   nsXBLKeyEventHandler(nsIAtom* aEventType, PRUint8 aPhase, PRUint8 aType);
+diff --git a/content/xbl/src/nsXBLResourceLoader.h b/content/xbl/src/nsXBLResourceLoader.h
+--- a/content/xbl/src/nsXBLResourceLoader.h
++++ b/content/xbl/src/nsXBLResourceLoader.h
+@@ -67,7 +67,7 @@ struct nsXBLResource
+   }
+ };
+ 
+-class nsXBLResourceLoader : public nsICSSLoaderObserver
++class nsXBLResourceLoader : public XPCOMGCFinalizedObject, public nsICSSLoaderObserver
+ {
+ public:
+   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+diff --git a/content/xbl/src/nsXBLService.cpp b/content/xbl/src/nsXBLService.cpp
+--- a/content/xbl/src/nsXBLService.cpp
++++ b/content/xbl/src/nsXBLService.cpp
+@@ -248,7 +248,7 @@ int nsXBLBindingRequest::gRefCnt = 0;
+ // nsXBLStreamListener, a helper class used for 
+ // asynchronous parsing of URLs
+ /* Header file */
+-class nsXBLStreamListener : public nsIStreamListener, public nsIDOMLoadListener
++class nsXBLStreamListener : public XPCOMGCFinalizedObject, public nsIStreamListener, public nsIDOMLoadListener
+ {
+ public:
+   NS_DECL_ISUPPORTS
+@@ -1077,7 +1077,8 @@ nsXBLService::LoadBindingDocumentInfo(ns
+   return NS_OK;
+ }
+ 
+-class nsSameOriginChecker : public nsIChannelEventSink,
++class nsSameOriginChecker : public XPCOMGCFinalizedObject,
++                            public nsIChannelEventSink,
+                             public nsIInterfaceRequestor
+ {
+   NS_DECL_ISUPPORTS
+diff --git a/content/xbl/src/nsXBLService.h b/content/xbl/src/nsXBLService.h
+--- a/content/xbl/src/nsXBLService.h
++++ b/content/xbl/src/nsXBLService.h
+@@ -58,7 +58,8 @@ class nsSupportsHashtable;
+ class nsSupportsHashtable;
+ class nsHashtable;
+ 
+-class nsXBLService : public nsIXBLService,
++class nsXBLService : public XPCOMGCFinalizedObject,
++                     public nsIXBLService,
+                      public nsIObserver,
+                      public nsSupportsWeakReference
+ {
+diff --git a/content/xbl/src/nsXBLWindowKeyHandler.h b/content/xbl/src/nsXBLWindowKeyHandler.h
+--- a/content/xbl/src/nsXBLWindowKeyHandler.h
++++ b/content/xbl/src/nsXBLWindowKeyHandler.h
+@@ -51,7 +51,7 @@ class nsXBLSpecialDocInfo;
+ class nsXBLSpecialDocInfo;
+ class nsXBLPrototypeHandler;
+ 
+-class nsXBLWindowKeyHandler : public nsIDOMKeyListener
++class nsXBLWindowKeyHandler : public XPCOMGCFinalizedObject, public nsIDOMKeyListener
+ {
+ public:
+   nsXBLWindowKeyHandler(nsIDOMElement* aElement, nsPIDOMEventTarget* aTarget);
+diff --git a/content/xml/content/src/nsXMLCDATASection.cpp b/content/xml/content/src/nsXMLCDATASection.cpp
+--- a/content/xml/content/src/nsXMLCDATASection.cpp
++++ b/content/xml/content/src/nsXMLCDATASection.cpp
+@@ -43,7 +43,8 @@
+ #include "nsContentUtils.h"
+ 
+ 
+-class nsXMLCDATASection : public nsGenericDOMDataNode,
++class nsXMLCDATASection : public XPCOMGCFinalizedObject,
++                          public nsGenericDOMDataNode,
+                           public nsIDOMCDATASection
+ {
+ public:
+diff --git a/content/xml/content/src/nsXMLElement.h b/content/xml/content/src/nsXMLElement.h
+--- a/content/xml/content/src/nsXMLElement.h
++++ b/content/xml/content/src/nsXMLElement.h
+@@ -44,7 +44,8 @@
+ 
+ class nsIDocShell;
+ 
+-class nsXMLElement : public nsGenericElement,
++class nsXMLElement : public XPCOMGCFinalizedObject,
++                     public nsGenericElement,
+                      public nsIDOMElement
+ {
+ public:
+diff --git a/content/xml/content/src/nsXMLProcessingInstruction.h b/content/xml/content/src/nsXMLProcessingInstruction.h
+--- a/content/xml/content/src/nsXMLProcessingInstruction.h
++++ b/content/xml/content/src/nsXMLProcessingInstruction.h
+@@ -45,7 +45,8 @@
+ #include "nsAString.h"
+ 
+ 
+-class nsXMLProcessingInstruction : public nsGenericDOMDataNode,
++class nsXMLProcessingInstruction : public XPCOMGCFinalizedObject,
++                                   public nsGenericDOMDataNode,
+                                    public nsIDOMProcessingInstruction
+ {
+ public:
+diff --git a/content/xml/document/src/nsXMLContentSink.h b/content/xml/document/src/nsXMLContentSink.h
+--- a/content/xml/document/src/nsXMLContentSink.h
++++ b/content/xml/document/src/nsXMLContentSink.h
+@@ -65,7 +65,8 @@ struct StackNode {
+   PRUint32 mNumFlushed;
+ };
+ 
+-class nsXMLContentSink : public nsContentSink,
++class nsXMLContentSink : public XPCOMGCFinalizedObject,
++                         public nsContentSink,
+                          public nsIXMLContentSink,
+                          public nsITransformObserver,
+                          public nsIExpatSink
+diff --git a/content/xml/document/src/nsXMLDocument.h b/content/xml/document/src/nsXMLDocument.h
+--- a/content/xml/document/src/nsXMLDocument.h
++++ b/content/xml/document/src/nsXMLDocument.h
+@@ -52,7 +52,8 @@ class nsIURI;
+ class nsIURI;
+ class nsIChannel;
+ 
+-class nsXMLDocument : public nsDocument,
++class nsXMLDocument : public XPCOMGCFinalizedObject,
++                      public nsDocument,
+                       public nsIInterfaceRequestor,
+                       public nsIChannelEventSink
+ {
+diff --git a/content/xml/document/src/nsXMLPrettyPrinter.h b/content/xml/document/src/nsXMLPrettyPrinter.h
+--- a/content/xml/document/src/nsXMLPrettyPrinter.h
++++ b/content/xml/document/src/nsXMLPrettyPrinter.h
+@@ -43,7 +43,7 @@
+ #include "nsIDocument.h"
+ #include "nsCOMPtr.h"
+ 
+-class nsXMLPrettyPrinter : public nsStubDocumentObserver
++class nsXMLPrettyPrinter : public XPCOMGCFinalizedObject, public nsStubDocumentObserver
+ {
+ public:
+     nsXMLPrettyPrinter();
+diff --git a/content/xslt/src/xpath/nsXPath1Scheme.cpp b/content/xslt/src/xpath/nsXPath1Scheme.cpp
+--- a/content/xslt/src/xpath/nsXPath1Scheme.cpp
++++ b/content/xslt/src/xpath/nsXPath1Scheme.cpp
+@@ -65,7 +65,7 @@ static NS_DEFINE_IID(kRangeCID, NS_RANGE
+  *
+  * This will effectively give us xmlns scheme support.
+  */
+-class nsXPath1SchemeNSResolver : public nsIDOMXPathNSResolver
++class nsXPath1SchemeNSResolver : public XPCOMGCFinalizedObject, public nsIDOMXPathNSResolver
+ {
+ public:
+   nsXPath1SchemeNSResolver(nsIXPointerSchemeContext *aContext)
+diff --git a/content/xslt/src/xpath/nsXPath1Scheme.h b/content/xslt/src/xpath/nsXPath1Scheme.h
+--- a/content/xslt/src/xpath/nsXPath1Scheme.h
++++ b/content/xslt/src/xpath/nsXPath1Scheme.h
+@@ -45,7 +45,7 @@
+ 
+ #include "nsIXPointer.h"
+ 
+-class nsXPath1SchemeProcessor : public nsIXPointerSchemeProcessor
++class nsXPath1SchemeProcessor : public XPCOMGCFinalizedObject, public nsIXPointerSchemeProcessor
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/content/xslt/src/xpath/nsXPathEvaluator.h b/content/xslt/src/xpath/nsXPathEvaluator.h
+--- a/content/xslt/src/xpath/nsXPathEvaluator.h
++++ b/content/xslt/src/xpath/nsXPathEvaluator.h
+@@ -51,7 +51,8 @@
+ /**
+  * A class for evaluating an XPath expression string
+  */
+-class nsXPathEvaluator : public nsIDOMXPathEvaluator,
++class nsXPathEvaluator : public XPCOMGCFinalizedObject,
++                         public nsIDOMXPathEvaluator,
+                          public nsIXPathEvaluatorInternal
+ {
+ public:
+diff --git a/content/xslt/src/xpath/nsXPathNSResolver.h b/content/xslt/src/xpath/nsXPathNSResolver.h
+--- a/content/xslt/src/xpath/nsXPathNSResolver.h
++++ b/content/xslt/src/xpath/nsXPathNSResolver.h
+@@ -48,7 +48,7 @@
+ /**
+  * A class for evaluating an XPath expression string
+  */
+-class nsXPathNSResolver : public nsIDOMXPathNSResolver
++class nsXPathNSResolver : public XPCOMGCFinalizedObject, public nsIDOMXPathNSResolver
+ {
+ public:
+     nsXPathNSResolver(nsIDOMNode* aNode);
+diff --git a/content/xslt/src/xpath/nsXPathResult.h b/content/xslt/src/xpath/nsXPathResult.h
+--- a/content/xslt/src/xpath/nsXPathResult.h
++++ b/content/xslt/src/xpath/nsXPathResult.h
+@@ -68,7 +68,8 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIXPathRe
+ /**
+  * A class for evaluating an XPath expression string
+  */
+-class nsXPathResult : public nsIDOMXPathResult,
++class nsXPathResult : public XPCOMGCFinalizedObject,
++                      public nsIDOMXPathResult,
+                       public nsStubMutationObserver,
+                       public nsIXPathResult
+ {
+diff --git a/content/xslt/src/xpath/txNodeSetAdaptor.h b/content/xslt/src/xpath/txNodeSetAdaptor.h
+--- a/content/xslt/src/xpath/txNodeSetAdaptor.h
++++ b/content/xslt/src/xpath/txNodeSetAdaptor.h
+@@ -47,7 +47,7 @@
+  * Implements an XPCOM wrapper around an XPath NodeSet.
+  */
+ 
+-class txNodeSetAdaptor : public txINodeSet 
++class txNodeSetAdaptor : public XPCOMGCFinalizedObject, public txINodeSet 
+ {
+ public:
+     txNodeSetAdaptor();
+diff --git a/content/xslt/src/xpath/txXPCOMExtensionFunction.cpp b/content/xslt/src/xpath/txXPCOMExtensionFunction.cpp
+--- a/content/xslt/src/xpath/txXPCOMExtensionFunction.cpp
++++ b/content/xslt/src/xpath/txXPCOMExtensionFunction.cpp
+@@ -50,7 +50,7 @@
+ #include "txXPathTreeWalker.h"
+ #include "xptcall.h"
+ 
+-class txFunctionEvaluationContext : public txIFunctionEvaluationContext
++class txFunctionEvaluationContext : public XPCOMGCFinalizedObject, public txIFunctionEvaluationContext
+ {
+ public:
+     txFunctionEvaluationContext(txIEvalContext *aContext, nsISupports *aState);
+diff --git a/content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp b/content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp
+--- a/content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp
++++ b/content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp
+@@ -92,7 +92,8 @@ getSpec(nsIChannel* aChannel, nsAString&
+     AppendUTF8toUTF16(spec, aSpec);
+ }
+ 
+-class txStylesheetSink : public nsIXMLContentSink,
++class txStylesheetSink : public XPCOMGCFinalizedObject,
++                         public nsIXMLContentSink,
+                          public nsIExpatSink,
+                          public nsIStreamListener,
+                          public nsIChannelEventSink,
+diff --git a/content/xslt/src/xslt/txMozillaXMLOutput.h b/content/xslt/src/xslt/txMozillaXMLOutput.h
+--- a/content/xslt/src/xslt/txMozillaXMLOutput.h
++++ b/content/xslt/src/xslt/txMozillaXMLOutput.h
+@@ -59,7 +59,8 @@ class nsIDocument;
+ class nsIDocument;
+ class nsINode;
+ 
+-class txTransformNotifier : public nsIScriptLoaderObserver,
++class txTransformNotifier : public XPCOMGCFinalizedObject,
++                            public nsIScriptLoaderObserver,
+                             public nsICSSLoaderObserver
+ {
+ public:
+diff --git a/content/xslt/src/xslt/txMozillaXSLTProcessor.h b/content/xslt/src/xslt/txMozillaXSLTProcessor.h
+--- a/content/xslt/src/xslt/txMozillaXSLTProcessor.h
++++ b/content/xslt/src/xslt/txMozillaXSLTProcessor.h
+@@ -70,7 +70,8 @@ class txIGlobalParameter;
+ /**
+  * txMozillaXSLTProcessor is a front-end to the XSLT Processor.
+  */
+-class txMozillaXSLTProcessor : public nsIXSLTProcessor,
++class txMozillaXSLTProcessor : public XPCOMGCFinalizedObject,
++                               public nsIXSLTProcessor,
+                                public nsIXSLTProcessorObsolete,
+                                public nsIXSLTProcessorPrivate,
+                                public nsIDocumentTransformer,
+diff --git a/content/xtf/src/nsXMLContentBuilder.cpp b/content/xtf/src/nsXMLContentBuilder.cpp
+--- a/content/xtf/src/nsXMLContentBuilder.cpp
++++ b/content/xtf/src/nsXMLContentBuilder.cpp
+@@ -56,7 +56,7 @@
+ 
+ static NS_DEFINE_CID(kXMLDocumentCID, NS_XMLDOCUMENT_CID);
+ 
+-class nsXMLContentBuilder : public nsIXMLContentBuilder
++class nsXMLContentBuilder : public XPCOMGCFinalizedObject, public nsIXMLContentBuilder
+ {
+ protected:
+   friend nsresult NS_NewXMLContentBuilder(nsIXMLContentBuilder** aResult);
+diff --git a/content/xtf/src/nsXTFInterfaceAggregator.cpp b/content/xtf/src/nsXTFInterfaceAggregator.cpp
+--- a/content/xtf/src/nsXTFInterfaceAggregator.cpp
++++ b/content/xtf/src/nsXTFInterfaceAggregator.cpp
+@@ -49,7 +49,7 @@
+ ////////////////////////////////////////////////////////////////////////
+ // nsXTFInterfaceAggregator class
+ 
+-class nsXTFInterfaceAggregator : protected nsAutoXPTCStub
++class nsXTFInterfaceAggregator : public XPCOMGCFinalizedObject, protected nsAutoXPTCStub
+ {
+ protected:
+   friend nsresult
+diff --git a/content/xtf/src/nsXTFService.cpp b/content/xtf/src/nsXTFService.cpp
+--- a/content/xtf/src/nsXTFService.cpp
++++ b/content/xtf/src/nsXTFService.cpp
+@@ -49,7 +49,7 @@
+ 
+ ////////////////////////////////////////////////////////////////////////
+ // nsXTFService class 
+-class nsXTFService : public nsIXTFService
++class nsXTFService : public XPCOMGCFinalizedObject, public nsIXTFService
+ {
+ protected:
+   friend nsresult NS_NewXTFService(nsIXTFService** aResult);
+diff --git a/content/xtf/src/nsXTFWeakTearoff.cpp b/content/xtf/src/nsXTFWeakTearoff.cpp
+--- a/content/xtf/src/nsXTFWeakTearoff.cpp
++++ b/content/xtf/src/nsXTFWeakTearoff.cpp
+@@ -49,7 +49,7 @@
+ ////////////////////////////////////////////////////////////////////////
+ // nsXTFWeakTearoff class
+ 
+-class nsXTFWeakTearoff : protected nsAutoXPTCStub
++class nsXTFWeakTearoff : public XPCOMGCFinalizedObject, protected nsAutoXPTCStub
+ {
+ protected:
+   ~nsXTFWeakTearoff();
+diff --git a/content/xul/content/src/nsXULElement.cpp b/content/xul/content/src/nsXULElement.cpp
+--- a/content/xul/content/src/nsXULElement.cpp
++++ b/content/xul/content/src/nsXULElement.cpp
+@@ -177,7 +177,7 @@ nsICSSOMFactory* nsXULElement::gCSSOMFac
+ /**
+  * A tearoff class for nsXULElement to implement nsIScriptEventHandlerOwner.
+  */
+-class nsScriptEventHandlerOwnerTearoff : public nsIScriptEventHandlerOwner
++class nsScriptEventHandlerOwnerTearoff : public XPCOMGCFinalizedObject, public nsIScriptEventHandlerOwner
+ {
+ public:
+     nsScriptEventHandlerOwnerTearoff(nsXULElement* aElement)
+@@ -218,7 +218,8 @@ PRUint32             nsXULPrototypeAttri
+ PRUint32             nsXULPrototypeAttribute::gNumCacheFills;
+ #endif
+ 
+-class nsXULElementTearoff : public nsIDOMElementCSSInlineStyle,
++class nsXULElementTearoff : public XPCOMGCFinalizedObject,
++                            public nsIDOMElementCSSInlineStyle,
+                             public nsIFrameLoaderOwner
+ {
+ public:
+diff --git a/content/xul/content/src/nsXULElement.h b/content/xul/content/src/nsXULElement.h
+--- a/content/xul/content/src/nsXULElement.h
++++ b/content/xul/content/src/nsXULElement.h
+@@ -446,7 +446,7 @@ public:
+ 
+ class nsScriptEventHandlerOwnerTearoff;
+ 
+-class nsXULElement : public nsGenericElement, public nsIDOMXULElement
++class nsXULElement : public XPCOMGCFinalizedObject, public nsGenericElement, public nsIDOMXULElement
+ {
+ public:
+     /**
+diff --git a/content/xul/content/src/nsXULPopupListener.h b/content/xul/content/src/nsXULPopupListener.h
+--- a/content/xul/content/src/nsXULPopupListener.h
++++ b/content/xul/content/src/nsXULPopupListener.h
+@@ -56,7 +56,8 @@
+ #include "nsIDOMContextMenuListener.h"
+ #include "nsCycleCollectionParticipant.h"
+ 
+-class nsXULPopupListener : public nsIDOMMouseListener,
++class nsXULPopupListener : public XPCOMGCFinalizedObject,
++                           public nsIDOMMouseListener,
+                            public nsIDOMContextMenuListener
+ {
+ public:
+diff --git a/content/xul/document/src/nsXULCommandDispatcher.h b/content/xul/document/src/nsXULCommandDispatcher.h
+--- a/content/xul/document/src/nsXULCommandDispatcher.h
++++ b/content/xul/document/src/nsXULCommandDispatcher.h
+@@ -57,7 +57,8 @@ class nsIDOMElement;
+ class nsIDOMElement;
+ class nsIFocusController;
+ 
+-class nsXULCommandDispatcher : public nsIDOMXULCommandDispatcher,
++class nsXULCommandDispatcher : public XPCOMGCFinalizedObject,
++                               public nsIDOMXULCommandDispatcher,
+                                public nsSupportsWeakReference
+ {
+ public:
+diff --git a/content/xul/document/src/nsXULContentSink.h b/content/xul/document/src/nsXULContentSink.h
+--- a/content/xul/document/src/nsXULContentSink.h
++++ b/content/xul/document/src/nsXULContentSink.h
+@@ -56,7 +56,8 @@ class nsXULPrototypeElement;
+ class nsXULPrototypeElement;
+ class nsXULPrototypeNode;
+ 
+-class XULContentSinkImpl : public nsIXMLContentSink,
++class XULContentSinkImpl : public XPCOMGCFinalizedObject,
++                           public nsIXMLContentSink,
+                            public nsIExpatSink
+ {
+ public:
+diff --git a/content/xul/document/src/nsXULControllers.h b/content/xul/document/src/nsXULControllers.h
+--- a/content/xul/document/src/nsXULControllers.h
++++ b/content/xul/document/src/nsXULControllers.h
+@@ -79,7 +79,8 @@ public:
+ 
+ NS_IMETHODIMP NS_NewXULControllers(nsISupports* aOuter, REFNSIID aIID, void** aResult);
+ 
+-class nsXULControllers : public nsIControllers,
++class nsXULControllers : public XPCOMGCFinalizedObject,
++                         public nsIControllers,
+                          public nsISecurityCheckedComponent
+ {
+ public:
+diff --git a/content/xul/document/src/nsXULDocument.h b/content/xul/document/src/nsXULDocument.h
+--- a/content/xul/document/src/nsXULDocument.h
++++ b/content/xul/document/src/nsXULDocument.h
+@@ -646,7 +646,7 @@ protected:
+     nsTime mLoadStart;
+ #endif
+ 
+-    class CachedChromeStreamListener : public nsIStreamListener {
++    class CachedChromeStreamListener : public XPCOMGCFinalizedObject, public nsIStreamListener {
+     protected:
+         nsXULDocument* mDocument;
+         PRPackedBool   mProtoLoaded;
+@@ -665,7 +665,7 @@ protected:
+     friend class CachedChromeStreamListener;
+ 
+ 
+-    class ParserObserver : public nsIRequestObserver {
++    class ParserObserver : public XPCOMGCFinalizedObject, public nsIRequestObserver {
+     protected:
+         nsRefPtr<nsXULDocument> mDocument;
+         nsRefPtr<nsXULPrototypeDocument> mPrototype;
+diff --git a/content/xul/document/src/nsXULPrototypeCache.cpp b/content/xul/document/src/nsXULPrototypeCache.cpp
+--- a/content/xul/document/src/nsXULPrototypeCache.cpp
++++ b/content/xul/document/src/nsXULPrototypeCache.cpp
+@@ -606,7 +606,7 @@ FastLoadPrefChangedCallback(const char* 
+ }
+ 
+ 
+-class nsXULFastLoadFileIO : public nsIFastLoadFileIO
++class nsXULFastLoadFileIO : public XPCOMGCFinalizedObject, public nsIFastLoadFileIO
+ {
+   public:
+     nsXULFastLoadFileIO(nsIFile* aFile)
+diff --git a/content/xul/document/src/nsXULPrototypeCache.h b/content/xul/document/src/nsXULPrototypeCache.h
+--- a/content/xul/document/src/nsXULPrototypeCache.h
++++ b/content/xul/document/src/nsXULPrototypeCache.h
+@@ -70,7 +70,8 @@ struct CacheScriptEntry
+  *  1. In-memory hashtables
+  *  2. The on-disk fastload file.
+  */
+-class nsXULPrototypeCache : public nsIXULPrototypeCache,
++class nsXULPrototypeCache : public XPCOMGCFinalizedObject,
++                                   public nsIXULPrototypeCache,
+                                    nsIObserver
+ {
+ public:
+diff --git a/content/xul/document/src/nsXULPrototypeDocument.cpp b/content/xul/document/src/nsXULPrototypeDocument.cpp
+--- a/content/xul/document/src/nsXULPrototypeDocument.cpp
++++ b/content/xul/document/src/nsXULPrototypeDocument.cpp
+@@ -69,7 +69,8 @@ static NS_DEFINE_CID(kDOMScriptObjectFac
+                      NS_DOM_SCRIPT_OBJECT_FACTORY_CID);
+ 
+ 
+-class nsXULPDGlobalObject : public nsIScriptGlobalObject,
++class nsXULPDGlobalObject : public XPCOMGCFinalizedObject,
++                            public nsIScriptGlobalObject,
+                             public nsIScriptObjectPrincipal
+ {
+ public:
+diff --git a/content/xul/document/src/nsXULPrototypeDocument.h b/content/xul/document/src/nsXULPrototypeDocument.h
+--- a/content/xul/document/src/nsXULPrototypeDocument.h
++++ b/content/xul/document/src/nsXULPrototypeDocument.h
+@@ -66,7 +66,8 @@ class nsXULPDGlobalObject;
+  * objects, from which the real DOM tree is built later in
+  * nsXULDocument::ResumeWalk.
+  */
+-class nsXULPrototypeDocument : public nsIScriptGlobalObjectOwner,
++class nsXULPrototypeDocument : public XPCOMGCFinalizedObject,
++                               public nsIScriptGlobalObjectOwner,
+                                public nsISerializable
+ {
+ public:
+diff --git a/content/xul/templates/src/nsRDFQuery.h b/content/xul/templates/src/nsRDFQuery.h
+--- a/content/xul/templates/src/nsRDFQuery.h
++++ b/content/xul/templates/src/nsRDFQuery.h
+@@ -67,7 +67,7 @@ public:
+     virtual void ClearCachedResults() = 0;
+ };
+ 
+-class nsRDFQuery : public nsITemplateRDFQuery
++class nsRDFQuery : public XPCOMGCFinalizedObject, public nsITemplateRDFQuery
+ {
+ public:
+ 
+diff --git a/content/xul/templates/src/nsXULContentBuilder.cpp b/content/xul/templates/src/nsXULContentBuilder.cpp
+--- a/content/xul/templates/src/nsXULContentBuilder.cpp
++++ b/content/xul/templates/src/nsXULContentBuilder.cpp
+@@ -125,7 +125,7 @@
+  * eContainerContentsBuilt: set to true for generation nodes to indicate that
+  *                          results have been determined.
+  */
+-class nsXULContentBuilder : public nsXULTemplateBuilder
++class nsXULContentBuilder : public XPCOMGCFinalizedObject, public nsXULTemplateBuilder
+ {
+ public:
+     // nsIXULTemplateBuilder interface
+diff --git a/content/xul/templates/src/nsXULSortService.h b/content/xul/templates/src/nsXULSortService.h
+--- a/content/xul/templates/src/nsXULSortService.h
++++ b/content/xul/templates/src/nsXULSortService.h
+@@ -114,7 +114,7 @@ struct contentSortInfo {
+ //
+ //   This is the sort service.
+ //
+-class XULSortServiceImpl : public nsIXULSortService
++class XULSortServiceImpl : public XPCOMGCFinalizedObject, public nsIXULSortService
+ {
+ protected:
+   XULSortServiceImpl(void) {}
+diff --git a/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.h b/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.h
+--- a/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.h
++++ b/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.h
+@@ -80,7 +80,8 @@ class nsXULTemplateResultRDF;
+ /**
+  * An object that generates results from a query on an RDF graph
+  */
+-class nsXULTemplateQueryProcessorRDF : public nsIXULTemplateQueryProcessor,
++class nsXULTemplateQueryProcessorRDF : public XPCOMGCFinalizedObject,
++                                       public nsIXULTemplateQueryProcessor,
+                                        public nsIRDFObserver
+ {
+ public:
+diff --git a/content/xul/templates/src/nsXULTemplateQueryProcessorStorage.h b/content/xul/templates/src/nsXULTemplateQueryProcessorStorage.h
+--- a/content/xul/templates/src/nsXULTemplateQueryProcessorStorage.h
++++ b/content/xul/templates/src/nsXULTemplateQueryProcessorStorage.h
+@@ -51,7 +51,7 @@
+ 
+ class nsXULTemplateQueryProcessorStorage;
+ 
+-class nsXULTemplateResultSetStorage : public nsISimpleEnumerator
++class nsXULTemplateResultSetStorage : public XPCOMGCFinalizedObject, public nsISimpleEnumerator
+ {
+ private:
+ 
+@@ -75,7 +75,7 @@ public:
+ 
+ };
+ 
+-class nsXULTemplateQueryProcessorStorage : public nsIXULTemplateQueryProcessor
++class nsXULTemplateQueryProcessorStorage : public XPCOMGCFinalizedObject, public nsIXULTemplateQueryProcessor
+ {
+ public:
+ 
+diff --git a/content/xul/templates/src/nsXULTemplateQueryProcessorXML.h b/content/xul/templates/src/nsXULTemplateQueryProcessorXML.h
+--- a/content/xul/templates/src/nsXULTemplateQueryProcessorXML.h
++++ b/content/xul/templates/src/nsXULTemplateQueryProcessorXML.h
+@@ -60,7 +60,7 @@ class nsXULTemplateQueryProcessorXML;
+   {0x0358d692, 0xccce, 0x4a97, \
+     { 0xb2, 0x51, 0xba, 0x8f, 0x17, 0x0f, 0x3b, 0x6f }}
+  
+-class nsXMLQuery : public nsISupports
++class nsXMLQuery : public XPCOMGCFinalizedObject, public nsISupports
+ {
+   public:
+     NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXMLQUERY_IID)
+@@ -111,7 +111,7 @@ class nsXMLQuery : public nsISupports
+ 
+ NS_DEFINE_STATIC_IID_ACCESSOR(nsXMLQuery, NS_IXMLQUERY_IID)
+ 
+-class nsXULTemplateResultSetXML : public nsISimpleEnumerator
++class nsXULTemplateResultSetXML : public XPCOMGCFinalizedObject, public nsISimpleEnumerator
+ {
+ private:
+ 
+@@ -145,7 +145,8 @@ public:
+     {}
+ };
+ 
+-class nsXULTemplateQueryProcessorXML : public nsIXULTemplateQueryProcessor,
++class nsXULTemplateQueryProcessorXML : public XPCOMGCFinalizedObject,
++                                       public nsIXULTemplateQueryProcessor,
+                                        public nsIDOMEventListener
+ {
+ public:
+diff --git a/content/xul/templates/src/nsXULTemplateResultRDF.h b/content/xul/templates/src/nsXULTemplateResultRDF.h
+--- a/content/xul/templates/src/nsXULTemplateResultRDF.h
++++ b/content/xul/templates/src/nsXULTemplateResultRDF.h
+@@ -48,7 +48,7 @@
+ /**
+  * A single result of a query on an RDF graph
+  */
+-class nsXULTemplateResultRDF : public nsIXULTemplateResult
++class nsXULTemplateResultRDF : public XPCOMGCFinalizedObject, public nsIXULTemplateResult
+ {
+ public:
+     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+diff --git a/content/xul/templates/src/nsXULTemplateResultSetRDF.h b/content/xul/templates/src/nsXULTemplateResultSetRDF.h
+--- a/content/xul/templates/src/nsXULTemplateResultSetRDF.h
++++ b/content/xul/templates/src/nsXULTemplateResultSetRDF.h
+@@ -49,7 +49,7 @@ class nsXULTemplateResultRDF;
+ /**
+  * An enumerator used to iterate over a set of results.
+  */
+-class nsXULTemplateResultSetRDF : public nsISimpleEnumerator
++class nsXULTemplateResultSetRDF : public XPCOMGCFinalizedObject, public nsISimpleEnumerator
+ {
+ private:
+     nsXULTemplateQueryProcessorRDF* mProcessor;
+diff --git a/content/xul/templates/src/nsXULTemplateResultStorage.h b/content/xul/templates/src/nsXULTemplateResultStorage.h
+--- a/content/xul/templates/src/nsXULTemplateResultStorage.h
++++ b/content/xul/templates/src/nsXULTemplateResultStorage.h
+@@ -46,7 +46,7 @@
+ /**
+  * A single result of a query from mozstorage
+  */
+-class nsXULTemplateResultStorage : public nsIXULTemplateResult
++class nsXULTemplateResultStorage : public XPCOMGCFinalizedObject, public nsIXULTemplateResult
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/content/xul/templates/src/nsXULTemplateResultXML.h b/content/xul/templates/src/nsXULTemplateResultXML.h
+--- a/content/xul/templates/src/nsXULTemplateResultXML.h
++++ b/content/xul/templates/src/nsXULTemplateResultXML.h
+@@ -45,7 +45,7 @@
+ /**
+  * An single result of an query
+  */
+-class nsXULTemplateResultXML : public nsIXULTemplateResult
++class nsXULTemplateResultXML : public XPCOMGCFinalizedObject, public nsIXULTemplateResult
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/content/xul/templates/src/nsXULTreeBuilder.cpp b/content/xul/templates/src/nsXULTreeBuilder.cpp
+--- a/content/xul/templates/src/nsXULTreeBuilder.cpp
++++ b/content/xul/templates/src/nsXULTreeBuilder.cpp
+@@ -71,7 +71,8 @@
+  * A XUL template builder that serves as an tree view, allowing
+  * (pretty much) arbitrary RDF to be presented in an tree.
+  */
+-class nsXULTreeBuilder : public nsXULTemplateBuilder,
++class nsXULTreeBuilder : public XPCOMGCFinalizedObject,
++                         public nsXULTemplateBuilder,
+                          public nsIXULTreeBuilder,
+                          public nsINativeTreeView
+ {
+diff --git a/docshell/base/nsAboutRedirector.h b/docshell/base/nsAboutRedirector.h
+--- a/docshell/base/nsAboutRedirector.h
++++ b/docshell/base/nsAboutRedirector.h
+@@ -41,7 +41,7 @@
+ 
+ #include "nsIAboutModule.h"
+ 
+-class nsAboutRedirector : public nsIAboutModule
++class nsAboutRedirector : public XPCOMGCFinalizedObject, public nsIAboutModule
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/docshell/base/nsDSURIContentListener.h b/docshell/base/nsDSURIContentListener.h
+--- a/docshell/base/nsDSURIContentListener.h
++++ b/docshell/base/nsDSURIContentListener.h
+@@ -49,6 +49,7 @@ class nsIWebNavigationInfo;
+ class nsIWebNavigationInfo;
+ 
+ class nsDSURIContentListener :
++    public XPCOMGCFinalizedObject,
+     public nsIURIContentListener,
+     public nsSupportsWeakReference
+ 
+diff --git a/docshell/base/nsDefaultURIFixup.h b/docshell/base/nsDefaultURIFixup.h
+--- a/docshell/base/nsDefaultURIFixup.h
++++ b/docshell/base/nsDefaultURIFixup.h
+@@ -48,7 +48,7 @@
+ #include "nsCDefaultURIFixup.h"
+ 
+ /* Header file */
+-class nsDefaultURIFixup : public nsIURIFixup
++class nsDefaultURIFixup : public XPCOMGCFinalizedObject, public nsIURIFixup
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h
+--- a/docshell/base/nsDocShell.h
++++ b/docshell/base/nsDocShell.h
+@@ -123,7 +123,7 @@ enum ViewMode {
+ //***    nsRefreshTimer
+ //*****************************************************************************
+ 
+-class nsRefreshTimer : public nsITimerCallback
++class nsRefreshTimer : public XPCOMGCFinalizedObject, public nsITimerCallback
+ {
+ public:
+     nsRefreshTimer();
+@@ -143,7 +143,8 @@ protected:
+     virtual ~nsRefreshTimer();
+ };
+ 
+-class nsClassifierCallback : public nsIChannelClassifier
++class nsClassifierCallback : public XPCOMGCFinalizedObject
++                           , public nsIChannelClassifier
+                            , public nsIURIClassifierCallback
+                            , public nsIRunnable
+ {
+@@ -678,7 +679,7 @@ protected:
+     static nsIURIFixup *sURIFixup;
+ 
+ public:
+-    class InterfaceRequestorProxy : public nsIInterfaceRequestor {
++    class InterfaceRequestorProxy : public XPCOMGCFinalizedObject, public nsIInterfaceRequestor {
+     public:
+         InterfaceRequestorProxy(nsIInterfaceRequestor* p);
+         virtual ~InterfaceRequestorProxy();
+diff --git a/docshell/base/nsDocShellEnumerator.h b/docshell/base/nsDocShellEnumerator.h
+--- a/docshell/base/nsDocShellEnumerator.h
++++ b/docshell/base/nsDocShellEnumerator.h
+@@ -114,7 +114,7 @@ protected:
+ };
+ 
+ 
+-class nsDocShellForwardsEnumerator : public nsDocShellEnumerator
++class nsDocShellForwardsEnumerator : public XPCOMGCFinalizedObject, public nsDocShellEnumerator
+ {
+ public:
+ 
+@@ -129,7 +129,7 @@ protected:
+ 
+ };
+ 
+-class nsDocShellBackwardsEnumerator : public nsDocShellEnumerator
++class nsDocShellBackwardsEnumerator : public XPCOMGCFinalizedObject, public nsDocShellEnumerator
+ {
+ public:
+ 
+diff --git a/docshell/base/nsDocShellLoadInfo.h b/docshell/base/nsDocShellLoadInfo.h
+--- a/docshell/base/nsDocShellLoadInfo.h
++++ b/docshell/base/nsDocShellLoadInfo.h
+@@ -51,7 +51,7 @@
+ #include "nsIInputStream.h"
+ #include "nsISHEntry.h"
+ 
+-class nsDocShellLoadInfo : public nsIDocShellLoadInfo
++class nsDocShellLoadInfo : public XPCOMGCFinalizedObject, public nsIDocShellLoadInfo
+ {
+ public:
+   nsDocShellLoadInfo();
+diff --git a/docshell/base/nsDocShellTransferableHooks.h b/docshell/base/nsDocShellTransferableHooks.h
+--- a/docshell/base/nsDocShellTransferableHooks.h
++++ b/docshell/base/nsDocShellTransferableHooks.h
+@@ -47,7 +47,7 @@
+ #include "nsCOMArray.h"
+ 
+ 
+-class nsTransferableHookData : public nsIClipboardDragDropHookList
++class nsTransferableHookData : public XPCOMGCFinalizedObject, public nsIClipboardDragDropHookList
+ {
+ public:
+     nsTransferableHookData();
+diff --git a/docshell/base/nsDownloadHistory.h b/docshell/base/nsDownloadHistory.h
+--- a/docshell/base/nsDownloadHistory.h
++++ b/docshell/base/nsDownloadHistory.h
+@@ -46,7 +46,7 @@
+ #define NS_DOWNLOADHISTORY_CID \
+   {0x2ee83680, 0x2af0, 0x4bcb, {0xbf, 0xa0, 0xc9, 0x70, 0x5f, 0x65, 0x54, 0xf1}}
+ 
+-class nsDownloadHistory : public nsIDownloadHistory
++class nsDownloadHistory : public XPCOMGCFinalizedObject, public nsIDownloadHistory
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/docshell/base/nsGlobalHistory2Adapter.h b/docshell/base/nsGlobalHistory2Adapter.h
+--- a/docshell/base/nsGlobalHistory2Adapter.h
++++ b/docshell/base/nsGlobalHistory2Adapter.h
+@@ -49,7 +49,7 @@
+ #define NS_GLOBALHISTORY2ADAPTER_CID \
+  { 0xa772eee4, 0x0464, 0x405d, { 0xa3, 0x29, 0xa2, 0x9d, 0xfd, 0xa3, 0x79, 0x1a } }
+ 
+-class nsGlobalHistory2Adapter : public nsIGlobalHistory
++class nsGlobalHistory2Adapter : public XPCOMGCFinalizedObject, public nsIGlobalHistory
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/docshell/base/nsGlobalHistoryAdapter.h b/docshell/base/nsGlobalHistoryAdapter.h
+--- a/docshell/base/nsGlobalHistoryAdapter.h
++++ b/docshell/base/nsGlobalHistoryAdapter.h
+@@ -50,7 +50,7 @@
+ #define NS_GLOBALHISTORYADAPTER_CID \
+  { 0x2e9b69dd, 0x9087, 0x438c, { 0x8b, 0x5d, 0xf7, 0x7b, 0x55, 0x3a, 0xbe, 0xfb } }
+ 
+-class nsGlobalHistoryAdapter : public nsIGlobalHistory2
++class nsGlobalHistoryAdapter : public XPCOMGCFinalizedObject, public nsIGlobalHistory2
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/docshell/base/nsWebNavigationInfo.h b/docshell/base/nsWebNavigationInfo.h
+--- a/docshell/base/nsWebNavigationInfo.h
++++ b/docshell/base/nsWebNavigationInfo.h
+@@ -48,7 +48,7 @@
+ #define NS_WEBNAVIGATION_INFO_CID \
+  { 0xf30bc0a2, 0x958b, 0x4287,{0xbf, 0x62, 0xce, 0x38, 0xba, 0x0c, 0x81, 0x1e}}
+ 
+-class nsWebNavigationInfo : public nsIWebNavigationInfo
++class nsWebNavigationInfo : public XPCOMGCFinalizedObject, public nsIWebNavigationInfo
+ {
+ public:
+   nsWebNavigationInfo() {}
+diff --git a/docshell/base/nsWebShell.cpp b/docshell/base/nsWebShell.cpp
+--- a/docshell/base/nsWebShell.cpp
++++ b/docshell/base/nsWebShell.cpp
+@@ -319,7 +319,8 @@ IsSameHost(nsIURI *uri1, nsIURI *uri2)
+   return host1.Equals(host2);
+ }
+ 
+-class nsPingListener : public nsIStreamListener
++class nsPingListener : public XPCOMGCFinalizedObject
++                     , public nsIStreamListener
+                      , public nsIInterfaceRequestor
+                      , public nsIChannelEventSink
+ {
+diff --git a/docshell/base/nsWebShell.h b/docshell/base/nsWebShell.h
+--- a/docshell/base/nsWebShell.h
++++ b/docshell/base/nsWebShell.h
+@@ -63,7 +63,8 @@ typedef enum {
+ #define NS_WEB_SHELL_CID \
+  { 0xa6cf9059, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
+ 
+-class nsWebShell : public nsDocShell,
++class nsWebShell : public XPCOMGCFinalizedObject,
++                   public nsDocShell,
+                    public nsIWebShellServices,
+                    public nsILinkHandler,
+                    public nsIClipboardCommands
+diff --git a/docshell/shistory/src/nsSHEntry.h b/docshell/shistory/src/nsSHEntry.h
+--- a/docshell/shistory/src/nsSHEntry.h
++++ b/docshell/shistory/src/nsSHEntry.h
+@@ -62,7 +62,8 @@
+ #include "nsExpirationTracker.h"
+ #include "nsDocShellEditorData.h"
+ 
+-class nsSHEntry : public nsISHEntry,
++class nsSHEntry : public XPCOMGCFinalizedObject,
++                  public nsISHEntry,
+                   public nsISHContainer,
+                   public nsIMutationObserver
+ {
+diff --git a/docshell/shistory/src/nsSHTransaction.h b/docshell/shistory/src/nsSHTransaction.h
+--- a/docshell/shistory/src/nsSHTransaction.h
++++ b/docshell/shistory/src/nsSHTransaction.h
+@@ -47,7 +47,7 @@
+ #include "nsISHTransaction.h"
+ #include "nsISHEntry.h"
+ 
+-class nsSHTransaction: public nsISHTransaction
++class nsSHTransaction: public XPCOMGCFinalizedObject, public nsISHTransaction
+ {
+ public:
+ 	NS_DECL_ISUPPORTS
+diff --git a/docshell/shistory/src/nsSHistory.cpp b/docshell/shistory/src/nsSHistory.cpp
+--- a/docshell/shistory/src/nsSHistory.cpp
++++ b/docshell/shistory/src/nsSHistory.cpp
+@@ -88,7 +88,7 @@ enum HistCmd{
+ //***      nsSHistoryObserver
+ //*****************************************************************************
+ 
+-class nsSHistoryObserver : public nsIObserver
++class nsSHistoryObserver : public XPCOMGCFinalizedObject, public nsIObserver
+ {
+ 
+ public:
+diff --git a/docshell/shistory/src/nsSHistory.h b/docshell/shistory/src/nsSHistory.h
+--- a/docshell/shistory/src/nsSHistory.h
++++ b/docshell/shistory/src/nsSHistory.h
+@@ -60,7 +60,8 @@ class nsIDocShell;
+ class nsIDocShell;
+ class nsSHEnumerator;
+ class nsSHistoryObserver;
+-class nsSHistory: public nsISHistory,
++class nsSHistory: public XPCOMGCFinalizedObject,
++                  public nsISHistory,
+                   public nsISHistoryInternal,
+                   public nsIWebNavigation,
+                   public PRCList
+@@ -124,7 +125,7 @@ protected:
+ //*****************************************************************************
+ //***    nsSHEnumerator: Object Management
+ //*****************************************************************************
+-class nsSHEnumerator : public nsISimpleEnumerator
++class nsSHEnumerator : public XPCOMGCFinalizedObject, public nsISimpleEnumerator
+ {
+ public:
+ 
+diff --git a/dom/src/base/nsBarProps.h b/dom/src/base/nsBarProps.h
+--- a/dom/src/base/nsBarProps.h
++++ b/dom/src/base/nsBarProps.h
+@@ -72,7 +72,7 @@ protected:
+ };
+ 
+ // Script "menubar" object
+-class nsMenubarProp : public nsBarProp
++class nsMenubarProp : public XPCOMGCFinalizedObject, public nsBarProp
+ {
+ public:
+   nsMenubarProp();
+@@ -82,7 +82,7 @@ public:
+ };
+ 
+ // Script "toolbar" object
+-class nsToolbarProp : public nsBarProp
++class nsToolbarProp : public XPCOMGCFinalizedObject, public nsBarProp
+ {
+ public:
+   nsToolbarProp();
+@@ -92,7 +92,7 @@ public:
+ };
+ 
+ // Script "locationbar" object
+-class nsLocationbarProp : public nsBarProp
++class nsLocationbarProp : public XPCOMGCFinalizedObject, public nsBarProp
+ {
+ public:
+   nsLocationbarProp();
+@@ -102,7 +102,7 @@ public:
+ };
+ 
+ // Script "personalbar" object
+-class nsPersonalbarProp : public nsBarProp
++class nsPersonalbarProp : public XPCOMGCFinalizedObject, public nsBarProp
+ {
+ public:
+   nsPersonalbarProp();
+@@ -112,7 +112,7 @@ public:
+ };
+ 
+ // Script "statusbar" object
+-class nsStatusbarProp : public nsBarProp
++class nsStatusbarProp : public XPCOMGCFinalizedObject, public nsBarProp
+ {
+ public:
+   nsStatusbarProp();
+@@ -122,7 +122,7 @@ public:
+ };
+ 
+ // Script "scrollbars" object
+-class nsScrollbarsProp : public nsBarProp {
++class nsScrollbarsProp : public XPCOMGCFinalizedObject, public nsBarProp {
+ public:
+   nsScrollbarsProp(nsGlobalWindow *aWindow);
+   virtual ~nsScrollbarsProp();
+diff --git a/dom/src/base/nsDOMClassInfo.cpp b/dom/src/base/nsDOMClassInfo.cpp
+--- a/dom/src/base/nsDOMClassInfo.cpp
++++ b/dom/src/base/nsDOMClassInfo.cpp
+@@ -4967,7 +4967,7 @@ DefineInterfaceConstants(JSContext *cx, 
+   return NS_OK;
+ }
+ 
+-class nsDOMConstructor : public nsIDOMDOMConstructor
++class nsDOMConstructor : public XPCOMGCFinalizedObject, public nsIDOMDOMConstructor
+ {
+ protected:
+   nsDOMConstructor(const PRUnichar *aName,
+@@ -8924,7 +8924,7 @@ IsObjInProtoChain(JSContext *cx, JSObjec
+   return PR_FALSE;
+ }
+ 
+-class nsPluginProtoChainInstallRunner : public nsIRunnable
++class nsPluginProtoChainInstallRunner : public XPCOMGCFinalizedObject, public nsIRunnable
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/dom/src/base/nsDOMClassInfo.h b/dom/src/base/nsDOMClassInfo.h
+--- a/dom/src/base/nsDOMClassInfo.h
++++ b/dom/src/base/nsDOMClassInfo.h
+@@ -97,7 +97,8 @@ typedef unsigned long PtrBits;
+ #define IS_EXTERNAL(_ptr) (PtrBits(_ptr) & 0x1)
+ 
+ 
+-class nsDOMClassInfo : public nsIXPCScriptable,
++class nsDOMClassInfo : public XPCOMGCFinalizedObject,
++                       public nsIXPCScriptable,
+                        public nsIClassInfo
+ {
+ public:
+@@ -389,7 +390,7 @@ public:
+ 
+ // Window scriptable helper
+ 
+-class nsWindowSH : public nsEventReceiverSH
++class nsWindowSH : public XPCOMGCFinalizedObject, public nsEventReceiverSH
+ {
+ protected:
+   nsWindowSH(nsDOMClassInfoData* aData) : nsEventReceiverSH(aData)
+@@ -508,7 +509,7 @@ public:
+ // DOM Node helper, this class deals with setting the parent for the
+ // wrappers
+ 
+-class nsNodeSH : public nsEventReceiverSH
++class nsNodeSH : public XPCOMGCFinalizedObject, public nsEventReceiverSH
+ {
+ protected:
+   nsNodeSH(nsDOMClassInfoData* aData) : nsEventReceiverSH(aData)
+@@ -658,7 +659,7 @@ public:
+ 
+ // NamedNodeMap helper
+ 
+-class nsNamedNodeMapSH : public nsNamedArraySH
++class nsNamedNodeMapSH : public XPCOMGCFinalizedObject, public nsNamedArraySH
+ {
+ protected:
+   nsNamedNodeMapSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
+@@ -688,7 +689,7 @@ public:
+ 
+ // HTMLCollection helper
+ 
+-class nsHTMLCollectionSH : public nsNamedArraySH
++class nsHTMLCollectionSH : public XPCOMGCFinalizedObject, public nsNamedArraySH
+ {
+ protected:
+   nsHTMLCollectionSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
+@@ -1048,7 +1049,7 @@ public:
+ 
+ // Plugin helper
+ 
+-class nsPluginSH : public nsNamedArraySH
++class nsPluginSH : public XPCOMGCFinalizedObject, public nsNamedArraySH
+ {
+ protected:
+   nsPluginSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
+@@ -1078,7 +1079,7 @@ public:
+ 
+ // PluginArray helper
+ 
+-class nsPluginArraySH : public nsNamedArraySH
++class nsPluginArraySH : public XPCOMGCFinalizedObject, public nsNamedArraySH
+ {
+ protected:
+   nsPluginArraySH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
+@@ -1108,7 +1109,7 @@ public:
+ 
+ // MimeTypeArray helper
+ 
+-class nsMimeTypeArraySH : public nsNamedArraySH
++class nsMimeTypeArraySH : public XPCOMGCFinalizedObject, public nsNamedArraySH
+ {
+ protected:
+   nsMimeTypeArraySH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
+@@ -1160,7 +1161,7 @@ public:
+ 
+ // History helper
+ 
+-class nsHistorySH : public nsStringArraySH
++class nsHistorySH : public XPCOMGCFinalizedObject, public nsStringArraySH
+ {
+ protected:
+   nsHistorySH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
+@@ -1186,7 +1187,7 @@ public:
+ 
+ // StringList scriptable helper
+ 
+-class nsStringListSH : public nsStringArraySH
++class nsStringListSH : public XPCOMGCFinalizedObject, public nsStringArraySH
+ {
+ protected:
+   nsStringListSH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
+@@ -1212,7 +1213,7 @@ public:
+ 
+ // MediaList helper
+ 
+-class nsMediaListSH : public nsStringArraySH
++class nsMediaListSH : public XPCOMGCFinalizedObject, public nsStringArraySH
+ {
+ protected:
+   nsMediaListSH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
+@@ -1288,7 +1289,7 @@ public:
+ 
+ // CSSStyleDeclaration helper
+ 
+-class nsCSSStyleDeclSH : public nsStringArraySH
++class nsCSSStyleDeclSH : public XPCOMGCFinalizedObject, public nsStringArraySH
+ {
+ protected:
+   nsCSSStyleDeclSH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
+@@ -1364,7 +1365,7 @@ public:
+ #ifdef MOZ_XUL
+ // TreeColumns helper
+ 
+-class nsTreeColumnsSH : public nsNamedArraySH
++class nsTreeColumnsSH : public XPCOMGCFinalizedObject, public nsNamedArraySH
+ {
+ protected:
+   nsTreeColumnsSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
+@@ -1394,7 +1395,7 @@ public:
+ 
+ // WebApps Storage helpers
+ 
+-class nsStorageSH : public nsNamedArraySH
++class nsStorageSH : public XPCOMGCFinalizedObject, public nsNamedArraySH
+ {
+ protected:
+   nsStorageSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
+@@ -1427,7 +1428,7 @@ public:
+   }
+ };
+ 
+-class nsStorageListSH : public nsNamedArraySH
++class nsStorageListSH : public XPCOMGCFinalizedObject, public nsNamedArraySH
+ {
+ protected:
+   nsStorageListSH(nsDOMClassInfoData* aData) : nsNamedArraySH(aData)
+@@ -1457,7 +1458,7 @@ public:
+ // class will pass back nsIDOMEvent::currentTarget to be used as
+ // 'this'.
+ 
+-class nsEventListenerThisTranslator : public nsIXPCFunctionThisTranslator
++class nsEventListenerThisTranslator : public XPCOMGCFinalizedObject, public nsIXPCFunctionThisTranslator
+ {
+ public:
+   nsEventListenerThisTranslator()
+@@ -1542,7 +1543,7 @@ public:
+   }
+ };
+ 
+-class nsOfflineResourceListSH : public nsStringArraySH
++class nsOfflineResourceListSH : public XPCOMGCFinalizedObject, public nsStringArraySH
+ {
+ protected:
+   nsOfflineResourceListSH(nsDOMClassInfoData* aData) : nsStringArraySH(aData)
+diff --git a/dom/src/base/nsDOMException.h b/dom/src/base/nsDOMException.h
+--- a/dom/src/base/nsDOMException.h
++++ b/dom/src/base/nsDOMException.h
+@@ -41,7 +41,8 @@
+ #include "nsIBaseDOMException.h"
+ #include "nsIException.h"
+ 
+-class nsBaseDOMException : public nsIException,
++class nsBaseDOMException : public XPCOMGCFinalizedObject,
++                           public nsIException,
+                            public nsIBaseDOMException
+ {
+ public:
+diff --git a/dom/src/base/nsDOMScriptObjectFactory.h b/dom/src/base/nsDOMScriptObjectFactory.h
+--- a/dom/src/base/nsDOMScriptObjectFactory.h
++++ b/dom/src/base/nsDOMScriptObjectFactory.h
+@@ -56,7 +56,8 @@
+ #include "nsIScriptRuntime.h"
+ #include "nsIScriptGlobalObject.h" // for misplaced NS_STID_ macros.
+ 
+-class nsDOMScriptObjectFactory : public nsIDOMScriptObjectFactory,
++class nsDOMScriptObjectFactory : public XPCOMGCFinalizedObject,
++                                 public nsIDOMScriptObjectFactory,
+                                  public nsIObserver,
+                                  public nsIExceptionProvider
+ {
+diff --git a/dom/src/base/nsDOMWindowList.h b/dom/src/base/nsDOMWindowList.h
+--- a/dom/src/base/nsDOMWindowList.h
++++ b/dom/src/base/nsDOMWindowList.h
+@@ -46,7 +46,7 @@ class nsIDocShell;
+ class nsIDocShell;
+ class nsIDOMWindow;
+ 
+-class nsDOMWindowList : public nsIDOMWindowCollection
++class nsDOMWindowList : public XPCOMGCFinalizedObject, public nsIDOMWindowCollection
+ {
+ public:
+   nsDOMWindowList(nsIDocShell *aDocShell);
+diff --git a/dom/src/base/nsDOMWindowUtils.h b/dom/src/base/nsDOMWindowUtils.h
+--- a/dom/src/base/nsDOMWindowUtils.h
++++ b/dom/src/base/nsDOMWindowUtils.h
+@@ -42,7 +42,8 @@
+ 
+ class nsGlobalWindow;
+ 
+-class nsDOMWindowUtils : public nsIDOMWindowUtils,
++class nsDOMWindowUtils : public XPCOMGCFinalizedObject,
++                         public nsIDOMWindowUtils,
+                          public nsSupportsWeakReference
+ {
+ public:
+diff --git a/dom/src/base/nsFocusController.h b/dom/src/base/nsFocusController.h
+--- a/dom/src/base/nsFocusController.h
++++ b/dom/src/base/nsFocusController.h
+@@ -55,7 +55,8 @@ class nsIController;
+ class nsIController;
+ class nsIControllers;
+ 
+-class nsFocusController : public nsIFocusController, 
++class nsFocusController : public XPCOMGCFinalizedObject, 
++                          public nsIFocusController, 
+                           public nsIDOMFocusListener,
+                           public nsSupportsWeakReference
+ {
+diff --git a/dom/src/base/nsGlobalWindow.cpp b/dom/src/base/nsGlobalWindow.cpp
+--- a/dom/src/base/nsGlobalWindow.cpp
++++ b/dom/src/base/nsGlobalWindow.cpp
+@@ -540,7 +540,7 @@ nsDummyJavaPluginOwner::GetValue(nsPlugi
+  * An indirect observer object that means we don't have to implement nsIObserver
+  * on nsGlobalWindow, where any script could see it.
+  */
+-class nsGlobalWindowObserver : public nsIObserver {
++class nsGlobalWindowObserver : public XPCOMGCFinalizedObject, public nsIObserver {
+ public:
+   nsGlobalWindowObserver(nsGlobalWindow* aWindow) : mWindow(aWindow) {}
+   NS_DECL_ISUPPORTS
+@@ -1208,7 +1208,7 @@ nsGlobalWindow::GetPopupControlState() c
+ #define WINDOWSTATEHOLDER_IID \
+ {0x0b917c3e, 0xbd50, 0x4683, {0xaf, 0xc9, 0xc7, 0x81, 0x07, 0xae, 0x33, 0x26}}
+ 
+-class WindowStateHolder : public nsISupports
++class WindowStateHolder : public XPCOMGCFinalizedObject, public nsISupports
+ {
+ public:
+   NS_DECLARE_STATIC_IID_ACCESSOR(WINDOWSTATEHOLDER_IID)
+diff --git a/dom/src/base/nsGlobalWindow.h b/dom/src/base/nsGlobalWindow.h
+--- a/dom/src/base/nsGlobalWindow.h
++++ b/dom/src/base/nsGlobalWindow.h
+@@ -221,7 +221,8 @@ private:
+ // belonging to the same outer window, but that's an unimportant
+ // side effect of inheriting PRCList).
+ 
+-class nsGlobalWindow : public nsPIDOMWindow,
++class nsGlobalWindow : public XPCOMGCFinalizedObject,
++                       public nsPIDOMWindow,
+                        public nsIScriptGlobalObject,
+                        public nsIDOMJSWindow,
+                        public nsIScriptObjectPrincipal,
+@@ -803,7 +804,8 @@ protected:
+ // nsNavigator: Script "navigator" object
+ //*****************************************************************************
+ 
+-class nsNavigator : public nsIDOMNavigator,
++class nsNavigator : public XPCOMGCFinalizedObject,
++                    public nsIDOMNavigator,
+                     public nsIDOMJSNavigator,
+                     public nsIDOMClientInformation
+ {
+@@ -839,7 +841,8 @@ class nsIURI;
+ // nsLocation: Script "location" object
+ //*****************************************************************************
+ 
+-class nsLocation : public nsIDOMLocation,
++class nsLocation : public XPCOMGCFinalizedObject,
++                   public nsIDOMLocation,
+                    public nsIDOMNSLocation
+ {
+ public:
+diff --git a/dom/src/base/nsGlobalWindowCommands.cpp b/dom/src/base/nsGlobalWindowCommands.cpp
+--- a/dom/src/base/nsGlobalWindowCommands.cpp
++++ b/dom/src/base/nsGlobalWindowCommands.cpp
+@@ -129,7 +129,7 @@ protected:
+ };
+ 
+ // this class implements commands whose behavior depends on the 'browse with caret' setting
+-class nsSelectMoveScrollCommand : public nsSelectionCommandsBase
++class nsSelectMoveScrollCommand : public XPCOMGCFinalizedObject, public nsSelectionCommandsBase
+ {
+ protected:
+ 
+@@ -142,7 +142,7 @@ protected:
+ };
+ 
+ // this class implements other selection commands
+-class nsSelectCommand : public nsSelectionCommandsBase
++class nsSelectCommand : public XPCOMGCFinalizedObject, public nsSelectionCommandsBase
+ {
+ protected:
+ 
+@@ -808,7 +808,7 @@ nsGoBackCommand::DoWebNavCommand(const c
+ 
+ ----------------------------------------------------------------------------*/
+ 
+-class nsClipboardDragDropHookCommand : public nsIControllerCommand
++class nsClipboardDragDropHookCommand : public XPCOMGCFinalizedObject, public nsIControllerCommand
+ {
+ public:
+ 
+diff --git a/dom/src/base/nsHistory.h b/dom/src/base/nsHistory.h
+--- a/dom/src/base/nsHistory.h
++++ b/dom/src/base/nsHistory.h
+@@ -47,7 +47,8 @@ class nsIDocShell;
+ class nsIDocShell;
+ 
+ // Script "History" object
+-class nsHistory : public nsIDOMHistory,
++class nsHistory : public XPCOMGCFinalizedObject,
++                  public nsIDOMHistory,
+                   public nsIDOMNSHistory
+ {
+ public:
+diff --git a/dom/src/base/nsJSEnvironment.cpp b/dom/src/base/nsJSEnvironment.cpp
+--- a/dom/src/base/nsJSEnvironment.cpp
++++ b/dom/src/base/nsJSEnvironment.cpp
+@@ -229,7 +229,7 @@ static nsIUnicodeDecoder *gDecoder;
+ // When moving from active state to inactive, nsJSContext::CC() is called
+ // unless the timer related to page load is active.
+ 
+-class nsUserActivityObserver : public nsIObserver
++class nsUserActivityObserver : public XPCOMGCFinalizedObject, public nsIObserver
+ {
+ public:
+   nsUserActivityObserver()
+@@ -287,7 +287,7 @@ nsUserActivityObserver::Observe(nsISuppo
+ // nsCCMemoryPressureObserver observes the memory-pressure notifications
+ // and forces a cycle collection when it happens.
+ 
+-class nsCCMemoryPressureObserver : public nsIObserver
++class nsCCMemoryPressureObserver : public XPCOMGCFinalizedObject, public nsIObserver
+ {
+ public:
+   NS_DECL_ISUPPORTS
+@@ -3779,7 +3779,7 @@ nsresult NS_CreateJSRuntime(nsIScriptRun
+ // to/from nsISupports.
+ // When consumed by non-JS (eg, another script language), conversion is done
+ // on-the-fly.
+-class nsJSArgArray : public nsIJSArgArray, public nsIArray {
++class nsJSArgArray : public XPCOMGCFinalizedObject, public nsIJSArgArray, public nsIArray {
+ public:
+   nsJSArgArray(JSContext *aContext, PRUint32 argc, jsval *argv, nsresult *prv);
+   ~nsJSArgArray();
+diff --git a/dom/src/base/nsJSEnvironment.h b/dom/src/base/nsJSEnvironment.h
+--- a/dom/src/base/nsJSEnvironment.h
++++ b/dom/src/base/nsJSEnvironment.h
+@@ -50,7 +50,8 @@
+ 
+ class nsIXPConnectJSObjectHolder;
+ 
+-class nsJSContext : public nsIScriptContext,
++class nsJSContext : public XPCOMGCFinalizedObject,
++                    public nsIScriptContext,
+                     public nsIXPCScriptNotify,
+                     public nsITimerCallback
+ {
+@@ -287,7 +288,7 @@ private:
+ 
+ class nsIJSRuntimeService;
+ 
+-class nsJSRuntime : public nsIScriptRuntime
++class nsJSRuntime : public XPCOMGCFinalizedObject, public nsIScriptRuntime
+ {
+ public:
+   // let people who can see us use our runtime for convenience.
+diff --git a/dom/src/base/nsJSTimeoutHandler.cpp b/dom/src/base/nsJSTimeoutHandler.cpp
+--- a/dom/src/base/nsJSTimeoutHandler.cpp
++++ b/dom/src/base/nsJSTimeoutHandler.cpp
+@@ -55,7 +55,7 @@ static const char kSetTimeoutStr[] = "se
+ static const char kSetTimeoutStr[] = "setTimeout";
+ 
+ // Our JS nsIScriptTimeoutHandler implementation.
+-class nsJSScriptTimeoutHandler: public nsIScriptTimeoutHandler
++class nsJSScriptTimeoutHandler: public XPCOMGCFinalizedObject, public nsIScriptTimeoutHandler
+ {
+ public:
+   // nsISupports
+diff --git a/dom/src/base/nsMimeTypeArray.h b/dom/src/base/nsMimeTypeArray.h
+--- a/dom/src/base/nsMimeTypeArray.h
++++ b/dom/src/base/nsMimeTypeArray.h
+@@ -45,7 +45,7 @@
+ 
+ class nsIDOMNavigator;
+ 
+-class nsMimeTypeArray : public nsIDOMMimeTypeArray
++class nsMimeTypeArray : public XPCOMGCFinalizedObject, public nsIDOMMimeTypeArray
+ {
+ public:
+   nsMimeTypeArray(nsIDOMNavigator* navigator);
+@@ -66,7 +66,7 @@ protected:
+   nsIDOMMimeType** mMimeTypeArray;
+ };
+ 
+-class nsMimeType : public nsIDOMMimeType
++class nsMimeType : public XPCOMGCFinalizedObject, public nsIDOMMimeType
+ {
+ public:
+   nsMimeType(nsIDOMPlugin* aPlugin, nsIDOMMimeType* aMimeType);
+@@ -80,7 +80,7 @@ protected:
+   nsCOMPtr<nsIDOMMimeType> mMimeType;
+ };
+ 
+-class nsHelperMimeType : public nsIDOMMimeType
++class nsHelperMimeType : public XPCOMGCFinalizedObject, public nsIDOMMimeType
+ {
+ public:
+   nsHelperMimeType(const nsAString& aType)
+diff --git a/dom/src/base/nsPluginArray.h b/dom/src/base/nsPluginArray.h
+--- a/dom/src/base/nsPluginArray.h
++++ b/dom/src/base/nsPluginArray.h
+@@ -47,7 +47,8 @@ class nsIDocShell;
+ class nsIDocShell;
+ class nsIPluginHost;
+ 
+-class nsPluginArray : public nsIDOMPluginArray,
++class nsPluginArray : public XPCOMGCFinalizedObject,
++                      public nsIDOMPluginArray,
+                       public nsIDOMJSPluginArray
+ {
+ public:
+@@ -79,7 +80,7 @@ protected:
+   nsIDocShell* mDocShell; // weak reference
+ };
+ 
+-class nsPluginElement : public nsIDOMPlugin
++class nsPluginElement : public XPCOMGCFinalizedObject, public nsIDOMPlugin
+ {
+ public:
+   nsPluginElement(nsIDOMPlugin* plugin);
+diff --git a/dom/src/base/nsScreen.h b/dom/src/base/nsScreen.h
+--- a/dom/src/base/nsScreen.h
++++ b/dom/src/base/nsScreen.h
+@@ -47,7 +47,7 @@ struct nsRect;
+ struct nsRect;
+ 
+ // Script "screen" object
+-class nsScreen : public nsIDOMScreen
++class nsScreen : public XPCOMGCFinalizedObject, public nsIDOMScreen
+ {
+ public:
+   nsScreen(nsIDocShell* aDocShell);
+diff --git a/dom/src/base/nsWindowRoot.h b/dom/src/base/nsWindowRoot.h
+--- a/dom/src/base/nsWindowRoot.h
++++ b/dom/src/base/nsWindowRoot.h
+@@ -56,7 +56,8 @@ class nsEventChainPostVisitor;
+ #include "nsIDOMEventTarget.h"
+ #include "nsCycleCollectionParticipant.h"
+ 
+-class nsWindowRoot : public nsIDOMEventTarget,
++class nsWindowRoot : public XPCOMGCFinalizedObject,
++                     public nsIDOMEventTarget,
+                      public nsIDOM3EventTarget,
+                      public nsIDOMNSEventTarget,
+                      public nsPIWindowRoot
+diff --git a/dom/src/events/nsJSEventListener.h b/dom/src/events/nsJSEventListener.h
+--- a/dom/src/events/nsJSEventListener.h
++++ b/dom/src/events/nsJSEventListener.h
+@@ -49,7 +49,8 @@
+ 
+ // nsJSEventListener interface
+ // misnamed - JS no longer has exclusive rights over this interface!
+-class nsJSEventListener : public nsIDOMEventListener,
++class nsJSEventListener : public XPCOMGCFinalizedObject,
++                          public nsIDOMEventListener,
+                           public nsIJSEventListener
+ {
+ public:
+diff --git a/dom/src/json/nsJSON.h b/dom/src/json/nsJSON.h
+--- a/dom/src/json/nsJSON.h
++++ b/dom/src/json/nsJSON.h
+@@ -79,7 +79,7 @@ protected:
+   nsCOMPtr<nsIUnicodeEncoder> mEncoder;
+ };
+ 
+-class nsJSON : public nsIJSON
++class nsJSON : public XPCOMGCFinalizedObject, public nsIJSON
+ {
+ public:
+   nsJSON();
+@@ -130,7 +130,7 @@ class nsJSONObjectStack : public nsTArra
+ {
+ };
+ 
+-class nsJSONListener : public nsIStreamListener
++class nsJSONListener : public XPCOMGCFinalizedObject, public nsIStreamListener
+ {
+ public:
+   nsJSONListener(JSContext *cx, jsval *rootVal, PRBool needsConverter);
+diff --git a/dom/src/jsurl/nsJSProtocolHandler.cpp b/dom/src/jsurl/nsJSProtocolHandler.cpp
+--- a/dom/src/jsurl/nsJSProtocolHandler.cpp
++++ b/dom/src/jsurl/nsJSProtocolHandler.cpp
+@@ -76,7 +76,7 @@
+ #include "nsIScriptChannel.h"
+ #include "nsIDocument.h"
+ 
+-class nsJSThunk : public nsIInputStream
++class nsJSThunk : public XPCOMGCFinalizedObject, public nsIInputStream
+ {
+ public:
+     nsJSThunk();
+@@ -380,7 +380,8 @@ nsresult nsJSThunk::EvaluateScript(nsICh
+ 
+ ////////////////////////////////////////////////////////////////////////////////
+ 
+-class nsJSChannel : public nsIChannel,
++class nsJSChannel : public XPCOMGCFinalizedObject,
++                    public nsIChannel,
+                     public nsIStreamListener,
+                     public nsIScriptChannel
+ {
+diff --git a/dom/src/jsurl/nsJSProtocolHandler.h b/dom/src/jsurl/nsJSProtocolHandler.h
+--- a/dom/src/jsurl/nsJSProtocolHandler.h
++++ b/dom/src/jsurl/nsJSProtocolHandler.h
+@@ -53,7 +53,7 @@
+     NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "javascript"
+ 
+ 
+-class nsJSProtocolHandler : public nsIProtocolHandler
++class nsJSProtocolHandler : public XPCOMGCFinalizedObject, public nsIProtocolHandler
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/dom/src/offline/nsDOMOfflineResourceList.h b/dom/src/offline/nsDOMOfflineResourceList.h
+--- a/dom/src/offline/nsDOMOfflineResourceList.h
++++ b/dom/src/offline/nsDOMOfflineResourceList.h
+@@ -58,7 +58,8 @@
+ 
+ class nsIDOMWindow;
+ 
+-class nsDOMOfflineResourceList : public nsIDOMOfflineResourceList,
++class nsDOMOfflineResourceList : public XPCOMGCFinalizedObject,
++                                 public nsIDOMOfflineResourceList,
+                                  public nsIObserver,
+                                  public nsIOfflineCacheUpdateObserver,
+                                  public nsIDOMEventTarget,
+diff --git a/dom/src/storage/nsDOMStorage.h b/dom/src/storage/nsDOMStorage.h
+--- a/dom/src/storage/nsDOMStorage.h
++++ b/dom/src/storage/nsDOMStorage.h
+@@ -82,7 +82,8 @@ public:
+   nsRefPtr<nsDOMStorageItem> mItem;
+ };
+ 
+-class nsDOMStorageManager : public nsIDOMStorageManager
++class nsDOMStorageManager : public XPCOMGCFinalizedObject
++                          , public nsIDOMStorageManager
+                           , public nsIObserver
+ {
+ public:
+@@ -111,7 +112,8 @@ protected:
+   nsTHashtable<nsDOMStorageEntry> mStorages;
+ };
+ 
+-class nsDOMStorage : public nsIDOMStorage,
++class nsDOMStorage : public XPCOMGCFinalizedObject,
++                     public nsIDOMStorage,
+                      public nsPIDOMStorage
+ {
+ public:
+@@ -201,7 +203,7 @@ protected:
+ #endif
+ };
+ 
+-class nsDOMStorageList : public nsIDOMStorageList
++class nsDOMStorageList : public XPCOMGCFinalizedObject, public nsIDOMStorageList
+ {
+ public:
+   nsDOMStorageList()
+@@ -253,7 +255,8 @@ protected:
+   nsInterfaceHashtable<nsStringHashKey, nsIDOMStorage> mStorages;
+ };
+ 
+-class nsDOMStorageItem : public nsIDOMStorageItem,
++class nsDOMStorageItem : public XPCOMGCFinalizedObject,
++                         public nsIDOMStorageItem,
+                          public nsIDOMToString
+ {
+ public:
+diff --git a/editor/composer/src/nsComposeTxtSrvFilter.h b/editor/composer/src/nsComposeTxtSrvFilter.h
+--- a/editor/composer/src/nsComposeTxtSrvFilter.h
++++ b/editor/composer/src/nsComposeTxtSrvFilter.h
+@@ -48,7 +48,7 @@
+  * This filter is used to skip over various form control nodes and
+  * mail's cite nodes
+  */
+-class nsComposeTxtSrvFilter : public nsITextServicesFilter
++class nsComposeTxtSrvFilter : public XPCOMGCFinalizedObject, public nsITextServicesFilter
+ {
+ public:
+   nsComposeTxtSrvFilter();
+diff --git a/editor/composer/src/nsComposerCommands.h b/editor/composer/src/nsComposerCommands.h
+--- a/editor/composer/src/nsComposerCommands.h
++++ b/editor/composer/src/nsComposerCommands.h
+@@ -107,7 +107,7 @@ protected:
+ 
+ // Shared class for the various style updating commands like bold, italics etc.
+ // Suitable for commands whose state is either 'on' or 'off'.
+-class nsStyleUpdatingCommand : public nsBaseStateUpdatingCommand
++class nsStyleUpdatingCommand : public XPCOMGCFinalizedObject, public nsBaseStateUpdatingCommand
+ {
+ public:
+ 
+@@ -124,7 +124,7 @@ protected:
+ };
+ 
+ 
+-class nsInsertTagCommand : public nsBaseComposerCommand
++class nsInsertTagCommand : public XPCOMGCFinalizedObject, public nsBaseComposerCommand
+ {
+ public:
+ 
+@@ -141,7 +141,7 @@ protected:
+ };
+ 
+ 
+-class nsListCommand : public nsBaseStateUpdatingCommand
++class nsListCommand : public XPCOMGCFinalizedObject, public nsBaseStateUpdatingCommand
+ {
+ public:
+ 
+@@ -156,7 +156,7 @@ protected:
+   virtual nsresult  ToggleState(nsIEditor *aEditor, const char* aTagName);
+ };
+ 
+-class nsListItemCommand : public nsBaseStateUpdatingCommand
++class nsListItemCommand : public XPCOMGCFinalizedObject, public nsBaseStateUpdatingCommand
+ {
+ public:
+ 
+@@ -190,7 +190,7 @@ protected:
+ };
+ 
+ 
+-class nsParagraphStateCommand : public nsMultiStateCommand
++class nsParagraphStateCommand : public XPCOMGCFinalizedObject, public nsMultiStateCommand
+ {
+ public:
+                    nsParagraphStateCommand();
+@@ -201,7 +201,7 @@ protected:
+   virtual nsresult SetState(nsIEditor *aEditor, nsString& newState);
+ };
+ 
+-class nsFontFaceStateCommand : public nsMultiStateCommand
++class nsFontFaceStateCommand : public XPCOMGCFinalizedObject, public nsMultiStateCommand
+ {
+ public:
+                    nsFontFaceStateCommand();
+@@ -212,7 +212,7 @@ protected:
+   virtual nsresult SetState(nsIEditor *aEditor, nsString& newState);
+ };
+ 
+-class nsFontSizeStateCommand : public nsMultiStateCommand
++class nsFontSizeStateCommand : public XPCOMGCFinalizedObject, public nsMultiStateCommand
+ {
+ public:
+                    nsFontSizeStateCommand();
+@@ -224,7 +224,7 @@ protected:
+   virtual nsresult SetState(nsIEditor *aEditor, nsString& newState);
+ };
+ 
+-class nsHighlightColorStateCommand : public nsMultiStateCommand
++class nsHighlightColorStateCommand : public XPCOMGCFinalizedObject, public nsMultiStateCommand
+ {
+ public:
+                    nsHighlightColorStateCommand();
+@@ -237,7 +237,7 @@ protected:
+ 
+ };
+ 
+-class nsFontColorStateCommand : public nsMultiStateCommand
++class nsFontColorStateCommand : public XPCOMGCFinalizedObject, public nsMultiStateCommand
+ {
+ public:
+                    nsFontColorStateCommand();
+@@ -248,7 +248,7 @@ protected:
+   virtual nsresult SetState(nsIEditor *aEditor, nsString& newState);
+ };
+ 
+-class nsAlignCommand : public nsMultiStateCommand
++class nsAlignCommand : public XPCOMGCFinalizedObject, public nsMultiStateCommand
+ {
+ public:
+                    nsAlignCommand();
+@@ -259,7 +259,7 @@ protected:
+   virtual nsresult SetState(nsIEditor *aEditor, nsString& newState);
+ };
+ 
+-class nsBackgroundColorStateCommand : public nsMultiStateCommand
++class nsBackgroundColorStateCommand : public XPCOMGCFinalizedObject, public nsMultiStateCommand
+ {
+ public:
+                    nsBackgroundColorStateCommand();
+@@ -270,7 +270,7 @@ protected:
+   virtual nsresult SetState(nsIEditor *aEditor, nsString& newState);
+ };
+ 
+-class nsAbsolutePositioningCommand : public nsBaseStateUpdatingCommand
++class nsAbsolutePositioningCommand : public XPCOMGCFinalizedObject, public nsBaseStateUpdatingCommand
+ {
+ public:
+                    nsAbsolutePositioningCommand();
+diff --git a/editor/composer/src/nsComposerCommandsUpdater.h b/editor/composer/src/nsComposerCommandsUpdater.h
+--- a/editor/composer/src/nsComposerCommandsUpdater.h
++++ b/editor/composer/src/nsComposerCommandsUpdater.h
+@@ -57,7 +57,8 @@ class nsIDocShell;
+ class nsIDocShell;
+ class nsITransactionManager;
+ 
+-class nsComposerCommandsUpdater : public nsISelectionListener,
++class nsComposerCommandsUpdater : public XPCOMGCFinalizedObject,
++                                  public nsISelectionListener,
+                                   public nsIDocumentStateListener,
+                                   public nsITransactionListener,
+                                   public nsITimerCallback
+diff --git a/editor/composer/src/nsEditingSession.h b/editor/composer/src/nsEditingSession.h
+--- a/editor/composer/src/nsEditingSession.h
++++ b/editor/composer/src/nsEditingSession.h
+@@ -70,7 +70,8 @@ class nsIControllers;
+ 
+ class nsComposerCommandsUpdater;
+ 
+-class nsEditingSession : public nsIEditingSession,
++class nsEditingSession : public XPCOMGCFinalizedObject,
++                         public nsIEditingSession,
+                          public nsIWebProgressListener,
+                          public nsSupportsWeakReference
+ {
+diff --git a/editor/composer/src/nsEditorSpellCheck.h b/editor/composer/src/nsEditorSpellCheck.h
+--- a/editor/composer/src/nsEditorSpellCheck.h
++++ b/editor/composer/src/nsEditorSpellCheck.h
+@@ -52,7 +52,7 @@
+     { 0x93, 0x9a, 0xec, 0x63, 0x51, 0xee, 0xa0, 0xcc }\
+ }
+ 
+-class nsEditorSpellCheck : public nsIEditorSpellCheck
++class nsEditorSpellCheck : public XPCOMGCFinalizedObject, public nsIEditorSpellCheck
+ {
+ public:
+   nsEditorSpellCheck();
+diff --git a/editor/libeditor/base/ChangeAttributeTxn.h b/editor/libeditor/base/ChangeAttributeTxn.h
+--- a/editor/libeditor/base/ChangeAttributeTxn.h
++++ b/editor/libeditor/base/ChangeAttributeTxn.h
+@@ -52,7 +52,7 @@ 0x97818860, 0xac48, 0x11d2, \
+  * A transaction that changes an attribute of a content node. 
+  * This transaction covers add, remove, and change attribute.
+  */
+-class ChangeAttributeTxn : public EditTxn
++class ChangeAttributeTxn : public XPCOMGCFinalizedObject, public EditTxn
+ {
+ public:
+ 
+diff --git a/editor/libeditor/base/ChangeCSSInlineStyleTxn.h b/editor/libeditor/base/ChangeCSSInlineStyleTxn.h
+--- a/editor/libeditor/base/ChangeCSSInlineStyleTxn.h
++++ b/editor/libeditor/base/ChangeCSSInlineStyleTxn.h
+@@ -53,7 +53,7 @@ 0xa2185c9e, 0x1dd1, 0x11b2, \
+  * A transaction that changes the value of a CSS inline style of a content node. 
+  * This transaction covers add, remove, and change a property's value.
+  */
+-class ChangeCSSInlineStyleTxn : public EditTxn
++class ChangeCSSInlineStyleTxn : public XPCOMGCFinalizedObject, public EditTxn
+ {
+ public:
+ 
+diff --git a/editor/libeditor/base/CreateElementTxn.h b/editor/libeditor/base/CreateElementTxn.h
+--- a/editor/libeditor/base/CreateElementTxn.h
++++ b/editor/libeditor/base/CreateElementTxn.h
+@@ -51,7 +51,7 @@ 0x7a6393c0, 0xac48, 0x11d2, \
+ /**
+  * A transaction that creates a new node in the content tree.
+  */
+-class CreateElementTxn : public EditTxn
++class CreateElementTxn : public XPCOMGCFinalizedObject, public EditTxn
+ {
+ public:
+ 
+diff --git a/editor/libeditor/base/DeleteElementTxn.h b/editor/libeditor/base/DeleteElementTxn.h
+--- a/editor/libeditor/base/DeleteElementTxn.h
++++ b/editor/libeditor/base/DeleteElementTxn.h
+@@ -54,7 +54,7 @@ class nsRangeUpdater;
+ /**
+  * A transaction that deletes a single element
+  */
+-class DeleteElementTxn : public EditTxn
++class DeleteElementTxn : public XPCOMGCFinalizedObject, public EditTxn
+ {
+ public:
+ 
+diff --git a/editor/libeditor/base/DeleteTextTxn.h b/editor/libeditor/base/DeleteTextTxn.h
+--- a/editor/libeditor/base/DeleteTextTxn.h
++++ b/editor/libeditor/base/DeleteTextTxn.h
+@@ -53,7 +53,7 @@ class nsRangeUpdater;
+ /**
+  * A transaction that removes text from a content node. 
+  */
+-class DeleteTextTxn : public EditTxn
++class DeleteTextTxn : public XPCOMGCFinalizedObject, public EditTxn
+ {
+ public:
+ 
+diff --git a/editor/libeditor/base/EditAggregateTxn.h b/editor/libeditor/base/EditAggregateTxn.h
+--- a/editor/libeditor/base/EditAggregateTxn.h
++++ b/editor/libeditor/base/EditAggregateTxn.h
+@@ -53,7 +53,7 @@ 0x345921a0, 0xac49, 0x11d2, \
+  * base class for all document editing transactions that require aggregation.
+  * provides a list of child transactions.
+  */
+-class EditAggregateTxn : public EditTxn
++class EditAggregateTxn : public XPCOMGCFinalizedObject, public EditTxn
+ {
+ public:
+   NS_IMETHOD QueryInterface(REFNSIID aIID, void **aInstancePtr);
+diff --git a/editor/libeditor/base/IMETextTxn.h b/editor/libeditor/base/IMETextTxn.h
+--- a/editor/libeditor/base/IMETextTxn.h
++++ b/editor/libeditor/base/IMETextTxn.h
+@@ -58,7 +58,7 @@ class nsIPresShell;
+ /**
+   * A transaction that inserts text into a content node. 
+   */
+-class IMETextTxn : public EditTxn
++class IMETextTxn : public XPCOMGCFinalizedObject, public EditTxn
+ {
+ public:
+   static const nsIID& GetCID() { static const nsIID iid = IME_TEXT_TXN_CID; return iid; }
+diff --git a/editor/libeditor/base/InsertElementTxn.h b/editor/libeditor/base/InsertElementTxn.h
+--- a/editor/libeditor/base/InsertElementTxn.h
++++ b/editor/libeditor/base/InsertElementTxn.h
+@@ -51,7 +51,7 @@ 0xb5762440, 0xcbb0, 0x11d2, \
+ /**
+  * A transaction that inserts a single element
+  */
+-class InsertElementTxn : public EditTxn
++class InsertElementTxn : public XPCOMGCFinalizedObject, public EditTxn
+ {
+ public:
+ 
+diff --git a/editor/libeditor/base/InsertTextTxn.h b/editor/libeditor/base/InsertTextTxn.h
+--- a/editor/libeditor/base/InsertTextTxn.h
++++ b/editor/libeditor/base/InsertTextTxn.h
+@@ -51,7 +51,7 @@ 0x93276f00, 0xab2c, 0x11d2, \
+ /**
+   * A transaction that inserts text into a content node. 
+   */
+-class InsertTextTxn : public EditTxn
++class InsertTextTxn : public XPCOMGCFinalizedObject, public EditTxn
+ {
+ public:
+ 
+diff --git a/editor/libeditor/base/JoinElementTxn.h b/editor/libeditor/base/JoinElementTxn.h
+--- a/editor/libeditor/base/JoinElementTxn.h
++++ b/editor/libeditor/base/JoinElementTxn.h
+@@ -57,7 +57,7 @@ class nsEditor;
+  * After DoTransaction() and RedoTransaction(), E1 is removed from the content
+  * tree and E2 remains.
+  */
+-class JoinElementTxn : public EditTxn
++class JoinElementTxn : public XPCOMGCFinalizedObject, public EditTxn
+ {
+ public:
+ 
+diff --git a/editor/libeditor/base/SetDocTitleTxn.h b/editor/libeditor/base/SetDocTitleTxn.h
+--- a/editor/libeditor/base/SetDocTitleTxn.h
++++ b/editor/libeditor/base/SetDocTitleTxn.h
+@@ -54,7 +54,7 @@ 0x7fc508b5, 0xed8f, 0x11d4, \
+  *  which is a text node under the <title> tag in a page's <head> section
+  * provides default concrete behavior for all nsITransaction methods.
+  */
+-class SetDocTitleTxn : public EditTxn
++class SetDocTitleTxn : public XPCOMGCFinalizedObject, public EditTxn
+ {
+ public:
+ 
+diff --git a/editor/libeditor/base/SplitElementTxn.h b/editor/libeditor/base/SplitElementTxn.h
+--- a/editor/libeditor/base/SplitElementTxn.h
++++ b/editor/libeditor/base/SplitElementTxn.h
+@@ -54,7 +54,7 @@ class nsEditor;
+  * A transaction that splits an element E into two identical nodes, E1 and E2
+  * with the children of E divided between E1 and E2.
+  */
+-class SplitElementTxn : public EditTxn
++class SplitElementTxn : public XPCOMGCFinalizedObject, public EditTxn
+ {
+ public:
+ 
+diff --git a/editor/libeditor/base/nsStyleSheetTxns.h b/editor/libeditor/base/nsStyleSheetTxns.h
+--- a/editor/libeditor/base/nsStyleSheetTxns.h
++++ b/editor/libeditor/base/nsStyleSheetTxns.h
+@@ -52,7 +52,7 @@ 0xd05e2981, 0x2fbe, 0x11d3, { 0x9c, 0xe4
+ 0xd05e2981, 0x2fbe, 0x11d3, { 0x9c, 0xe4, 0xe8, 0x39, 0x38, 0x35, 0x30, 0x7c } }
+ 
+ 
+-class AddStyleSheetTxn : public EditTxn
++class AddStyleSheetTxn : public XPCOMGCFinalizedObject, public EditTxn
+ {
+   friend class TransactionFactory;
+ 
+@@ -81,7 +81,7 @@ protected:
+ };
+ 
+ 
+-class RemoveStyleSheetTxn : public EditTxn
++class RemoveStyleSheetTxn : public XPCOMGCFinalizedObject, public EditTxn
+ {
+   friend class TransactionFactory;
+ 
+diff --git a/editor/libeditor/html/TypeInState.h b/editor/libeditor/html/TypeInState.h
+--- a/editor/libeditor/html/TypeInState.h
++++ b/editor/libeditor/html/TypeInState.h
+@@ -57,7 +57,7 @@ struct PropItem
+   ~PropItem();
+ };
+ 
+-class TypeInState : public nsISelectionListener
++class TypeInState : public XPCOMGCFinalizedObject, public nsISelectionListener
+ {
+ public:
+ 
+diff --git a/editor/libeditor/html/nsHTMLAnonymousUtils.cpp b/editor/libeditor/html/nsHTMLAnonymousUtils.cpp
+--- a/editor/libeditor/html/nsHTMLAnonymousUtils.cpp
++++ b/editor/libeditor/html/nsHTMLAnonymousUtils.cpp
+@@ -103,7 +103,7 @@ static PRInt32 GetCSSFloatValue(nsIDOMCS
+   return (PRInt32) f;
+ }
+ 
+-class nsElementDeletionObserver : public nsIMutationObserver
++class nsElementDeletionObserver : public XPCOMGCFinalizedObject, public nsIMutationObserver
+ {
+ public:
+   nsElementDeletionObserver(nsINode* aNativeAnonNode, nsINode* aObservedNode)
+diff --git a/editor/libeditor/html/nsHTMLObjectResizer.h b/editor/libeditor/html/nsHTMLObjectResizer.h
+--- a/editor/libeditor/html/nsHTMLObjectResizer.h
++++ b/editor/libeditor/html/nsHTMLObjectResizer.h
+@@ -68,7 +68,7 @@
+ // ResizerSelectionListener
+ // ==================================================================
+ 
+-class ResizerSelectionListener : public nsISelectionListener
++class ResizerSelectionListener : public XPCOMGCFinalizedObject, public nsISelectionListener
+ {
+ public:
+ 
+@@ -90,7 +90,7 @@ protected:
+ // ResizerMouseMotionListener
+ // ==================================================================
+ 
+-class ResizerMouseMotionListener: public nsIDOMMouseMotionListener
++class ResizerMouseMotionListener: public XPCOMGCFinalizedObject, public nsIDOMMouseMotionListener
+ {
+ public:
+   ResizerMouseMotionListener(nsIHTMLEditor * aEditor);
+@@ -114,7 +114,7 @@ public:
+ // DocumentResizeEventListener
+ // ==================================================================
+ 
+-class DocumentResizeEventListener: public nsIDOMEventListener
++class DocumentResizeEventListener: public XPCOMGCFinalizedObject, public nsIDOMEventListener
+ {
+ public:
+   DocumentResizeEventListener(nsIHTMLEditor * aEditor);
+diff --git a/editor/libeditor/html/nsHTMLURIRefObject.h b/editor/libeditor/html/nsHTMLURIRefObject.h
+--- a/editor/libeditor/html/nsHTMLURIRefObject.h
++++ b/editor/libeditor/html/nsHTMLURIRefObject.h
+@@ -52,7 +52,7 @@
+     { 0xb2, 0x9c, 0xc3, 0xd6, 0x3a, 0x58, 0xf1, 0xd2 } \
+ }
+ 
+-class nsHTMLURIRefObject : public nsIURIRefObject
++class nsHTMLURIRefObject : public XPCOMGCFinalizedObject, public nsIURIRefObject
+ {
+ public:
+   nsHTMLURIRefObject();
+diff --git a/editor/libeditor/text/nsAOLCiter.h b/editor/libeditor/text/nsAOLCiter.h
+--- a/editor/libeditor/text/nsAOLCiter.h
++++ b/editor/libeditor/text/nsAOLCiter.h
+@@ -44,7 +44,7 @@
+ 
+ /** Mail citations using the AOL style >> This is a citation <<
+   */
+-class nsAOLCiter  : public nsICiter
++class nsAOLCiter  : public XPCOMGCFinalizedObject, public nsICiter
+ {
+ public:
+   nsAOLCiter();
+diff --git a/editor/libeditor/text/nsEditorEventListeners.h b/editor/libeditor/text/nsEditorEventListeners.h
+--- a/editor/libeditor/text/nsEditorEventListeners.h
++++ b/editor/libeditor/text/nsEditorEventListeners.h
+@@ -60,7 +60,7 @@
+  *  This class will delegate events to its editor according to the translation
+  *  it is responsible for.  i.e. 'c' becomes a keydown, but 'ESC' becomes nothing.
+  */
+-class nsTextEditorKeyListener : public nsIDOMKeyListener {
++class nsTextEditorKeyListener : public XPCOMGCFinalizedObject, public nsIDOMKeyListener {
+ public:
+   /** the default constructor
+    */
+@@ -93,7 +93,7 @@ protected:
+ 
+ /** editor Implementation of the TextListener interface
+  */
+-class nsTextEditorTextListener : public nsIDOMTextListener
++class nsTextEditorTextListener : public XPCOMGCFinalizedObject, public nsIDOMTextListener
+ {
+ public:
+   /** default constructor
+@@ -125,7 +125,7 @@ protected:
+ 
+ class nsIEditorIMESupport;
+ 
+-class nsTextEditorCompositionListener : public nsIDOMCompositionListener
++class nsTextEditorCompositionListener : public XPCOMGCFinalizedObject, public nsIDOMCompositionListener
+ {
+ public:
+   /** default constructor
+@@ -159,7 +159,7 @@ protected:
+ 
+ /** editor Implementation of the MouseListener interface
+  */
+-class nsTextEditorMouseListener : public nsIDOMMouseListener 
++class nsTextEditorMouseListener : public XPCOMGCFinalizedObject, public nsIDOMMouseListener 
+ {
+ public:
+   /** default constructor
+@@ -195,7 +195,7 @@ protected:
+ 
+ /** editor Implementation of the DragListener interface
+  */
+-class nsTextEditorDragListener : public nsIDOMDragListener 
++class nsTextEditorDragListener : public XPCOMGCFinalizedObject, public nsIDOMDragListener 
+ {
+ public:
+   /** default constructor
+@@ -242,7 +242,7 @@ protected:
+ 
+ /** editor Implementation of the FocusListener interface
+  */
+-class nsTextEditorFocusListener : public nsIDOMFocusListener 
++class nsTextEditorFocusListener : public XPCOMGCFinalizedObject, public nsIDOMFocusListener 
+ {
+ public:
+   /** default constructor
+diff --git a/editor/libeditor/text/nsInternetCiter.h b/editor/libeditor/text/nsInternetCiter.h
+--- a/editor/libeditor/text/nsInternetCiter.h
++++ b/editor/libeditor/text/nsInternetCiter.h
+@@ -44,7 +44,7 @@
+ 
+ /** Mail citations using standard Internet style.
+   */
+-class nsInternetCiter  : public nsICiter
++class nsInternetCiter  : public XPCOMGCFinalizedObject, public nsICiter
+ {
+ public:
+   nsInternetCiter();
+diff --git a/editor/libeditor/text/nsPlaintextEditor.h b/editor/libeditor/text/nsPlaintextEditor.h
+--- a/editor/libeditor/text/nsPlaintextEditor.h
++++ b/editor/libeditor/text/nsPlaintextEditor.h
+@@ -57,7 +57,8 @@ class nsIDocumentEncoder;
+  * The text editor implementation.
+  * Use to edit text document represented as a DOM tree. 
+  */
+-class nsPlaintextEditor : public nsEditor,
++class nsPlaintextEditor : public XPCOMGCFinalizedObject,
++                          public nsEditor,
+                           public nsIPlaintextEditor,
+                           public nsIEditorMailSupport
+ {
+diff --git a/editor/libeditor/text/nsTextEditRules.h b/editor/libeditor/text/nsTextEditRules.h
+--- a/editor/libeditor/text/nsTextEditRules.h
++++ b/editor/libeditor/text/nsTextEditRules.h
+@@ -56,7 +56,7 @@
+   * 2. Selection must not be explicitly set by the rule method.  
+   *    Any manipulation of Selection must be done by the editor.
+   */
+-class nsTextEditRules : public nsIEditRules
++class nsTextEditRules : public XPCOMGCFinalizedObject, public nsIEditRules
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/editor/txmgr/src/nsTransactionList.h b/editor/txmgr/src/nsTransactionList.h
+--- a/editor/txmgr/src/nsTransactionList.h
++++ b/editor/txmgr/src/nsTransactionList.h
+@@ -50,7 +50,7 @@ class nsTransactionRedoStack;
+ /** implementation of a transaction list object.
+  *
+  */
+-class nsTransactionList : public nsITransactionList
++class nsTransactionList : public XPCOMGCFinalizedObject, public nsITransactionList
+ {
+ private:
+ 
+diff --git a/editor/txmgr/src/nsTransactionManager.h b/editor/txmgr/src/nsTransactionManager.h
+--- a/editor/txmgr/src/nsTransactionManager.h
++++ b/editor/txmgr/src/nsTransactionManager.h
+@@ -52,7 +52,8 @@ class nsTransactionRedoStack;
+ /** implementation of a transaction manager object.
+  *
+  */
+-class nsTransactionManager : public nsITransactionManager
++class nsTransactionManager : public XPCOMGCFinalizedObject
++                           , public nsITransactionManager
+                            , public nsSupportsWeakReference
+ {
+ private:
+diff --git a/editor/txmgr/tests/TestTXMgr.cpp b/editor/txmgr/tests/TestTXMgr.cpp
+--- a/editor/txmgr/tests/TestTXMgr.cpp
++++ b/editor/txmgr/tests/TestTXMgr.cpp
+@@ -448,7 +448,7 @@ public:
+ 
+ NS_IMPL_ISUPPORTS1(TestTransaction, nsITransaction)
+ 
+-class SimpleTransaction : public TestTransaction
++class SimpleTransaction : public XPCOMGCFinalizedObject, public TestTransaction
+ {
+ public:
+ 
+diff --git a/editor/txtsvc/src/nsFilteredContentIterator.h b/editor/txtsvc/src/nsFilteredContentIterator.h
+--- a/editor/txtsvc/src/nsFilteredContentIterator.h
++++ b/editor/txtsvc/src/nsFilteredContentIterator.h
+@@ -48,7 +48,7 @@
+ /**
+  * 
+  */
+-class nsFilteredContentIterator : public nsIContentIterator
++class nsFilteredContentIterator : public XPCOMGCFinalizedObject, public nsIContentIterator
+ {
+ public:
+ 
+diff --git a/editor/txtsvc/src/nsTSDNotifier.h b/editor/txtsvc/src/nsTSDNotifier.h
+--- a/editor/txtsvc/src/nsTSDNotifier.h
++++ b/editor/txtsvc/src/nsTSDNotifier.h
+@@ -43,7 +43,7 @@
+ 
+ class nsTextServicesDocument;
+ 
+-class nsTSDNotifier : public nsIEditActionListener
++class nsTSDNotifier : public XPCOMGCFinalizedObject, public nsIEditActionListener
+ {
+ private:
+ 
+diff --git a/editor/txtsvc/src/nsTextServicesDocument.h b/editor/txtsvc/src/nsTextServicesDocument.h
+--- a/editor/txtsvc/src/nsTextServicesDocument.h
++++ b/editor/txtsvc/src/nsTextServicesDocument.h
+@@ -58,7 +58,7 @@ class nsIRangeUtils;
+ /** implementation of a text services object.
+  *
+  */
+-class nsTextServicesDocument : public nsITextServicesDocument
++class nsTextServicesDocument : public XPCOMGCFinalizedObject, public nsITextServicesDocument
+ {
+ private:
+   static nsIAtom *sAAtom;
+diff --git a/embedding/browser/gtk/src/EmbedContentListener.h b/embedding/browser/gtk/src/EmbedContentListener.h
+--- a/embedding/browser/gtk/src/EmbedContentListener.h
++++ b/embedding/browser/gtk/src/EmbedContentListener.h
+@@ -43,7 +43,8 @@
+ 
+ class EmbedPrivate;
+ 
+-class EmbedContentListener : public nsIURIContentListener,
++class EmbedContentListener : public XPCOMGCFinalizedObject,
++                             public nsIURIContentListener,
+                              public nsSupportsWeakReference
+ {
+  public:
+diff --git a/embedding/browser/gtk/src/EmbedEventListener.h b/embedding/browser/gtk/src/EmbedEventListener.h
+--- a/embedding/browser/gtk/src/EmbedEventListener.h
++++ b/embedding/browser/gtk/src/EmbedEventListener.h
+@@ -44,7 +44,8 @@
+ 
+ class EmbedPrivate;
+ 
+-class EmbedEventListener : public nsIDOMKeyListener,
++class EmbedEventListener : public XPCOMGCFinalizedObject,
++                           public nsIDOMKeyListener,
+                            public nsIDOMMouseListener,
+                            public nsIDOMUIListener
+ {
+diff --git a/embedding/browser/gtk/src/EmbedProgress.h b/embedding/browser/gtk/src/EmbedProgress.h
+--- a/embedding/browser/gtk/src/EmbedProgress.h
++++ b/embedding/browser/gtk/src/EmbedProgress.h
+@@ -42,7 +42,8 @@
+ #include "nsWeakReference.h"
+ #include "EmbedPrivate.h"
+ 
+-class EmbedProgress : public nsIWebProgressListener,
++class EmbedProgress : public XPCOMGCFinalizedObject,
++                      public nsIWebProgressListener,
+                       public nsSupportsWeakReference
+ {
+  public:
+diff --git a/embedding/browser/gtk/src/EmbedWindow.h b/embedding/browser/gtk/src/EmbedWindow.h
+--- a/embedding/browser/gtk/src/EmbedWindow.h
++++ b/embedding/browser/gtk/src/EmbedWindow.h
+@@ -53,7 +53,8 @@
+ 
+ class EmbedPrivate;
+ 
+-class EmbedWindow : public nsIWebBrowserChrome,
++class EmbedWindow : public XPCOMGCFinalizedObject,
++		    public nsIWebBrowserChrome,
+ 		    public nsIWebBrowserChromeFocus,
+                     public nsIEmbeddingSiteWindow,
+                     public nsITooltipListener,
+diff --git a/embedding/browser/gtk/src/EmbedWindowCreator.h b/embedding/browser/gtk/src/EmbedWindowCreator.h
+--- a/embedding/browser/gtk/src/EmbedWindowCreator.h
++++ b/embedding/browser/gtk/src/EmbedWindowCreator.h
+@@ -40,7 +40,7 @@
+ 
+ #include <nsIWindowCreator.h>
+ 
+-class EmbedWindowCreator : public nsIWindowCreator
++class EmbedWindowCreator : public XPCOMGCFinalizedObject, public nsIWindowCreator
+ {
+  public:
+   EmbedWindowCreator();
+diff --git a/embedding/browser/gtk/src/GtkPromptService.h b/embedding/browser/gtk/src/GtkPromptService.h
+--- a/embedding/browser/gtk/src/GtkPromptService.h
++++ b/embedding/browser/gtk/src/GtkPromptService.h
+@@ -43,7 +43,7 @@
+ 
+ class nsIDOMWindow;
+ 
+-class GtkPromptService : public nsIPromptService
++class GtkPromptService : public XPCOMGCFinalizedObject, public nsIPromptService
+ {
+ public:
+     GtkPromptService();
+diff --git a/embedding/browser/webBrowser/nsCommandHandler.h b/embedding/browser/webBrowser/nsCommandHandler.h
+--- a/embedding/browser/webBrowser/nsCommandHandler.h
++++ b/embedding/browser/webBrowser/nsCommandHandler.h
+@@ -45,6 +45,7 @@
+ #include "nsIDOMWindow.h"
+ 
+ class nsCommandHandler :
++    public XPCOMGCFinalizedObject,
+     public nsICommandHandlerInit,
+     public nsICommandHandler
+ {
+diff --git a/embedding/browser/webBrowser/nsContextMenuInfo.h b/embedding/browser/webBrowser/nsContextMenuInfo.h
+--- a/embedding/browser/webBrowser/nsContextMenuInfo.h
++++ b/embedding/browser/webBrowser/nsContextMenuInfo.h
+@@ -55,7 +55,7 @@ class ChromeContextMenuListener;
+ // Helper class for implementors of nsIContextMenuListener2
+ //*****************************************************************************
+  
+-class nsContextMenuInfo : public nsIContextMenuInfo
++class nsContextMenuInfo : public XPCOMGCFinalizedObject, public nsIContextMenuInfo
+ {
+   friend class ChromeContextMenuListener;
+   
+diff --git a/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp b/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
+--- a/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
++++ b/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
+@@ -1006,7 +1006,7 @@ nsDocShellTreeOwner::GetOwnerRequestor()
+ ///////////////////////////////////////////////////////////////////////////////
+ // DefaultTooltipTextProvider
+ 
+-class DefaultTooltipTextProvider : public nsITooltipTextProvider
++class DefaultTooltipTextProvider : public XPCOMGCFinalizedObject, public nsITooltipTextProvider
+ {
+ public:
+     DefaultTooltipTextProvider();
+diff --git a/embedding/browser/webBrowser/nsDocShellTreeOwner.h b/embedding/browser/webBrowser/nsDocShellTreeOwner.h
+--- a/embedding/browser/webBrowser/nsDocShellTreeOwner.h
++++ b/embedding/browser/webBrowser/nsDocShellTreeOwner.h
+@@ -92,7 +92,8 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsICDocShe
+ NS_DEFINE_STATIC_IID_ACCESSOR(nsICDocShellTreeOwner,
+                               NS_ICDOCSHELLTREEOWNER_IID)
+ 
+-class nsDocShellTreeOwner : public nsIDocShellTreeOwner,
++class nsDocShellTreeOwner : public XPCOMGCFinalizedObject,
++                            public nsIDocShellTreeOwner,
+                             public nsIBaseWindow,
+                             public nsIInterfaceRequestor,
+                             public nsIWebProgressListener,
+@@ -180,7 +181,8 @@ protected:
+ // with the DOM with AddChromeListeners() and removing itself with
+ // RemoveChromeListeners().
+ //
+-class ChromeTooltipListener : public nsIDOMMouseListener,
++class ChromeTooltipListener : public XPCOMGCFinalizedObject,
++                                public nsIDOMMouseListener,
+                                 public nsIDOMKeyListener,
+                                 public nsIDOMMouseMotionListener
+ {
+@@ -270,7 +272,7 @@ private:
+ // with the DOM with AddChromeListeners() and removing itself with
+ // RemoveChromeListeners().
+ //
+-class ChromeContextMenuListener : public nsIDOMContextMenuListener
++class ChromeContextMenuListener : public XPCOMGCFinalizedObject, public nsIDOMContextMenuListener
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/embedding/browser/webBrowser/nsEmbedStream.h b/embedding/browser/webBrowser/nsEmbedStream.h
+--- a/embedding/browser/webBrowser/nsEmbedStream.h
++++ b/embedding/browser/webBrowser/nsEmbedStream.h
+@@ -44,7 +44,7 @@
+ #include <nsIStreamListener.h>
+ #include <nsIWebBrowser.h>
+ 
+-class nsEmbedStream : public nsIInputStream 
++class nsEmbedStream : public XPCOMGCFinalizedObject, public nsIInputStream 
+ {
+  public:
+ 
+diff --git a/embedding/browser/webBrowser/nsWebBrowser.h b/embedding/browser/webBrowser/nsWebBrowser.h
+--- a/embedding/browser/webBrowser/nsWebBrowser.h
++++ b/embedding/browser/webBrowser/nsWebBrowser.h
+@@ -105,7 +105,8 @@ public:
+ {0xf1eac761, 0x87e9, 0x11d3, { 0xaf, 0x80, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c }}
+ 
+ 
+-class nsWebBrowser : public nsIWebBrowser,
++class nsWebBrowser : public XPCOMGCFinalizedObject,
++                     public nsIWebBrowser,
+                      public nsIWebNavigation,
+                      public nsIWebBrowserSetup,
+                      public nsIDocShellTreeItem,
+diff --git a/embedding/browser/webBrowser/nsWebBrowserContentPolicy.h b/embedding/browser/webBrowser/nsWebBrowserContentPolicy.h
+--- a/embedding/browser/webBrowser/nsWebBrowserContentPolicy.h
++++ b/embedding/browser/webBrowser/nsWebBrowserContentPolicy.h
+@@ -44,7 +44,7 @@
+ 
+ #define NS_WEBBROWSERCONTENTPOLICY_CONTRACTID "@mozilla.org/embedding/browser/content-policy;1"
+ 
+-class nsWebBrowserContentPolicy : public nsIContentPolicy
++class nsWebBrowserContentPolicy : public XPCOMGCFinalizedObject, public nsIContentPolicy
+ {
+ public:
+     nsWebBrowserContentPolicy();
+diff --git a/embedding/components/appstartup/src/nsAppStartupNotifier.h b/embedding/components/appstartup/src/nsAppStartupNotifier.h
+--- a/embedding/components/appstartup/src/nsAppStartupNotifier.h
++++ b/embedding/components/appstartup/src/nsAppStartupNotifier.h
+@@ -44,7 +44,7 @@
+ #define NS_APPSTARTUPNOTIFIER_CID \
+    { 0x1f59b001, 0x2c9, 0x11d5, { 0xae, 0x76, 0xcc, 0x92, 0xf7, 0xdb, 0x9e, 0x3 } }
+ 
+-class nsAppStartupNotifier : public nsIObserver
++class nsAppStartupNotifier : public XPCOMGCFinalizedObject, public nsIObserver
+ {
+ public:
+     NS_DEFINE_STATIC_CID_ACCESSOR( NS_APPSTARTUPNOTIFIER_CID )
+diff --git a/embedding/components/commandhandler/src/nsBaseCommandController.h b/embedding/components/commandhandler/src/nsBaseCommandController.h
+--- a/embedding/components/commandhandler/src/nsBaseCommandController.h
++++ b/embedding/components/commandhandler/src/nsBaseCommandController.h
+@@ -54,7 +54,8 @@
+ 
+ // The base editor controller is used for both text widgets, 
+ //   and all other text and html editing
+-class nsBaseCommandController :  public nsIController,
++class nsBaseCommandController :  public XPCOMGCFinalizedObject,
++                            public nsIController,
+                             public nsIControllerContext,
+                             public nsIInterfaceRequestor,
+                             public nsICommandController
+diff --git a/embedding/components/commandhandler/src/nsCommandGroup.cpp b/embedding/components/commandhandler/src/nsCommandGroup.cpp
+--- a/embedding/components/commandhandler/src/nsCommandGroup.cpp
++++ b/embedding/components/commandhandler/src/nsCommandGroup.cpp
+@@ -48,7 +48,7 @@
+ #include "nsCRT.h"
+ 
+ 
+-class nsGroupsEnumerator : public nsISimpleEnumerator
++class nsGroupsEnumerator : public XPCOMGCFinalizedObject, public nsISimpleEnumerator
+ {
+ public:
+               nsGroupsEnumerator(nsHashtable& inHashTable);
+@@ -165,7 +165,7 @@ nsGroupsEnumerator::Initialize()
+ #pragma mark -
+ #endif
+ 
+-class nsNamedGroupEnumerator : public nsISimpleEnumerator
++class nsNamedGroupEnumerator : public XPCOMGCFinalizedObject, public nsISimpleEnumerator
+ {
+ public:
+               nsNamedGroupEnumerator(nsVoidArray* inArray);
+diff --git a/embedding/components/commandhandler/src/nsCommandGroup.h b/embedding/components/commandhandler/src/nsCommandGroup.h
+--- a/embedding/components/commandhandler/src/nsCommandGroup.h
++++ b/embedding/components/commandhandler/src/nsCommandGroup.h
+@@ -53,7 +53,7 @@
+  "@mozilla.org/embedcomp/controller-command-group;1"
+ 
+ 
+-class nsControllerCommandGroup : public nsIControllerCommandGroup
++class nsControllerCommandGroup : public XPCOMGCFinalizedObject, public nsIControllerCommandGroup
+ {
+ public:
+ 
+diff --git a/embedding/components/commandhandler/src/nsCommandManager.h b/embedding/components/commandhandler/src/nsCommandManager.h
+--- a/embedding/components/commandhandler/src/nsCommandManager.h
++++ b/embedding/components/commandhandler/src/nsCommandManager.h
+@@ -52,7 +52,8 @@ template<class E> class nsCOMArray;
+ template<class E> class nsCOMArray;
+ 
+ 
+-class nsCommandManager :  public nsICommandManager,
++class nsCommandManager :  public XPCOMGCFinalizedObject,
++                          public nsICommandManager,
+                           public nsPICommandUpdater,
+                        // public nsISecurityCheckedComponent,
+                           public nsSupportsWeakReference
+diff --git a/embedding/components/commandhandler/src/nsCommandParams.h b/embedding/components/commandhandler/src/nsCommandParams.h
+--- a/embedding/components/commandhandler/src/nsCommandParams.h
++++ b/embedding/components/commandhandler/src/nsCommandParams.h
+@@ -50,7 +50,7 @@
+ 
+ 
+ 
+-class nsCommandParams : public nsICommandParams
++class nsCommandParams : public XPCOMGCFinalizedObject, public nsICommandParams
+ {
+ public:
+ 
+diff --git a/embedding/components/commandhandler/src/nsControllerCommandTable.h b/embedding/components/commandhandler/src/nsControllerCommandTable.h
+--- a/embedding/components/commandhandler/src/nsControllerCommandTable.h
++++ b/embedding/components/commandhandler/src/nsControllerCommandTable.h
+@@ -46,7 +46,8 @@
+ 
+ class nsIControllerCommand;
+ 
+-class  nsControllerCommandTable : public nsIControllerCommandTable,
++class  nsControllerCommandTable : public XPCOMGCFinalizedObject,
++                                  public nsIControllerCommandTable,
+                                   public nsSupportsWeakReference
+ {
+ public:
+diff --git a/embedding/components/find/src/nsFind.cpp b/embedding/components/find/src/nsFind.cpp
+--- a/embedding/components/find/src/nsFind.cpp
++++ b/embedding/components/find/src/nsFind.cpp
+@@ -104,7 +104,7 @@ static NS_DEFINE_IID(kRangeCID, NS_RANGE
+ // 5) The implementation assumes that First() and Next() are only called
+ // in find-forward mode, while Last() and Prev() are used in find-backward.
+ 
+-class nsFindContentIterator : public nsIContentIterator
++class nsFindContentIterator : public XPCOMGCFinalizedObject, public nsIContentIterator
+ {
+ public:
+   nsFindContentIterator(PRBool aFindBackward)
+diff --git a/embedding/components/find/src/nsFind.h b/embedding/components/find/src/nsFind.h
+--- a/embedding/components/find/src/nsFind.h
++++ b/embedding/components/find/src/nsFind.h
+@@ -58,7 +58,7 @@ class nsIAtom;
+ 
+ class nsFindContentIterator;
+ 
+-class nsFind : public nsIFind
++class nsFind : public XPCOMGCFinalizedObject, public nsIFind
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/embedding/components/find/src/nsWebBrowserFind.h b/embedding/components/find/src/nsWebBrowserFind.h
+--- a/embedding/components/find/src/nsWebBrowserFind.h
++++ b/embedding/components/find/src/nsWebBrowserFind.h
+@@ -65,7 +65,8 @@ class nsIDocShell;
+ // class nsWebBrowserFind
+ //*****************************************************************************   
+ 
+-class nsWebBrowserFind  : public nsIWebBrowserFind,
++class nsWebBrowserFind  : public XPCOMGCFinalizedObject,
++                          public nsIWebBrowserFind,
+                           public nsIWebBrowserFindInFrames
+ {
+ public:
+diff --git a/embedding/components/printingui/src/unixshared/nsPrintProgress.h b/embedding/components/printingui/src/unixshared/nsPrintProgress.h
+--- a/embedding/components/printingui/src/unixshared/nsPrintProgress.h
++++ b/embedding/components/printingui/src/unixshared/nsPrintProgress.h
+@@ -50,7 +50,7 @@
+ #include "nsIObserver.h"
+ #include "nsString.h"
+ 
+-class nsPrintProgress : public nsIPrintProgress, public nsIPrintStatusFeedback
++class nsPrintProgress : public XPCOMGCFinalizedObject, public nsIPrintProgress, public nsIPrintStatusFeedback
+ {
+ public: 
+ 	NS_DECL_ISUPPORTS
+diff --git a/embedding/components/printingui/src/unixshared/nsPrintProgressParams.h b/embedding/components/printingui/src/unixshared/nsPrintProgressParams.h
+--- a/embedding/components/printingui/src/unixshared/nsPrintProgressParams.h
++++ b/embedding/components/printingui/src/unixshared/nsPrintProgressParams.h
+@@ -42,7 +42,7 @@
+ #include "nsIPrintProgressParams.h"
+ #include "nsString.h"
+ 
+-class nsPrintProgressParams : public nsIPrintProgressParams
++class nsPrintProgressParams : public XPCOMGCFinalizedObject, public nsIPrintProgressParams
+ {
+ public: 
+ 	NS_DECL_ISUPPORTS
+diff --git a/embedding/components/printingui/src/unixshared/nsPrintingPromptService.h b/embedding/components/printingui/src/unixshared/nsPrintingPromptService.h
+--- a/embedding/components/printingui/src/unixshared/nsPrintingPromptService.h
++++ b/embedding/components/printingui/src/unixshared/nsPrintingPromptService.h
+@@ -57,7 +57,8 @@ class nsIDOMWindow;
+ class nsIDOMWindow;
+ class nsIDialogParamBlock;
+ 
+-class nsPrintingPromptService: public nsIPrintingPromptService,
++class nsPrintingPromptService: public XPCOMGCFinalizedObject,
++                               public nsIPrintingPromptService,
+                                public nsIWebProgressListener
+ {
+ 
+diff --git a/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.h b/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.h
+--- a/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.h
++++ b/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.h
+@@ -67,7 +67,8 @@ class nsIStorageStream;
+ 
+ struct URIData;
+ 
+-class nsWebBrowserPersist : public nsIInterfaceRequestor,
++class nsWebBrowserPersist : public XPCOMGCFinalizedObject,
++                            public nsIInterfaceRequestor,
+                             public nsIWebBrowserPersist,
+                             public nsIStreamListener,
+                             public nsIProgressEventSink,
+@@ -244,7 +245,7 @@ private:
+ };
+ 
+ // Helper class does node fixup during persistence
+-class nsEncoderNodeFixup : public nsIDocumentEncoderNodeFixup
++class nsEncoderNodeFixup : public XPCOMGCFinalizedObject, public nsIDocumentEncoderNodeFixup
+ {
+ public:
+     nsEncoderNodeFixup();
+diff --git a/embedding/components/windowwatcher/src/nsDialogParamBlock.h b/embedding/components/windowwatcher/src/nsDialogParamBlock.h
+--- a/embedding/components/windowwatcher/src/nsDialogParamBlock.h
++++ b/embedding/components/windowwatcher/src/nsDialogParamBlock.h
+@@ -48,7 +48,7 @@
+ 
+ class nsString;
+ 
+-class nsDialogParamBlock: public nsIDialogParamBlock
++class nsDialogParamBlock: public XPCOMGCFinalizedObject, public nsIDialogParamBlock
+ {
+ public: 	
+   nsDialogParamBlock();
+diff --git a/embedding/components/windowwatcher/src/nsPrompt.h b/embedding/components/windowwatcher/src/nsPrompt.h
+--- a/embedding/components/windowwatcher/src/nsPrompt.h
++++ b/embedding/components/windowwatcher/src/nsPrompt.h
+@@ -43,7 +43,8 @@
+ #include "nsIPromptService.h"
+ #include "nsIPromptService2.h"
+ 
+-class nsPrompt : public nsIPrompt,
++class nsPrompt : public XPCOMGCFinalizedObject,
++                 public nsIPrompt,
+                  public nsIAuthPrompt,
+                  public nsIAuthPrompt2 {
+ 
+@@ -83,7 +84,7 @@ protected:
+  * A class that wraps an nsIAuthPrompt so that it can be used as an
+  * nsIAuthPrompt2.
+  */
+-class AuthPromptWrapper : public nsIAuthPrompt2
++class AuthPromptWrapper : public XPCOMGCFinalizedObject, public nsIAuthPrompt2
+ {
+   public:
+     AuthPromptWrapper(nsIAuthPrompt* aAuthPrompt) :
+diff --git a/embedding/components/windowwatcher/src/nsPromptService.h b/embedding/components/windowwatcher/src/nsPromptService.h
+--- a/embedding/components/windowwatcher/src/nsPromptService.h
++++ b/embedding/components/windowwatcher/src/nsPromptService.h
+@@ -55,7 +55,8 @@ class nsIDOMWindow;
+ class nsIDOMWindow;
+ class nsIDialogParamBlock;
+ 
+-class nsPromptService: public nsIPromptService2,
++class nsPromptService: public XPCOMGCFinalizedObject,
++                       public nsIPromptService2,
+                        public nsPIPromptService,
+                        public nsINonBlockingAlertService {
+ 
+diff --git a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp
+--- a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp
++++ b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp
+@@ -169,7 +169,7 @@ void nsWatcherWindowEntry::ReferenceSelf
+  ****************** nsWatcherWindowEnumerator *******************
+  ****************************************************************/
+ 
+-class nsWatcherWindowEnumerator : public nsISimpleEnumerator {
++class nsWatcherWindowEnumerator : public XPCOMGCFinalizedObject, public nsISimpleEnumerator {
+ 
+ public:
+   nsWatcherWindowEnumerator(nsWindowWatcher *inWatcher);
+diff --git a/embedding/components/windowwatcher/src/nsWindowWatcher.h b/embedding/components/windowwatcher/src/nsWindowWatcher.h
+--- a/embedding/components/windowwatcher/src/nsWindowWatcher.h
++++ b/embedding/components/windowwatcher/src/nsWindowWatcher.h
+@@ -65,6 +65,7 @@ struct SizeSpec;
+ struct SizeSpec;
+ 
+ class nsWindowWatcher :
++      public XPCOMGCFinalizedObject,
+       public nsIWindowWatcher,
+       public nsPIWindowWatcher,
+       public nsIPromptFactory,
+diff --git a/extensions/auth/nsAuthGSSAPI.h b/extensions/auth/nsAuthGSSAPI.h
+--- a/extensions/auth/nsAuthGSSAPI.h
++++ b/extensions/auth/nsAuthGSSAPI.h
+@@ -69,7 +69,7 @@
+  * last call are required as input to the next.
+  */
+ 
+-class nsAuthGSSAPI : public nsIAuthModule
++class nsAuthGSSAPI : public XPCOMGCFinalizedObject, public nsIAuthModule
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/extensions/auth/nsAuthSASL.h b/extensions/auth/nsAuthSASL.h
+--- a/extensions/auth/nsAuthSASL.h
++++ b/extensions/auth/nsAuthSASL.h
+@@ -47,7 +47,7 @@
+  * apply to this class
+  */
+ 
+-class nsAuthSASL : public nsIAuthModule
++class nsAuthSASL : public XPCOMGCFinalizedObject, public nsIAuthModule
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/extensions/auth/nsAuthSambaNTLM.h b/extensions/auth/nsAuthSambaNTLM.h
+--- a/extensions/auth/nsAuthSambaNTLM.h
++++ b/extensions/auth/nsAuthSambaNTLM.h
+@@ -54,7 +54,7 @@
+  * NOTE: at time of writing, this requires patches to be added to the stock
+  * Samba winbindd and ntlm_auth!  
+  */
+-class nsAuthSambaNTLM : public nsIAuthModule
++class nsAuthSambaNTLM : public XPCOMGCFinalizedObject, public nsIAuthModule
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/extensions/auth/nsHttpNegotiateAuth.h b/extensions/auth/nsHttpNegotiateAuth.h
+--- a/extensions/auth/nsHttpNegotiateAuth.h
++++ b/extensions/auth/nsHttpNegotiateAuth.h
+@@ -48,7 +48,7 @@
+ // The nsHttpNegotiateAuth class provides responses for the GSS-API Negotiate method
+ // as specified by Microsoft in draft-brezak-spnego-http-04.txt
+ 
+-class nsHttpNegotiateAuth : public nsIHttpAuthenticator
++class nsHttpNegotiateAuth : public XPCOMGCFinalizedObject, public nsIHttpAuthenticator
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/extensions/cookie/nsCookiePermission.h b/extensions/cookie/nsCookiePermission.h
+--- a/extensions/cookie/nsCookiePermission.h
++++ b/extensions/cookie/nsCookiePermission.h
+@@ -46,7 +46,8 @@
+ 
+ class nsIPrefBranch;
+ 
+-class nsCookiePermission : public nsICookiePermission
++class nsCookiePermission : public XPCOMGCFinalizedObject
++                         , public nsICookiePermission
+                          , public nsIObserver
+ {
+ public:
+diff --git a/extensions/cookie/nsCookiePromptService.h b/extensions/cookie/nsCookiePromptService.h
+--- a/extensions/cookie/nsCookiePromptService.h
++++ b/extensions/cookie/nsCookiePromptService.h
+@@ -39,7 +39,7 @@
+ 
+ #include "nsICookiePromptService.h"
+ 
+-class nsCookiePromptService : public nsICookiePromptService {
++class nsCookiePromptService : public XPCOMGCFinalizedObject, public nsICookiePromptService {
+ 
+ public:
+ 
+diff --git a/extensions/cookie/nsPermission.h b/extensions/cookie/nsPermission.h
+--- a/extensions/cookie/nsPermission.h
++++ b/extensions/cookie/nsPermission.h
+@@ -43,7 +43,7 @@
+ 
+ ////////////////////////////////////////////////////////////////////////////////
+ 
+-class nsPermission : public nsIPermission
++class nsPermission : public XPCOMGCFinalizedObject, public nsIPermission
+ {
+ public:
+   // nsISupports
+diff --git a/extensions/cookie/nsPermissionManager.h b/extensions/cookie/nsPermissionManager.h
+--- a/extensions/cookie/nsPermissionManager.h
++++ b/extensions/cookie/nsPermissionManager.h
+@@ -145,7 +145,8 @@ private:
+ };
+ 
+ 
+-class nsPermissionManager : public nsIPermissionManager,
++class nsPermissionManager : public XPCOMGCFinalizedObject,
++                            public nsIPermissionManager,
+                             public nsIObserver,
+                             public nsSupportsWeakReference
+ {
+diff --git a/extensions/cookie/nsPopupWindowManager.h b/extensions/cookie/nsPopupWindowManager.h
+--- a/extensions/cookie/nsPopupWindowManager.h
++++ b/extensions/cookie/nsPopupWindowManager.h
+@@ -47,7 +47,8 @@
+ 
+ class nsIURI;
+ 
+-class nsPopupWindowManager : public nsIPopupWindowManager,
++class nsPopupWindowManager : public XPCOMGCFinalizedObject,
++                             public nsIPopupWindowManager,
+                              public nsIObserver,
+                              public nsSupportsWeakReference {
+ 
+diff --git a/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp b/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
+--- a/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
++++ b/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp
+@@ -340,7 +340,7 @@ FileInfoComparator(gconstpointer a, gcon
+ 
+ //-----------------------------------------------------------------------------
+ 
+-class nsGnomeVFSInputStream : public nsIInputStream
++class nsGnomeVFSInputStream : public XPCOMGCFinalizedObject, public nsIInputStream
+ {
+   public:
+     NS_DECL_ISUPPORTS
+@@ -762,7 +762,8 @@ nsGnomeVFSInputStream::IsNonBlocking(PRB
+ 
+ //-----------------------------------------------------------------------------
+ 
+-class nsGnomeVFSProtocolHandler : public nsIProtocolHandler
++class nsGnomeVFSProtocolHandler : public XPCOMGCFinalizedObject
++                                , public nsIProtocolHandler
+                                 , public nsIObserver
+ {
+   public:
+diff --git a/extensions/permissions/nsContentBlocker.h b/extensions/permissions/nsContentBlocker.h
+--- a/extensions/permissions/nsContentBlocker.h
++++ b/extensions/permissions/nsContentBlocker.h
+@@ -49,7 +49,8 @@ class nsIPrefBranch;
+ // number of permission types in nsIContentPolicy
+ #define NUMBER_OF_TYPES 13
+ 
+-class nsContentBlocker : public nsIContentPolicy,
++class nsContentBlocker : public XPCOMGCFinalizedObject,
++                         public nsIContentPolicy,
+                          public nsIObserver,
+                          public nsSupportsWeakReference
+ {
+diff --git a/extensions/pref/autoconfig/src/nsAutoConfig.h b/extensions/pref/autoconfig/src/nsAutoConfig.h
+--- a/extensions/pref/autoconfig/src/nsAutoConfig.h
++++ b/extensions/pref/autoconfig/src/nsAutoConfig.h
+@@ -45,7 +45,8 @@
+ #include "nsIPrefBranch.h"
+ #include "nsWeakReference.h"
+ 
+-class nsAutoConfig : public nsIAutoConfig,
++class nsAutoConfig : public XPCOMGCFinalizedObject,
++                     public nsIAutoConfig,
+                      public nsITimerCallback,
+                      public nsIStreamListener,
+                      public nsIObserver,
+diff --git a/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp b/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp
+--- a/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp
++++ b/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp
+@@ -58,7 +58,7 @@ extern PRLogModuleInfo *MCD;
+ // Security Manager for new XPCONNECT enabled JS Context
+ // Right now it allows all access
+ 
+-class AutoConfigSecMan : public nsIXPCSecurityManager
++class AutoConfigSecMan : public XPCOMGCFinalizedObject, public nsIXPCSecurityManager
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/extensions/pref/autoconfig/src/nsReadConfig.h b/extensions/pref/autoconfig/src/nsReadConfig.h
+--- a/extensions/pref/autoconfig/src/nsReadConfig.h
++++ b/extensions/pref/autoconfig/src/nsReadConfig.h
+@@ -42,7 +42,8 @@
+ #include "nsIObserver.h"
+ 
+ 
+-class nsReadConfig : public nsIReadConfig,
++class nsReadConfig : public XPCOMGCFinalizedObject,
++                     public nsIReadConfig,
+                      public nsIObserver
+ {
+ 
+diff --git a/extensions/pref/system-pref/src/gconf/nsSystemPrefService.h b/extensions/pref/system-pref/src/gconf/nsSystemPrefService.h
+--- a/extensions/pref/system-pref/src/gconf/nsSystemPrefService.h
++++ b/extensions/pref/system-pref/src/gconf/nsSystemPrefService.h
+@@ -56,7 +56,7 @@ class GConfProxy;
+ // on the gconf platform.
+ ////////////////////////////////////////////////////////////////////////////
+ 
+-class nsSystemPrefService : public nsIPrefBranch2
++class nsSystemPrefService : public XPCOMGCFinalizedObject, public nsIPrefBranch2
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/extensions/pref/system-pref/src/nsSystemPref.h b/extensions/pref/system-pref/src/nsSystemPref.h
+--- a/extensions/pref/system-pref/src/nsSystemPref.h
++++ b/extensions/pref/system-pref/src/nsSystemPref.h
+@@ -72,7 +72,8 @@ struct SysPrefItem;
+ // editor (i.e. gconf-editor in gnome) should be used.
+ //////////////////////////////////////////////////////////////////////////
+ 
+-class nsSystemPref : public nsIObserver,
++class nsSystemPref : public XPCOMGCFinalizedObject,
++                     public nsIObserver,
+                      public nsSupportsWeakReference
+ {
+ public:
+diff --git a/extensions/spellcheck/hunspell/src/mozHunspell.h b/extensions/spellcheck/hunspell/src/mozHunspell.h
+--- a/extensions/spellcheck/hunspell/src/mozHunspell.h
++++ b/extensions/spellcheck/hunspell/src/mozHunspell.h
+@@ -76,7 +76,8 @@
+ { 0x56c778e4, 0x1bee, 0x45f3, \
+   { 0xa6, 0x89, 0x88, 0x66, 0x92, 0xa9, 0x7f, 0xe7 } }
+ 
+-class mozHunspell : public mozISpellCheckingEngine,
++class mozHunspell : public XPCOMGCFinalizedObject,
++                   public mozISpellCheckingEngine,
+                    public nsIObserver,
+                    public nsSupportsWeakReference
+ {
+diff --git a/extensions/spellcheck/hunspell/src/mozHunspellDirProvider.h b/extensions/spellcheck/hunspell/src/mozHunspellDirProvider.h
+--- a/extensions/spellcheck/hunspell/src/mozHunspellDirProvider.h
++++ b/extensions/spellcheck/hunspell/src/mozHunspellDirProvider.h
+@@ -41,7 +41,7 @@
+ #include "nsISimpleEnumerator.h"
+ 
+ class mozHunspellDirProvider :
+-  public nsIDirectoryServiceProvider2
++  public XPCOMGCFinalizedObject, public nsIDirectoryServiceProvider2
+ {
+ public:
+   NS_DECL_ISUPPORTS
+@@ -60,7 +60,7 @@ public:
+   static char const *const kContractID;
+ 
+ private:
+-  class AppendingEnumerator : public nsISimpleEnumerator
++  class AppendingEnumerator : public XPCOMGCFinalizedObject, public nsISimpleEnumerator
+   {
+   public:
+     NS_DECL_ISUPPORTS
+diff --git a/extensions/spellcheck/src/mozEnglishWordUtils.h b/extensions/spellcheck/src/mozEnglishWordUtils.h
+--- a/extensions/spellcheck/src/mozEnglishWordUtils.h
++++ b/extensions/spellcheck/src/mozEnglishWordUtils.h
+@@ -48,7 +48,7 @@
+ 
+ #include "mozITXTToHTMLConv.h" 
+ 
+-class mozEnglishWordUtils : public mozISpellI18NUtil
++class mozEnglishWordUtils : public XPCOMGCFinalizedObject, public mozISpellI18NUtil
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/extensions/spellcheck/src/mozInlineSpellChecker.h b/extensions/spellcheck/src/mozInlineSpellChecker.h
+--- a/extensions/spellcheck/src/mozInlineSpellChecker.h
++++ b/extensions/spellcheck/src/mozInlineSpellChecker.h
+@@ -139,7 +139,7 @@ protected:
+                                     nsIDOMRange** aRange);
+ };
+ 
+-class mozInlineSpellChecker : public nsIInlineSpellChecker, nsIEditActionListener, nsIDOMFocusListener, nsIDOMMouseListener, nsIDOMKeyListener,
++class mozInlineSpellChecker : public XPCOMGCFinalizedObject, public nsIInlineSpellChecker, nsIEditActionListener, nsIDOMFocusListener, nsIDOMMouseListener, nsIDOMKeyListener,
+                                      nsSupportsWeakReference
+ {
+ private:
+diff --git a/extensions/spellcheck/src/mozPersonalDictionary.h b/extensions/spellcheck/src/mozPersonalDictionary.h
+--- a/extensions/spellcheck/src/mozPersonalDictionary.h
++++ b/extensions/spellcheck/src/mozPersonalDictionary.h
+@@ -81,7 +81,8 @@ private:
+ };
+ 
+ 
+-class mozPersonalDictionary : public mozIPersonalDictionary, 
++class mozPersonalDictionary : public XPCOMGCFinalizedObject, 
++                              public mozIPersonalDictionary, 
+                               public nsIObserver,
+                               public nsSupportsWeakReference
+ {
+diff --git a/extensions/spellcheck/src/mozSpellChecker.h b/extensions/spellcheck/src/mozSpellChecker.h
+--- a/extensions/spellcheck/src/mozSpellChecker.h
++++ b/extensions/spellcheck/src/mozSpellChecker.h
+@@ -48,7 +48,7 @@
+ #include "nsVoidArray.h"
+ #include "mozISpellI18NUtil.h"
+ 
+-class mozSpellChecker : public nsISpellChecker
++class mozSpellChecker : public XPCOMGCFinalizedObject, public nsISpellChecker
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/extensions/spellcheck/src/mozSpellI18NManager.h b/extensions/spellcheck/src/mozSpellI18NManager.h
+--- a/extensions/spellcheck/src/mozSpellI18NManager.h
++++ b/extensions/spellcheck/src/mozSpellI18NManager.h
+@@ -47,7 +47,7 @@ 0xaeb8936f, 0x219c, 0x4d3c, \
+ 0xaeb8936f, 0x219c, 0x4d3c, \
+   { 0x83, 0x85, 0xd9, 0x38, 0x2d, 0xaa, 0x55, 0x1a } }
+ 
+-class mozSpellI18NManager : public mozISpellI18NManager
++class mozSpellI18NManager : public XPCOMGCFinalizedObject, public mozISpellI18NManager
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/extensions/universalchardet/src/xpcom/nsUdetXPCOMWrapper.h b/extensions/universalchardet/src/xpcom/nsUdetXPCOMWrapper.h
+--- a/extensions/universalchardet/src/xpcom/nsUdetXPCOMWrapper.h
++++ b/extensions/universalchardet/src/xpcom/nsUdetXPCOMWrapper.h
+@@ -142,98 +142,98 @@ class nsXPCOMStringDetector
+ };
+ 
+ //=====================================================================
+-class nsUniversalXPCOMDetector : public nsXPCOMDetector
++class nsUniversalXPCOMDetector : public XPCOMGCFinalizedObject, public nsXPCOMDetector
+ {
+ public:
+   nsUniversalXPCOMDetector() 
+     : nsXPCOMDetector(NS_FILTER_ALL) {}
+ };
+ 
+-class nsUniversalXPCOMStringDetector : public nsXPCOMStringDetector
++class nsUniversalXPCOMStringDetector : public XPCOMGCFinalizedObject, public nsXPCOMStringDetector
+ {
+ public:
+   nsUniversalXPCOMStringDetector() 
+     : nsXPCOMStringDetector(NS_FILTER_ALL) {}
+ };
+ 
+-class nsJAPSMDetector : public nsXPCOMDetector
++class nsJAPSMDetector : public XPCOMGCFinalizedObject, public nsXPCOMDetector
+ {
+ public:
+   nsJAPSMDetector() 
+     : nsXPCOMDetector(NS_FILTER_JAPANESE) {}
+ };
+ 
+-class nsJAStringPSMDetector : public nsXPCOMStringDetector
++class nsJAStringPSMDetector : public XPCOMGCFinalizedObject, public nsXPCOMStringDetector
+ {
+ public:
+   nsJAStringPSMDetector() 
+     : nsXPCOMStringDetector(NS_FILTER_JAPANESE) {}
+ };
+ 
+-class nsKOPSMDetector : public nsXPCOMDetector
++class nsKOPSMDetector : public XPCOMGCFinalizedObject, public nsXPCOMDetector
+ {
+ public:
+   nsKOPSMDetector() 
+     : nsXPCOMDetector(NS_FILTER_KOREAN) {}
+ };
+ 
+-class nsKOStringPSMDetector : public nsXPCOMStringDetector
++class nsKOStringPSMDetector : public XPCOMGCFinalizedObject, public nsXPCOMStringDetector
+ {
+ public:
+   nsKOStringPSMDetector() 
+     : nsXPCOMStringDetector(NS_FILTER_KOREAN) {}
+ };
+ 
+-class nsZHTWPSMDetector : public nsXPCOMDetector
++class nsZHTWPSMDetector : public XPCOMGCFinalizedObject, public nsXPCOMDetector
+ {
+ public:
+   nsZHTWPSMDetector() 
+     : nsXPCOMDetector(NS_FILTER_CHINESE_TRADITIONAL) {}
+ };
+ 
+-class nsZHTWStringPSMDetector : public nsXPCOMStringDetector
++class nsZHTWStringPSMDetector : public XPCOMGCFinalizedObject, public nsXPCOMStringDetector
+ {
+ public:
+   nsZHTWStringPSMDetector() 
+     : nsXPCOMStringDetector(NS_FILTER_CHINESE_TRADITIONAL) {}
+ };
+ 
+-class nsZHCNPSMDetector : public nsXPCOMDetector
++class nsZHCNPSMDetector : public XPCOMGCFinalizedObject, public nsXPCOMDetector
+ {
+ public:
+   nsZHCNPSMDetector() 
+     : nsXPCOMDetector(NS_FILTER_CHINESE_SIMPLIFIED) {}
+ };
+ 
+-class nsZHCNStringPSMDetector : public nsXPCOMStringDetector
++class nsZHCNStringPSMDetector : public XPCOMGCFinalizedObject, public nsXPCOMStringDetector
+ {
+ public:
+   nsZHCNStringPSMDetector() 
+     : nsXPCOMStringDetector(NS_FILTER_CHINESE_SIMPLIFIED) {}
+ };
+ 
+-class nsZHPSMDetector : public nsXPCOMDetector
++class nsZHPSMDetector : public XPCOMGCFinalizedObject, public nsXPCOMDetector
+ {
+ public:
+   nsZHPSMDetector() 
+     : nsXPCOMDetector(NS_FILTER_CHINESE) {}
+ };
+ 
+-class nsZHStringPSMDetector : public nsXPCOMStringDetector
++class nsZHStringPSMDetector : public XPCOMGCFinalizedObject, public nsXPCOMStringDetector
+ {
+ public:
+   nsZHStringPSMDetector() 
+     : nsXPCOMStringDetector(NS_FILTER_CHINESE) {}
+ };
+ 
+-class nsCJKPSMDetector : public nsXPCOMDetector
++class nsCJKPSMDetector : public XPCOMGCFinalizedObject, public nsXPCOMDetector
+ {
+ public:
+   nsCJKPSMDetector() 
+     : nsXPCOMDetector(NS_FILTER_CJK) {}
+ };
+ 
+-class nsCJKStringPSMDetector : public nsXPCOMStringDetector
++class nsCJKStringPSMDetector : public XPCOMGCFinalizedObject, public nsXPCOMStringDetector
+ {
+ public:
+   nsCJKStringPSMDetector() 
+diff --git a/gfx/src/nsScriptableRegion.h b/gfx/src/nsScriptableRegion.h
+--- a/gfx/src/nsScriptableRegion.h
++++ b/gfx/src/nsScriptableRegion.h
+@@ -45,7 +45,7 @@ class nsIRegion;
+ /**
+  * An adapter class for the unscriptable nsIRegion interface.
+  */
+-class NS_GFX nsScriptableRegion : public nsIScriptableRegion {
++class NS_GFX nsScriptableRegion : public XPCOMGCFinalizedObject, public nsIScriptableRegion {
+ public:
+ 	nsScriptableRegion(nsIRegion* region);
+ 	virtual ~nsScriptableRegion();
+diff --git a/gfx/src/shared/gfxImageFrame.h b/gfx/src/shared/gfxImageFrame.h
+--- a/gfx/src/shared/gfxImageFrame.h
++++ b/gfx/src/shared/gfxImageFrame.h
+@@ -56,7 +56,8 @@
+     {0x84, 0xa9, 0xa2, 0x80, 0xc2, 0x68, 0xe4, 0xfb} \
+ }
+ 
+-class gfxImageFrame : public gfxIImageFrame,
++class gfxImageFrame : public XPCOMGCFinalizedObject,
++                      public gfxIImageFrame,
+                       public nsIInterfaceRequestor
+ {
+ public:
+diff --git a/gfx/src/thebes/nsThebesDeviceContext.h b/gfx/src/thebes/nsThebesDeviceContext.h
+--- a/gfx/src/thebes/nsThebesDeviceContext.h
++++ b/gfx/src/thebes/nsThebesDeviceContext.h
+@@ -61,7 +61,7 @@ extern PRLogModuleInfo* gThebesGFXLog;
+ #include "gfxOS2Surface.h"
+ #endif
+ 
+-class nsThebesDeviceContext : public DeviceContextImpl
++class nsThebesDeviceContext : public XPCOMGCFinalizedObject, public DeviceContextImpl
+ {
+ public:
+     nsThebesDeviceContext();
+diff --git a/gfx/src/thebes/nsThebesFontEnumerator.h b/gfx/src/thebes/nsThebesFontEnumerator.h
+--- a/gfx/src/thebes/nsThebesFontEnumerator.h
++++ b/gfx/src/thebes/nsThebesFontEnumerator.h
+@@ -41,7 +41,7 @@
+ 
+ #include "nsIFontEnumerator.h"
+ 
+-class nsThebesFontEnumerator : public nsIFontEnumerator
++class nsThebesFontEnumerator : public XPCOMGCFinalizedObject, public nsIFontEnumerator
+ {
+ public:
+     nsThebesFontEnumerator();
+diff --git a/gfx/src/thebes/nsThebesFontMetrics.h b/gfx/src/thebes/nsThebesFontMetrics.h
+--- a/gfx/src/thebes/nsThebesFontMetrics.h
++++ b/gfx/src/thebes/nsThebesFontMetrics.h
+@@ -48,7 +48,7 @@
+ #include "gfxFont.h"
+ #include "gfxTextRunCache.h"
+ 
+-class nsThebesFontMetrics : public nsIThebesFontMetrics
++class nsThebesFontMetrics : public XPCOMGCFinalizedObject, public nsIThebesFontMetrics
+ {
+ public:
+     nsThebesFontMetrics();
+diff --git a/gfx/src/thebes/nsThebesImage.h b/gfx/src/thebes/nsThebesImage.h
+--- a/gfx/src/thebes/nsThebesImage.h
++++ b/gfx/src/thebes/nsThebesImage.h
+@@ -51,7 +51,7 @@
+ #include "gfxQuartzImageSurface.h"
+ #endif
+ 
+-class nsThebesImage : public nsIImage
++class nsThebesImage : public XPCOMGCFinalizedObject, public nsIImage
+ {
+ public:
+     nsThebesImage();
+diff --git a/gfx/src/thebes/nsThebesRegion.h b/gfx/src/thebes/nsThebesRegion.h
+--- a/gfx/src/thebes/nsThebesRegion.h
++++ b/gfx/src/thebes/nsThebesRegion.h
+@@ -43,7 +43,7 @@
+ #include "nsIRegion.h"
+ #include "nsRegion.h"
+ 
+-class nsThebesRegion : public nsIRegion
++class nsThebesRegion : public XPCOMGCFinalizedObject, public nsIRegion
+ {
+ public:
+     nsThebesRegion();
+diff --git a/gfx/src/thebes/nsThebesRenderingContext.h b/gfx/src/thebes/nsThebesRenderingContext.h
+--- a/gfx/src/thebes/nsThebesRenderingContext.h
++++ b/gfx/src/thebes/nsThebesRenderingContext.h
+@@ -58,7 +58,7 @@
+ 
+ class nsIImage;
+ 
+-class nsThebesRenderingContext : public nsRenderingContextImpl
++class nsThebesRenderingContext : public XPCOMGCFinalizedObject, public nsRenderingContextImpl
+ {
+ public:
+     nsThebesRenderingContext();
+diff --git a/intl/chardet/src/nsDetectionAdaptor.h b/intl/chardet/src/nsDetectionAdaptor.h
+--- a/intl/chardet/src/nsDetectionAdaptor.h
++++ b/intl/chardet/src/nsDetectionAdaptor.h
+@@ -47,7 +47,7 @@ class CToken;
+ class CToken;
+ 
+ //--------------------------------------------------------------
+-class nsMyObserver : public nsICharsetDetectionObserver
++class nsMyObserver : public XPCOMGCFinalizedObject, public nsICharsetDetectionObserver
+ {
+  public:
+    NS_DECL_ISUPPORTS
+@@ -96,6 +96,7 @@ class nsMyObserver : public nsICharsetDe
+ };
+ 
+ class nsDetectionAdaptor : 
++                           public XPCOMGCFinalizedObject,
+                            public nsIParserFilter,
+                            public nsICharsetDetectionAdaptor
+ {
+diff --git a/intl/chardet/src/nsDocumentCharsetInfo.h b/intl/chardet/src/nsDocumentCharsetInfo.h
+--- a/intl/chardet/src/nsDocumentCharsetInfo.h
++++ b/intl/chardet/src/nsDocumentCharsetInfo.h
+@@ -41,7 +41,7 @@
+ #include "nsIFactory.h"
+ #include "nsIDocumentCharsetInfo.h"
+ 
+-class nsDocumentCharsetInfo : public nsIDocumentCharsetInfo
++class nsDocumentCharsetInfo : public XPCOMGCFinalizedObject, public nsIDocumentCharsetInfo
+ {
+ public:
+   nsDocumentCharsetInfo ();
+diff --git a/intl/chardet/src/nsMetaCharsetObserver.h b/intl/chardet/src/nsMetaCharsetObserver.h
+--- a/intl/chardet/src/nsMetaCharsetObserver.h
++++ b/intl/chardet/src/nsMetaCharsetObserver.h
+@@ -49,7 +49,8 @@
+ // Class declaration for the class 
+ //
+ //========================================================================== 
+-class nsMetaCharsetObserver: public nsIElementObserver, 
++class nsMetaCharsetObserver: public XPCOMGCFinalizedObject, 
++                             public nsIElementObserver, 
+                              public nsIObserver, 
+                              public nsObserverBase,
+                              public nsIMetaCharsetService,
+diff --git a/intl/chardet/src/nsXMLEncodingObserver.h b/intl/chardet/src/nsXMLEncodingObserver.h
+--- a/intl/chardet/src/nsXMLEncodingObserver.h
++++ b/intl/chardet/src/nsXMLEncodingObserver.h
+@@ -45,7 +45,8 @@
+ #include "nsObserverBase.h"
+ #include "nsWeakReference.h"
+ 
+-class nsXMLEncodingObserver: public nsIElementObserver, 
++class nsXMLEncodingObserver: public XPCOMGCFinalizedObject, 
++                             public nsIElementObserver, 
+                              public nsIObserver, 
+                              public nsObserverBase,
+                              public nsIXMLEncodingService,
+diff --git a/intl/locale/src/nsCollation.h b/intl/locale/src/nsCollation.h
+--- a/intl/locale/src/nsCollation.h
++++ b/intl/locale/src/nsCollation.h
+@@ -48,7 +48,7 @@
+ 
+ // Create a collation interface for an input locale.
+ // 
+-class nsCollationFactory: public nsICollationFactory {
++class nsCollationFactory: public XPCOMGCFinalizedObject, public nsICollationFactory {
+ 
+ public: 
+   NS_DECL_ISUPPORTS 
+diff --git a/intl/locale/src/nsLanguageAtomService.h b/intl/locale/src/nsLanguageAtomService.h
+--- a/intl/locale/src/nsLanguageAtomService.h
++++ b/intl/locale/src/nsLanguageAtomService.h
+@@ -46,7 +46,7 @@
+ #define NS_LANGUAGEATOMSERVICE_CID \
+   {0xa6cf9120, 0x15b3, 0x11d2, {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
+ 
+-class nsLanguageAtomService : public nsILanguageAtomService
++class nsLanguageAtomService : public XPCOMGCFinalizedObject, public nsILanguageAtomService
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/intl/locale/src/nsLocale.h b/intl/locale/src/nsLocale.h
+--- a/intl/locale/src/nsLocale.h
++++ b/intl/locale/src/nsLocale.h
+@@ -58,7 +58,7 @@
+ 
+ class nsStringArray;
+ 
+-class nsLocale : public nsILocale {
++class nsLocale : public XPCOMGCFinalizedObject, public nsILocale {
+ 	friend class nsLocaleService;
+ 	NS_DECL_ISUPPORTS
+ 
+diff --git a/intl/locale/src/nsLocaleService.cpp b/intl/locale/src/nsLocaleService.cpp
+--- a/intl/locale/src/nsLocaleService.cpp
++++ b/intl/locale/src/nsLocaleService.cpp
+@@ -98,7 +98,7 @@ static int posix_locale_category[LocaleL
+ //
+ // nsILocaleService implementation
+ //
+-class nsLocaleService: public nsILocaleService {
++class nsLocaleService: public XPCOMGCFinalizedObject, public nsILocaleService {
+ 
+ public:
+ 	
+diff --git a/intl/locale/src/nsScriptableDateFormat.cpp b/intl/locale/src/nsScriptableDateFormat.cpp
+--- a/intl/locale/src/nsScriptableDateFormat.cpp
++++ b/intl/locale/src/nsScriptableDateFormat.cpp
+@@ -50,7 +50,7 @@ static NS_DEFINE_CID(kLocaleServiceCID, 
+ static NS_DEFINE_CID(kLocaleServiceCID, NS_LOCALESERVICE_CID);
+ static NS_DEFINE_CID(kDateTimeFormatCID, NS_DATETIMEFORMAT_CID);
+ 
+-class nsScriptableDateFormat : public nsIScriptableDateFormat {
++class nsScriptableDateFormat : public XPCOMGCFinalizedObject, public nsIScriptableDateFormat {
+  public: 
+   NS_DECL_ISUPPORTS 
+ 
+diff --git a/intl/locale/src/unix/nsCollationUnix.h b/intl/locale/src/unix/nsCollationUnix.h
+--- a/intl/locale/src/unix/nsCollationUnix.h
++++ b/intl/locale/src/unix/nsCollationUnix.h
+@@ -46,7 +46,7 @@
+ 
+ 
+ 
+-class nsCollationUnix : public nsICollation {
++class nsCollationUnix : public XPCOMGCFinalizedObject, public nsICollation {
+ 
+ protected:
+   nsCollation   *mCollation;
+diff --git a/intl/locale/src/unix/nsDateTimeFormatUnix.h b/intl/locale/src/unix/nsDateTimeFormatUnix.h
+--- a/intl/locale/src/unix/nsDateTimeFormatUnix.h
++++ b/intl/locale/src/unix/nsDateTimeFormatUnix.h
+@@ -46,7 +46,7 @@
+ 
+ #define kPlatformLocaleLength 64
+ 
+-class nsDateTimeFormatUnix : public nsIDateTimeFormat {
++class nsDateTimeFormatUnix : public XPCOMGCFinalizedObject, public nsIDateTimeFormat {
+ 
+ public: 
+   NS_DECL_ISUPPORTS 
+diff --git a/intl/locale/src/unix/nsPosixLocale.h b/intl/locale/src/unix/nsPosixLocale.h
+--- a/intl/locale/src/unix/nsPosixLocale.h
++++ b/intl/locale/src/unix/nsPosixLocale.h
+@@ -45,7 +45,7 @@
+ 
+ 
+ 
+-class nsPosixLocale : public nsIPosixLocale {
++class nsPosixLocale : public XPCOMGCFinalizedObject, public nsIPosixLocale {
+ 
+   NS_DECL_ISUPPORTS
+ 
+diff --git a/intl/lwbrk/src/nsJISx4501LineBreaker.h b/intl/lwbrk/src/nsJISx4501LineBreaker.h
+--- a/intl/lwbrk/src/nsJISx4501LineBreaker.h
++++ b/intl/lwbrk/src/nsJISx4501LineBreaker.h
+@@ -40,7 +40,7 @@
+ 
+ #include "nsILineBreaker.h"
+ 
+-class nsJISx4051LineBreaker : public nsILineBreaker
++class nsJISx4051LineBreaker : public XPCOMGCFinalizedObject, public nsILineBreaker
+ {
+   NS_DECL_ISUPPORTS
+ 
+diff --git a/intl/lwbrk/src/nsSampleWordBreaker.h b/intl/lwbrk/src/nsSampleWordBreaker.h
+--- a/intl/lwbrk/src/nsSampleWordBreaker.h
++++ b/intl/lwbrk/src/nsSampleWordBreaker.h
+@@ -51,7 +51,7 @@ typedef enum {
+   kWbClassThaiLetter
+ } wb_class;
+ 
+-class nsSampleWordBreaker : public nsIWordBreaker
++class nsSampleWordBreaker : public XPCOMGCFinalizedObject, public nsIWordBreaker
+ {
+   NS_DECL_ISUPPORTS
+ public:
+diff --git a/intl/strres/src/nsStringBundle.h b/intl/strres/src/nsStringBundle.h
+--- a/intl/strres/src/nsStringBundle.h
++++ b/intl/strres/src/nsStringBundle.h
+@@ -45,7 +45,7 @@
+ #include "nsCOMArray.h"
+ #include "nsIStringBundleOverride.h"
+ 
+-class nsStringBundle : public nsIStringBundle
++class nsStringBundle : public XPCOMGCFinalizedObject, public nsIStringBundle
+ {
+ public:
+     // init version
+@@ -85,7 +85,7 @@ public:
+  * @created         28/Dec/1999
+  * @author  Catalin Rotaru [CATA]
+  */
+-class nsExtensibleStringBundle : public nsIStringBundle
++class nsExtensibleStringBundle : public XPCOMGCFinalizedObject, public nsIStringBundle
+ {
+   NS_DECL_ISUPPORTS
+   NS_DECL_NSISTRINGBUNDLE
+diff --git a/intl/strres/src/nsStringBundleTextOverride.cpp b/intl/strres/src/nsStringBundleTextOverride.cpp
+--- a/intl/strres/src/nsStringBundleTextOverride.cpp
++++ b/intl/strres/src/nsStringBundleTextOverride.cpp
+@@ -49,7 +49,7 @@ static NS_DEFINE_CID(kPersistentProperti
+ 
+ // first we need a simple class which wraps a nsIPropertyElement and
+ // cuts out the leading URL from the key
+-class URLPropertyElement : public nsIPropertyElement
++class URLPropertyElement : public XPCOMGCFinalizedObject, public nsIPropertyElement
+ {
+ public:
+     URLPropertyElement(nsIPropertyElement *aRealElement, PRUint32 aURLLength) :
+@@ -109,7 +109,7 @@ URLPropertyElement::SetValue(const nsASt
+ 
+ // this is a special enumerator which returns only the elements which
+ // are prefixed with a particular url
+-class nsPropertyEnumeratorByURL : public nsISimpleEnumerator
++class nsPropertyEnumeratorByURL : public XPCOMGCFinalizedObject, public nsISimpleEnumerator
+ {
+ public:
+     nsPropertyEnumeratorByURL(const nsACString& aURL,
+diff --git a/intl/strres/src/nsStringBundleTextOverride.h b/intl/strres/src/nsStringBundleTextOverride.h
+--- a/intl/strres/src/nsStringBundleTextOverride.h
++++ b/intl/strres/src/nsStringBundleTextOverride.h
+@@ -55,7 +55,7 @@
+ 
+ // an implementation which does overrides from a text file
+ 
+-class nsStringBundleTextOverride : public nsIStringBundleOverride
++class nsStringBundleTextOverride : public XPCOMGCFinalizedObject, public nsIStringBundleOverride
+ {
+  public:
+     nsStringBundleTextOverride() { }
+diff --git a/intl/uconv/src/nsCharsetAlias.h b/intl/uconv/src/nsCharsetAlias.h
+--- a/intl/uconv/src/nsCharsetAlias.h
++++ b/intl/uconv/src/nsCharsetAlias.h
+@@ -41,7 +41,7 @@
+ #include "nsGREResProperties.h"
+ 
+ //==============================================================
+-class nsCharsetAlias2 : public nsICharsetAlias
++class nsCharsetAlias2 : public XPCOMGCFinalizedObject, public nsICharsetAlias
+ {
+   NS_DECL_ISUPPORTS
+ 
+diff --git a/intl/uconv/src/nsCharsetConverterManager.h b/intl/uconv/src/nsCharsetConverterManager.h
+--- a/intl/uconv/src/nsCharsetConverterManager.h
++++ b/intl/uconv/src/nsCharsetConverterManager.h
+@@ -46,7 +46,7 @@
+ #include "nsINativeUConvService.h"
+ #endif
+ 
+-class nsCharsetConverterManager : public nsICharsetConverterManager
++class nsCharsetConverterManager : public XPCOMGCFinalizedObject, public nsICharsetConverterManager
+ {
+   NS_DECL_ISUPPORTS
+   NS_DECL_NSICHARSETCONVERTERMANAGER
+diff --git a/intl/uconv/src/nsConverterInputStream.h b/intl/uconv/src/nsConverterInputStream.h
+--- a/intl/uconv/src/nsConverterInputStream.h
++++ b/intl/uconv/src/nsConverterInputStream.h
+@@ -55,7 +55,8 @@
+ 
+ 
+ 
+-class nsConverterInputStream : public nsIConverterInputStream,
++class nsConverterInputStream : public XPCOMGCFinalizedObject,
++                               public nsIConverterInputStream,
+                                public nsIUnicharLineInputStream {
+ 
+  public:
+diff --git a/intl/uconv/src/nsConverterOutputStream.h b/intl/uconv/src/nsConverterOutputStream.h
+--- a/intl/uconv/src/nsConverterOutputStream.h
++++ b/intl/uconv/src/nsConverterOutputStream.h
+@@ -50,7 +50,7 @@ class nsIOutputStream;
+ { 0xff8780a5, 0xbbb1, 0x4bc5, \
+   { 0x8e, 0xe7, 0x05, 0x7e, 0x7b, 0xc5, 0xc9, 0x25 } }
+ 
+-class nsConverterOutputStream : public nsIConverterOutputStream {
++class nsConverterOutputStream : public XPCOMGCFinalizedObject, public nsIConverterOutputStream {
+     public:
+         nsConverterOutputStream() {}
+ 
+diff --git a/intl/uconv/src/nsPlatformCharset.h b/intl/uconv/src/nsPlatformCharset.h
+--- a/intl/uconv/src/nsPlatformCharset.h
++++ b/intl/uconv/src/nsPlatformCharset.h
+@@ -39,7 +39,7 @@
+ 
+ #include "nsIPlatformCharset.h"
+ 
+-class nsPlatformCharset : public nsIPlatformCharset
++class nsPlatformCharset : public XPCOMGCFinalizedObject, public nsIPlatformCharset
+ {
+   NS_DECL_ISUPPORTS
+ 
+diff --git a/intl/uconv/src/nsScriptableUConv.h b/intl/uconv/src/nsScriptableUConv.h
+--- a/intl/uconv/src/nsScriptableUConv.h
++++ b/intl/uconv/src/nsScriptableUConv.h
+@@ -44,7 +44,7 @@
+ #include "nsICharsetConverterManager.h"
+ #include "nsIScriptableUConv.h"
+ 
+-class nsScriptableUnicodeConverter : public nsIScriptableUnicodeConverter
++class nsScriptableUnicodeConverter : public XPCOMGCFinalizedObject, public nsIScriptableUnicodeConverter
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/intl/uconv/src/nsTextToSubURI.h b/intl/uconv/src/nsTextToSubURI.h
+--- a/intl/uconv/src/nsTextToSubURI.h
++++ b/intl/uconv/src/nsTextToSubURI.h
+@@ -40,7 +40,7 @@
+ #include "nsITextToSubURI.h"
+ 
+ //==============================================================
+-class nsTextToSubURI: public nsITextToSubURI {
++class nsTextToSubURI: public XPCOMGCFinalizedObject, public nsITextToSubURI {
+   NS_DECL_ISUPPORTS
+   NS_DECL_NSITEXTTOSUBURI
+ 
+diff --git a/intl/uconv/src/nsUTF8ConverterService.h b/intl/uconv/src/nsUTF8ConverterService.h
+--- a/intl/uconv/src/nsUTF8ConverterService.h
++++ b/intl/uconv/src/nsUTF8ConverterService.h
+@@ -41,7 +41,7 @@
+ 
+ //==============================================================
+ 
+-class nsUTF8ConverterService: public nsIUTF8ConverterService {
++class nsUTF8ConverterService: public XPCOMGCFinalizedObject, public nsIUTF8ConverterService {
+   NS_DECL_ISUPPORTS
+   NS_DECL_NSIUTF8CONVERTERSERVICE
+ 
+diff --git a/intl/uconv/src/nsUTF8ToUnicode.h b/intl/uconv/src/nsUTF8ToUnicode.h
+--- a/intl/uconv/src/nsUTF8ToUnicode.h
++++ b/intl/uconv/src/nsUTF8ToUnicode.h
+@@ -60,7 +60,7 @@
+  * @author  Catalin Rotaru [CATA]
+  */
+ 
+-class nsUTF8ToUnicode : public nsBasicDecoderSupport
++class nsUTF8ToUnicode : public XPCOMGCFinalizedObject, public nsBasicDecoderSupport
+ {
+ public:
+ 
+diff --git a/intl/uconv/src/nsUnicodeToUTF8.h b/intl/uconv/src/nsUnicodeToUTF8.h
+--- a/intl/uconv/src/nsUnicodeToUTF8.h
++++ b/intl/uconv/src/nsUnicodeToUTF8.h
+@@ -57,7 +57,7 @@
+  * @created         05/Apr/1999
+  * @author  Catalin Rotaru [CATA]
+  */
+-class nsUnicodeToUTF8 : public nsIUnicodeEncoder
++class nsUnicodeToUTF8 : public XPCOMGCFinalizedObject, public nsIUnicodeEncoder
+ {
+   NS_DECL_ISUPPORTS
+ 
+diff --git a/intl/uconv/ucvcn/nsGBKToUnicode.h b/intl/uconv/ucvcn/nsGBKToUnicode.h
+--- a/intl/uconv/ucvcn/nsGBKToUnicode.h
++++ b/intl/uconv/ucvcn/nsGBKToUnicode.h
+@@ -52,7 +52,7 @@
+  * @created         07/Sept/1999
+  * @author  Yueheng Xu, Yueheng.Xu@intel.com
+  */
+-class nsGBKToUnicode : public nsBufferDecoderSupport
++class nsGBKToUnicode : public XPCOMGCFinalizedObject, public nsBufferDecoderSupport
+ {
+ public:
+ 		  
+diff --git a/intl/uconv/ucvcn/nsHZToUnicode.h b/intl/uconv/ucvcn/nsHZToUnicode.h
+--- a/intl/uconv/ucvcn/nsHZToUnicode.h
++++ b/intl/uconv/ucvcn/nsHZToUnicode.h
+@@ -51,7 +51,7 @@
+  * @created         08/Sept/1999
+  * @author  Yueheng Xu, Yueheng.Xu@intel.com
+  */
+-class nsHZToUnicode : public nsBufferDecoderSupport
++class nsHZToUnicode : public XPCOMGCFinalizedObject, public nsBufferDecoderSupport
+ {
+ public:
+ 		
+diff --git a/intl/uconv/ucvcn/nsISO2022CNToUnicode.h b/intl/uconv/ucvcn/nsISO2022CNToUnicode.h
+--- a/intl/uconv/ucvcn/nsISO2022CNToUnicode.h
++++ b/intl/uconv/ucvcn/nsISO2022CNToUnicode.h
+@@ -51,7 +51,7 @@
+ #define SS2         0x4e
+ #define SS3         0x4f
+ 
+-class nsISO2022CNToUnicode : public nsBasicDecoderSupport
++class nsISO2022CNToUnicode : public XPCOMGCFinalizedObject, public nsBasicDecoderSupport
+ {
+ public:
+   nsISO2022CNToUnicode() : 
+diff --git a/intl/uconv/ucvcn/nsUnicodeToGB2312V2.h b/intl/uconv/ucvcn/nsUnicodeToGB2312V2.h
+--- a/intl/uconv/ucvcn/nsUnicodeToGB2312V2.h
++++ b/intl/uconv/ucvcn/nsUnicodeToGB2312V2.h
+@@ -50,7 +50,7 @@
+  * @created         06/Apr/1999
+  * @author  Catalin Rotaru [CATA]
+  */
+-class nsUnicodeToGB2312V2 : public nsEncoderSupport
++class nsUnicodeToGB2312V2 : public XPCOMGCFinalizedObject, public nsEncoderSupport
+ {
+ public:
+ 
+diff --git a/intl/uconv/ucvcn/nsUnicodeToGBK.h b/intl/uconv/ucvcn/nsUnicodeToGBK.h
+--- a/intl/uconv/ucvcn/nsUnicodeToGBK.h
++++ b/intl/uconv/ucvcn/nsUnicodeToGBK.h
+@@ -53,7 +53,7 @@
+ //----------------------------------------------------------------------
+ // Class nsUnicodeToGBK [declaration]
+ 
+-class nsUnicodeToGBK: public nsEncoderSupport
++class nsUnicodeToGBK: public XPCOMGCFinalizedObject, public nsEncoderSupport
+ {
+ public:
+ 
+diff --git a/intl/uconv/ucvcn/nsUnicodeToHZ.h b/intl/uconv/ucvcn/nsUnicodeToHZ.h
+--- a/intl/uconv/ucvcn/nsUnicodeToHZ.h
++++ b/intl/uconv/ucvcn/nsUnicodeToHZ.h
+@@ -51,7 +51,7 @@
+ //----------------------------------------------------------------------
+ // Class nsUnicodeToHZ [declaration]
+ 
+-class nsUnicodeToHZ: public nsEncoderSupport
++class nsUnicodeToHZ: public XPCOMGCFinalizedObject, public nsEncoderSupport
+ {
+ public:
+ 
+diff --git a/intl/uconv/ucvja/nsJapaneseToUnicode.h b/intl/uconv/ucvja/nsJapaneseToUnicode.h
+--- a/intl/uconv/ucvja/nsJapaneseToUnicode.h
++++ b/intl/uconv/ucvja/nsJapaneseToUnicode.h
+@@ -50,7 +50,7 @@ protected:
+  const PRUint16 * const *mMapIndex;
+ };
+ 
+-class nsShiftJISToUnicode : public nsJapaneseToUnicode
++class nsShiftJISToUnicode : public XPCOMGCFinalizedObject, public nsJapaneseToUnicode
+ {
+ public:
+ 
+@@ -83,7 +83,7 @@ private:
+  PRInt32 mData;
+ };
+ 
+-class nsEUCJPToUnicodeV2 : public nsJapaneseToUnicode
++class nsEUCJPToUnicodeV2 : public XPCOMGCFinalizedObject, public nsJapaneseToUnicode
+ {
+ public:
+ 
+@@ -114,7 +114,7 @@ private:
+  PRInt32 mData;
+ };
+  
+-class nsISO2022JPToUnicodeV2 : public nsJapaneseToUnicode
++class nsISO2022JPToUnicodeV2 : public XPCOMGCFinalizedObject, public nsJapaneseToUnicode
+ {
+ public:
+ 
+diff --git a/intl/uconv/ucvja/nsUnicodeToISO2022JP.h b/intl/uconv/ucvja/nsUnicodeToISO2022JP.h
+--- a/intl/uconv/ucvja/nsUnicodeToISO2022JP.h
++++ b/intl/uconv/ucvja/nsUnicodeToISO2022JP.h
+@@ -49,7 +49,7 @@
+  * @created         17/Feb/1999
+  * @author  Catalin Rotaru [CATA]
+  */
+-class nsUnicodeToISO2022JP : public nsEncoderSupport
++class nsUnicodeToISO2022JP : public XPCOMGCFinalizedObject, public nsEncoderSupport
+ {
+ public:
+ 
+diff --git a/intl/uconv/ucvko/nsISO2022KRToUnicode.h b/intl/uconv/ucvko/nsISO2022KRToUnicode.h
+--- a/intl/uconv/ucvko/nsISO2022KRToUnicode.h
++++ b/intl/uconv/ucvko/nsISO2022KRToUnicode.h
+@@ -41,7 +41,7 @@
+ 
+ 
+  
+-class nsISO2022KRToUnicode : public nsBasicDecoderSupport
++class nsISO2022KRToUnicode : public XPCOMGCFinalizedObject, public nsBasicDecoderSupport
+ {
+ public:
+   nsISO2022KRToUnicode()
+diff --git a/intl/uconv/ucvko/nsUnicodeToJamoTTF.h b/intl/uconv/ucvko/nsUnicodeToJamoTTF.h
+--- a/intl/uconv/ucvko/nsUnicodeToJamoTTF.h
++++ b/intl/uconv/ucvko/nsUnicodeToJamoTTF.h
+@@ -46,7 +46,7 @@
+ //----------------------------------------------------------------------
+ // Class nsUnicodeToJamoTTF [declaration]
+ 
+-class nsUnicodeToJamoTTF : public nsIUnicodeEncoder, public nsICharRepresentable
++class nsUnicodeToJamoTTF : public XPCOMGCFinalizedObject, public nsIUnicodeEncoder, public nsICharRepresentable
+ {
+ 
+   NS_DECL_ISUPPORTS
+diff --git a/intl/uconv/ucvlatin/nsMUTF7ToUnicode.h b/intl/uconv/ucvlatin/nsMUTF7ToUnicode.h
+--- a/intl/uconv/ucvlatin/nsMUTF7ToUnicode.h
++++ b/intl/uconv/ucvlatin/nsMUTF7ToUnicode.h
+@@ -49,7 +49,7 @@
+  * @created         18/May/1999
+  * @author  Catalin Rotaru [CATA]
+  */
+-class nsMUTF7ToUnicode : public nsBasicUTF7Decoder 
++class nsMUTF7ToUnicode : public XPCOMGCFinalizedObject, public nsBasicUTF7Decoder 
+ {
+ public:
+ 
+diff --git a/intl/uconv/ucvlatin/nsUCS2BEToUnicode.h b/intl/uconv/ucvlatin/nsUCS2BEToUnicode.h
+--- a/intl/uconv/ucvlatin/nsUCS2BEToUnicode.h
++++ b/intl/uconv/ucvlatin/nsUCS2BEToUnicode.h
+@@ -62,7 +62,7 @@ protected:
+ };
+ 
+ // UTF-16 big endian
+-class nsUTF16BEToUnicode : public nsUTF16ToUnicodeBase
++class nsUTF16BEToUnicode : public XPCOMGCFinalizedObject, public nsUTF16ToUnicodeBase
+ {
+ public:
+ 
+@@ -71,7 +71,7 @@ public:
+ };
+ 
+ // UTF-16 little endian
+-class nsUTF16LEToUnicode : public nsUTF16ToUnicodeBase
++class nsUTF16LEToUnicode : public XPCOMGCFinalizedObject, public nsUTF16ToUnicodeBase
+ {
+ public:
+ 
+@@ -80,7 +80,7 @@ public:
+ };
+ 
+ // UTF-16 with BOM
+-class nsUTF16ToUnicode : public nsUTF16ToUnicodeBase
++class nsUTF16ToUnicode : public XPCOMGCFinalizedObject, public nsUTF16ToUnicodeBase
+ {
+ public:
+ 
+diff --git a/intl/uconv/ucvlatin/nsUTF32ToUnicode.h b/intl/uconv/ucvlatin/nsUTF32ToUnicode.h
+--- a/intl/uconv/ucvlatin/nsUTF32ToUnicode.h
++++ b/intl/uconv/ucvlatin/nsUTF32ToUnicode.h
+@@ -88,7 +88,7 @@ protected:
+  * @author  Jungshik Shin
+  */
+ 
+-class nsUTF32BEToUnicode : public nsUTF32ToUnicode
++class nsUTF32BEToUnicode : public XPCOMGCFinalizedObject, public nsUTF32ToUnicode
+ {
+ public:
+ 
+@@ -112,7 +112,7 @@ public:
+  * @author  Jungshik Shin
+  */
+ 
+-class nsUTF32LEToUnicode : public nsUTF32ToUnicode
++class nsUTF32LEToUnicode : public XPCOMGCFinalizedObject, public nsUTF32ToUnicode
+ {
+ public:
+ 
+diff --git a/intl/uconv/ucvlatin/nsUTF7ToUnicode.h b/intl/uconv/ucvlatin/nsUTF7ToUnicode.h
+--- a/intl/uconv/ucvlatin/nsUTF7ToUnicode.h
++++ b/intl/uconv/ucvlatin/nsUTF7ToUnicode.h
+@@ -90,7 +90,7 @@ protected:
+  * @created         18/May/1999
+  * @author  Catalin Rotaru [CATA]
+  */
+-class nsUTF7ToUnicode : public nsBasicUTF7Decoder 
++class nsUTF7ToUnicode : public XPCOMGCFinalizedObject, public nsBasicUTF7Decoder 
+ {
+ public:
+ 
+diff --git a/intl/uconv/ucvlatin/nsUnicodeToMUTF7.h b/intl/uconv/ucvlatin/nsUnicodeToMUTF7.h
+--- a/intl/uconv/ucvlatin/nsUnicodeToMUTF7.h
++++ b/intl/uconv/ucvlatin/nsUnicodeToMUTF7.h
+@@ -49,7 +49,7 @@
+  * @created         18/May/1999
+  * @author  Catalin Rotaru [CATA]
+  */
+-class nsUnicodeToMUTF7 : public nsBasicUTF7Encoder
++class nsUnicodeToMUTF7 : public XPCOMGCFinalizedObject, public nsBasicUTF7Encoder
+ {
+ public:
+ 
+diff --git a/intl/uconv/ucvlatin/nsUnicodeToTSCII.h b/intl/uconv/ucvlatin/nsUnicodeToTSCII.h
+--- a/intl/uconv/ucvlatin/nsUnicodeToTSCII.h
++++ b/intl/uconv/ucvlatin/nsUnicodeToTSCII.h
+@@ -49,7 +49,7 @@
+ //----------------------------------------------------------------------
+ // Class nsUnicodeToTSCII [declaration]
+ 
+-class nsUnicodeToTSCII : public nsIUnicodeEncoder, public nsICharRepresentable
++class nsUnicodeToTSCII : public XPCOMGCFinalizedObject, public nsIUnicodeEncoder, public nsICharRepresentable
+ {
+ 
+ NS_DECL_ISUPPORTS
+diff --git a/intl/uconv/ucvlatin/nsUnicodeToUCS2BE.h b/intl/uconv/ucvlatin/nsUnicodeToUCS2BE.h
+--- a/intl/uconv/ucvlatin/nsUnicodeToUCS2BE.h
++++ b/intl/uconv/ucvlatin/nsUnicodeToUCS2BE.h
+@@ -40,7 +40,7 @@
+ 
+ #include "nsUCSupport.h"
+ 
+-class nsUnicodeToUTF16BE: public nsBasicEncoder
++class nsUnicodeToUTF16BE: public XPCOMGCFinalizedObject, public nsBasicEncoder
+ {
+ public:
+   nsUnicodeToUTF16BE() { mBOM = 0;}
+diff --git a/intl/uconv/ucvlatin/nsUnicodeToUTF32.h b/intl/uconv/ucvlatin/nsUnicodeToUTF32.h
+--- a/intl/uconv/ucvlatin/nsUnicodeToUTF32.h
++++ b/intl/uconv/ucvlatin/nsUnicodeToUTF32.h
+@@ -91,7 +91,7 @@ protected:
+  * @author  Jungshik Shin
+  */
+ 
+-class nsUnicodeToUTF32BE : public nsUnicodeToUTF32
++class nsUnicodeToUTF32BE : public XPCOMGCFinalizedObject, public nsUnicodeToUTF32
+ {
+ public:
+ 
+@@ -115,7 +115,7 @@ public:
+  * @author  Jungshik Shin
+  */
+ 
+-class nsUnicodeToUTF32LE : public nsUnicodeToUTF32
++class nsUnicodeToUTF32LE : public XPCOMGCFinalizedObject, public nsUnicodeToUTF32
+ {
+ public:
+ 
+diff --git a/intl/uconv/ucvlatin/nsUnicodeToUTF7.h b/intl/uconv/ucvlatin/nsUnicodeToUTF7.h
+--- a/intl/uconv/ucvlatin/nsUnicodeToUTF7.h
++++ b/intl/uconv/ucvlatin/nsUnicodeToUTF7.h
+@@ -95,7 +95,7 @@ protected:
+  * @created         03/Jun/1999
+  * @author  Catalin Rotaru [CATA]
+  */
+-class nsUnicodeToUTF7 : public nsBasicUTF7Encoder
++class nsUnicodeToUTF7 : public XPCOMGCFinalizedObject, public nsBasicUTF7Encoder
+ {
+ public:
+ 
+diff --git a/intl/uconv/util/nsUCSupport.h b/intl/uconv/util/nsUCSupport.h
+--- a/intl/uconv/util/nsUCSupport.h
++++ b/intl/uconv/util/nsUCSupport.h
+@@ -178,7 +178,7 @@ public:
+  * @created         15/Mar/1999
+  * @author  Catalin Rotaru [CATA]
+  */
+-class nsTableDecoderSupport : public nsBufferDecoderSupport
++class nsTableDecoderSupport : public XPCOMGCFinalizedObject, public nsBufferDecoderSupport
+ {
+ public:
+ 
+@@ -215,7 +215,7 @@ protected:
+  * @created         24/Mar/1999
+  * @author  Catalin Rotaru [CATA]
+  */
+-class nsMultiTableDecoderSupport : public nsBufferDecoderSupport
++class nsMultiTableDecoderSupport : public XPCOMGCFinalizedObject, public nsBufferDecoderSupport
+ {
+ public:
+ 
+@@ -255,7 +255,7 @@ protected:
+  * @created         19/Apr/1999
+  * @author  Catalin Rotaru [CATA]
+  */
+-class nsOneByteDecoderSupport : public nsBasicDecoderSupport
++class nsOneByteDecoderSupport : public XPCOMGCFinalizedObject, public nsBasicDecoderSupport
+ {
+ public:
+ 
+@@ -405,7 +405,7 @@ public:
+  * @created         17/Feb/1999
+  * @author  Catalin Rotaru [CATA]
+  */
+-class nsTableEncoderSupport : public nsEncoderSupport
++class nsTableEncoderSupport : public XPCOMGCFinalizedObject, public nsEncoderSupport
+ {
+ public:
+ 
+@@ -449,7 +449,7 @@ protected:
+  * @created         11/Mar/1999
+  * @author  Catalin Rotaru [CATA]
+  */
+-class nsMultiTableEncoderSupport : public nsEncoderSupport
++class nsMultiTableEncoderSupport : public XPCOMGCFinalizedObject, public nsEncoderSupport
+ {
+ public:
+ 
+diff --git a/intl/unicharutil/src/nsCaseConversionImp2.h b/intl/unicharutil/src/nsCaseConversionImp2.h
+--- a/intl/unicharutil/src/nsCaseConversionImp2.h
++++ b/intl/unicharutil/src/nsCaseConversionImp2.h
+@@ -43,7 +43,7 @@
+ 
+ #include "nsICaseConversion.h"
+ 
+-class nsCaseConversionImp2 : public nsICaseConversion { 
++class nsCaseConversionImp2 : public XPCOMGCFinalizedObject, public nsICaseConversion { 
+   NS_DECL_ISUPPORTS 
+ 
+ public:
+diff --git a/intl/unicharutil/src/nsCategoryImp.h b/intl/unicharutil/src/nsCategoryImp.h
+--- a/intl/unicharutil/src/nsCategoryImp.h
++++ b/intl/unicharutil/src/nsCategoryImp.h
+@@ -39,7 +39,7 @@
+ 
+ #include "nsIUGenCategory.h"
+ 
+-class nsCategoryImp : public nsIUGenCategory {
++class nsCategoryImp : public XPCOMGCFinalizedObject, public nsIUGenCategory {
+    NS_DECL_ISUPPORTS
+    
+ public:
+diff --git a/intl/unicharutil/src/nsEntityConverter.h b/intl/unicharutil/src/nsEntityConverter.h
+--- a/intl/unicharutil/src/nsEntityConverter.h
++++ b/intl/unicharutil/src/nsEntityConverter.h
+@@ -54,7 +54,7 @@ public:
+     nsCOMPtr<nsIStringBundle> mEntities;
+ };
+ 
+-class nsEntityConverter: public nsIEntityConverter
++class nsEntityConverter: public XPCOMGCFinalizedObject, public nsIEntityConverter
+ {
+ public:
+ 	
+diff --git a/intl/unicharutil/src/nsHankakuToZenkaku.cpp b/intl/unicharutil/src/nsHankakuToZenkaku.cpp
+--- a/intl/unicharutil/src/nsHankakuToZenkaku.cpp
++++ b/intl/unicharutil/src/nsHankakuToZenkaku.cpp
+@@ -131,7 +131,7 @@ void HankakuToZenkaku (
+ 
+ 
+ 
+-class nsHankakuToZenkaku : public nsITextTransform {
++class nsHankakuToZenkaku : public XPCOMGCFinalizedObject, public nsITextTransform {
+   NS_DECL_ISUPPORTS
+ 
+ public: 
+diff --git a/intl/unicharutil/src/nsSaveAsCharset.h b/intl/unicharutil/src/nsSaveAsCharset.h
+--- a/intl/unicharutil/src/nsSaveAsCharset.h
++++ b/intl/unicharutil/src/nsSaveAsCharset.h
+@@ -52,7 +52,7 @@ class nsIUnicodeEncoder;
+ class nsIUnicodeEncoder;
+ class nsIEntityConverter;
+ 
+-class nsSaveAsCharset : public nsISaveAsCharset
++class nsSaveAsCharset : public XPCOMGCFinalizedObject, public nsISaveAsCharset
+ {
+ public:
+ 	
+diff --git a/intl/unicharutil/src/nsUnicodeNormalizer.h b/intl/unicharutil/src/nsUnicodeNormalizer.h
+--- a/intl/unicharutil/src/nsUnicodeNormalizer.h
++++ b/intl/unicharutil/src/nsUnicodeNormalizer.h
+@@ -46,7 +46,7 @@ nsresult NS_NewUnicodeNormalizer(nsISupp
+ nsresult NS_NewUnicodeNormalizer(nsISupports** oResult);
+ 
+ 
+-class nsUnicodeNormalizer : public nsIUnicodeNormalizer {
++class nsUnicodeNormalizer : public XPCOMGCFinalizedObject, public nsIUnicodeNormalizer {
+ public:
+    nsUnicodeNormalizer();
+    virtual ~nsUnicodeNormalizer();
+diff --git a/js/jsd/jsd_xpc.cpp b/js/jsd/jsd_xpc.cpp
+--- a/js/jsd/jsd_xpc.cpp
++++ b/js/jsd/jsd_xpc.cpp
+@@ -3306,7 +3306,7 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR
+  * and/or removed from the app-start category by the jsdService::initAtStartup
+  * property.
+  */
+-class jsdASObserver : public nsIObserver 
++class jsdASObserver : public XPCOMGCFinalizedObject, public nsIObserver 
+ {
+   public:
+     NS_DECL_ISUPPORTS
+diff --git a/js/jsd/jsd_xpc.h b/js/jsd/jsd_xpc.h
+--- a/js/jsd/jsd_xpc.h
++++ b/js/jsd/jsd_xpc.h
+@@ -65,7 +65,7 @@ struct PCMapEntry {
+  * reflected jsd data structures
+  *******************************************************************************/
+ 
+-class jsdObject : public jsdIObject
++class jsdObject : public XPCOMGCFinalizedObject, public jsdIObject
+ {
+   public:
+     NS_DECL_ISUPPORTS
+@@ -97,7 +97,7 @@ class jsdObject : public jsdIObject
+ };
+ 
+ 
+-class jsdProperty : public jsdIProperty
++class jsdProperty : public XPCOMGCFinalizedObject, public jsdIProperty
+ {
+   public:
+     NS_DECL_ISUPPORTS
+@@ -130,7 +130,7 @@ class jsdProperty : public jsdIProperty
+     JSDProperty   *mProperty;
+ };
+ 
+-class jsdScript : public jsdIScript
++class jsdScript : public XPCOMGCFinalizedObject, public jsdIScript
+ {
+   public:
+     NS_DECL_ISUPPORTS
+@@ -187,7 +187,7 @@ class jsdScript : public jsdIScript
+ 
+ PRUint32 jsdScript::LastTag = 0;
+ 
+-class jsdContext : public jsdIContext
++class jsdContext : public XPCOMGCFinalizedObject, public jsdIContext
+ {
+   public:
+     NS_DECL_ISUPPORTS
+@@ -215,7 +215,7 @@ class jsdContext : public jsdIContext
+ 
+ PRUint32 jsdContext::LastTag = 0;
+ 
+-class jsdStackFrame : public jsdIStackFrame
++class jsdStackFrame : public XPCOMGCFinalizedObject, public jsdIStackFrame
+ {
+   public:
+     NS_DECL_ISUPPORTS
+@@ -243,7 +243,7 @@ class jsdStackFrame : public jsdIStackFr
+     JSDStackFrameInfo *mStackFrameInfo;
+ };
+ 
+-class jsdValue : public jsdIValue
++class jsdValue : public XPCOMGCFinalizedObject, public jsdIValue
+ {
+   public:
+     NS_DECL_ISUPPORTS
+@@ -271,7 +271,7 @@ class jsdValue : public jsdIValue
+  * debugger service
+  ******************************************************************************/
+ 
+-class jsdService : public jsdIDebuggerService
++class jsdService : public XPCOMGCFinalizedObject, public jsdIDebuggerService
+ {
+   public:
+     NS_DECL_ISUPPORTS
+diff --git a/js/src/xpconnect/loader/mozJSComponentLoader.h b/js/src/xpconnect/loader/mozJSComponentLoader.h
+--- a/js/src/xpconnect/loader/mozJSComponentLoader.h
++++ b/js/src/xpconnect/loader/mozJSComponentLoader.h
+@@ -68,7 +68,7 @@
+ #define MOZJSCOMPONENTLOADER_TYPE_NAME "text/javascript"
+ 
+ // nsIFastLoadFileIO implementation for component fastload
+-class nsXPCFastLoadIO : public nsIFastLoadFileIO
++class nsXPCFastLoadIO : public XPCOMGCFinalizedObject, public nsIFastLoadFileIO
+ {
+  public:
+     NS_DECL_ISUPPORTS
+@@ -88,7 +88,8 @@ class nsXPCFastLoadIO : public nsIFastLo
+ };
+ 
+ 
+-class mozJSComponentLoader : public nsIModuleLoader,
++class mozJSComponentLoader : public XPCOMGCFinalizedObject,
++                             public nsIModuleLoader,
+                              public xpcIJSModuleLoader,
+                              public nsIObserver
+ {
+diff --git a/js/src/xpconnect/loader/mozJSSubScriptLoader.h b/js/src/xpconnect/loader/mozJSSubScriptLoader.h
+--- a/js/src/xpconnect/loader/mozJSSubScriptLoader.h
++++ b/js/src/xpconnect/loader/mozJSSubScriptLoader.h
+@@ -50,7 +50,7 @@
+     {0x8e, 0x08, 0x82, 0xfa, 0x0a, 0x33, 0x9b, 0x00} \
+ }
+ 
+-class mozJSSubScriptLoader : public mozIJSSubScriptLoader
++class mozJSSubScriptLoader : public XPCOMGCFinalizedObject, public mozIJSSubScriptLoader
+ {
+ public:
+     mozJSSubScriptLoader();
+diff --git a/js/src/xpconnect/src/xpcJSWeakReference.h b/js/src/xpconnect/src/xpcJSWeakReference.h
+--- a/js/src/xpconnect/src/xpcJSWeakReference.h
++++ b/js/src/xpconnect/src/xpcJSWeakReference.h
+@@ -40,7 +40,7 @@
+ #include "xpcIJSWeakReference.h"
+ #include "nsIWeakReference.h"
+ 
+-class xpcJSWeakReference : public xpcIJSWeakReference
++class xpcJSWeakReference : public XPCOMGCFinalizedObject, public xpcIJSWeakReference
+ {
+ public:
+     xpcJSWeakReference();
+diff --git a/js/src/xpconnect/src/xpcstack.cpp b/js/src/xpconnect/src/xpcstack.cpp
+--- a/js/src/xpconnect/src/xpcstack.cpp
++++ b/js/src/xpconnect/src/xpcstack.cpp
+@@ -42,7 +42,7 @@
+ 
+ #include "xpcprivate.h"
+ 
+-class XPCJSStackFrame : public nsIStackFrame
++class XPCJSStackFrame : public XPCOMGCFinalizedObject, public nsIStackFrame
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/js/src/xpconnect/tests/TestXPC.cpp b/js/src/xpconnect/tests/TestXPC.cpp
+--- a/js/src/xpconnect/tests/TestXPC.cpp
++++ b/js/src/xpconnect/tests/TestXPC.cpp
+@@ -136,7 +136,7 @@ my_ErrorReporter(JSContext *cx, const ch
+ /***************************************************************************/
+ // Foo class for used with some of the tests
+ 
+-class nsTestXPCFoo : public nsITestXPCFoo2
++class nsTestXPCFoo : public XPCOMGCFinalizedObject, public nsITestXPCFoo2
+ {
+     NS_DECL_ISUPPORTS
+     NS_DECL_NSITESTXPCFOO
+@@ -200,7 +200,7 @@ nsTestXPCFoo::~nsTestXPCFoo()
+ /***************************************************************************/
+ // test for nsIXPCSecurityManager
+ 
+-class MySecMan : public nsIXPCSecurityManager
++class MySecMan : public XPCOMGCFinalizedObject, public nsIXPCSecurityManager
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/js/src/xpconnect/tests/components/xpctest_array.cpp b/js/src/xpconnect/tests/components/xpctest_array.cpp
+--- a/js/src/xpconnect/tests/components/xpctest_array.cpp
++++ b/js/src/xpconnect/tests/components/xpctest_array.cpp
+@@ -42,7 +42,7 @@
+ 
+ #include "xpctest_private.h"
+ 
+-class xpcarraytest : public nsIXPCTestArray
++class xpcarraytest : public XPCOMGCFinalizedObject, public nsIXPCTestArray
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/js/src/xpconnect/tests/components/xpctest_attributes.cpp b/js/src/xpconnect/tests/components/xpctest_attributes.cpp
+--- a/js/src/xpconnect/tests/components/xpctest_attributes.cpp
++++ b/js/src/xpconnect/tests/components/xpctest_attributes.cpp
+@@ -46,7 +46,7 @@
+   {0x1364941e, 0x4462, 0x11d3, \
+     { 0x82, 0xee, 0x00, 0x60, 0xb0, 0xeb, 0x59, 0x6f }}
+ 
+-class xpcTestObjectReadOnly : public nsIXPCTestObjectReadOnly {
++class xpcTestObjectReadOnly : public XPCOMGCFinalizedObject, public nsIXPCTestObjectReadOnly {
+  public: 
+   NS_DECL_ISUPPORTS
+   NS_DECL_NSIXPCTESTOBJECTREADONLY
+@@ -143,7 +143,7 @@ xpctest::ConstructXPCTestObjectReadOnly(
+   {0x3b9b1d38, 0x491a, 0x11d3, \
+     { 0x82, 0xef, 0x00, 0x60, 0xb0, 0xeb, 0x59, 0x6f }}
+ 
+-class xpcTestObjectReadWrite : public nsIXPCTestObjectReadWrite {
++class xpcTestObjectReadWrite : public XPCOMGCFinalizedObject, public nsIXPCTestObjectReadWrite {
+   public: 
+   NS_DECL_ISUPPORTS
+   NS_DECL_NSIXPCTESTOBJECTREADWRITE
+diff --git a/js/src/xpconnect/tests/components/xpctest_calljs.cpp b/js/src/xpconnect/tests/components/xpctest_calljs.cpp
+--- a/js/src/xpconnect/tests/components/xpctest_calljs.cpp
++++ b/js/src/xpconnect/tests/components/xpctest_calljs.cpp
+@@ -44,7 +44,7 @@
+ #include "nsISupports.h"
+ #include "nsIClassInfoImpl.h"
+ 
+-class xpcTestCallJS : public nsIXPCTestCallJS, public nsIXPCScriptable {
++class xpcTestCallJS : public XPCOMGCFinalizedObject, public nsIXPCTestCallJS, public nsIXPCScriptable {
+ public:
+     NS_DECL_ISUPPORTS
+     NS_DECL_NSIXPCTESTCALLJS
+diff --git a/js/src/xpconnect/tests/components/xpctest_child.cpp b/js/src/xpconnect/tests/components/xpctest_child.cpp
+--- a/js/src/xpconnect/tests/components/xpctest_child.cpp
++++ b/js/src/xpconnect/tests/components/xpctest_child.cpp
+@@ -141,7 +141,7 @@ NS_IMETHODIMP xpctestParent::Method1a(ns
+ /***************************************************************************/
+ #else
+ /***************************************************************************/
+-class xpctestChild : public nsIXPCTestChild
++class xpctestChild : public XPCOMGCFinalizedObject, public nsIXPCTestChild
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/js/src/xpconnect/tests/components/xpctest_const.cpp b/js/src/xpconnect/tests/components/xpctest_const.cpp
+--- a/js/src/xpconnect/tests/components/xpctest_const.cpp
++++ b/js/src/xpconnect/tests/components/xpctest_const.cpp
+@@ -42,7 +42,7 @@
+ #include "xpctest_const.h"
+ #include "xpctest_private.h"
+ 
+-class xpcTestConst : public nsIXPCTestConst {
++class xpcTestConst : public XPCOMGCFinalizedObject, public nsIXPCTestConst {
+ public:
+   NS_DECL_ISUPPORTS
+   NS_DECL_NSIXPCTESTCONST
+diff --git a/js/src/xpconnect/tests/components/xpctest_domstring.cpp b/js/src/xpconnect/tests/components/xpctest_domstring.cpp
+--- a/js/src/xpconnect/tests/components/xpctest_domstring.cpp
++++ b/js/src/xpconnect/tests/components/xpctest_domstring.cpp
+@@ -43,7 +43,7 @@
+ #include "xpctest_domstring.h"
+ #include "xpctest_private.h"
+ 
+-class xpcTestDOMString : public nsIXPCTestDOMString {
++class xpcTestDOMString : public XPCOMGCFinalizedObject, public nsIXPCTestDOMString {
+ public:
+     NS_DECL_ISUPPORTS
+     NS_DECL_NSIXPCTESTDOMSTRING
+diff --git a/js/src/xpconnect/tests/components/xpctest_echo.cpp b/js/src/xpconnect/tests/components/xpctest_echo.cpp
+--- a/js/src/xpconnect/tests/components/xpctest_echo.cpp
++++ b/js/src/xpconnect/tests/components/xpctest_echo.cpp
+@@ -46,7 +46,7 @@
+ #define IMPLEMENT_TIMER_STUFF 1
+ #endif
+ 
+-class xpctestEcho : public nsIEcho
++class xpctestEcho : public XPCOMGCFinalizedObject, public nsIEcho
+ #ifdef IMPLEMENT_TIMER_STUFF
+ , public nsITimerCallback
+ #endif // IMPLEMENT_TIMER_STUFF
+diff --git a/js/src/xpconnect/tests/components/xpctest_in.cpp b/js/src/xpconnect/tests/components/xpctest_in.cpp
+--- a/js/src/xpconnect/tests/components/xpctest_in.cpp
++++ b/js/src/xpconnect/tests/components/xpctest_in.cpp
+@@ -46,7 +46,7 @@
+     { 0xa7, 0x35, 0x00, 0x9b, 0x9a, 0x75, 0x92, 0x04 }}
+ 
+ 
+-class xpcTestIn : public nsIXPCTestIn {
++class xpcTestIn : public XPCOMGCFinalizedObject, public nsIXPCTestIn {
+ public:
+   NS_DECL_ISUPPORTS
+   NS_DECL_NSIXPCTESTIN
+diff --git a/js/src/xpconnect/tests/components/xpctest_inout.cpp b/js/src/xpconnect/tests/components/xpctest_inout.cpp
+--- a/js/src/xpconnect/tests/components/xpctest_inout.cpp
++++ b/js/src/xpconnect/tests/components/xpctest_inout.cpp
+@@ -42,7 +42,7 @@
+ #include "xpctest_inout.h"
+ #include "xpctest_private.h"
+ 
+-class xpcTestInOut : public nsIXPCTestInOut {
++class xpcTestInOut : public XPCOMGCFinalizedObject, public nsIXPCTestInOut {
+ public:
+   NS_DECL_ISUPPORTS
+   NS_DECL_NSIXPCTESTINOUT
+diff --git a/js/src/xpconnect/tests/components/xpctest_multiple.cpp b/js/src/xpconnect/tests/components/xpctest_multiple.cpp
+--- a/js/src/xpconnect/tests/components/xpctest_multiple.cpp
++++ b/js/src/xpconnect/tests/components/xpctest_multiple.cpp
+@@ -43,7 +43,7 @@
+ #include "xpctest_private.h"
+ #include "nsIClassInfoImpl.h"
+ 
+-class xpcTestParentOne : public nsIXPCTestParentOne {
++class xpcTestParentOne : public XPCOMGCFinalizedObject, public nsIXPCTestParentOne {
+ public: 
+     NS_DECL_ISUPPORTS
+     NS_DECL_NSIXPCTESTPARENTONE
+@@ -106,7 +106,7 @@ xpctest::ConstructXPCTestParentOne(nsISu
+ 
+ /*****************************************************************************/
+ 
+-class xpcTestParentTwo : public nsIXPCTestParentTwo {
++class xpcTestParentTwo : public XPCOMGCFinalizedObject, public nsIXPCTestParentTwo {
+ public: 
+   NS_DECL_NSIXPCTESTPARENTTWO
+   NS_DECL_ISUPPORTS
+@@ -174,7 +174,7 @@ xpctest::ConstructXPCTestParentTwo(nsISu
+  * nsIXPCTestChild2 inherits from nsISupports
+  */
+ 
+-class xpcTestChild2 : public nsIXPCTestChild2, public nsIXPCTestParentOne, public nsIXPCTestParentTwo {
++class xpcTestChild2 : public XPCOMGCFinalizedObject, public nsIXPCTestChild2, public nsIXPCTestParentOne, public nsIXPCTestParentTwo {
+ public: 
+   NS_DECL_NSIXPCTESTCHILD2
+   NS_DECL_NSIXPCTESTPARENTONE
+@@ -296,7 +296,7 @@ xpctest::ConstructXPCTestChild2(nsISuppo
+  * nsIXPCTestParentOne
+  */
+ 
+-class xpcTestChild3 : public nsIXPCTestChild3 {
++class xpcTestChild3 : public XPCOMGCFinalizedObject, public nsIXPCTestChild3 {
+ public: 
+   NS_DECL_ISUPPORTS
+   NS_DECL_NSIXPCTESTCHILD3
+diff --git a/js/src/xpconnect/tests/components/xpctest_noisy.cpp b/js/src/xpconnect/tests/components/xpctest_noisy.cpp
+--- a/js/src/xpconnect/tests/components/xpctest_noisy.cpp
++++ b/js/src/xpconnect/tests/components/xpctest_noisy.cpp
+@@ -43,7 +43,7 @@
+ 
+ #include "xpctest_private.h"
+ 
+-class xpctestNoisy : public nsIXPCTestNoisy
++class xpctestNoisy : public XPCOMGCFinalizedObject, public nsIXPCTestNoisy
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/js/src/xpconnect/tests/components/xpctest_out.cpp b/js/src/xpconnect/tests/components/xpctest_out.cpp
+--- a/js/src/xpconnect/tests/components/xpctest_out.cpp
++++ b/js/src/xpconnect/tests/components/xpctest_out.cpp
+@@ -46,7 +46,7 @@
+   {0x4105ae88, 0x5599, 0x11d3, \
+     { 0x82, 0xef, 0x00, 0x60, 0xb0, 0xeb, 0x59, 0x6f }}
+ 
+-class xpcTestOut : public nsIXPCTestOut {
++class xpcTestOut : public XPCOMGCFinalizedObject, public nsIXPCTestOut {
+ public:
+ NS_DECL_ISUPPORTS
+ NS_DECL_NSIXPCTESTOUT
+diff --git a/js/src/xpconnect/tests/components/xpctest_overloaded.cpp b/js/src/xpconnect/tests/components/xpctest_overloaded.cpp
+--- a/js/src/xpconnect/tests/components/xpctest_overloaded.cpp
++++ b/js/src/xpconnect/tests/components/xpctest_overloaded.cpp
+@@ -94,7 +94,7 @@
+ * nsIXPCScriptable instance per class if desired.
+ */
+ 
+-class xpcoverloaded : public nsIXPCTestOverloaded, public nsIXPCScriptable
++class xpcoverloaded : public XPCOMGCFinalizedObject, public nsIXPCTestOverloaded, public nsIXPCScriptable
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/js/src/xpconnect/tests/components/xpctest_string.cpp b/js/src/xpconnect/tests/components/xpctest_string.cpp
+--- a/js/src/xpconnect/tests/components/xpctest_string.cpp
++++ b/js/src/xpconnect/tests/components/xpctest_string.cpp
+@@ -42,7 +42,7 @@
+ 
+ #include "xpctest_private.h"
+ 
+-class xpcstringtest : public nsIXPCTestString
++class xpcstringtest : public XPCOMGCFinalizedObject, public nsIXPCTestString
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/js/src/xpconnect/tests/components/xpctest_variant.cpp b/js/src/xpconnect/tests/components/xpctest_variant.cpp
+--- a/js/src/xpconnect/tests/components/xpctest_variant.cpp
++++ b/js/src/xpconnect/tests/components/xpctest_variant.cpp
+@@ -43,7 +43,7 @@
+ #include "xpctest_private.h"
+ #include "nsString.h"
+ 
+-class nsTestVariant : public nsITestVariant
++class nsTestVariant : public XPCOMGCFinalizedObject, public nsITestVariant
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/layout/base/nsCaret.h b/layout/base/nsCaret.h
+--- a/layout/base/nsCaret.h
++++ b/layout/base/nsCaret.h
+@@ -50,7 +50,8 @@ class nsIView;
+ 
+ //-----------------------------------------------------------------------------
+ 
+-class nsCaret : public nsICaret,
++class nsCaret : public XPCOMGCFinalizedObject,
++                public nsICaret,
+                 public nsISelectionListener
+ {
+   public:
+diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp
+--- a/layout/base/nsDocumentViewer.cpp
++++ b/layout/base/nsDocumentViewer.cpp
+@@ -230,7 +230,7 @@ class DocumentViewerImpl;
+ #pragma mark ** nsDocViewerSelectionListener **
+ #endif
+ 
+-class nsDocViewerSelectionListener : public nsISelectionListener
++class nsDocViewerSelectionListener : public XPCOMGCFinalizedObject, public nsISelectionListener
+ {
+ public:
+ 
+@@ -262,7 +262,7 @@ protected:
+ 
+ /** editor Implementation of the FocusListener interface
+  */
+-class nsDocViewerFocusListener : public nsIDOMFocusListener
++class nsDocViewerFocusListener : public XPCOMGCFinalizedObject, public nsIDOMFocusListener
+ {
+ public:
+   /** default constructor
+@@ -294,7 +294,8 @@ private:
+ #endif
+ 
+ //-------------------------------------------------------------
+-class DocumentViewerImpl : public nsIDocumentViewer,
++class DocumentViewerImpl : public XPCOMGCFinalizedObject,
++                           public nsIDocumentViewer,
+                            public nsIContentViewerEdit,
+                            public nsIContentViewerFile,
+                            public nsIMarkupDocumentViewer,
+diff --git a/layout/base/nsFocusEventSuppressor.cpp b/layout/base/nsFocusEventSuppressor.cpp
+--- a/layout/base/nsFocusEventSuppressor.cpp
++++ b/layout/base/nsFocusEventSuppressor.cpp
+@@ -38,7 +38,7 @@
+ #include "nsIFocusEventSuppressor.h"
+ #include "nsTArray.h"
+ 
+-class nsFocusEventSuppressorService : public nsIFocusEventSuppressorService
++class nsFocusEventSuppressorService : public XPCOMGCFinalizedObject, public nsIFocusEventSuppressorService
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/layout/base/nsFrameTraversal.cpp b/layout/base/nsFrameTraversal.cpp
+--- a/layout/base/nsFrameTraversal.cpp
++++ b/layout/base/nsFrameTraversal.cpp
+@@ -42,7 +42,7 @@
+ #include "nsPlaceholderFrame.h"
+ 
+ 
+-class nsFrameIterator: public nsIBidirectionalEnumerator
++class nsFrameIterator: public XPCOMGCFinalizedObject, public nsIBidirectionalEnumerator
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/layout/base/nsFrameTraversal.h b/layout/base/nsFrameTraversal.h
+--- a/layout/base/nsFrameTraversal.h
++++ b/layout/base/nsFrameTraversal.h
+@@ -51,7 +51,7 @@ nsresult NS_NewFrameTraversal(nsIBidirec
+ 
+ nsresult NS_CreateFrameTraversal(nsIFrameTraversal** aResult);
+ 
+-class nsFrameTraversal : public nsIFrameTraversal
++class nsFrameTraversal : public XPCOMGCFinalizedObject, public nsIFrameTraversal
+ {
+ public:
+   nsFrameTraversal();
+diff --git a/layout/base/nsImageLoader.h b/layout/base/nsImageLoader.h
+--- a/layout/base/nsImageLoader.h
++++ b/layout/base/nsImageLoader.h
+@@ -48,7 +48,7 @@ class nsIURI;
+ #include "imgIRequest.h"
+ #include "nsCOMPtr.h"
+ 
+-class nsImageLoader : public nsStubImageDecoderObserver
++class nsImageLoader : public XPCOMGCFinalizedObject, public nsStubImageDecoderObserver
+ {
+ public:
+   nsImageLoader();
+diff --git a/layout/base/nsLayoutDebugger.cpp b/layout/base/nsLayoutDebugger.cpp
+--- a/layout/base/nsLayoutDebugger.cpp
++++ b/layout/base/nsLayoutDebugger.cpp
+@@ -48,7 +48,7 @@
+ #include <stdio.h>
+ 
+ #ifdef NS_DEBUG
+-class nsLayoutDebugger : public nsILayoutDebugger {
++class nsLayoutDebugger : public XPCOMGCFinalizedObject, public nsILayoutDebugger {
+ public:
+   nsLayoutDebugger();
+   virtual ~nsLayoutDebugger();
+diff --git a/layout/base/nsLayoutHistoryState.cpp b/layout/base/nsLayoutHistoryState.cpp
+--- a/layout/base/nsLayoutHistoryState.cpp
++++ b/layout/base/nsLayoutHistoryState.cpp
+@@ -46,7 +46,8 @@
+ #include "nsClassHashtable.h"
+ #include "nsPresState.h"
+ 
+-class nsLayoutHistoryState : public nsILayoutHistoryState,
++class nsLayoutHistoryState : public XPCOMGCFinalizedObject,
++                             public nsILayoutHistoryState,
+                              public nsSupportsWeakReference
+ {
+ public:
+diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h
+--- a/layout/base/nsPresContext.h
++++ b/layout/base/nsPresContext.h
+@@ -145,7 +145,7 @@ enum nsLayoutPhase {
+ // An interface for presentation contexts. Presentation contexts are
+ // objects that provide an outer context for a presentation shell.
+ 
+-class nsPresContext : public nsIObserver {
++class nsPresContext : public XPCOMGCFinalizedObject, public nsIObserver {
+ public:
+   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+   NS_DECL_NSIOBSERVER
+diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp
+--- a/layout/base/nsPresShell.cpp
++++ b/layout/base/nsPresShell.cpp
+@@ -767,7 +767,7 @@ class nsPresShellEventCB;
+ class nsPresShellEventCB;
+ class nsAutoCauseReflowNotifier;
+ 
+-class PresShell : public nsIPresShell, public nsIViewObserver,
++class PresShell : public XPCOMGCFinalizedObject, public nsIPresShell, public nsIViewObserver,
+                   public nsStubDocumentObserver,
+                   public nsISelectionController, public nsIObserver,
+                   public nsSupportsWeakReference
+diff --git a/layout/base/nsStyleSheetService.h b/layout/base/nsStyleSheetService.h
+--- a/layout/base/nsStyleSheetService.h
++++ b/layout/base/nsStyleSheetService.h
+@@ -54,7 +54,7 @@ class nsICategoryManager;
+ #define NS_STYLESHEETSERVICE_CONTRACTID \
+   "@mozilla.org/content/style-sheet-service;1"
+ 
+-class nsStyleSheetService : public nsIStyleSheetService
++class nsStyleSheetService : public XPCOMGCFinalizedObject, public nsIStyleSheetService
+ {
+  public:
+   nsStyleSheetService() NS_HIDDEN;
+diff --git a/layout/build/nsContentDLF.h b/layout/build/nsContentDLF.h
+--- a/layout/build/nsContentDLF.h
++++ b/layout/build/nsContentDLF.h
+@@ -53,7 +53,7 @@ class nsIStreamListener;
+ class nsIStreamListener;
+ struct nsModuleComponentInfo;
+ 
+-class nsContentDLF : public nsIDocumentLoaderFactory
++class nsContentDLF : public XPCOMGCFinalizedObject, public nsIDocumentLoaderFactory
+ {
+ public:
+   nsContentDLF();
+diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp
+--- a/layout/build/nsLayoutModule.cpp
++++ b/layout/build/nsLayoutModule.cpp
+@@ -298,7 +298,7 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR
+ // references to objects in other component libraries that have already been
+ // shutdown (and possibly unloaded if 60709 is ever fixed).
+ 
+-class LayoutShutdownObserver : public nsIObserver
++class LayoutShutdownObserver : public XPCOMGCFinalizedObject, public nsIObserver
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp
+--- a/layout/forms/nsComboboxControlFrame.cpp
++++ b/layout/forms/nsComboboxControlFrame.cpp
+@@ -124,7 +124,7 @@ const PRInt32 kSizeNotSet = -1;
+  * combo box is toggled to open or close. this is used by Accessibility which presses
+  * that button Programmatically.
+  */
+-class nsComboButtonListener: public nsIDOMMouseListener
++class nsComboButtonListener: public XPCOMGCFinalizedObject, public nsIDOMMouseListener
+ {
+   public:
+ 
+diff --git a/layout/forms/nsFileControlFrame.h b/layout/forms/nsFileControlFrame.h
+--- a/layout/forms/nsFileControlFrame.h
++++ b/layout/forms/nsFileControlFrame.h
+@@ -100,7 +100,7 @@ protected:
+ protected:
+   class MouseListener;
+   friend class MouseListener;
+-  class MouseListener : public nsIDOMMouseListener {
++  class MouseListener : public XPCOMGCFinalizedObject, public nsIDOMMouseListener {
+   public:
+     NS_DECL_ISUPPORTS
+     
+diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp
+--- a/layout/forms/nsListControlFrame.cpp
++++ b/layout/forms/nsListControlFrame.cpp
+@@ -113,7 +113,8 @@ DOMTimeStamp nsListControlFrame::gLastKe
+  * Frames are not refcounted so they can't be used as event listeners.
+  *****************************************************************************/
+ 
+-class nsListEventListener : public nsIDOMKeyListener,
++class nsListEventListener : public XPCOMGCFinalizedObject,
++                            public nsIDOMKeyListener,
+                             public nsIDOMMouseListener,
+                             public nsIDOMMouseMotionListener
+ {
+diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp
+--- a/layout/forms/nsTextControlFrame.cpp
++++ b/layout/forms/nsTextControlFrame.cpp
+@@ -180,7 +180,8 @@ GetWrapPropertyEnum(nsIContent* aContent
+   return PR_FALSE;
+ }
+ 
+-class nsTextInputListener : public nsISelectionListener,
++class nsTextInputListener : public XPCOMGCFinalizedObject,
++                            public nsISelectionListener,
+                             public nsIDOMFocusListener,
+                             public nsIDOMKeyListener,
+                             public nsIEditorObserver,
+@@ -558,7 +559,8 @@ nsTextInputListener::GetKeyBindings()
+ 
+ // END nsTextInputListener
+ 
+-class nsTextInputSelectionImpl : public nsSupportsWeakReference
++class nsTextInputSelectionImpl : public XPCOMGCFinalizedObject
++                               , public nsSupportsWeakReference
+                                , public nsISelectionController
+ {
+ public:
+diff --git a/layout/generic/nsAutoCopyListener.h b/layout/generic/nsAutoCopyListener.h
+--- a/layout/generic/nsAutoCopyListener.h
++++ b/layout/generic/nsAutoCopyListener.h
+@@ -41,7 +41,7 @@
+ #include "nsISelectionListener.h"
+ #include "nsISelectionPrivate.h"
+ 
+-class nsAutoCopyListener : public nsISelectionListener
++class nsAutoCopyListener : public XPCOMGCFinalizedObject, public nsISelectionListener
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/layout/generic/nsBulletFrame.cpp b/layout/generic/nsBulletFrame.cpp
+--- a/layout/generic/nsBulletFrame.cpp
++++ b/layout/generic/nsBulletFrame.cpp
+@@ -62,7 +62,7 @@
+ #include "nsIComponentManager.h"
+ #include "nsContentUtils.h"
+ 
+-class nsBulletListener : public nsStubImageDecoderObserver
++class nsBulletListener : public XPCOMGCFinalizedObject, public nsStubImageDecoderObserver
+ {
+ public:
+   nsBulletListener();
+diff --git a/layout/generic/nsFrameSelection.h b/layout/generic/nsFrameSelection.h
+--- a/layout/generic/nsFrameSelection.h
++++ b/layout/generic/nsFrameSelection.h
+@@ -200,7 +200,7 @@ class nsIScrollableView;
+  * or they may cause other objects to be deleted.
+  */
+ 
+-class nsFrameSelection : public nsISupports {
++class nsFrameSelection : public XPCOMGCFinalizedObject, public nsISupports {
+ public:
+   NS_DECLARE_STATIC_IID_ACCESSOR(NS_FRAME_SELECTION_IID)
+   enum HINT { HINTLEFT = 0, HINTRIGHT = 1};  //end of this line or beginning of next
+diff --git a/layout/generic/nsFrameUtil.cpp b/layout/generic/nsFrameUtil.cpp
+--- a/layout/generic/nsFrameUtil.cpp
++++ b/layout/generic/nsFrameUtil.cpp
+@@ -46,7 +46,7 @@
+ 
+ 
+ #ifdef NS_DEBUG
+-class nsFrameUtil : public nsIFrameUtil {
++class nsFrameUtil : public XPCOMGCFinalizedObject, public nsIFrameUtil {
+ public:
+   nsFrameUtil();
+   virtual ~nsFrameUtil();
+diff --git a/layout/generic/nsImageFrame.h b/layout/generic/nsImageFrame.h
+--- a/layout/generic/nsImageFrame.h
++++ b/layout/generic/nsImageFrame.h
+@@ -64,7 +64,7 @@ class nsDisplayImage;
+ 
+ class nsImageFrame;
+ 
+-class nsImageListener : public nsStubImageDecoderObserver
++class nsImageListener : public XPCOMGCFinalizedObject, public nsStubImageDecoderObserver
+ {
+ public:
+   nsImageListener(nsImageFrame *aFrame);
+@@ -297,7 +297,7 @@ private:
+   // is an input arg telling the routine if the request has completed)
+   PRBool HandleIconLoads(imgIRequest* aRequest, PRBool aCompleted);
+ 
+-  class IconLoad : public nsIObserver {
++  class IconLoad : public XPCOMGCFinalizedObject, public nsIObserver {
+     // private class that wraps the data and logic needed for 
+     // broken image and loading image icons
+   public:
+diff --git a/layout/generic/nsImageMap.h b/layout/generic/nsImageMap.h
+--- a/layout/generic/nsImageMap.h
++++ b/layout/generic/nsImageMap.h
+@@ -56,7 +56,7 @@ class nsString;
+ class nsString;
+ class nsIDOMEvent;
+ 
+-class nsImageMap : public nsStubMutationObserver, public nsIDOMFocusListener,
++class nsImageMap : public XPCOMGCFinalizedObject, public nsStubMutationObserver, public nsIDOMFocusListener,
+                    public nsIImageMap
+ {
+ public:
+diff --git a/layout/generic/nsLineBox.h b/layout/generic/nsLineBox.h
+--- a/layout/generic/nsLineBox.h
++++ b/layout/generic/nsLineBox.h
+@@ -1508,7 +1508,7 @@ nsLineList_const_reverse_iterator::opera
+ 
+ //----------------------------------------------------------------------
+ 
+-class nsLineIterator : public nsILineIteratorNavigator {
++class nsLineIterator : public XPCOMGCFinalizedObject, public nsILineIteratorNavigator {
+ public:
+   nsLineIterator();
+   virtual ~nsLineIterator();
+diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp
+--- a/layout/generic/nsObjectFrame.cpp
++++ b/layout/generic/nsObjectFrame.cpp
+@@ -188,7 +188,8 @@ static PRLogModuleInfo *nsObjectFrameLM 
+ // special class for handeling DOM context menu events because for
+ // some reason it starves other mouse events if implemented on the
+ // same class
+-class nsPluginDOMContextMenuListener : public nsIDOMContextMenuListener,
++class nsPluginDOMContextMenuListener : public XPCOMGCFinalizedObject,
++                                       public nsIDOMContextMenuListener,
+                                        public nsIEventListener
+ {
+ public:
+@@ -213,7 +214,8 @@ public:
+ };
+ 
+ 
+-class nsPluginInstanceOwner : public nsIPluginInstanceOwner,
++class nsPluginInstanceOwner : public XPCOMGCFinalizedObject,
++                              public nsIPluginInstanceOwner,
+                               public nsIPluginTagInfo2,
+ #ifdef OJI
+                               public nsIJVMPluginTagInfo,
+diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp
+--- a/layout/generic/nsSelection.cpp
++++ b/layout/generic/nsSelection.cpp
+@@ -193,7 +193,8 @@ struct RangeData
+ // This ensures that nsFrameSelection is never deleted before its
+ // nsTypedSelections.
+ 
+-class nsTypedSelection : public nsISelection2,
++class nsTypedSelection : public XPCOMGCFinalizedObject,
++                         public nsISelection2,
+                          public nsISelectionPrivate,
+                          public nsSupportsWeakReference
+ {
+@@ -398,7 +399,7 @@ public:
+   }
+ };
+ 
+-class nsSelectionIterator : public nsIBidirectionalEnumerator
++class nsSelectionIterator : public XPCOMGCFinalizedObject, public nsIBidirectionalEnumerator
+ {
+ public:
+ /*BEGIN nsIEnumerator interfaces
+@@ -427,7 +428,7 @@ private:
+   SelectionType mType;
+ };
+ 
+-class nsAutoScrollTimer : public nsITimerCallback
++class nsAutoScrollTimer : public XPCOMGCFinalizedObject, public nsITimerCallback
+ {
+ public:
+ 
+diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp
+--- a/layout/generic/nsTextFrameThebes.cpp
++++ b/layout/generic/nsTextFrameThebes.cpp
+@@ -2512,7 +2512,7 @@ PropertyProvider::SetupJustificationSpac
+ 
+ // Helper class for managing blinking text
+ 
+-class nsBlinkTimer : public nsITimerCallback
++class nsBlinkTimer : public XPCOMGCFinalizedObject, public nsITimerCallback
+ {
+ public:
+   nsBlinkTimer();
+diff --git a/layout/inspector/src/inCSSValueSearch.h b/layout/inspector/src/inCSSValueSearch.h
+--- a/layout/inspector/src/inCSSValueSearch.h
++++ b/layout/inspector/src/inCSSValueSearch.h
+@@ -52,7 +52,7 @@ class nsIDOMCSSStyleRule;
+ class nsIDOMCSSStyleRule;
+ class nsIURI;
+ 
+-class inCSSValueSearch : public inICSSValueSearch
++class inCSSValueSearch : public XPCOMGCFinalizedObject, public inICSSValueSearch
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/layout/inspector/src/inDOMUtils.h b/layout/inspector/src/inDOMUtils.h
+--- a/layout/inspector/src/inDOMUtils.h
++++ b/layout/inspector/src/inDOMUtils.h
+@@ -44,7 +44,7 @@
+ #include "nsISupportsArray.h"
+ #include "nsIInspectorCSSUtils.h"
+ 
+-class inDOMUtils : public inIDOMUtils
++class inDOMUtils : public XPCOMGCFinalizedObject, public inIDOMUtils
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/layout/inspector/src/inDOMView.h b/layout/inspector/src/inDOMView.h
+--- a/layout/inspector/src/inDOMView.h
++++ b/layout/inspector/src/inDOMView.h
+@@ -52,7 +52,8 @@
+ 
+ class inDOMViewNode;
+ 
+-class inDOMView : public inIDOMView,
++class inDOMView : public XPCOMGCFinalizedObject,
++                  public inIDOMView,
+                   public nsITreeView,
+                   public nsStubMutationObserver
+ {
+diff --git a/layout/inspector/src/inDeepTreeWalker.h b/layout/inspector/src/inDeepTreeWalker.h
+--- a/layout/inspector/src/inDeepTreeWalker.h
++++ b/layout/inspector/src/inDeepTreeWalker.h
+@@ -46,7 +46,7 @@
+ 
+ class inIDOMUtils;
+ 
+-class inDeepTreeWalker : public inIDeepTreeWalker
++class inDeepTreeWalker : public XPCOMGCFinalizedObject, public inIDeepTreeWalker
+ {
+ public:
+ 	NS_DECL_ISUPPORTS
+diff --git a/layout/inspector/src/inFlasher.h b/layout/inspector/src/inFlasher.h
+--- a/layout/inspector/src/inFlasher.h
++++ b/layout/inspector/src/inFlasher.h
+@@ -52,7 +52,7 @@
+ #define DIR_VERTICAL 0
+ #define DIR_HORIZONTAL 1 
+ 
+-class inFlasher : public inIFlasher
++class inFlasher : public XPCOMGCFinalizedObject, public inIFlasher
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/layout/mathml/base/src/nsMathMLChar.cpp b/layout/mathml/base/src/nsMathMLChar.cpp
+--- a/layout/mathml/base/src/nsMathMLChar.cpp
++++ b/layout/mathml/base/src/nsMathMLChar.cpp
+@@ -515,7 +515,7 @@ nsGlyphTable::HasPartsOf(nsPresContext* 
+ // user' system. The class is an XPCOM shutdown observer to allow us to
+ // free its allocated data at shutdown
+ 
+-class nsGlyphTableList : public nsIObserver
++class nsGlyphTableList : public XPCOMGCFinalizedObject, public nsIObserver
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/layout/printing/nsPagePrintTimer.h b/layout/printing/nsPagePrintTimer.h
+--- a/layout/printing/nsPagePrintTimer.h
++++ b/layout/printing/nsPagePrintTimer.h
+@@ -49,7 +49,7 @@ class nsPrintEngine;
+ //---------------------------------------------------
+ //-- Page Timer Class
+ //---------------------------------------------------
+-class nsPagePrintTimer : public nsITimerCallback
++class nsPagePrintTimer : public XPCOMGCFinalizedObject, public nsITimerCallback
+ {
+ public:
+ 
+diff --git a/layout/printing/nsPrintEngine.h b/layout/printing/nsPrintEngine.h
+--- a/layout/printing/nsPrintEngine.h
++++ b/layout/printing/nsPrintEngine.h
+@@ -60,7 +60,7 @@ class nsIPageSequenceFrame;
+ // nsPrintEngine Class
+ //
+ //------------------------------------------------------------------------
+-class nsPrintEngine : public nsIObserver
++class nsPrintEngine : public XPCOMGCFinalizedObject, public nsIObserver
+ {
+ public:
+   // nsISupports interface...
+diff --git a/layout/printing/nsPrintPreviewListener.h b/layout/printing/nsPrintPreviewListener.h
+--- a/layout/printing/nsPrintPreviewListener.h
++++ b/layout/printing/nsPrintPreviewListener.h
+@@ -53,7 +53,7 @@
+ // with the DOM with AddChromeListeners() and removing itself with
+ // RemoveChromeListeners().
+ //
+-class nsPrintPreviewListener : public nsIDOMEventListener
++class nsPrintPreviewListener : public XPCOMGCFinalizedObject, public nsIDOMEventListener
+ 
+ {
+ public:
+diff --git a/layout/style/nsCSSLoader.h b/layout/style/nsCSSLoader.h
+--- a/layout/style/nsCSSLoader.h
++++ b/layout/style/nsCSSLoader.h
+@@ -106,7 +106,8 @@ class nsMediaList;
+  * Data needed to properly load a stylesheet *
+  *********************************************/
+ 
+-class SheetLoadData : public nsIRunnable,
++class SheetLoadData : public XPCOMGCFinalizedObject,
++                      public nsIRunnable,
+                       public nsIUnicharStreamLoaderObserver
+ {
+ public:
+@@ -295,7 +296,7 @@ enum StyleSheetState {
+  * Loader Declaration *
+  **********************/
+ 
+-class CSSLoaderImpl : public nsICSSLoader
++class CSSLoaderImpl : public XPCOMGCFinalizedObject, public nsICSSLoader
+ {
+ public:
+   CSSLoaderImpl(void);
+diff --git a/layout/style/nsCSSOMFactory.h b/layout/style/nsCSSOMFactory.h
+--- a/layout/style/nsCSSOMFactory.h
++++ b/layout/style/nsCSSOMFactory.h
+@@ -44,7 +44,7 @@
+ 
+ #include "nsICSSOMFactory.h"
+ 
+-class nsCSSOMFactory : public nsICSSOMFactory {
++class nsCSSOMFactory : public XPCOMGCFinalizedObject, public nsICSSOMFactory {
+ 
+ public:
+ 
+diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp
+--- a/layout/style/nsCSSParser.cpp
++++ b/layout/style/nsCSSParser.cpp
+@@ -86,7 +86,7 @@
+ //----------------------------------------------------------------------
+ 
+ // Your basic top-down recursive descent style parser
+-class CSSParserImpl : public nsICSSParser {
++class CSSParserImpl : public XPCOMGCFinalizedObject, public nsICSSParser {
+ public:
+   CSSParserImpl();
+   virtual ~CSSParserImpl();
+diff --git a/layout/style/nsCSSRuleProcessor.h b/layout/style/nsCSSRuleProcessor.h
+--- a/layout/style/nsCSSRuleProcessor.h
++++ b/layout/style/nsCSSRuleProcessor.h
+@@ -61,7 +61,7 @@ struct RuleCascadeData;
+  * is told when the rule processor is going away (via DropRuleProcessor).
+  */
+ 
+-class nsCSSRuleProcessor: public nsIStyleRuleProcessor {
++class nsCSSRuleProcessor: public XPCOMGCFinalizedObject, public nsIStyleRuleProcessor {
+ public:
+   nsCSSRuleProcessor(const nsCOMArray<nsICSSStyleSheet>& aSheets);
+   virtual ~nsCSSRuleProcessor();
+diff --git a/layout/style/nsCSSRules.cpp b/layout/style/nsCSSRules.cpp
+--- a/layout/style/nsCSSRules.cpp
++++ b/layout/style/nsCSSRules.cpp
+@@ -83,7 +83,7 @@ NS_IMETHODIMP _class::MapRuleInfoInto(ns
+ // -------------------------------
+ // Style Rule List for group rules
+ //
+-class CSSGroupRuleRuleListImpl : public nsIDOMCSSRuleList
++class CSSGroupRuleRuleListImpl : public XPCOMGCFinalizedObject, public nsIDOMCSSRuleList
+ {
+ public:
+   CSSGroupRuleRuleListImpl(nsICSSGroupRule *aGroupRule);
+diff --git a/layout/style/nsCSSStyleRule.cpp b/layout/style/nsCSSStyleRule.cpp
+--- a/layout/style/nsCSSStyleRule.cpp
++++ b/layout/style/nsCSSStyleRule.cpp
+@@ -782,7 +782,7 @@ nsCSSSelectorList::Clone(PRBool aDeep) c
+ 
+ class CSSStyleRuleImpl;
+ 
+-class CSSImportantRule : public nsIStyleRule {
++class CSSImportantRule : public XPCOMGCFinalizedObject, public nsIStyleRule {
+ public:
+   CSSImportantRule(nsCSSDeclaration* aDeclaration);
+ 
+@@ -880,7 +880,7 @@ private:
+   void* operator new(size_t size) CPP_THROW_NEW;
+ };
+ 
+-class DOMCSSStyleRuleImpl : public nsICSSStyleRuleDOMWrapper
++class DOMCSSStyleRuleImpl : public XPCOMGCFinalizedObject, public nsICSSStyleRuleDOMWrapper
+ {
+ public:
+   DOMCSSStyleRuleImpl(nsICSSStyleRule *aRule);
+diff --git a/layout/style/nsCSSStyleSheet.cpp b/layout/style/nsCSSStyleSheet.cpp
+--- a/layout/style/nsCSSStyleSheet.cpp
++++ b/layout/style/nsCSSStyleSheet.cpp
+@@ -79,7 +79,7 @@
+ // -------------------------------
+ // Style Rule List for the DOM
+ //
+-class CSSRuleListImpl : public nsIDOMCSSRuleList
++class CSSRuleListImpl : public XPCOMGCFinalizedObject, public nsIDOMCSSRuleList
+ {
+ public:
+   CSSRuleListImpl(nsCSSStyleSheet *aStyleSheet);
+diff --git a/layout/style/nsCSSStyleSheet.h b/layout/style/nsCSSStyleSheet.h
+--- a/layout/style/nsCSSStyleSheet.h
++++ b/layout/style/nsCSSStyleSheet.h
+@@ -95,7 +95,8 @@ class CSSRuleListImpl;
+ class CSSRuleListImpl;
+ static PRBool CascadeSheetRulesInto(nsICSSStyleSheet* aSheet, void* aData);
+ 
+-class nsCSSStyleSheet : public nsICSSStyleSheet, 
++class nsCSSStyleSheet : public XPCOMGCFinalizedObject, 
++                        public nsICSSStyleSheet, 
+                         public nsIDOMCSSStyleSheet,
+                         public nsICSSLoaderObserver
+ {
+diff --git a/layout/style/nsDOMCSSRGBColor.h b/layout/style/nsDOMCSSRGBColor.h
+--- a/layout/style/nsDOMCSSRGBColor.h
++++ b/layout/style/nsDOMCSSRGBColor.h
+@@ -47,7 +47,7 @@
+ 
+ class nsIDOMCSSPrimitiveValue;
+ 
+-class nsDOMCSSRGBColor : public nsIDOMNSRGBAColor {
++class nsDOMCSSRGBColor : public XPCOMGCFinalizedObject, public nsIDOMNSRGBAColor {
+ public:
+   nsDOMCSSRGBColor(nsIDOMCSSPrimitiveValue* aRed,
+                    nsIDOMCSSPrimitiveValue* aGreen,
+diff --git a/layout/style/nsDOMCSSRect.h b/layout/style/nsDOMCSSRect.h
+--- a/layout/style/nsDOMCSSRect.h
++++ b/layout/style/nsDOMCSSRect.h
+@@ -45,7 +45,7 @@
+ #include "nsCOMPtr.h"
+ class nsIDOMCSSPrimitiveValue;
+ 
+-class nsDOMCSSRect : public nsIDOMRect {
++class nsDOMCSSRect : public XPCOMGCFinalizedObject, public nsIDOMRect {
+ public:
+   nsDOMCSSRect(nsIDOMCSSPrimitiveValue* aTop,
+                nsIDOMCSSPrimitiveValue* aRight,
+diff --git a/layout/style/nsDOMCSSValueList.h b/layout/style/nsDOMCSSValueList.h
+--- a/layout/style/nsDOMCSSValueList.h
++++ b/layout/style/nsDOMCSSValueList.h
+@@ -46,7 +46,7 @@
+ 
+ #include "nsCOMPtr.h"
+ 
+-class nsDOMCSSValueList : public nsIDOMCSSValueList
++class nsDOMCSSValueList : public XPCOMGCFinalizedObject, public nsIDOMCSSValueList
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/layout/style/nsHTMLCSSStyleSheet.cpp b/layout/style/nsHTMLCSSStyleSheet.cpp
+--- a/layout/style/nsHTMLCSSStyleSheet.cpp
++++ b/layout/style/nsHTMLCSSStyleSheet.cpp
+@@ -94,14 +94,14 @@ CSSDisablePropsRule::CSSDisablePropsRule
+   mInheritQuotes.mOpen = inherit;
+ }
+ 
+-class CSSFirstLineRule : public CSSDisablePropsRule {
++class CSSFirstLineRule : public XPCOMGCFinalizedObject, public CSSDisablePropsRule {
+ public:
+   CSSFirstLineRule() {}
+ 
+   NS_IMETHOD MapRuleInfoInto(nsRuleData* aRuleData);
+ };
+ 
+-class CSSFirstLetterRule : public CSSDisablePropsRule {
++class CSSFirstLetterRule : public XPCOMGCFinalizedObject, public CSSDisablePropsRule {
+ public:
+   CSSFirstLetterRule() {}
+ 
+@@ -328,7 +328,8 @@ CSSFirstLetterRule::MapRuleInfoInto(nsRu
+ 
+ // -----------------------------------------------------------
+ 
+-class HTMLCSSStyleSheetImpl : public nsIHTMLCSSStyleSheet,
++class HTMLCSSStyleSheetImpl : public XPCOMGCFinalizedObject,
++                              public nsIHTMLCSSStyleSheet,
+                               public nsIStyleRuleProcessor {
+ public:
+   HTMLCSSStyleSheetImpl();
+diff --git a/layout/style/nsHTMLStyleSheet.h b/layout/style/nsHTMLStyleSheet.h
+--- a/layout/style/nsHTMLStyleSheet.h
++++ b/layout/style/nsHTMLStyleSheet.h
+@@ -52,7 +52,7 @@
+ #include "nsCOMPtr.h"
+ class nsMappedAttributes;
+ 
+-class nsHTMLStyleSheet : public nsIStyleSheet, public nsIStyleRuleProcessor {
++class nsHTMLStyleSheet : public XPCOMGCFinalizedObject, public nsIStyleSheet, public nsIStyleRuleProcessor {
+ public:
+   nsHTMLStyleSheet(void);
+   nsresult Init();
+@@ -109,7 +109,7 @@ private:
+ 
+   class HTMLColorRule;
+   friend class HTMLColorRule;
+-  class HTMLColorRule : public nsIStyleRule {
++  class HTMLColorRule : public XPCOMGCFinalizedObject, public nsIStyleRule {
+   public:
+     HTMLColorRule() {}
+ 
+@@ -143,7 +143,7 @@ private:
+   // this rule handles <th> inheritance
+   class TableTHRule;
+   friend class TableTHRule;
+-  class TableTHRule: public GenericTableRule {
++  class TableTHRule: public XPCOMGCFinalizedObject, public GenericTableRule {
+   public:
+     TableTHRule() {}
+ 
+@@ -154,7 +154,7 @@ private:
+   // is set on its <table>
+   class TableTbodyRule;
+   friend class TableTbodyRule;
+-  class TableTbodyRule: public GenericTableRule {
++  class TableTbodyRule: public XPCOMGCFinalizedObject, public GenericTableRule {
+   public:
+     TableTbodyRule() {}
+ 
+@@ -164,7 +164,7 @@ private:
+   // this rule handles borders on a <row> when rules is set on its <table>
+   class TableRowRule;
+   friend class TableRowRule;
+-  class TableRowRule: public GenericTableRule {
++  class TableRowRule: public XPCOMGCFinalizedObject, public GenericTableRule {
+   public:
+     TableRowRule() {}
+ 
+@@ -174,7 +174,7 @@ private:
+   // this rule handles borders on a <colgroup> when rules is set on its <table>
+   class TableColgroupRule;
+   friend class TableColgroupRule;
+-  class TableColgroupRule: public GenericTableRule {
++  class TableColgroupRule: public XPCOMGCFinalizedObject, public GenericTableRule {
+   public:
+     TableColgroupRule() {}
+ 
+@@ -186,7 +186,7 @@ private:
+   // cols.
+   class TableColRule;
+   friend class TableColRule;
+-  class TableColRule: public GenericTableRule {
++  class TableColRule: public XPCOMGCFinalizedObject, public GenericTableRule {
+   public:
+     TableColRule() {}
+ 
+@@ -197,7 +197,7 @@ private:
+   // This should only be used for <col>s which are not in a colgroup.
+   class TableUngroupedColRule;
+   friend class TableUngroupedColRule;
+-  class TableUngroupedColRule: public GenericTableRule {
++  class TableUngroupedColRule: public XPCOMGCFinalizedObject, public GenericTableRule {
+   public:
+     TableUngroupedColRule() {}
+ 
+diff --git a/layout/style/nsIMediaList.h b/layout/style/nsIMediaList.h
+--- a/layout/style/nsIMediaList.h
++++ b/layout/style/nsIMediaList.h
+@@ -52,7 +52,7 @@ class nsICSSStyleSheet;
+ class nsICSSStyleSheet;
+ class nsCSSStyleSheet;
+ 
+-class nsMediaList : public nsIDOMMediaList {
++class nsMediaList : public XPCOMGCFinalizedObject, public nsIDOMMediaList {
+ public:
+   nsMediaList();
+ 
+diff --git a/layout/style/nsInspectorCSSUtils.h b/layout/style/nsInspectorCSSUtils.h
+--- a/layout/style/nsInspectorCSSUtils.h
++++ b/layout/style/nsInspectorCSSUtils.h
+@@ -48,7 +48,7 @@
+ 
+ class nsIPresShell;
+ 
+-class nsInspectorCSSUtils : public nsIInspectorCSSUtils {
++class nsInspectorCSSUtils : public XPCOMGCFinalizedObject, public nsIInspectorCSSUtils {
+ 
+ public:
+ 
+diff --git a/layout/style/nsLayoutStylesheetCache.h b/layout/style/nsLayoutStylesheetCache.h
+--- a/layout/style/nsLayoutStylesheetCache.h
++++ b/layout/style/nsLayoutStylesheetCache.h
+@@ -46,7 +46,7 @@ class nsICSSLoader;
+ class nsICSSLoader;
+ 
+ class nsLayoutStylesheetCache
+- : public nsIObserver
++ : public XPCOMGCFinalizedObject, public nsIObserver
+ {
+   NS_DECL_ISUPPORTS
+   NS_DECL_NSIOBSERVER
+diff --git a/layout/style/nsROCSSPrimitiveValue.h b/layout/style/nsROCSSPrimitiveValue.h
+--- a/layout/style/nsROCSSPrimitiveValue.h
++++ b/layout/style/nsROCSSPrimitiveValue.h
+@@ -53,7 +53,7 @@
+ #include "nsDOMCSSRect.h"
+ #include "nsDOMCSSRGBColor.h"
+ 
+-class nsROCSSPrimitiveValue : public nsIDOMCSSPrimitiveValue
++class nsROCSSPrimitiveValue : public XPCOMGCFinalizedObject, public nsIDOMCSSPrimitiveValue
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/layout/svg/base/src/nsSVGImageFrame.cpp b/layout/svg/base/src/nsSVGImageFrame.cpp
+--- a/layout/svg/base/src/nsSVGImageFrame.cpp
++++ b/layout/svg/base/src/nsSVGImageFrame.cpp
+@@ -53,7 +53,7 @@ using namespace mozilla;
+ 
+ class nsSVGImageFrame;
+ 
+-class nsSVGImageListener : public nsStubImageDecoderObserver
++class nsSVGImageListener : public XPCOMGCFinalizedObject, public nsStubImageDecoderObserver
+ {
+ public:
+   nsSVGImageListener(nsSVGImageFrame *aFrame);
+diff --git a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp
+--- a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp
++++ b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp
+@@ -56,7 +56,7 @@
+ #include "nsIInterfaceRequestorUtils.h"
+ #include "nsSVGMatrix.h"
+ 
+-class nsSVGMutationObserver : public nsStubMutationObserver
++class nsSVGMutationObserver : public XPCOMGCFinalizedObject, public nsStubMutationObserver
+ {
+ public:
+   // nsIMutationObserver interface
+diff --git a/layout/svg/base/src/nsSVGPathGeometryFrame.cpp b/layout/svg/base/src/nsSVGPathGeometryFrame.cpp
+--- a/layout/svg/base/src/nsSVGPathGeometryFrame.cpp
++++ b/layout/svg/base/src/nsSVGPathGeometryFrame.cpp
+@@ -50,7 +50,7 @@
+ #include "nsSVGPathGeometryElement.h"
+ #include "gfxContext.h"
+ 
+-class nsSVGMarkerProperty : public nsStubMutationObserver {
++class nsSVGMarkerProperty : public XPCOMGCFinalizedObject, public nsStubMutationObserver {
+ public:
+   nsSVGMarkerProperty(nsIURI                 *aMarkerStart,
+                       nsIURI                 *aMarkerMid,
+diff --git a/layout/svg/base/src/nsSVGTextPathFrame.h b/layout/svg/base/src/nsSVGTextPathFrame.h
+--- a/layout/svg/base/src/nsSVGTextPathFrame.h
++++ b/layout/svg/base/src/nsSVGTextPathFrame.h
+@@ -46,7 +46,7 @@
+ 
+ class nsSVGTextPathFrame;
+ 
+-class nsSVGPathListener : public nsStubMutationObserver {
++class nsSVGPathListener : public XPCOMGCFinalizedObject, public nsStubMutationObserver {
+ public:
+   nsSVGPathListener(nsIContent *aPathElement,
+                     nsSVGTextPathFrame *aTextPathFrame);
+diff --git a/layout/svg/base/src/nsSVGUtils.cpp b/layout/svg/base/src/nsSVGUtils.cpp
+--- a/layout/svg/base/src/nsSVGUtils.cpp
++++ b/layout/svg/base/src/nsSVGUtils.cpp
+@@ -172,7 +172,7 @@ nsSVGPropertyBase::ContentRemoved(nsIDoc
+ }
+ 
+ class nsSVGFilterProperty :
+-  public nsSVGPropertyBase, public nsISVGFilterProperty {
++  public XPCOMGCFinalizedObject, public nsSVGPropertyBase, public nsISVGFilterProperty {
+ public:
+   nsSVGFilterProperty(nsIContent *aFilter, nsIFrame *aFilteredFrame);
+   virtual ~nsSVGFilterProperty() {
+@@ -260,7 +260,7 @@ nsSVGFilterProperty::ParentChainChanged(
+   mFrame->DeleteProperty(nsGkAtoms::filter);
+ }
+ 
+-class nsSVGClipPathProperty : public nsSVGPropertyBase {
++class nsSVGClipPathProperty : public XPCOMGCFinalizedObject, public nsSVGPropertyBase {
+ public:
+   nsSVGClipPathProperty(nsIContent *aClipPath, nsIFrame *aClippedFrame)
+     : nsSVGPropertyBase(aClipPath, aClippedFrame, nsGkAtoms::clipPath) {
+@@ -317,7 +317,7 @@ nsSVGClipPathProperty::ParentChainChange
+ }
+ 
+ 
+-class nsSVGMaskProperty : public nsSVGPropertyBase {
++class nsSVGMaskProperty : public XPCOMGCFinalizedObject, public nsSVGPropertyBase {
+ public:
+   nsSVGMaskProperty(nsIContent *aMask, nsIFrame *aMaskedFrame)
+     : nsSVGPropertyBase(aMask, aMaskedFrame, nsGkAtoms::mask) {
+diff --git a/layout/xul/base/public/nsXULPopupManager.h b/layout/xul/base/public/nsXULPopupManager.h
+--- a/layout/xul/base/public/nsXULPopupManager.h
++++ b/layout/xul/base/public/nsXULPopupManager.h
+@@ -304,7 +304,8 @@ private:
+   CloseMenuMode mCloseMenuMode;
+ };
+ 
+-class nsXULPopupManager : public nsIDOMKeyListener,
++class nsXULPopupManager : public XPCOMGCFinalizedObject,
++                          public nsIDOMKeyListener,
+                           public nsIMenuRollup,
+                           public nsIRollupListener,
+                           public nsITimerCallback
+diff --git a/layout/xul/base/src/grid/nsGridRowGroupLayout.h b/layout/xul/base/src/grid/nsGridRowGroupLayout.h
+--- a/layout/xul/base/src/grid/nsGridRowGroupLayout.h
++++ b/layout/xul/base/src/grid/nsGridRowGroupLayout.h
+@@ -50,7 +50,7 @@
+ /**
+  * The nsIBoxLayout implementation for nsGridRowGroupFrame.
+  */
+-class nsGridRowGroupLayout : public nsGridRowLayout
++class nsGridRowGroupLayout : public XPCOMGCFinalizedObject, public nsGridRowLayout
+ {
+ public:
+ 
+diff --git a/layout/xul/base/src/grid/nsGridRowLeafLayout.h b/layout/xul/base/src/grid/nsGridRowLeafLayout.h
+--- a/layout/xul/base/src/grid/nsGridRowLeafLayout.h
++++ b/layout/xul/base/src/grid/nsGridRowLeafLayout.h
+@@ -53,7 +53,7 @@
+  */
+ // XXXldb This needs a better name that indicates that it's for any grid
+ // row.
+-class nsGridRowLeafLayout : public nsGridRowLayout
++class nsGridRowLeafLayout : public XPCOMGCFinalizedObject, public nsGridRowLayout
+ {
+ public:
+ 
+diff --git a/layout/xul/base/src/nsBoxObject.h b/layout/xul/base/src/nsBoxObject.h
+--- a/layout/xul/base/src/nsBoxObject.h
++++ b/layout/xul/base/src/nsBoxObject.h
+@@ -50,7 +50,7 @@ class nsIDocShell;
+ class nsIDocShell;
+ struct nsRect;
+ 
+-class nsBoxObject : public nsPIBoxObject
++class nsBoxObject : public XPCOMGCFinalizedObject, public nsPIBoxObject
+ {
+   NS_DECL_ISUPPORTS
+   NS_DECL_NSIBOXOBJECT
+diff --git a/layout/xul/base/src/nsImageBoxFrame.h b/layout/xul/base/src/nsImageBoxFrame.h
+--- a/layout/xul/base/src/nsImageBoxFrame.h
++++ b/layout/xul/base/src/nsImageBoxFrame.h
+@@ -46,7 +46,7 @@
+ 
+ class nsImageBoxFrame;
+ 
+-class nsImageBoxListener : public nsStubImageDecoderObserver
++class nsImageBoxListener : public XPCOMGCFinalizedObject, public nsStubImageDecoderObserver
+ {
+ public:
+   nsImageBoxListener();
+diff --git a/layout/xul/base/src/nsListBoxBodyFrame.cpp b/layout/xul/base/src/nsListBoxBodyFrame.cpp
+--- a/layout/xul/base/src/nsListBoxBodyFrame.cpp
++++ b/layout/xul/base/src/nsListBoxBodyFrame.cpp
+@@ -99,7 +99,7 @@
+ // do we wait before checking again?
+ #define SMOOTH_INTERVAL 100
+ 
+-class nsListScrollSmoother : public nsITimerCallback
++class nsListScrollSmoother : public XPCOMGCFinalizedObject, public nsITimerCallback
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/layout/xul/base/src/nsMenuBarListener.h b/layout/xul/base/src/nsMenuBarListener.h
+--- a/layout/xul/base/src/nsMenuBarListener.h
++++ b/layout/xul/base/src/nsMenuBarListener.h
+@@ -50,7 +50,7 @@ class nsIDOMKeyEvent;
+ 
+ /** editor Implementation of the DragListener interface
+  */
+-class nsMenuBarListener : public nsIDOMKeyListener, public nsIDOMFocusListener, public nsIDOMMouseListener
++class nsMenuBarListener : public XPCOMGCFinalizedObject, public nsIDOMKeyListener, public nsIDOMFocusListener, public nsIDOMMouseListener
+ {
+ public:
+   /** default constructor
+diff --git a/layout/xul/base/src/nsMenuFrame.h b/layout/xul/base/src/nsMenuFrame.h
+--- a/layout/xul/base/src/nsMenuFrame.h
++++ b/layout/xul/base/src/nsMenuFrame.h
+@@ -86,7 +86,7 @@ class nsMenuFrame;
+  * to it. The callback is delegated to the contained nsMenuFrame as long as
+  * the contained nsMenuFrame has not been destroyed.
+  */
+-class nsMenuTimerMediator : public nsITimerCallback
++class nsMenuTimerMediator : public XPCOMGCFinalizedObject, public nsITimerCallback
+ {
+ public:
+   nsMenuTimerMediator(nsMenuFrame* aFrame);
+diff --git a/layout/xul/base/src/nsRepeatService.h b/layout/xul/base/src/nsRepeatService.h
+--- a/layout/xul/base/src/nsRepeatService.h
++++ b/layout/xul/base/src/nsRepeatService.h
+@@ -46,7 +46,7 @@
+ 
+ class nsITimer;
+ 
+-class nsRepeatService : public nsITimerCallback
++class nsRepeatService : public XPCOMGCFinalizedObject, public nsITimerCallback
+ {
+ public:
+ 
+diff --git a/layout/xul/base/src/nsSliderFrame.h b/layout/xul/base/src/nsSliderFrame.h
+--- a/layout/xul/base/src/nsSliderFrame.h
++++ b/layout/xul/base/src/nsSliderFrame.h
+@@ -54,7 +54,7 @@ class nsSliderFrame;
+ 
+ nsIFrame* NS_NewSliderFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
+ 
+-class nsSliderMediator : public nsIDOMMouseListener
++class nsSliderMediator : public XPCOMGCFinalizedObject, public nsIDOMMouseListener
+ {
+ public:
+ 
+diff --git a/layout/xul/base/src/nsSplitterFrame.cpp b/layout/xul/base/src/nsSplitterFrame.cpp
+--- a/layout/xul/base/src/nsSplitterFrame.cpp
++++ b/layout/xul/base/src/nsSplitterFrame.cpp
+@@ -93,7 +93,7 @@ public:
+   PRInt32 index;
+ };
+ 
+-class nsSplitterFrameInner : public nsIDOMMouseListener, public nsIDOMMouseMotionListener {
++class nsSplitterFrameInner : public XPCOMGCFinalizedObject, public nsIDOMMouseListener, public nsIDOMMouseMotionListener {
+ 
+ public:
+ 
+diff --git a/layout/xul/base/src/nsSprocketLayout.h b/layout/xul/base/src/nsSprocketLayout.h
+--- a/layout/xul/base/src/nsSprocketLayout.h
++++ b/layout/xul/base/src/nsSprocketLayout.h
+@@ -104,7 +104,7 @@ public:
+ 
+ nsresult NS_NewSprocketLayout(nsIPresShell* aPresShell, nsIBoxLayout*& aNewLayout);
+ 
+-class nsSprocketLayout : public nsBoxLayout {
++class nsSprocketLayout : public XPCOMGCFinalizedObject, public nsBoxLayout {
+ 
+ public:
+ 
+diff --git a/layout/xul/base/src/nsStackLayout.h b/layout/xul/base/src/nsStackLayout.h
+--- a/layout/xul/base/src/nsStackLayout.h
++++ b/layout/xul/base/src/nsStackLayout.h
+@@ -52,7 +52,7 @@
+ 
+ nsresult NS_NewStackLayout(nsIPresShell* aPresShell, nsIBoxLayout*& aNewLayout);
+ 
+-class nsStackLayout : public nsBoxLayout
++class nsStackLayout : public XPCOMGCFinalizedObject, public nsBoxLayout
+ {
+ public:
+ 
+diff --git a/layout/xul/base/src/nsXULTooltipListener.h b/layout/xul/base/src/nsXULTooltipListener.h
+--- a/layout/xul/base/src/nsXULTooltipListener.h
++++ b/layout/xul/base/src/nsXULTooltipListener.h
+@@ -54,7 +54,8 @@
+ #endif
+ #include "nsWeakPtr.h"
+ 
+-class nsXULTooltipListener : public nsIDOMMouseListener,
++class nsXULTooltipListener : public XPCOMGCFinalizedObject,
++                             public nsIDOMMouseListener,
+                              public nsIDOMMouseMotionListener,
+                              public nsIDOMKeyListener,
+                              public nsIDOMXULListener
+diff --git a/layout/xul/base/src/tree/src/nsTreeColumns.h b/layout/xul/base/src/tree/src/nsTreeColumns.h
+--- a/layout/xul/base/src/tree/src/nsTreeColumns.h
++++ b/layout/xul/base/src/tree/src/nsTreeColumns.h
+@@ -50,7 +50,7 @@ class nsTreeColumns;
+ 
+ // This class is our column info.  We use it to iterate our columns and to obtain
+ // information about each column.
+-class nsTreeColumn : public nsITreeColumn {
++class nsTreeColumn : public XPCOMGCFinalizedObject, public nsITreeColumn {
+ public:
+   nsTreeColumn(nsTreeColumns* aColumns, nsIContent* aContent);
+   ~nsTreeColumn();
+@@ -136,7 +136,7 @@ private:
+     {0x92, 0x23, 0x81, 0x4d, 0x3a, 0xde, 0x93, 0xa3} \
+ }
+ 
+-class nsTreeColumns : public nsITreeColumns {
++class nsTreeColumns : public XPCOMGCFinalizedObject, public nsITreeColumns {
+ public:
+   nsTreeColumns(nsITreeBoxObject* aTree);
+   ~nsTreeColumns();
+diff --git a/layout/xul/base/src/tree/src/nsTreeContentView.h b/layout/xul/base/src/tree/src/nsTreeContentView.h
+--- a/layout/xul/base/src/tree/src/nsTreeContentView.h
++++ b/layout/xul/base/src/tree/src/nsTreeContentView.h
+@@ -50,7 +50,8 @@
+ 
+ nsresult NS_NewTreeContentView(nsITreeView** aResult);
+ 
+-class nsTreeContentView : public nsINativeTreeView,
++class nsTreeContentView : public XPCOMGCFinalizedObject,
++                          public nsINativeTreeView,
+                           public nsITreeContentView,
+                           public nsStubDocumentObserver
+ {
+diff --git a/layout/xul/base/src/tree/src/nsTreeImageListener.h b/layout/xul/base/src/tree/src/nsTreeImageListener.h
+--- a/layout/xul/base/src/tree/src/nsTreeImageListener.h
++++ b/layout/xul/base/src/tree/src/nsTreeImageListener.h
+@@ -63,7 +63,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsITreeIma
+ NS_DEFINE_STATIC_IID_ACCESSOR(nsITreeImageListener, NS_ITREEIMAGELISTENER_IID)
+ 
+ // This class handles image load observation.
+-class nsTreeImageListener : public nsStubImageDecoderObserver, public nsITreeImageListener
++class nsTreeImageListener : public XPCOMGCFinalizedObject, public nsStubImageDecoderObserver, public nsITreeImageListener
+ {
+ public:
+   nsTreeImageListener(nsITreeBoxObject* aTree);
+diff --git a/layout/xul/base/src/tree/src/nsTreeSelection.h b/layout/xul/base/src/tree/src/nsTreeSelection.h
+--- a/layout/xul/base/src/tree/src/nsTreeSelection.h
++++ b/layout/xul/base/src/tree/src/nsTreeSelection.h
+@@ -49,7 +49,7 @@ class nsITreeBoxObject;
+ class nsITreeBoxObject;
+ struct nsTreeRange;
+ 
+-class nsTreeSelection : public nsITreeSelection
++class nsTreeSelection : public XPCOMGCFinalizedObject, public nsITreeSelection
+ {
+ public:
+   nsTreeSelection(nsITreeBoxObject* aTree);
+diff --git a/modules/libjar/nsJARChannel.cpp b/modules/libjar/nsJARChannel.cpp
+--- a/modules/libjar/nsJARChannel.cpp
++++ b/modules/libjar/nsJARChannel.cpp
+@@ -77,7 +77,7 @@ static PRLogModuleInfo *gJarProtocolLog 
+ // this class allows us to do some extra work on the stream transport thread.
+ //-----------------------------------------------------------------------------
+ 
+-class nsJARInputThunk : public nsIInputStream
++class nsJARInputThunk : public XPCOMGCFinalizedObject, public nsIInputStream
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/modules/libjar/nsJARChannel.h b/modules/libjar/nsJARChannel.h
+--- a/modules/libjar/nsJARChannel.h
++++ b/modules/libjar/nsJARChannel.h
+@@ -57,7 +57,8 @@ class nsJARInputThunk;
+ 
+ //-----------------------------------------------------------------------------
+ 
+-class nsJARChannel : public nsIJARChannel
++class nsJARChannel : public XPCOMGCFinalizedObject
++                   , public nsIJARChannel
+                    , public nsIDownloadObserver
+                    , public nsIStreamListener
+ {
+diff --git a/modules/libjar/nsJARInputStream.h b/modules/libjar/nsJARInputStream.h
+--- a/modules/libjar/nsJARInputStream.h
++++ b/modules/libjar/nsJARInputStream.h
+@@ -48,7 +48,7 @@
+  * object returned by calls to nsJAR::GetInputStream(filename) for the
+  * purpose of reading a file item out of a JAR file. 
+  *------------------------------------------------------------------------*/
+-class nsJARInputStream : public nsIInputStream
++class nsJARInputStream : public XPCOMGCFinalizedObject, public nsIInputStream
+ {
+   public:
+     nsJARInputStream() : 
+diff --git a/modules/libjar/nsJARProtocolHandler.h b/modules/libjar/nsJARProtocolHandler.h
+--- a/modules/libjar/nsJARProtocolHandler.h
++++ b/modules/libjar/nsJARProtocolHandler.h
+@@ -46,7 +46,8 @@
+ #include "nsWeakReference.h"
+ #include "nsCOMPtr.h"
+ 
+-class nsJARProtocolHandler : public nsIJARProtocolHandler
++class nsJARProtocolHandler : public XPCOMGCFinalizedObject
++                           , public nsIJARProtocolHandler
+                            , public nsSupportsWeakReference
+ {
+ public:
+diff --git a/modules/libjar/nsJARURI.h b/modules/libjar/nsJARURI.h
+--- a/modules/libjar/nsJARURI.h
++++ b/modules/libjar/nsJARURI.h
+@@ -65,7 +65,8 @@
+ }
+ 
+ 
+-class nsJARURI : public nsIJARURI,
++class nsJARURI : public XPCOMGCFinalizedObject,
++                 public nsIJARURI,
+                  public nsISerializable,
+                  public nsIClassInfo,
+                  public nsINestedURI
+diff --git a/modules/libjar/nsXPTZipLoader.h b/modules/libjar/nsXPTZipLoader.h
+--- a/modules/libjar/nsXPTZipLoader.h
++++ b/modules/libjar/nsXPTZipLoader.h
+@@ -48,7 +48,7 @@
+       { 0x80, 0x55, 0x81, 0xbe, 0xd8, 0xb8, 0xdb, 0x96 } }
+ 
+ 
+-class nsXPTZipLoader : public nsIXPTLoader
++class nsXPTZipLoader : public XPCOMGCFinalizedObject, public nsIXPTLoader
+ {
+  public:
+     nsXPTZipLoader();
+diff --git a/modules/libjar/zipwriter/src/nsDeflateConverter.h b/modules/libjar/zipwriter/src/nsDeflateConverter.h
+--- a/modules/libjar/zipwriter/src/nsDeflateConverter.h
++++ b/modules/libjar/zipwriter/src/nsDeflateConverter.h
+@@ -51,7 +51,7 @@
+ 
+ #define ZIP_BUFLEN (4 * 1024 - 1)
+ 
+-class nsDeflateConverter : public nsIStreamConverter
++class nsDeflateConverter : public XPCOMGCFinalizedObject, public nsIStreamConverter
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/modules/libjar/zipwriter/src/nsZipDataStream.h b/modules/libjar/zipwriter/src/nsZipDataStream.h
+--- a/modules/libjar/zipwriter/src/nsZipDataStream.h
++++ b/modules/libjar/zipwriter/src/nsZipDataStream.h
+@@ -45,7 +45,7 @@
+ #include "nsIStreamListener.h"
+ #include "nsAutoPtr.h"
+ 
+-class nsZipDataStream : public nsIStreamListener
++class nsZipDataStream : public XPCOMGCFinalizedObject, public nsIStreamListener
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/modules/libjar/zipwriter/src/nsZipHeader.h b/modules/libjar/zipwriter/src/nsZipHeader.h
+--- a/modules/libjar/zipwriter/src/nsZipHeader.h
++++ b/modules/libjar/zipwriter/src/nsZipHeader.h
+@@ -48,7 +48,7 @@
+ #define ZIP_ATTRS_FILE 0
+ #define ZIP_ATTRS_DIRECTORY 16
+ 
+-class nsZipHeader : public nsIZipEntry
++class nsZipHeader : public XPCOMGCFinalizedObject, public nsIZipEntry
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/modules/libjar/zipwriter/src/nsZipWriter.h b/modules/libjar/zipwriter/src/nsZipWriter.h
+--- a/modules/libjar/zipwriter/src/nsZipWriter.h
++++ b/modules/libjar/zipwriter/src/nsZipWriter.h
+@@ -74,7 +74,8 @@ public:
+     PRInt32 mCompression;
+ };
+ 
+-class nsZipWriter : public nsIZipWriter,
++class nsZipWriter : public XPCOMGCFinalizedObject,
++                    public nsIZipWriter,
+                     public nsIRequestObserver
+ {
+ public:
+diff --git a/modules/libpr0n/decoders/bmp/nsBMPDecoder.h b/modules/libpr0n/decoders/bmp/nsBMPDecoder.h
+--- a/modules/libpr0n/decoders/bmp/nsBMPDecoder.h
++++ b/modules/libpr0n/decoders/bmp/nsBMPDecoder.h
+@@ -146,7 +146,7 @@ enum ERLEState {
+ /**
+  * Decoder for BMP-Files, as used by Windows and OS/2
+  */
+-class nsBMPDecoder : public imgIDecoder
++class nsBMPDecoder : public XPCOMGCFinalizedObject, public imgIDecoder
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/modules/libpr0n/decoders/bmp/nsICODecoder.h b/modules/libpr0n/decoders/bmp/nsICODecoder.h
+--- a/modules/libpr0n/decoders/bmp/nsICODecoder.h
++++ b/modules/libpr0n/decoders/bmp/nsICODecoder.h
+@@ -76,7 +76,7 @@ struct IconDirEntry
+   PRUint32  mImageOffset;
+ };
+ 
+-class nsICODecoder : public imgIDecoder
++class nsICODecoder : public XPCOMGCFinalizedObject, public imgIDecoder
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/modules/libpr0n/decoders/gif/nsGIFDecoder2.h b/modules/libpr0n/decoders/gif/nsGIFDecoder2.h
+--- a/modules/libpr0n/decoders/gif/nsGIFDecoder2.h
++++ b/modules/libpr0n/decoders/gif/nsGIFDecoder2.h
+@@ -59,7 +59,7 @@
+ //////////////////////////////////////////////////////////////////////
+ // nsGIFDecoder2 Definition
+ 
+-class nsGIFDecoder2 : public imgIDecoder   
++class nsGIFDecoder2 : public XPCOMGCFinalizedObject, public imgIDecoder   
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/modules/libpr0n/decoders/icon/gtk/nsIconChannel.h b/modules/libpr0n/decoders/icon/gtk/nsIconChannel.h
+--- a/modules/libpr0n/decoders/icon/gtk/nsIconChannel.h
++++ b/modules/libpr0n/decoders/icon/gtk/nsIconChannel.h
+@@ -48,7 +48,7 @@
+  * gtk/gnome for an icon, saves it as a tmp icon, and creates a new channel for
+  * that file to which all calls will be proxied.
+  */
+-class nsIconChannel : public nsIChannel {
++class nsIconChannel : public XPCOMGCFinalizedObject, public nsIChannel {
+   public:
+     NS_DECL_ISUPPORTS
+     NS_FORWARD_NSIREQUEST(mRealChannel->)
+diff --git a/modules/libpr0n/decoders/icon/nsIconDecoder.h b/modules/libpr0n/decoders/icon/nsIconDecoder.h
+--- a/modules/libpr0n/decoders/icon/nsIconDecoder.h
++++ b/modules/libpr0n/decoders/icon/nsIconDecoder.h
+@@ -76,7 +76,7 @@
+ //
+ //////////////////////////////////////////////////////////////////////////////////////////////
+ 
+-class nsIconDecoder : public imgIDecoder
++class nsIconDecoder : public XPCOMGCFinalizedObject, public imgIDecoder
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/modules/libpr0n/decoders/icon/nsIconProtocolHandler.h b/modules/libpr0n/decoders/icon/nsIconProtocolHandler.h
+--- a/modules/libpr0n/decoders/icon/nsIconProtocolHandler.h
++++ b/modules/libpr0n/decoders/icon/nsIconProtocolHandler.h
+@@ -42,7 +42,7 @@
+ #include "nsWeakReference.h"
+ #include "nsIProtocolHandler.h"
+ 
+-class nsIconProtocolHandler : public nsIProtocolHandler, public nsSupportsWeakReference
++class nsIconProtocolHandler : public XPCOMGCFinalizedObject, public nsIProtocolHandler, public nsSupportsWeakReference
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/modules/libpr0n/decoders/icon/nsIconURI.h b/modules/libpr0n/decoders/icon/nsIconURI.h
+--- a/modules/libpr0n/decoders/icon/nsIconURI.h
++++ b/modules/libpr0n/decoders/icon/nsIconURI.h
+@@ -52,7 +52,7 @@
+     { 0x99, 0x7, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b }   \
+ }
+ 
+-class nsMozIconURI : public nsIMozIconURI
++class nsMozIconURI : public XPCOMGCFinalizedObject, public nsIMozIconURI
+ {
+ public:    
+   NS_DECL_ISUPPORTS
+diff --git a/modules/libpr0n/decoders/jpeg/nsJPEGDecoder.h b/modules/libpr0n/decoders/jpeg/nsJPEGDecoder.h
+--- a/modules/libpr0n/decoders/jpeg/nsJPEGDecoder.h
++++ b/modules/libpr0n/decoders/jpeg/nsJPEGDecoder.h
+@@ -82,7 +82,7 @@ typedef enum {
+     JPEG_ERROR    
+ } jstate;
+ 
+-class nsJPEGDecoder : public imgIDecoder
++class nsJPEGDecoder : public XPCOMGCFinalizedObject, public imgIDecoder
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/modules/libpr0n/decoders/png/nsPNGDecoder.h b/modules/libpr0n/decoders/png/nsPNGDecoder.h
+--- a/modules/libpr0n/decoders/png/nsPNGDecoder.h
++++ b/modules/libpr0n/decoders/png/nsPNGDecoder.h
+@@ -62,7 +62,7 @@
+     {0xbe, 0x07, 0xd1, 0x6e, 0xeb, 0x4c, 0x50, 0xed} \
+ }
+ 
+-class nsPNGDecoder : public imgIDecoder
++class nsPNGDecoder : public XPCOMGCFinalizedObject, public imgIDecoder
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/modules/libpr0n/decoders/xbm/nsXBMDecoder.h b/modules/libpr0n/decoders/xbm/nsXBMDecoder.h
+--- a/modules/libpr0n/decoders/xbm/nsXBMDecoder.h
++++ b/modules/libpr0n/decoders/xbm/nsXBMDecoder.h
+@@ -54,7 +54,7 @@
+   { 0x90, 0x2f, 0x2c, 0x5e, 0x1a, 0x14, 0x94, 0xce } \
+ }
+ 
+-class nsXBMDecoder : public imgIDecoder
++class nsXBMDecoder : public XPCOMGCFinalizedObject, public imgIDecoder
+ {
+ public:
+     NS_DECL_ISUPPORTS
+diff --git a/modules/libpr0n/encoders/jpeg/nsJPEGEncoder.h b/modules/libpr0n/encoders/jpeg/nsJPEGEncoder.h
+--- a/modules/libpr0n/encoders/jpeg/nsJPEGEncoder.h
++++ b/modules/libpr0n/encoders/jpeg/nsJPEGEncoder.h
+@@ -56,7 +56,7 @@ extern "C" {
+ // Provides JPEG encoding functionality. Use InitFromData() to do the
+ // encoding. See that function definition for encoding options.
+ 
+-class nsJPEGEncoder : public imgIEncoder
++class nsJPEGEncoder : public XPCOMGCFinalizedObject, public imgIEncoder
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/modules/libpr0n/encoders/png/nsPNGEncoder.h b/modules/libpr0n/encoders/png/nsPNGEncoder.h
+--- a/modules/libpr0n/encoders/png/nsPNGEncoder.h
++++ b/modules/libpr0n/encoders/png/nsPNGEncoder.h
+@@ -50,7 +50,7 @@
+ // Provides PNG encoding functionality. Use InitFromData() to do the
+ // encoding. See that function definition for encoding options.
+ 
+-class nsPNGEncoder : public imgIEncoder
++class nsPNGEncoder : public XPCOMGCFinalizedObject, public imgIEncoder
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/modules/libpr0n/src/imgCache.h b/modules/libpr0n/src/imgCache.h
+--- a/modules/libpr0n/src/imgCache.h
++++ b/modules/libpr0n/src/imgCache.h
+@@ -55,7 +55,8 @@ class nsICacheEntryDescriptor;
+     {0x83, 0x91, 0xe1, 0x42, 0x42, 0xc5, 0x9a, 0x41} \
+ }
+ 
+-class imgCache : public imgICache, 
++class imgCache : public XPCOMGCFinalizedObject, 
++                 public imgICache, 
+                  public nsIObserver,
+                  public nsSupportsWeakReference
+ {
+diff --git a/modules/libpr0n/src/imgContainer.cpp b/modules/libpr0n/src/imgContainer.cpp
+--- a/modules/libpr0n/src/imgContainer.cpp
++++ b/modules/libpr0n/src/imgContainer.cpp
+@@ -1312,7 +1312,8 @@ imgContainer::RestoreDiscardedData(void)
+   return NS_OK;
+ }
+ 
+-class ContainerLoader : public imgILoad,
++class ContainerLoader : public XPCOMGCFinalizedObject,
++                        public imgILoad,
+                         public imgIDecoderObserver,
+                         public nsSupportsWeakReference
+ {
+diff --git a/modules/libpr0n/src/imgContainer.h b/modules/libpr0n/src/imgContainer.h
+--- a/modules/libpr0n/src/imgContainer.h
++++ b/modules/libpr0n/src/imgContainer.h
+@@ -131,7 +131,8 @@
+  * because the first two have public setters and the observer we only get
+  * in Init().
+  */
+-class imgContainer : public imgIContainer, 
++class imgContainer : public XPCOMGCFinalizedObject, 
++                     public imgIContainer, 
+                      public nsITimerCallback, 
+                      public nsIProperties
+ {
+diff --git a/modules/libpr0n/src/imgLoader.h b/modules/libpr0n/src/imgLoader.h
+--- a/modules/libpr0n/src/imgLoader.h
++++ b/modules/libpr0n/src/imgLoader.h
+@@ -58,7 +58,7 @@ class nsILoadGroup;
+     {0xa5, 0xb8, 0x95, 0x1f, 0x13, 0xc8, 0x46, 0xf7} \
+ }
+ 
+-class imgLoader : public imgILoader, public nsIContentSniffer
++class imgLoader : public XPCOMGCFinalizedObject, public imgILoader, public nsIContentSniffer
+ {
+ public:
+   NS_DECL_ISUPPORTS
+@@ -86,7 +86,7 @@ private:
+ #include "nsCOMPtr.h"
+ #include "nsIStreamListener.h"
+ 
+-class ProxyListener : public nsIStreamListener
++class ProxyListener : public XPCOMGCFinalizedObject, public nsIStreamListener
+ {
+ public:
+   ProxyListener(nsIStreamListener *dest);
+@@ -108,7 +108,7 @@ private:
+ 
+ #include "nsCOMArray.h"
+ 
+-class imgCacheValidator : public nsIStreamListener
++class imgCacheValidator : public XPCOMGCFinalizedObject, public nsIStreamListener
+ {
+ public:
+   imgCacheValidator(imgRequest *request, void *aContext);
+diff --git a/modules/libpr0n/src/imgRequest.h b/modules/libpr0n/src/imgRequest.h
+--- a/modules/libpr0n/src/imgRequest.h
++++ b/modules/libpr0n/src/imgRequest.h
+@@ -73,7 +73,8 @@ enum {
+   onStopRequest    = PR_BIT(5)
+ };
+ 
+-class imgRequest : public imgILoad,
++class imgRequest : public XPCOMGCFinalizedObject,
++                   public imgILoad,
+                    public imgIDecoderObserver,
+                    public nsIStreamListener,
+                    public nsSupportsWeakReference
+diff --git a/modules/libpr0n/src/imgRequestProxy.h b/modules/libpr0n/src/imgRequestProxy.h
+--- a/modules/libpr0n/src/imgRequestProxy.h
++++ b/modules/libpr0n/src/imgRequestProxy.h
+@@ -59,7 +59,7 @@
+     {0x8f, 0x65, 0x9c, 0x46, 0x2e, 0xe2, 0xbc, 0x95} \
+ }
+ 
+-class imgRequestProxy : public imgIRequest, public nsISupportsPriority
++class imgRequestProxy : public XPCOMGCFinalizedObject, public imgIRequest, public nsISupportsPriority
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/modules/libpr0n/src/imgTools.cpp b/modules/libpr0n/src/imgTools.cpp
+--- a/modules/libpr0n/src/imgTools.cpp
++++ b/modules/libpr0n/src/imgTools.cpp
+@@ -60,7 +60,8 @@ using namespace mozilla;
+ /* ========== Utility classes ========== */
+ 
+ 
+-class HelperLoader : public imgILoad,
++class HelperLoader : public XPCOMGCFinalizedObject,
++                     public imgILoad,
+                      public imgIDecoderObserver,
+                      public nsSupportsWeakReference
+ {
+diff --git a/modules/libpr0n/src/imgTools.h b/modules/libpr0n/src/imgTools.h
+--- a/modules/libpr0n/src/imgTools.h
++++ b/modules/libpr0n/src/imgTools.h
+@@ -46,7 +46,7 @@
+     {0xb7, 0xbb, 0x26, 0x3d, 0xf9, 0x71, 0x51, 0x49} \
+ }
+ 
+-class imgTools : public imgITools
++class imgTools : public XPCOMGCFinalizedObject, public imgITools
+ {
+ public:
+   NS_DECL_ISUPPORTS
+diff --git a/modules/libpref/src/nsPref.cpp b/modules/libpref/src/nsPref.cpp
+--- a/modules/libpref/src/nsPref.cpp
++++ b/modules/libpref/src/nsPref.cpp
+@@ -81,7 +81,8 @@
+ #include "prprf.h"
+ 
+ 
+-class nsPref : public nsIPref,
++class nsPref : public XPCOMGCFinalizedObject,
++               public nsIPref,
+                public nsIPrefService,
+                public nsIObserver,
+                public nsIPrefBranchInternal,
+diff --git a/modules/libpref/src/nsPrefBranch.h b/modules/libpref/src/nsPrefBranch.h
+--- a/modules/libpref/src/nsPrefBranch.h
++++ b/modules/libpref/src/nsPrefBranch.h
+@@ -52,7 +52,8 @@
+ #include "nsVoidArray.h"
+ #include "nsWeakReference.h"
+ 
+-class nsPrefBranch : public nsIPrefBranchInternal,
++class nsPrefBranch : public XPCOMGCFinalizedObject,
++                     public nsIPrefBranchInternal,
+                      public nsISecurityPref,