Files
servo/components/script
Martin Robinson 08aad55ef7 script: Break the ScriptThread dependency on the initial Pipeline (#40918)
`ScriptThread`s start with an initial `Pipeline`, but that `Pipeline`
should not be used for any `ScriptThread` global data as a
`ScriptThread` can have any number of `Pipeline`s that come and go.
There's no architectural reason why a `ScriptThread` should be
associated with only a single `WebView`.

This change makes it so that the `ScriptThread` no longer uses the
`PipelineId` and the `WebViewId` of the initial `Pipeline` to initialize
itself. Instead a `ScriptEventLoopId` is used to uniquely identify every
`ScriptThread` in both the `ScriptThread` and the `Constellation`.
The remaining use was for crash reporting. Now when a crash happens, it
launches the sad tab in all `WebView`s that depeneded on that
`ScriptThread`.

This is a change which should allow simplifying the way that
`EventLoop`s/`ScriptThread`s are started in the `Constellation`, which
will be handled in a followup.

Testing: This shouldn't change behavior except in the case where a
`ScriptThread` is used in more than a single `WebView`, which should
work
properly now. I tested this change manually by running servoshell in
multiprocess mode while causing a panic to happen due to a null pointer
dereference. The sad tab appeared after this change, so things seem to
work
properly still. Testing crashes is tricky with the way we test servo
now.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-11-27 13:34:57 +00:00
..
2025-10-02 07:51:19 +00:00