Backed out changeset 516d8328dcb6 (bug 1251593) for test tree bustage on a CLOSED TREE
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 18 Mar 2016 07:59:17 +0100
changeset 289314 52029291217539501fced30b968fe639d8d0c011
parent 289313 b4a2342c8f5d781844dc26d9b504801d120910d6
child 289315 20a5b1e769229b9221bccb0735f815a78f409c5f
push id30099
push usercbook@mozilla.com
push dateFri, 18 Mar 2016 14:52:23 +0000
treeherdermozilla-central@9c5d494d0548 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1251593
milestone48.0a1
backs out516d8328dcb6718d4f0a23d772354ebe2267956a
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
Backed out changeset 516d8328dcb6 (bug 1251593) for test tree bustage on a CLOSED TREE
mfbt/RefCounted.h
--- a/mfbt/RefCounted.h
+++ b/mfbt/RefCounted.h
@@ -21,25 +21,16 @@
 #include "nsXPCOM.h"
 #endif
 
 #if defined(MOZILLA_INTERNAL_API) && \
     (defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING))
 #define MOZ_REFCOUNTED_LEAK_CHECKING
 #endif
 
-#if defined(MOZILLA_INTERNAL_API) && \
-    defined(DEBUG)
-#define MOZ_REFCOUNTED_THREAD_CHECKING
-#endif
-
-#ifdef MOZ_REFCOUNTED_THREAD_CHECKING
-#include "nsISupports.h"
-#endif
-
 namespace mozilla {
 
 /**
  * RefCounted<T> is a sort of a "mixin" for a class T.  RefCounted
  * manages, well, refcounting for T, and because RefCounted is
  * parameterized on T, RefCounted<T> can call T's destructor directly.
  * This means T doesn't need to have a virtual dtor and so doesn't
  * need a vtable.
@@ -101,39 +92,31 @@ class RefCounted
 protected:
   RefCounted() : mRefCnt(0) {}
   ~RefCounted() { MOZ_ASSERT(mRefCnt == detail::DEAD); }
 
 public:
   // Compatibility with nsRefPtr.
   void AddRef() const
   {
-#ifdef MOZ_REFCOUNTED_THREAD_CHECKING
-    RefCountThreadCheck(IntegralConstant<RefCountAtomicity, Atomicity>());
-#endif
-
     // Note: this method must be thread safe for AtomicRefCounted.
     MOZ_ASSERT(int32_t(mRefCnt) >= 0);
 #ifndef MOZ_REFCOUNTED_LEAK_CHECKING
     ++mRefCnt;
 #else
     const char* type = static_cast<const T*>(this)->typeName();
     uint32_t size = static_cast<const T*>(this)->typeSize();
     const void* ptr = static_cast<const T*>(this);
     MozRefCountType cnt = ++mRefCnt;
     detail::RefCountLogger::logAddRef(ptr, cnt, type, size);
 #endif
   }
 
   void Release() const
   {
-#ifdef MOZ_REFCOUNTED_THREAD_CHECKING
-    RefCountThreadCheck(IntegralConstant<RefCountAtomicity, Atomicity>());
-#endif
-
     // Note: this method must be thread safe for AtomicRefCounted.
     MOZ_ASSERT(int32_t(mRefCnt) > 0);
 #ifndef MOZ_REFCOUNTED_LEAK_CHECKING
     MozRefCountType cnt = --mRefCnt;
 #else
     const char* type = static_cast<const T*>(this)->typeName();
     const void* ptr = static_cast<const T*>(this);
     MozRefCountType cnt = --mRefCnt;
@@ -162,30 +145,16 @@ public:
     MOZ_ASSERT(mRefCnt > 0);
     return mRefCnt == 1;
   }
 
 private:
   mutable typename Conditional<Atomicity == AtomicRefCount,
                                Atomic<MozRefCountType>,
                                MozRefCountType>::Type mRefCnt;
-
-#ifdef MOZ_REFCOUNTED_THREAD_CHECKING
-  void RefCountThreadCheck(IntegralConstant<RefCountAtomicity, AtomicRefCount>) const
-  {
-    // no need to check the thread if we use AtomicRefCount.
-  }
-
-  void RefCountThreadCheck(IntegralConstant<RefCountAtomicity, NonAtomicRefCount>) const
-  {
-    NS_ASSERT_OWNINGTHREAD(RefCounted);
-  }
-
-  NS_DECL_OWNINGTHREAD;
-#endif
 };
 
 #ifdef MOZ_REFCOUNTED_LEAK_CHECKING
 // Passing override for the optional argument marks the typeName and
 // typeSize functions defined by this macro as overrides.
 #define MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(T, ...) \
   virtual const char* typeName() const __VA_ARGS__ { return #T; } \
   virtual size_t typeSize() const __VA_ARGS__ { return sizeof(*this); }