Bug 812880 - Remove some static RefPtrs which were causing deadlocks at shutdown. r=cjones, a=akeybl
authorJustin Lebar <justin.lebar@gmail.com>
Mon, 19 Nov 2012 20:09:11 -0500
changeset 117046 464cf04f7f866f5d0628e0cc237f4f942a0f0d6e
parent 117045 7f76d7828b3ddfb983aeb6add14bc35abe676e20
child 117047 0e1c415ec2efefff2c2ec230cb099676402d4aa1
push id1729
push userryanvm@gmail.com
push dateWed, 21 Nov 2012 22:39:15 +0000
treeherdermozilla-beta@8f0032f48497 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones, akeybl
bugs812880
milestone18.0
Bug 812880 - Remove some static RefPtrs which were causing deadlocks at shutdown. r=cjones, a=akeybl
dom/system/gonk/AutoMounter.cpp
--- a/dom/system/gonk/AutoMounter.cpp
+++ b/dom/system/gonk/AutoMounter.cpp
@@ -17,16 +17,17 @@
 #include <sys/socket.h>
 #include <android/log.h>
 
 #include "AutoMounter.h"
 #include "AutoMounterSetting.h"
 #include "base/message_loop.h"
 #include "mozilla/FileUtils.h"
 #include "mozilla/Hal.h"
+#include "mozilla/StaticPtr.h"
 #include "nsAutoPtr.h"
 #include "nsMemory.h"
 #include "nsString.h"
 #include "nsThreadUtils.h"
 #include "nsXULAppAPI.h"
 #include "Volume.h"
 #include "VolumeManager.h"
 
@@ -280,17 +281,17 @@ private:
 
   AutoVolumeEventObserver         mVolumeEventObserver;
   AutoVolumeManagerStateObserver  mVolumeManagerStateObserver;
   RefPtr<VolumeResponseCallback>  mResponseCallback;
   int32_t                         mMode;
   VolumeArray                     mAutoVolume;
 };
 
-static RefPtr<AutoMounter> sAutoMounter;
+static StaticRefPtr<AutoMounter> sAutoMounter;
 
 /***************************************************************************/
 
 void
 AutoVolumeManagerStateObserver::Notify(const VolumeManager::StateChangedEvent &)
 {
   LOG("VolumeManager state changed event: %s", VolumeManager::StateStr());
 
@@ -519,18 +520,18 @@ public:
     DBG("UsbCable switch device: %d state: %s\n",
         aEvent.device(), SwitchStateStr(aEvent));
     XRE_GetIOMessageLoop()->PostTask(
         FROM_HERE,
         NewRunnableFunction(UsbCableEventIOThread));
   }
 };
 
-static RefPtr<UsbCableObserver> sUsbCableObserver;
-static RefPtr<AutoMounterSetting> sAutoMounterSetting;
+static StaticRefPtr<UsbCableObserver> sUsbCableObserver;
+static StaticRefPtr<AutoMounterSetting> sAutoMounterSetting;
 
 void
 InitAutoMounter()
 {
   InitVolumeManager();
   sAutoMounterSetting = new AutoMounterSetting();
 
   XRE_GetIOMessageLoop()->PostTask(