Bug 883037 - Clean up HOLD/DROP of nsHTMLDocument. r=peterv
authorAndrew McCreight <amccreight@mozilla.com>
Tue, 25 Jun 2013 17:13:06 -0700
changeset 136458 06bc878dd47f254346f016ca4c6a85fa0610b294
parent 136457 da5456a94c1b5b9a9f01c4da389d539813b114df
child 136459 da6afcd4271babb8ce355ec015d8e33173d182be
push id30115
push useramccreight@mozilla.com
push dateWed, 26 Jun 2013 00:13:50 +0000
treeherdermozilla-inbound@06bc878dd47f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs883037
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 883037 - Clean up HOLD/DROP of nsHTMLDocument. r=peterv
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)
 {