Bug 884061 - Part 3m: Use NS_DECL_THREADSAFE_ISUPPORTS in ipc/, r=bent

--HG--
extra : rebase_source : 77f707d086624cc908a4e39935aa2a03f16543fb
This commit is contained in:
Joshua Cranmer 2013-07-18 21:23:32 -05:00
parent 697b803613
commit 48de6321af
5 changed files with 8 additions and 15 deletions

View File

@ -36,7 +36,7 @@ CloseFileRunnable::~CloseFileRunnable()
}
}
NS_IMPL_THREADSAFE_ISUPPORTS1(CloseFileRunnable, nsIRunnable)
NS_IMPL_ISUPPORTS1(CloseFileRunnable, nsIRunnable)
void
CloseFileRunnable::Dispatch()

View File

@ -31,7 +31,7 @@ public:
{ }
#endif
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIRUNNABLE
void Dispatch();

View File

@ -23,7 +23,7 @@ using mozilla::ipc::MessagePump;
using mozilla::ipc::MessagePumpForChildProcess;
using base::TimeTicks;
NS_IMPL_THREADSAFE_ISUPPORTS2(DoWorkRunnable, nsIRunnable, nsITimerCallback)
NS_IMPL_ISUPPORTS2(DoWorkRunnable, nsIRunnable, nsITimerCallback)
NS_IMETHODIMP
DoWorkRunnable::Run()

View File

@ -29,7 +29,7 @@ public:
DoWorkRunnable(MessagePump* aPump)
: mPump(aPump) { }
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIRUNNABLE
NS_DECL_NSITIMERCALLBACK

View File

@ -15,7 +15,7 @@
#include "base/basictypes.h"
#include "nsAtomicRefcnt.h"
#include "nsISupportsImpl.h"
#include "mozilla/ipc/SyncChannel.h"
#include "nsAutoPtr.h"
@ -392,22 +392,15 @@ private:
{
public:
RefCountedTask(CancelableTask* aTask)
: mTask(aTask)
, mRefCnt(0) {}
: mTask(aTask) {}
~RefCountedTask() { delete mTask; }
void Run() { mTask->Run(); }
void Cancel() { mTask->Cancel(); }
void AddRef() {
NS_AtomicIncrementRefcnt(mRefCnt);
}
void Release() {
if (NS_AtomicDecrementRefcnt(mRefCnt) == 0)
delete this;
}
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(RefCountedTask)
private:
CancelableTask* mTask;
nsrefcnt mRefCnt;
};
//