Closed Bug 1711090 Opened 3 years ago Closed 3 years ago

Support creating timers with a std::function callback

Categories

(Core :: XPCOM, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
90 Branch
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: nobody → nika
Status: NEW → ASSIGNED

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

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.

Flags: needinfo?(nika)
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
Flags: needinfo?(nika)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: