Bug 726343 - Improve DOMEventTargetHelper CC logging, r=mccr8
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Sun, 12 Feb 2012 15:09:18 +0200
changeset 86662 12939cf8dbcbea95a13f816ce91e6de04829150a
parent 86661 5f1384f6fea9caa7a92f5de34251b349d464bbe8
child 86663 4a9a6ffd1f2122565ccaf4991ee8ca7354f6710b
push id22040
push useropettay@mozilla.com
push dateSun, 12 Feb 2012 13:18:16 +0000
treeherdermozilla-central@12939cf8dbcb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs726343
milestone13.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 726343 - Improve DOMEventTargetHelper CC logging, r=mccr8
content/events/src/nsDOMEventTargetHelper.cpp
--- a/content/events/src/nsDOMEventTargetHelper.cpp
+++ b/content/events/src/nsDOMEventTargetHelper.cpp
@@ -67,17 +67,31 @@ nsDOMEventListenerWrapper::HandleEvent(n
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMEventTargetHelper)
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDOMEventTargetHelper)
   NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMEventTargetHelper)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDOMEventTargetHelper)
+  if (NS_UNLIKELY(cb.WantDebugInfo())) {
+    char name[512];
+    nsAutoString uri;
+    if (tmp->mOwner && tmp->mOwner->GetExtantDocument()) {
+      tmp->mOwner->GetExtantDocument()->GetDocumentURI(uri);
+    }
+    PR_snprintf(name, sizeof(name), "nsDOMEventTargetHelper %s",
+                NS_ConvertUTF16toUTF8(uri).get());
+    cb.DescribeRefCountedNode(tmp->mRefCnt.get(), sizeof(nsDOMEventTargetHelper),
+                              name);
+  } else {
+    NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsDOMEventTargetHelper, tmp->mRefCnt.get())
+  }
+
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_MEMBER(mListenerManager,
                                                   nsEventListenerManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mScriptContext)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOwner)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMEventTargetHelper)