script: Make timers per-process (#34581)

Before all timers were managed by the Constellation process, meaning
that they had to trigger IPC calls to be scheduled and fired. Currently,
timers are only used in the `ScriptThread`, so it makes sense that they
are per-process.

This change restores the timer thread functionality that existed before
avoided entirely. Completion is done using a callback that is sent to
the timer thread similarly to how fetch is done. This allows reusing the
existing task queue without making any new channels.

Fixes #15219.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2024-12-24 10:53:35 +01:00 committed by GitHub
parent ff7626bfc6
commit 226299380d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 366 additions and 324 deletions

13
Cargo.lock generated
View file

@ -6053,6 +6053,7 @@ dependencies = [
"tempfile",
"tendril",
"time 0.3.36",
"timers",
"tracing",
"unicode-bidi",
"unicode-segmentation",
@ -7304,6 +7305,18 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06535c958d6abe68dc4b4ef9e6845f758fc42fe463d0093d0aca40254f03fb14"
[[package]]
name = "timers"
version = "0.0.1"
dependencies = [
"base",
"crossbeam-channel",
"log",
"malloc_size_of_derive",
"serde",
"servo_malloc_size_of",
]
[[package]]
name = "tiny-skia"
version = "0.11.4"