bug 808229 - remove unused runnable macros r=surkov

This commit is contained in:
Trevor Saunders 2012-11-02 17:49:05 -04:00
parent 788e8fce72
commit dda18f5df9

View File

@ -66,50 +66,6 @@ protected: \
private: \
ClassType *mObj; \
#define NS_DECL_RUNNABLEMETHOD(ClassType, Method) \
class nsRunnableMethod_##Method : public nsRunnable \
{ \
public: \
nsRunnableMethod_##Method(ClassType *aObj) : mObj(aObj) \
{ \
NS_IF_ADDREF(mObj); \
} \
\
NS_IMETHODIMP Run() \
{ \
if (!mObj) \
return NS_OK; \
(mObj-> Method)(); \
return NS_OK; \
} \
\
NS_DECL_RUNNABLEMETHOD_HELPER(ClassType, Method) \
\
};
#define NS_DECL_RUNNABLEMETHOD_ARG1(ClassType, Method, Arg1Type) \
class nsRunnableMethod_##Method : public nsRunnable \
{ \
public: \
nsRunnableMethod_##Method(ClassType *aObj, Arg1Type aArg1) : \
mObj(aObj), mArg1(aArg1) \
{ \
NS_IF_ADDREF(mObj); \
} \
\
NS_IMETHODIMP Run() \
{ \
if (!mObj) \
return NS_OK; \
(mObj-> Method)(mArg1); \
return NS_OK; \
} \
\
NS_DECL_RUNNABLEMETHOD_HELPER(ClassType, Method) \
Arg1Type mArg1; \
};
#define NS_DECL_RUNNABLEMETHOD_ARG2(ClassType, Method, Arg1Type, Arg2Type) \
class nsRunnableMethod_##Method : public nsRunnable \
{ \
@ -134,23 +90,6 @@ public: \
Arg1Type mArg1; \
Arg2Type mArg2; \
};
#define NS_DISPATCH_RUNNABLEMETHOD(Method, Obj) \
{ \
nsCOMPtr<nsIRunnable> runnable = \
new nsRunnableMethod_##Method(Obj); \
if (runnable) \
NS_DispatchToMainThread(runnable); \
}
#define NS_DISPATCH_RUNNABLEMETHOD_ARG1(Method, Obj, Arg1) \
{ \
nsCOMPtr<nsIRunnable> runnable = \
new nsRunnableMethod_##Method(Obj, Arg1); \
if (runnable) \
NS_DispatchToMainThread(runnable); \
}
#define NS_DISPATCH_RUNNABLEMETHOD_ARG2(Method, Obj, Arg1, Arg2) \
{ \
nsCOMPtr<nsIRunnable> runnable = \