Bug 1426779 - Disable precise runnable leakchecking names on release and beta. r=froydnj draft
authorAndrew McCreight <continuation@gmail.com>
Thu, 04 Jan 2018 12:59:02 -0800
changeset 715829 7cdd255a30cd5e194ff42f0cef3af0be2cf07e5b
parent 715828 323f5f2b6412a3b955fd3f6f148eeff1d77304e6
child 744910 a86deac128cbd12c6327dba76ce6b5df83681e9d
push id94286
push userbmo:continuation@gmail.com
push dateThu, 04 Jan 2018 21:24:29 +0000
reviewersfroydnj
bugs1426779
milestone59.0
Bug 1426779 - Disable precise runnable leakchecking names on release and beta. r=froydnj The NS_IMPL_NAMED_* macros rely on the mName field, which are not defined on beta or release, so don't use them on those branches, so that Firefox will build. MozReview-Commit-ID: 9wEnPqshBJ8
xpcom/threads/nsThreadUtils.cpp
--- a/xpcom/threads/nsThreadUtils.cpp
+++ b/xpcom/threads/nsThreadUtils.cpp
@@ -35,19 +35,26 @@ NS_IMPL_ISUPPORTS(IdlePeriod, nsIIdlePer
 
 NS_IMETHODIMP
 IdlePeriod::GetIdlePeriodHint(TimeStamp* aIdleDeadline)
 {
   *aIdleDeadline = TimeStamp();
   return NS_OK;
 }
 
+// NS_IMPL_NAMED_* relies on the mName field, which is not present on
+// release or beta. Instead, fall back to using "Runnable" for all
+// runnables.
+#ifdef RELEASE_OR_BETA
+NS_IMPL_ISUPPORTS(Runnable, nsIRunnable, nsINamed)
+#else
 NS_IMPL_NAMED_ADDREF(Runnable, mName)
 NS_IMPL_NAMED_RELEASE(Runnable, mName)
 NS_IMPL_QUERY_INTERFACE(Runnable, nsIRunnable, nsINamed)
+#endif
 
 NS_IMETHODIMP
 Runnable::Run()
 {
   // Do nothing
   return NS_OK;
 }