bug 118061 Adding NS_NewTimer r=dveditz sr=sfraser
git-svn-id: svn://10.0.0.236/trunk@112666 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
e262b0cb89
commit
826c21e7bc
@ -152,4 +152,7 @@ public:
|
||||
NS_IMETHOD_(void*) GetClosure() = 0;
|
||||
};
|
||||
|
||||
extern NS_COM nsresult
|
||||
NS_NewTimer(nsITimer* *aResult, nsTimerCallbackFunc aCallback, void *aClosure,
|
||||
PRUint32 aDelay, PRUint32 aPriority, PRUint32 aType);
|
||||
#endif // nsITimer_h___
|
||||
|
||||
@ -353,3 +353,22 @@ void nsTimerImpl::SetDelayInternal(PRUint32 aDelay)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewTimer(nsITimer* *aResult, nsTimerCallbackFunc aCallback, void *aClosure,
|
||||
PRUint32 aDelay, PRUint32 aPriority, PRUint32 aType)
|
||||
{
|
||||
nsTimerImpl* timer = new nsTimerImpl();
|
||||
if (timer == nsnull)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(timer);
|
||||
|
||||
nsresult rv = timer->Init(aCallback, aClosure, aDelay, aPriority, aType);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(timer);
|
||||
return rv;
|
||||
}
|
||||
|
||||
*aResult = timer;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user