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
--- 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;
}