Bug 883037 - Clean up HOLD/DROP of nsHTMLDocument. r=peterv, a=bajaj
authorAndrew McCreight <amccreight@mozilla.com>
Tue, 25 Jun 2013 17:13:06 -0700
changeset 147803 9a606e0005f146dca25df686d4c5ae6a138e017e
parent 147802 a0836a9de974d74193c80296435fc853f89a4bb2
child 147804 d8a815ac433b0b09a0a3922332a603ae103c35bb
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv, bajaj
bugs883037
milestone24.0a2
Bug 883037 - Clean up HOLD/DROP of nsHTMLDocument. r=peterv, a=bajaj
content/html/document/src/nsHTMLDocument.cpp
--- a/content/html/document/src/nsHTMLDocument.cpp
+++ b/content/html/document/src/nsHTMLDocument.cpp
@@ -199,17 +199,16 @@ nsHTMLDocument::nsHTMLDocument()
   mCompatMode = eCompatibility_NavQuirks;
 
   SetIsDOMBinding();
 }
 
 nsHTMLDocument::~nsHTMLDocument()
 {
   mAll = nullptr;
-  NS_DROP_JS_OBJECTS(this, nsHTMLDocument);
 }
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLDocument, nsDocument)
   NS_ASSERTION(!nsCCUncollectableMarker::InGeneration(cb, tmp->GetMarkedCCGeneration()),
                "Shouldn't traverse nsHTMLDocument!");
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mImages)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mApplets)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEmbeds)
@@ -2699,17 +2698,17 @@ nsHTMLDocument::GetAll(JSContext* aCx, E
       aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
       return nullptr;
     }
 
     // Make the JSObject hold a reference to this.
     JS_SetPrivate(mAll, static_cast<nsINode*>(this));
     NS_ADDREF_THIS();
 
-    NS_HOLD_JS_OBJECTS(this, nsHTMLDocument);
+    PreserveWrapper(static_cast<nsINode*>(this));
   }
 
   return mAll;
 }
 
 static void
 NotifyEditableStateChange(nsINode *aNode, nsIDocument *aDocument)
 {