Skip to content

Script: review timer mechanism to remove task queueing #37984

@gterzian

Description

@gterzian

Following #37946, script can use timer callbacks that are not Send, which means we can restructure the below:

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions