Bug 935778 - Part 0.4: Spray even more MOZ_DECLARE_REFCOUNTED_TYPENAME across the tree
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 21 Feb 2014 09:11:33 -0500
changeset 169892 fc033be15f374bb0011ef20bb7e319c6e5b3aed5
parent 169891 b44289e756fc6d47cb6dbde058b0dc027d58868f
child 169893 babff8d1437ba51b159ed5e08333485f56d1aca8
push id26269
push userryanvm@gmail.com
push dateFri, 21 Feb 2014 19:53:30 +0000
treeherdermozilla-central@fb8597ff68ea [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs935778
milestone30.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 935778 - Part 0.4: Spray even more MOZ_DECLARE_REFCOUNTED_TYPENAME across the tree
content/media/fmp4/PlatformDecoderModule.h
content/media/fmp4/wmf/MFTDecoder.h
dom/bluetooth/BluetoothProfileController.h
dom/system/gonk/AutoMounter.cpp
dom/system/gonk/Volume.h
dom/system/gonk/VolumeCommand.h
dom/system/gonk/VolumeManager.h
dom/system/gonk/VolumeServiceIOThread.h
hal/gonk/GonkHal.cpp
hal/gonk/GonkSwitch.cpp
ipc/dbus/DBusUtils.h
ipc/netd/Netd.h
ipc/unixsocket/UnixSocket.h
memory/mozalloc/VolatileBuffer.h
mozglue/linker/ElfLoader.h
mozglue/linker/Mappable.h
mozglue/linker/Zip.h
widget/gtk/nsClipboard.cpp
--- a/content/media/fmp4/PlatformDecoderModule.h
+++ b/content/media/fmp4/PlatformDecoderModule.h
@@ -139,16 +139,17 @@ public:
 // arbitrary thread.
 //
 // Decoding is done asynchronously. Any async work can be done on the
 // MediaTaskQueue passed into the PlatformDecoderModules's Create*Decoder()
 // function. This may not be necessary for platforms with async APIs
 // for decoding.
 class MediaDataDecoder : public AtomicRefCounted<MediaDataDecoder> {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(MediaDataDecoder)
   virtual ~MediaDataDecoder() {};
 
   // Initialize the decoder. The decoder should be ready to decode after
   // this returns. The decoder should do any initialization here, rather
   // than in its constructor or PlatformDecoderModule::Create*Decoder(),
   // so that if the MP4Reader needs to shutdown during initialization,
   // it can call Shutdown() to cancel this operation. Any initialization
   // that requires blocking the calling thread in this function *must*
--- a/content/media/fmp4/wmf/MFTDecoder.h
+++ b/content/media/fmp4/wmf/MFTDecoder.h
@@ -11,16 +11,17 @@
 #include "mozilla/RefPtr.h"
 #include "mozilla/ReentrantMonitor.h"
 #include "nsIThread.h"
 
 namespace mozilla {
 
 class MFTDecoder : public AtomicRefCounted<MFTDecoder> {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(MTFDecoder)
   MFTDecoder();
   ~MFTDecoder();
 
   // Creates the MFT. First thing to do as part of setup.
   //
   // Params:
   //  - aMFTClsID the clsid used by CoCreateInstance to instantiate the
   //    decoder MFT.
--- a/dom/bluetooth/BluetoothProfileController.h
+++ b/dom/bluetooth/BluetoothProfileController.h
@@ -54,16 +54,17 @@ BEGIN_BLUETOOTH_NAMESPACE
 
 class BluetoothProfileManagerBase;
 class BluetoothReplyRunnable;
 typedef void (*BluetoothProfileControllerCallback)();
 
 class BluetoothProfileController : public RefCounted<BluetoothProfileController>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(BluetoothProfileController)
   /**
    * @param aConnect:       If it's a connect request, the value should be set
    *                        to true. For disconnect request, set it to false.
    * @param aDeviceAddress: The address of remote device.
    * @param aRunnable:      Once the controller has done, the runnable will be
    *                        replied. When all connection/disconnection attemps
    *                        have failed, an error is fired. In other words,
    *                        reply a success if any attemp successes.
--- a/dom/system/gonk/AutoMounter.cpp
+++ b/dom/system/gonk/AutoMounter.cpp
@@ -161,16 +161,17 @@ private:
     int   mErrorCount;
 };
 
 /***************************************************************************/
 
 class AutoMounter : public RefCounted<AutoMounter>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(AutoMounter)
 
   typedef nsTArray<RefPtr<Volume> > VolumeArray;
 
   AutoMounter()
     : mResponseCallback(new AutoMounterResponseCallback),
       mMode(AUTOMOUNTER_DISABLE)
   {
     VolumeManager::RegisterStateObserver(&mVolumeManagerStateObserver);
@@ -627,16 +628,17 @@ UsbCableEventIOThread()
 *   to IOThread context before we can do anything.
 *
 **************************************************************************/
 
 class UsbCableObserver : public SwitchObserver,
                          public RefCounted<UsbCableObserver>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(UsbCableObserver)
   UsbCableObserver()
   {
     RegisterSwitchObserver(SWITCH_USB, this);
   }
 
   ~UsbCableObserver()
   {
     UnregisterSwitchObserver(SWITCH_USB, this);
--- a/dom/system/gonk/Volume.h
+++ b/dom/system/gonk/Volume.h
@@ -22,16 +22,17 @@ namespace system {
 *
 *   Each volume originates from the /system/etv/vold.fstab file.
 *
 ***************************************************************************/
 
 class Volume : public RefCounted<Volume>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(Volume)
   Volume(const nsCSubstring& aVolumeName);
 
   typedef long STATE; // States are now defined in nsIVolume.idl
 
   static const char* StateStr(STATE aState) { return NS_VolumeStateStr(aState); }
   const char* StateStr() const  { return StateStr(mState); }
   STATE State() const           { return mState; }
 
--- a/dom/system/gonk/VolumeCommand.h
+++ b/dom/system/gonk/VolumeCommand.h
@@ -30,16 +30,17 @@ class VolumeCommand;
 *
 *   Valid Response codes can be found in the vold/ResponseCode.h header.
 *
 ***************************************************************************/
 
 class VolumeResponseCallback : public RefCounted<VolumeResponseCallback>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(VolumeResponseCallback)
   VolumeResponseCallback()
     : mResponseCode(0), mPending(false) {}
 
   virtual ~VolumeResponseCallback() {}
 
   bool Done() const
   {
     // Response codes from the 200, 400, and 500 series all indicated that
@@ -103,16 +104,17 @@ private:
 *   All of these commands are asynchronous in nature, and the
 *   ResponseReceived callback will be called when a response is available.
 *
 ***************************************************************************/
 
 class VolumeCommand : public RefCounted<VolumeCommand>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(VolumeCommand)
   VolumeCommand(VolumeResponseCallback* aCallback)
     : mBytesConsumed(0),
       mCallback(aCallback)
   {
     SetCmd(NS_LITERAL_CSTRING(""));
   }
 
   VolumeCommand(const nsACString& aCommand, VolumeResponseCallback* aCallback)
--- a/dom/system/gonk/VolumeManager.h
+++ b/dom/system/gonk/VolumeManager.h
@@ -72,16 +72,17 @@ namespace system {
 *   commands are being used.
 *
 ***************************************************************************/
 
 class VolumeManager : public MessageLoopForIO::LineWatcher,
                       public RefCounted<VolumeManager>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(VolumeManager)
 
   typedef nsTArray<RefPtr<Volume> > VolumeArray;
 
   VolumeManager();
   virtual ~VolumeManager();
 
   //-----------------------------------------------------------------------
   //
--- a/dom/system/gonk/VolumeServiceIOThread.h
+++ b/dom/system/gonk/VolumeServiceIOThread.h
@@ -18,16 +18,17 @@ class nsVolumeService;
 * The nsVolumeServiceIOThread is a companion class to the nsVolumeService
 * class, but whose methods are called from IOThread.
 */
 class VolumeServiceIOThread : public VolumeManager::StateObserver,
                               public Volume::EventObserver,
                               public RefCounted<VolumeServiceIOThread>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(VolumeServiceIOThread)
   VolumeServiceIOThread(nsVolumeService* aVolumeService);
   ~VolumeServiceIOThread();
 
 private:
   void  UpdateAllVolumes();
 
   virtual void Notify(const VolumeManager::StateChangedEvent& aEvent);
   virtual void Notify(Volume* const & aVolume);
--- a/hal/gonk/GonkHal.cpp
+++ b/hal/gonk/GonkHal.cpp
@@ -293,16 +293,17 @@ public:
 };
 
 } // anonymous namespace
 
 class BatteryObserver : public IUeventObserver,
                         public RefCounted<BatteryObserver>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(BatteryObserver)
   BatteryObserver()
     :mUpdater(new BatteryUpdater())
   {
   }
 
   virtual void Notify(const NetlinkEvent &aEvent)
   {
     // this will run on IO thread
--- a/hal/gonk/GonkSwitch.cpp
+++ b/hal/gonk/GonkSwitch.cpp
@@ -49,16 +49,17 @@ namespace hal_impl {
  *    SUBSYSTEM=switch
  *    SWITCH_NAME=usb_configuration
  *    SWITCH_STATE=0
  *    SEQNUM=5038
  */
 class SwitchHandler : public RefCounted<SwitchHandler>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(SwitchHandler)
   SwitchHandler(const char* aDevPath, SwitchDevice aDevice)
     : mDevPath(aDevPath),
       mState(SWITCH_STATE_UNKNOWN),
       mDevice(aDevice)
   {
     GetInitialState();
   }
 
@@ -228,16 +229,17 @@ public:
 private:
   SwitchEvent mEvent;
 };
 
 class SwitchEventObserver : public IUeventObserver,
                             public RefCounted<SwitchEventObserver>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(SwitchEventObserver)
   SwitchEventObserver() : mEnableCount(0)
   {
     Init();
   }
 
   ~SwitchEventObserver()
   {
     mHandler.Clear();
--- a/ipc/dbus/DBusUtils.h
+++ b/ipc/dbus/DBusUtils.h
@@ -56,16 +56,17 @@ private:
  * DBusReplyHandler represents a handler for DBus reply messages. Inherit
  * from this class and implement the Handle method. The method Callback
  * should be passed to the DBus send function, with the class instance as
  * user-data argument.
  */
 class DBusReplyHandler : public mozilla::RefCounted<DBusReplyHandler>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(DBusReplyHandler)
   virtual ~DBusReplyHandler() {
   }
 
   /**
    * Implements a call-back function for DBus. The supplied value for
    * aData must be a pointer to an instance of DBusReplyHandler.
    */
   static void Callback(DBusMessage* aReply, void* aData);
--- a/ipc/netd/Netd.h
+++ b/ipc/netd/Netd.h
@@ -24,29 +24,31 @@ struct NetdCommand
 
   // Number of octets in mData.
   size_t mSize;
 };
 
 class NetdConsumer : public mozilla::RefCounted<NetdConsumer>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(NetdConsumer)
   virtual ~NetdConsumer() { }
   virtual void MessageReceived(NetdCommand* aMessage) = 0;
 };
 
 class NetdWriteTask : public Task
 {
   virtual void Run();
 };
 
 class NetdClient : public MessageLoopForIO::LineWatcher,
                    public RefCounted<NetdClient>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(NetdClient)
   typedef std::queue<NetdCommand*> NetdCommandQueue;
 
   NetdClient();
   virtual ~NetdClient();
   static void Start();
   static void SendNetdCommandIOThread(NetdCommand* aMessage);
 
 private:
--- a/ipc/unixsocket/UnixSocket.h
+++ b/ipc/unixsocket/UnixSocket.h
@@ -155,16 +155,17 @@ enum SocketConnectionStatus {
   SOCKET_LISTENING = 1,
   SOCKET_CONNECTING = 2,
   SOCKET_CONNECTED = 3
 };
 
 class UnixSocketConsumer : public RefCounted<UnixSocketConsumer>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(UnixSocketConsumer)
   UnixSocketConsumer();
 
   virtual ~UnixSocketConsumer();
 
   SocketConnectionStatus GetConnectionStatus() const
   {
     MOZ_ASSERT(NS_IsMainThread());
     return mConnectionStatus;
--- a/memory/mozalloc/VolatileBuffer.h
+++ b/memory/mozalloc/VolatileBuffer.h
@@ -41,16 +41,17 @@
  */
 
 namespace mozilla {
 
 class MOZALLOC_EXPORT VolatileBuffer : public RefCounted<VolatileBuffer>
 {
   friend class VolatileBufferPtr_base;
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(VolatileBuffer)
   VolatileBuffer();
   ~VolatileBuffer();
 
   /* aAlignment must be a multiple of the pointer size */
   bool Init(size_t aSize, size_t aAlignment = sizeof(void*));
 
   size_t HeapSizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const;
   size_t NonHeapSizeOfExcludingThis() const;
--- a/mozglue/linker/ElfLoader.h
+++ b/mozglue/linker/ElfLoader.h
@@ -86,16 +86,17 @@ template <> inline RefCounted<LibHandle,
 
 /**
  * Abstract class for loaded libraries. Libraries may be loaded through the
  * system linker or this linker, both cases will be derived from this class.
  */
 class LibHandle: public mozilla::AtomicRefCounted<LibHandle>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(LibHandle)
   /**
    * Constructor. Takes the path of the loaded library and will store a copy
    * of the leaf name.
    */
   LibHandle(const char *path)
   : directRefCnt(0), path(path ? strdup(path) : nullptr), mappable(nullptr) { }
 
   /**
--- a/mozglue/linker/Mappable.h
+++ b/mozglue/linker/Mappable.h
@@ -17,16 +17,17 @@
  * Abstract class to handle mmap()ing from various kind of entities, such as
  * plain files or Zip entries. The virtual members are meant to act as the
  * equivalent system functions, except mapped memory is always MAP_PRIVATE,
  * even though a given implementation may use something different internally.
  */
 class Mappable: public mozilla::RefCounted<Mappable>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(Mappable)
   virtual ~Mappable() { }
 
   virtual MemoryRange mmap(const void *addr, size_t length, int prot, int flags,
                            off_t offset) = 0;
 
   enum Kind {
     MAPPABLE_FILE,
     MAPPABLE_EXTRACT_FILE,
--- a/mozglue/linker/Zip.h
+++ b/mozglue/linker/Zip.h
@@ -24,16 +24,17 @@ class ZipCollection;
  * performed, which means hand-crafted malicious Zip archives can make the
  * code fail in bad ways. However, since the only intended use is to load
  * libraries from Zip archives, there is no interest in making this code
  * safe, since the libraries could contain malicious code anyways.
  */
 class Zip: public mozilla::AtomicRefCounted<Zip>
 {
 public:
+  MOZ_DECLARE_REFCOUNTED_TYPENAME(Zip)
   /**
    * Create a Zip instance for the given file name. Returns nullptr in case
    * of failure.
    */
   static mozilla::TemporaryRef<Zip> Create(const char *filename);
 
   /**
    * Create a Zip instance using the given buffer.
--- a/widget/gtk/nsClipboard.cpp
+++ b/widget/gtk/nsClipboard.cpp
@@ -866,16 +866,17 @@ static GtkSelectionData* CopyRetrievedDa
 {
     // A negative length indicates that retrieving the data failed.
     return gtk_selection_data_get_length(aData) >= 0 ?
         gtk_selection_data_copy(aData) : nullptr;
 }
 
 class RetrievalContext : public RefCounted<RetrievalContext> {
 public:
+    MOZ_DECLARE_REFCOUNTED_TYPENAME(RetrievalContext)
     enum State { INITIAL, COMPLETED, TIMED_OUT };
 
     RetrievalContext() : mState(INITIAL), mData(nullptr) {}
     ~RetrievalContext()
     {
         MOZ_ASSERT(!mData, "Wait() wasn't called");
     }