diff options
author | Martin Robinson <mrobinson@igalia.com> | 2025-04-04 21:39:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-04 19:39:38 +0000 |
commit | 5a35e1faec941b02291b33d10cd2f516e0464f01 (patch) | |
tree | e055335fd519e867079e3e6cfe9e2a620b182060 /components/servo/lib.rs | |
parent | c7a7862574b4fca62bed35d958f0f363f0b6ab3f (diff) | |
download | servo-5a35e1faec941b02291b33d10cd2f516e0464f01.tar.gz servo-5a35e1faec941b02291b33d10cd2f516e0464f01.zip |
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>
Diffstat (limited to 'components/servo/lib.rs')
-rw-r--r-- | components/servo/lib.rs | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 3bd0e1443a8..ef4d8b446fd 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -55,10 +55,10 @@ use compositing_traits::{CompositorMsg, CompositorProxy, CompositorReceiver}; ))] use constellation::content_process_sandbox_profile; use constellation::{ - Constellation, FromCompositorLogger, FromScriptLogger, InitialConstellationState, + Constellation, FromEmbedderLogger, FromScriptLogger, InitialConstellationState, UnprivilegedContent, }; -use constellation_traits::ConstellationMsg; +use constellation_traits::EmbedderToConstellationMessage; use crossbeam_channel::{Receiver, Sender, unbounded}; use embedder_traits::user_content_manager::UserContentManager; pub use embedder_traits::*; @@ -128,12 +128,12 @@ pub use crate::webview_delegate::{ }; #[cfg(feature = "webdriver")] -fn webdriver(port: u16, constellation: Sender<ConstellationMsg>) { +fn webdriver(port: u16, constellation: Sender<EmbedderToConstellationMessage>) { webdriver_server::start_server(port, constellation); } #[cfg(not(feature = "webdriver"))] -fn webdriver(_port: u16, _constellation: Sender<ConstellationMsg>) {} +fn webdriver(_port: u16, _constellation: Sender<EmbedderToConstellationMessage>) {} #[cfg(feature = "media-gstreamer")] mod media_platform { @@ -606,7 +606,7 @@ impl Servo { let constellation_chan = self.constellation_proxy.sender(); let env = env_logger::Env::default(); let env_logger = EnvLoggerBuilder::from_env(env).build(); - let con_logger = FromCompositorLogger::new(constellation_chan); + let con_logger = FromEmbedderLogger::new(constellation_chan); let filter = max(env_logger.filter(), con_logger.filter()); let logger = BothLogger(env_logger, con_logger); @@ -622,7 +622,8 @@ impl Servo { } debug!("Sending Exit message to Constellation"); - self.constellation_proxy.send(ConstellationMsg::Exit); + self.constellation_proxy + .send(EmbedderToConstellationMessage::Exit); self.shutdown_state.set(ShutdownState::ShuttingDown); } @@ -642,11 +643,12 @@ impl Servo { .borrow_mut() .insert(webview.id(), webview.weak_handle()); let viewport_details = self.compositor.borrow().default_webview_viewport_details(); - self.constellation_proxy.send(ConstellationMsg::NewWebView( - url.into(), - webview.id(), - viewport_details, - )); + self.constellation_proxy + .send(EmbedderToConstellationMessage::NewWebView( + url.into(), + webview.id(), + viewport_details, + )); webview } @@ -1048,7 +1050,7 @@ fn create_constellation( #[cfg(feature = "webgpu")] wgpu_image_map: WGPUImageMap, protocols: ProtocolRegistry, user_content_manager: UserContentManager, -) -> Sender<ConstellationMsg> { +) -> Sender<EmbedderToConstellationMessage> { // Global configuration options, parsed from the command line. let opts = opts::get(); |