mirror of
https://github.com/servo/servo
synced 2026-05-14 10:56:44 +02:00
Currently starting a script `EventLoop` depends on sending data about
the initial `Pipeline`. This change breaks this dependency. The goal
here is to:
1. Allow `ScriptThread`s to be shared between `WebView`s. This will
allow more flexiblity with the way that `ScriptThread`s are created,
which should allow us to perserve system resources by allowing them
to be shared between `WebView`s. With this change, we can do away
with the `InitialPipelineState` entirely, which was gather
information necessary for both a new `EventLoop` and a new
`Pipeline`. We no longer have to do many clones when reusing an
existing even loop.
1. Simplify the way that `EventLoop`s and `Pipeline`s are spawned. Now
`Pipeline`s are spawned in the same way no matter what.
Now the general order of operations when starting a pipeline is:
1. Get or create an event loop for the pipeline:
- If the event loop needs to be spawn, spawned it in a new thread or
process.
2. Send the spawn pipeline message to the event loop (kept alive via an
`Rc`.
Testing: This should not change behavior in a way that is observable, so
should
be covered by existing tests.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
155 KiB
155 KiB