Support creating timers with a std::function callback
Categories
(Core :: XPCOM, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox90 | --- | fixed |
People
(Reporter: nika, Assigned: nika)
Details
Attachments
(4 files)
Currently the only ways to create timers are either with nsIObserver
, or nsITimerCallback
interface callbacks, or by using a raw function pointer like nsTimerCallbackFunc
which captures a void*
closure. These aren't very ergonomic and the function pointer variant in particular is often somewhat unsafe, as it requires manual memory management.
Assignee | ||
Comment 1•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
Assignee | ||
Comment 3•3 years ago
|
||
Assignee | ||
Comment 4•3 years ago
|
||
They are not used anywhere in the codebase and come with
non-insignificant complexity which we can drop.
Pushed by nlayzell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ecc51d9ad027 Part 1: Simplify nsTimerImpl's Callback implementation, r=KrisWright https://hg.mozilla.org/integration/autoland/rev/fc9c788ff41d Part 2: Allow creating a nsITimer with a std::function callback, r=KrisWright https://hg.mozilla.org/integration/autoland/rev/0b6a886eea8a Part 3: Add some missing nsITimerCallback queryinterface targets, r=KrisWright,necko-reviewers,kershaw https://hg.mozilla.org/integration/autoland/rev/5c6f0950714d Part 4: Remove non-string func timer names, r=KrisWright
Comment 6•3 years ago
|
||
Backed out 4 changesets (Bug 1711090) for causing bustages in nsTimerImpl.cpp
Backout link: https://hg.mozilla.org/integration/autoland/rev/8d7eefa3c3f89a5f10e83cf430389b33c4297042
Push with failures, failure log.
Pushed by nlayzell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c795c538cf38 Part 1: Simplify nsTimerImpl's Callback implementation, r=KrisWright https://hg.mozilla.org/integration/autoland/rev/f152095f3abf Part 2: Allow creating a nsITimer with a std::function callback, r=KrisWright https://hg.mozilla.org/integration/autoland/rev/067bc09ae0e2 Part 3: Add some missing nsITimerCallback queryinterface targets, r=KrisWright,necko-reviewers,kershaw https://hg.mozilla.org/integration/autoland/rev/5b33487a687b Part 4: Remove non-string func timer names, r=KrisWright
Comment 8•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c795c538cf38
https://hg.mozilla.org/mozilla-central/rev/f152095f3abf
https://hg.mozilla.org/mozilla-central/rev/067bc09ae0e2
https://hg.mozilla.org/mozilla-central/rev/5b33487a687b
Assignee | ||
Updated•3 years ago
|
Description
•