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
Родитель b5ca3d42b3
Коммит fd7dc9022e
5 изменённых файлов: 8 добавлений и 15 удалений

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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