mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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:
parent
c7a7862574
commit
5a35e1faec
37 changed files with 415 additions and 364 deletions
|
@ -20,7 +20,7 @@ use compositing_traits::{
|
|||
CompositionPipeline, CompositorMsg, CompositorReceiver, SendableFrameTree,
|
||||
};
|
||||
use constellation_traits::{
|
||||
AnimationTickType, CompositorHitTestResult, ConstellationMsg, PaintMetricEvent,
|
||||
AnimationTickType, CompositorHitTestResult, EmbedderToConstellationMessage, PaintMetricEvent,
|
||||
UntrustedNodeAddress, WindowSizeType,
|
||||
};
|
||||
use crossbeam_channel::Sender;
|
||||
|
@ -101,7 +101,7 @@ pub struct ServoRenderer {
|
|||
compositor_receiver: CompositorReceiver,
|
||||
|
||||
/// The channel on which messages can be sent to the constellation.
|
||||
pub(crate) constellation_sender: Sender<ConstellationMsg>,
|
||||
pub(crate) constellation_sender: Sender<EmbedderToConstellationMessage>,
|
||||
|
||||
/// The channel on which messages can be sent to the time profiler.
|
||||
time_profiler_chan: profile_time::ProfilerChan,
|
||||
|
@ -279,7 +279,7 @@ impl PipelineDetails {
|
|||
tick_type.insert(AnimationTickType::REQUEST_ANIMATION_FRAME);
|
||||
}
|
||||
|
||||
let msg = ConstellationMsg::TickAnimation(self.id, tick_type);
|
||||
let msg = EmbedderToConstellationMessage::TickAnimation(self.id, tick_type);
|
||||
if let Err(e) = compositor.global.borrow().constellation_sender.send(msg) {
|
||||
warn!("Sending tick to constellation failed ({:?}).", e);
|
||||
}
|
||||
|
@ -415,7 +415,9 @@ impl ServoRenderer {
|
|||
self.cursor = cursor;
|
||||
if let Err(e) = self
|
||||
.constellation_sender
|
||||
.send(ConstellationMsg::SetCursor(webview_id, cursor))
|
||||
.send(EmbedderToConstellationMessage::SetCursor(
|
||||
webview_id, cursor,
|
||||
))
|
||||
{
|
||||
warn!("Sending event to constellation failed ({:?}).", e);
|
||||
}
|
||||
|
@ -1261,7 +1263,7 @@ impl IOCompositor {
|
|||
// to device pixels, but not including any pinch zoom.
|
||||
let hidpi_scale_factor = self.device_pixels_per_page_pixel_not_including_page_zoom();
|
||||
let size = rect.size().to_f32() / hidpi_scale_factor;
|
||||
let msg = ConstellationMsg::ChangeViewportDetails(
|
||||
let msg = EmbedderToConstellationMessage::ChangeViewportDetails(
|
||||
webview_id,
|
||||
ViewportDetails {
|
||||
size,
|
||||
|
@ -1420,7 +1422,7 @@ impl IOCompositor {
|
|||
|
||||
// Pass the pipeline/epoch states to the constellation and check
|
||||
// if it's safe to output the image.
|
||||
let msg = ConstellationMsg::IsReadyToSaveImage(pipeline_epochs);
|
||||
let msg = EmbedderToConstellationMessage::IsReadyToSaveImage(pipeline_epochs);
|
||||
if let Err(e) = self.global.borrow().constellation_sender.send(msg) {
|
||||
warn!("Sending ready to save to constellation failed ({:?}).", e);
|
||||
}
|
||||
|
@ -1585,7 +1587,7 @@ impl IOCompositor {
|
|||
PaintMetricState::Seen(epoch, first_reflow) if epoch <= current_epoch => {
|
||||
assert!(epoch <= current_epoch);
|
||||
if let Err(error) = self.global.borrow().constellation_sender.send(
|
||||
ConstellationMsg::PaintMetric(
|
||||
EmbedderToConstellationMessage::PaintMetric(
|
||||
*pipeline_id,
|
||||
PaintMetricEvent::FirstPaint(paint_time, first_reflow),
|
||||
),
|
||||
|
@ -1602,7 +1604,7 @@ impl IOCompositor {
|
|||
match pipeline.first_contentful_paint_metric {
|
||||
PaintMetricState::Seen(epoch, first_reflow) if epoch <= current_epoch => {
|
||||
if let Err(error) = self.global.borrow().constellation_sender.send(
|
||||
ConstellationMsg::PaintMetric(
|
||||
EmbedderToConstellationMessage::PaintMetric(
|
||||
*pipeline_id,
|
||||
PaintMetricEvent::FirstContentfulPaint(paint_time, first_reflow),
|
||||
),
|
||||
|
|
|
@ -8,7 +8,7 @@ use std::cell::Cell;
|
|||
use std::rc::Rc;
|
||||
|
||||
use compositing_traits::{CompositorProxy, CompositorReceiver};
|
||||
use constellation_traits::ConstellationMsg;
|
||||
use constellation_traits::EmbedderToConstellationMessage;
|
||||
use crossbeam_channel::Sender;
|
||||
use embedder_traits::ShutdownState;
|
||||
use profile_traits::{mem, time};
|
||||
|
@ -34,7 +34,7 @@ pub struct InitialCompositorState {
|
|||
/// A port on which messages inbound to the compositor can be received.
|
||||
pub receiver: CompositorReceiver,
|
||||
/// A channel to the constellation.
|
||||
pub constellation_chan: Sender<ConstellationMsg>,
|
||||
pub constellation_chan: Sender<EmbedderToConstellationMessage>,
|
||||
/// A channel to the time profiler thread.
|
||||
pub time_profiler_chan: time::ProfilerChan,
|
||||
/// A channel to the memory profiler thread.
|
||||
|
|
|
@ -9,7 +9,7 @@ use std::rc::Rc;
|
|||
|
||||
use base::id::{PipelineId, WebViewId};
|
||||
use compositing_traits::SendableFrameTree;
|
||||
use constellation_traits::{CompositorHitTestResult, ConstellationMsg, ScrollState};
|
||||
use constellation_traits::{CompositorHitTestResult, EmbedderToConstellationMessage, ScrollState};
|
||||
use embedder_traits::{
|
||||
InputEvent, MouseButton, MouseButtonAction, MouseButtonEvent, MouseMoveEvent, ShutdownState,
|
||||
TouchEvent, TouchEventType, TouchId,
|
||||
|
@ -168,14 +168,9 @@ impl WebView {
|
|||
}
|
||||
});
|
||||
|
||||
let _ = self
|
||||
.global
|
||||
.borrow()
|
||||
.constellation_sender
|
||||
.send(ConstellationMsg::SetScrollStates(
|
||||
pipeline_id,
|
||||
scroll_states,
|
||||
));
|
||||
let _ = self.global.borrow().constellation_sender.send(
|
||||
EmbedderToConstellationMessage::SetScrollStates(pipeline_id, scroll_states),
|
||||
);
|
||||
}
|
||||
|
||||
pub(crate) fn set_frame_tree_on_pipeline_details(
|
||||
|
@ -295,16 +290,9 @@ impl WebView {
|
|||
|
||||
self.global.borrow_mut().update_cursor(point, &result);
|
||||
|
||||
if let Err(error) =
|
||||
self.global
|
||||
.borrow()
|
||||
.constellation_sender
|
||||
.send(ConstellationMsg::ForwardInputEvent(
|
||||
self.id,
|
||||
event,
|
||||
Some(result),
|
||||
))
|
||||
{
|
||||
if let Err(error) = self.global.borrow().constellation_sender.send(
|
||||
EmbedderToConstellationMessage::ForwardInputEvent(self.id, event, Some(result)),
|
||||
) {
|
||||
warn!("Sending event to constellation failed ({error:?}).");
|
||||
}
|
||||
}
|
||||
|
@ -364,16 +352,9 @@ impl WebView {
|
|||
|
||||
event.init_sequence_id(self.touch_handler.current_sequence_id);
|
||||
let event = InputEvent::Touch(event);
|
||||
if let Err(e) =
|
||||
self.global
|
||||
.borrow()
|
||||
.constellation_sender
|
||||
.send(ConstellationMsg::ForwardInputEvent(
|
||||
self.id,
|
||||
event,
|
||||
Some(result),
|
||||
))
|
||||
{
|
||||
if let Err(e) = self.global.borrow().constellation_sender.send(
|
||||
EmbedderToConstellationMessage::ForwardInputEvent(self.id, event, Some(result)),
|
||||
) {
|
||||
warn!("Sending event to constellation failed ({:?}).", e);
|
||||
false
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue