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

@ -14,7 +14,7 @@ use ipc_channel::ipc::IpcSender;
use log::warn;
use malloc_size_of_derive::MallocSizeOf;
use profile_traits::time::{send_profile_data, ProfilerCategory, ProfilerChan, TimerMetadata};
use script_traits::{ConstellationControlMsg, LayoutMsg, ProgressiveWebMetricType};
use script_traits::{LayoutMsg, ProgressiveWebMetricType, ScriptThreadMessage};
use servo_config::opts;
use servo_url::ServoUrl;
@ -258,7 +258,7 @@ pub struct PaintTimeMetrics {
pipeline_id: PipelineId,
time_profiler_chan: ProfilerChan,
constellation_chan: IpcSender<LayoutMsg>,
script_chan: IpcSender<ConstellationControlMsg>,
script_chan: IpcSender<ScriptThreadMessage>,
url: ServoUrl,
}
@ -267,7 +267,7 @@ impl PaintTimeMetrics {
pipeline_id: PipelineId,
time_profiler_chan: ProfilerChan,
constellation_chan: IpcSender<LayoutMsg>,
script_chan: IpcSender<ConstellationControlMsg>,
script_chan: IpcSender<ScriptThreadMessage>,
url: ServoUrl,
navigation_start: CrossProcessInstant,
) -> PaintTimeMetrics {
@ -369,7 +369,7 @@ impl ProgressiveWebMetric for PaintTimeMetrics {
name: ProgressiveWebMetricType,
time: CrossProcessInstant,
) {
let msg = ConstellationControlMsg::PaintMetric(self.pipeline_id, name, time);
let msg = ScriptThreadMessage::PaintMetric(self.pipeline_id, name, time);
if let Err(e) = self.script_chan.send(msg) {
warn!("Sending metric to script thread failed ({}).", e);
}