mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
Create a constellation_traits
crate (#36088)
This change creates a `constellation_traits` crate. Previously messages to the `Constellation` were in the `compositing_traits` crate, which came about organically. This change moves these to a new crate which also contains data types that are used in both compositing/libservo and script (ie types that cross the process boundary). The idea is similar to `embedding_traits`, but this is meant for types not exposed to the API. This change allows deduplicating `UntrustedNodeAddress`, which previously had two versions to avoid circular dependencies. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
02375809b0
commit
7c574141c0
52 changed files with 399 additions and 270 deletions
|
@ -26,6 +26,7 @@ base = { workspace = true }
|
|||
bluetooth_traits = { workspace = true, optional = true }
|
||||
canvas_traits = { workspace = true }
|
||||
compositing_traits = { workspace = true }
|
||||
constellation_traits = { workspace = true }
|
||||
crossbeam-channel = { workspace = true }
|
||||
devtools_traits = { workspace = true }
|
||||
embedder_traits = { workspace = true }
|
||||
|
|
|
@ -108,9 +108,10 @@ use bluetooth_traits::BluetoothRequest;
|
|||
use canvas_traits::ConstellationCanvasMsg;
|
||||
use canvas_traits::canvas::{CanvasId, CanvasMsg};
|
||||
use canvas_traits::webgl::WebGLThreads;
|
||||
use compositing_traits::{
|
||||
CompositorMsg, CompositorProxy, ConstellationMsg as FromCompositorMsg, PaintMetricEvent,
|
||||
SendableFrameTree,
|
||||
use compositing_traits::{CompositorMsg, CompositorProxy, SendableFrameTree};
|
||||
use constellation_traits::{
|
||||
AnimationTickType, CompositorHitTestResult, ConstellationMsg as FromCompositorMsg, LogEntry,
|
||||
PaintMetricEvent, ScrollState, TraversalDirection, WindowSizeData, WindowSizeType,
|
||||
};
|
||||
use crossbeam_channel::{Receiver, Sender, select, unbounded};
|
||||
use devtools_traits::{
|
||||
|
@ -121,7 +122,7 @@ use embedder_traits::resources::{self, Resource};
|
|||
use embedder_traits::{
|
||||
Cursor, EmbedderMsg, EmbedderProxy, ImeEvent, InputEvent, MediaSessionActionType,
|
||||
MediaSessionEvent, MediaSessionPlaybackState, MouseButton, MouseButtonAction, MouseButtonEvent,
|
||||
Theme, TraversalDirection, WebDriverCommandMsg, WebDriverLoadStatus,
|
||||
Theme, WebDriverCommandMsg, WebDriverLoadStatus,
|
||||
};
|
||||
use euclid::Size2D;
|
||||
use euclid::default::Size2D as UntypedSize2D;
|
||||
|
@ -139,14 +140,13 @@ use net_traits::{self, IpcSend, ReferrerPolicy, ResourceThreads};
|
|||
use profile_traits::{mem, time};
|
||||
use script_layout_interface::{LayoutFactory, ScriptThreadFactory};
|
||||
use script_traits::{
|
||||
AnimationState, AnimationTickType, AuxiliaryWebViewCreationRequest,
|
||||
AuxiliaryWebViewCreationResponse, BroadcastMsg, ConstellationInputEvent,
|
||||
DiscardBrowsingContext, DocumentActivity, DocumentState, IFrameLoadInfo,
|
||||
IFrameLoadInfoWithData, IFrameSandboxState, IFrameSizeMsg, Job, LoadData, LoadOrigin, LogEntry,
|
||||
MessagePortMsg, NavigationHistoryBehavior, PortMessageTask, ProgressiveWebMetricType,
|
||||
SWManagerMsg, SWManagerSenders, ScriptMsg as FromScriptMsg, ScriptThreadMessage,
|
||||
ScriptToConstellationChan, ServiceWorkerManagerFactory, ServiceWorkerMsg,
|
||||
StructuredSerializedData, UpdatePipelineIdReason, WindowSizeData, WindowSizeType,
|
||||
AnimationState, AuxiliaryWebViewCreationRequest, AuxiliaryWebViewCreationResponse,
|
||||
BroadcastMsg, ConstellationInputEvent, DiscardBrowsingContext, DocumentActivity, DocumentState,
|
||||
IFrameLoadInfo, IFrameLoadInfoWithData, IFrameSandboxState, IFrameSizeMsg, Job, LoadData,
|
||||
LoadOrigin, MessagePortMsg, NavigationHistoryBehavior, PortMessageTask,
|
||||
ProgressiveWebMetricType, SWManagerMsg, SWManagerSenders, ScriptMsg as FromScriptMsg,
|
||||
ScriptThreadMessage, ScriptToConstellationChan, ServiceWorkerManagerFactory, ServiceWorkerMsg,
|
||||
StructuredSerializedData, UpdatePipelineIdReason,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use servo_config::{opts, pref};
|
||||
|
@ -161,7 +161,7 @@ use webgpu::{self, WebGPU, WebGPURequest, WebGPUResponse};
|
|||
use webrender::RenderApi;
|
||||
use webrender::RenderApiSender;
|
||||
use webrender_api::{DocumentId, ImageKey};
|
||||
use webrender_traits::{CompositorHitTestResult, ScrollState, WebrenderExternalImageRegistry};
|
||||
use webrender_traits::WebrenderExternalImageRegistry;
|
||||
|
||||
use crate::browsingcontext::{
|
||||
AllBrowsingContextsIterator, BrowsingContext, FullyActiveBrowsingContextsIterator,
|
||||
|
|
|
@ -12,11 +12,11 @@ use std::thread;
|
|||
|
||||
use backtrace::Backtrace;
|
||||
use base::id::WebViewId;
|
||||
use compositing_traits::ConstellationMsg as FromCompositorMsg;
|
||||
use constellation_traits::{ConstellationMsg as FromCompositorMsg, LogEntry};
|
||||
use crossbeam_channel::Sender;
|
||||
use log::{Level, LevelFilter, Log, Metadata, Record};
|
||||
use parking_lot::ReentrantMutex;
|
||||
use script_traits::{LogEntry, ScriptMsg as FromScriptMsg, ScriptToConstellationChan};
|
||||
use script_traits::{ScriptMsg as FromScriptMsg, ScriptToConstellationChan};
|
||||
|
||||
/// A logger directed at the constellation from content processes
|
||||
/// #[derive(Clone)]
|
||||
|
|
|
@ -20,6 +20,7 @@ use base::id::{
|
|||
use bluetooth_traits::BluetoothRequest;
|
||||
use canvas_traits::webgl::WebGLPipeline;
|
||||
use compositing_traits::{CompositionPipeline, CompositorMsg, CompositorProxy};
|
||||
use constellation_traits::WindowSizeData;
|
||||
use crossbeam_channel::{Sender, unbounded};
|
||||
use devtools_traits::{DevtoolsControlMsg, ScriptToDevtoolsControlMsg};
|
||||
use fonts::{SystemFontServiceProxy, SystemFontServiceProxySender};
|
||||
|
@ -35,7 +36,7 @@ use profile_traits::{mem as profile_mem, time};
|
|||
use script_layout_interface::{LayoutFactory, ScriptThreadFactory};
|
||||
use script_traits::{
|
||||
AnimationState, DiscardBrowsingContext, DocumentActivity, InitialScriptState, LoadData,
|
||||
NewLayoutInfo, SWManagerMsg, ScriptThreadMessage, ScriptToConstellationChan, WindowSizeData,
|
||||
NewLayoutInfo, SWManagerMsg, ScriptThreadMessage, ScriptToConstellationChan,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use servo_config::opts::{self, Opts};
|
||||
|
|
|
@ -46,7 +46,7 @@ mod from_compositor {
|
|||
};
|
||||
}
|
||||
|
||||
impl LogTarget for compositing_traits::ConstellationMsg {
|
||||
impl LogTarget for constellation_traits::ConstellationMsg {
|
||||
fn log_target(&self) -> &'static str {
|
||||
match self {
|
||||
Self::Exit => target!("Exit"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue