mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
backout bug 157123, it caused crasher bug 160824
a=asa
This commit is contained in:
parent
75b005d166
commit
b5c07224a5
@ -46,7 +46,7 @@
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#define INITAL_REPEAT_DELAY 250
|
||||
#define REPEAT_DELAY 25
|
||||
#define REPEAT_DELAY 10
|
||||
#else
|
||||
#define INITAL_REPEAT_DELAY 250
|
||||
#define REPEAT_DELAY 50
|
||||
@ -92,14 +92,14 @@ void nsRepeatService::Start(nsITimerCallback* aCallback)
|
||||
mRepeatTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);
|
||||
|
||||
if (NS_OK == rv) {
|
||||
mRepeatTimer->Init(this, INITAL_REPEAT_DELAY, PR_TRUE, NS_TYPE_REPEATING_SLACK);
|
||||
mFirstCall = PR_TRUE;
|
||||
mRepeatTimer->Init(this, INITAL_REPEAT_DELAY);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void nsRepeatService::Stop()
|
||||
{
|
||||
//printf("Stopping repeat timer\n");
|
||||
if (mRepeatTimer) {
|
||||
mRepeatTimer->Cancel();
|
||||
mRepeatTimer = nsnull;
|
||||
@ -109,14 +109,19 @@ void nsRepeatService::Stop()
|
||||
|
||||
NS_IMETHODIMP_(void) nsRepeatService::Notify(nsITimer *timer)
|
||||
{
|
||||
// if the repeat delay is the initial one reset it.
|
||||
if (mRepeatTimer) {
|
||||
mRepeatTimer->Cancel();
|
||||
}
|
||||
|
||||
// do callback
|
||||
if (mCallback)
|
||||
mCallback->Notify(timer);
|
||||
|
||||
// start timer again.
|
||||
if (mFirstCall) {
|
||||
mRepeatTimer->SetDelay(REPEAT_DELAY);
|
||||
mFirstCall = PR_FALSE;
|
||||
if (mRepeatTimer) {
|
||||
mRepeatTimer = do_CreateInstance("@mozilla.org/timer;1");
|
||||
mRepeatTimer->Init(this, REPEAT_DELAY);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user