Bug 999883 - Make BackgroundHangMonitor not use mozilla::RefCounted; r=froydnj
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 23 Apr 2014 09:45:56 -0400
changeset 199326 efdfbde5f291a9b3cb1889e7c96ba5ea070ef2e8
parent 199325 bd59c5ef0677817e38d833f065316b527d79f914
child 199327 bfd16de7bf251bb0184a3f4baf6c76552abc8dc1
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs999883
milestone31.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 999883 - Make BackgroundHangMonitor not use mozilla::RefCounted; r=froydnj
xpcom/threads/BackgroundHangMonitor.cpp
--- a/xpcom/threads/BackgroundHangMonitor.cpp
+++ b/xpcom/threads/BackgroundHangMonitor.cpp
@@ -91,33 +91,33 @@ public:
   BackgroundHangManager();
   ~BackgroundHangManager();
 };
 
 /**
  * BackgroundHangThread is a per-thread object that is used
  * by all instances of BackgroundHangMonitor to monitor hangs.
  */
-class BackgroundHangThread : public RefCounted<BackgroundHangThread>
-                           , public LinkedListElement<BackgroundHangThread>
+class BackgroundHangThread : public LinkedListElement<BackgroundHangThread>
 {
 private:
   static ThreadLocal<BackgroundHangThread*> sTlsKey;
 
   BackgroundHangThread(const BackgroundHangThread&);
   BackgroundHangThread& operator=(const BackgroundHangThread&);
+  ~BackgroundHangThread();
 
   /* Keep a reference to the manager, so we can keep going even
      after BackgroundHangManager::Shutdown is called. */
   const RefPtr<BackgroundHangManager> mManager;
   // Unique thread ID for identification
   const PRThread* mThreadID;
 
 public:
-  MOZ_DECLARE_REFCOUNTED_TYPENAME(BackgroundHangThread)
+  NS_INLINE_DECL_REFCOUNTING(BackgroundHangThread)
   static BackgroundHangThread* FindThread();
 
   static void Startup()
   {
     /* We can tolerate init() failing.
        The if block turns off warn_unused_result. */
     if (!sTlsKey.init()) {}
   }
@@ -139,17 +139,16 @@ public:
   // Stack of current hang
   Telemetry::HangHistogram::Stack mHangStack;
   // Statistics for telemetry
   Telemetry::ThreadHangStats mStats;
 
   BackgroundHangThread(const char* aName,
                        uint32_t aTimeoutMs,
                        uint32_t aMaxTimeoutMs);
-  ~BackgroundHangThread();
 
   // Report a hang; aManager->mLock IS locked
   void ReportHang(PRIntervalTime aHangTime);
   // Report a permanent hang; aManager->mLock IS locked
   void ReportPermaHang();
   // Called by BackgroundHangMonitor::NotifyActivity
   void NotifyActivity();
   // Called by BackgroundHangMonitor::NotifyWait