script_traits: Rename ConstellationControlMsg to ScriptThreadMessage (#35226)

At some point in the past this message was only sent from the
`Constellation` to `script`, but nowadays this is sent from various
parts of servo to the `ScriptThread`, so this is a better name. In
particular, the current name makes it seeem like this message controls
the `Constellation`, which it does not.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2025-01-30 23:46:17 +01:00 committed by GitHub
parent 006ec58598
commit ad07db0b0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 183 additions and 200 deletions

View file

@ -286,10 +286,10 @@ pub enum UpdatePipelineIdReason {
Traversal,
}
/// Messages sent from the constellation or layout to the script thread.
// FIXME: https://github.com/servo/servo/issues/34591
/// Messages sent to the `ScriptThread` event loop from the `Constellation`, `Compositor`, and (for
/// now) `Layout`.
#[derive(Deserialize, Serialize)]
pub enum ConstellationControlMsg {
pub enum ScriptThreadMessage {
/// Takes the associated window proxy out of "delaying-load-events-mode",
/// used if a scheduled navigated was refused by the embedder.
/// <https://html.spec.whatwg.org/multipage/#delaying-load-events-mode>
@ -406,9 +406,9 @@ pub enum ConstellationControlMsg {
SetEpochPaintTime(PipelineId, Epoch, CrossProcessInstant),
}
impl fmt::Debug for ConstellationControlMsg {
impl fmt::Debug for ScriptThreadMessage {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
use self::ConstellationControlMsg::*;
use self::ScriptThreadMessage::*;
let variant = match *self {
StopDelayingLoadEventsMode(..) => "StopDelayingLoadsEventMode",
AttachLayout(..) => "AttachLayout",
@ -551,9 +551,9 @@ pub struct InitialScriptState {
/// Loading into a Secure Context
pub inherited_secure_context: Option<bool>,
/// A channel with which messages can be sent to us (the script thread).
pub constellation_sender: IpcSender<ConstellationControlMsg>,
pub constellation_sender: IpcSender<ScriptThreadMessage>,
/// A port on which messages sent by the constellation to script can be received.
pub constellation_receiver: IpcReceiver<ConstellationControlMsg>,
pub constellation_receiver: IpcReceiver<ScriptThreadMessage>,
/// A channel on which messages can be sent to the constellation from script.
pub pipeline_to_constellation_sender: ScriptToConstellationChan,
/// A handle to register script-(and associated layout-)threads for hang monitoring.