constellation: Rename messages sent to the Constellation (#36341)

Messages that are sent to the `Constellation` have pretty ambiguous
names.
This change does two renames:

- `ConstellationMsg` → `EmbedderToConstellationMessage`
- `ScriptMsg` → `ScriptToConstellationMessage`

This naming reflects that the `Constellation` stands in between the
embedding layer and the script layer and can receive messages from both.
Soon both of these message types will live in `constellation_traits`,
reflecting the idea that the `_traits` variant for a crate is
responsible for exposing the API for that crate.

Testing: No new tests are necessary here as this just renames two enums.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2025-04-04 21:39:38 +02:00 committed by GitHub
parent c7a7862574
commit 5a35e1faec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 415 additions and 364 deletions

View file

@ -6,7 +6,7 @@ use std::collections::HashSet;
use std::time::{Duration, Instant};
use std::{cmp, thread};
use constellation_traits::ConstellationMsg;
use constellation_traits::EmbedderToConstellationMessage;
use embedder_traits::{MouseButtonAction, WebDriverCommandMsg, WebDriverScriptCommand};
use ipc_channel::ipc;
use keyboard_types::webdriver::KeyInputState;
@ -206,7 +206,7 @@ impl Handler {
let cmd_msg =
WebDriverCommandMsg::KeyboardAction(session.browsing_context_id, keyboard_event);
self.constellation_chan
.send(ConstellationMsg::WebDriverCommand(cmd_msg))
.send(EmbedderToConstellationMessage::WebDriverCommand(cmd_msg))
.unwrap();
}
@ -234,7 +234,7 @@ impl Handler {
let cmd_msg =
WebDriverCommandMsg::KeyboardAction(session.browsing_context_id, keyboard_event);
self.constellation_chan
.send(ConstellationMsg::WebDriverCommand(cmd_msg))
.send(EmbedderToConstellationMessage::WebDriverCommand(cmd_msg))
.unwrap();
}
}
@ -286,7 +286,7 @@ impl Handler {
pointer_input_state.y as f32,
);
self.constellation_chan
.send(ConstellationMsg::WebDriverCommand(cmd_msg))
.send(EmbedderToConstellationMessage::WebDriverCommand(cmd_msg))
.unwrap();
}
@ -333,7 +333,7 @@ impl Handler {
pointer_input_state.y as f32,
);
self.constellation_chan
.send(ConstellationMsg::WebDriverCommand(cmd_msg))
.send(EmbedderToConstellationMessage::WebDriverCommand(cmd_msg))
.unwrap();
}
@ -388,7 +388,7 @@ impl Handler {
let cmd_msg =
WebDriverCommandMsg::GetWindowSize(self.session.as_ref().unwrap().webview_id, sender);
self.constellation_chan
.send(ConstellationMsg::WebDriverCommand(cmd_msg))
.send(EmbedderToConstellationMessage::WebDriverCommand(cmd_msg))
.unwrap();
// Steps 7 - 8
@ -468,7 +468,7 @@ impl Handler {
let cmd_msg =
WebDriverCommandMsg::MouseMoveAction(session.webview_id, x as f32, y as f32);
self.constellation_chan
.send(ConstellationMsg::WebDriverCommand(cmd_msg))
.send(EmbedderToConstellationMessage::WebDriverCommand(cmd_msg))
.unwrap();
// Step 7.3
pointer_input_state.x = x;