Files
tubestation/services
Jens Stutte ddeb6c7c01 Bug 1964039 - Avoid to use SetDelay in namedTimer. r=sync-reviewers,markh
Using SetDelay on an existing ONE_SHOT timer is a convenient way to re-schedule a timer that did not yet fire.

However, if the timer fired already but the callback did not yet fully execute and the caller still thinks
to have a pending timer, our internal book-keeping will already have removed the timer from the list and
SetDelay will not re-activate the timer for us.

namedTimer instead seems to expect to always have activated a timer when called. We can still reuse the existing
timer object but need to always call initWithCallback which takes care of all the book-keeping details for us.
Note that this does not change much in terms of effort, as also SetDelay removes and then re-adds the timer from
and to the active timers list.

Differential Revision: https://phabricator.services.mozilla.com/D247440
2025-05-15 20:08:36 +00:00
..