-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Script: review timer mechanism to remove task queueing #37984
Copy link
Copy link
Open
Labels
A-content/scriptRelated to the script threadRelated to the script thread
Description
Following #37946, script can use timer callbacks that are not Send, which means we can restructure the below:
servo/components/script/timers.rs
Line 617 in 827261a
| struct TimerListener { |
I think we can mark the struct with crown::unrooted_must_root_lint::must_root, and have it own a Dom<GlobalScope>.
The task source could then be obtained from the global, but I think we should try to take this a bit further and try to avoid queueing a task, because when the timer is dispatched, we are already on the script-thread, so we can pretend to already be inside a queued task. This requires some looking into(things like entering a realm if necessary).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-content/scriptRelated to the script threadRelated to the script thread