servo/components/shared/script
Martin Robinson 5f927a2c28
script: Refactor channels in ScriptThread into receivers and senders (#34776)
Create two new data structures in the `script` crate to hold senders and
receiver:

- `ScriptThreadSenders`: holds all outgoing channels from the
  `ScriptThread` including a channel to the `ScriptThread` itself. The
  ultimate goal with this is to reduce duplication by giving a boxed
  version of this this to `Window`s.
- `ScriptThradReceivers`: holds all incoming channels to the
  `ScriptThread`. This isn't cloenable like the senders. This is used to
  abstract away `recv()` and `try_recv()` methods used to make the
  `ScriptThread` event loop easier to read.

In addition:

- The many duplicated `ScriptThread` self-senders for the `TaskManager`
  have been removed and, in general, a lot of boilerplate is removed as
  well.
- Visibilty of all methods affected by this change is changed to
  `pub(crate)` in order to take advantage of dead code detection. Some
  dead code produced from macros is removed.
- Some conversion code is refactord into implementations of the `From`
  trait.
- The names of channels uses a standard "sender" and "receiver" naming
  as well as trying to be descriptive of where they go in `ScriptThread`
  as well as `InitialScriptState`

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-12-26 03:34:54 +00:00
..
tests compositor: Move WebRender-ish messages and types to webrender_traits (#32315) 2024-05-20 10:35:18 +00:00
Cargo.toml Add webgpu feature flag (#34444) 2024-12-05 16:07:27 +00:00
lib.rs script: Refactor channels in ScriptThread into receivers and senders (#34776) 2024-12-26 03:34:54 +00:00
script_msg.rs Replace HistoryEntryReplacement with NavigationHistoryBehavior from the navigation API (#34681) 2024-12-18 12:47:20 +00:00
serializable.rs Move non-gfx things out of gfx_traits and create a base crate (#32296) 2024-05-17 12:28:58 +00:00
transferable.rs Move non-gfx things out of gfx_traits and create a base crate (#32296) 2024-05-17 12:28:58 +00:00
webdriver_msg.rs Allow running testharness/testdriver/reftests in servodriver (#34550) 2024-12-11 19:18:44 +00:00