Closed
Bug 74827
Opened 24 years ago
Closed 24 years ago
Need to be able to cancel in-progress timers
Categories
(Core Graveyard :: Widget: Mac, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla0.9.1
People
(Reporter: sfraser_bugs, Assigned: sfraser_bugs)
References
Details
Attachments
(1 file)
(deleted),
patch
|
Details | Diff | Splinter Review |
The mac timer code currently bails on cancelling a timer that is currently being
fired. However, because it's possible to have repeating timers, this makes it
impossible to cancel timers from their callbacks. Also, the other platforms
implement this.
Assignee | ||
Comment 1•24 years ago
|
||
Assignee | ||
Comment 2•24 years ago
|
||
dcone: please test the attached patch, and let me know if it works. I can't test,
because no other places in the code seem to attempt to cancel repeating timers
from the callback.
Comment 3•24 years ago
|
||
looks like this one may be getting in by moz0.9
Priority: -- → P3
Target Milestone: --- → mozilla0.9
Comment 4•24 years ago
|
||
I tried the timer.. and the code gets only called once, so this does not work
correctly.
If you want to debug.. the timer is in
mozilla/content/base/src/nsDocumentViewer. There is a timer in there.
Go to the Notify method, this is the entry point for the timer and gets called
only once. If you print example 0, there will be two pages.. the timer gets
called for the first page, but never the second page..
the correct behavior would be that the notify should get called once for each of
two pages and then stop.
Assignee | ||
Comment 5•24 years ago
|
||
dcone: Print doesn't work for me in either viewer or Mozilla, so I can't debug
this. Can you please try to debug the Mac timer changes here.
You should hit the assertion at:
NS_ASSERTION(aTimer->GetType() == NS_TYPE_ONE_SHOT, "Cancelling repeating
timer");
when you try to cancel the repeating timer (the assetion is just for debugging,
it should be removed from the patch). This should set aTimer->mCanceledInCallback
to true, which causes the timer to get cancelled when its callback is done.
Assignee | ||
Comment 6•24 years ago
|
||
Additional note: I saw a repeating timer get cancelled (from, I think, image
code) and stuff seemed to work fine. Should I be able to debug the print stuff
now?
Comment 7•24 years ago
|
||
saari has been pulling his hair out over something like this in the art decoder.
it seems repeating timers can be cancelled just dandy on mac, but you can't
restart them on win32. cc'ing him.
Comment 8•24 years ago
|
||
Printing uses the one shot timer now, a page starts for each timer, so debuggin
the repeating timers there will not work. The printing should have used one shot
timers since repeating timers could have been notified multiple times for a
page. I am not sure who uses multiple timers now.. but this issue should still
be fixed and tested for consistency across platform, it can cause problems as I
found out.
Also.. to restart the windows timers.. you have to create a new one.. not just
restart. On the Mac.. you can just restart them. I did go thru this problem
also.
Comment 10•24 years ago
|
||
looks good, r=pink
Comment 12•24 years ago
|
||
sr=waterson
Assignee | ||
Comment 13•24 years ago
|
||
Thanks man. Just 1 second too late for my checkin comment!.
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•