script/dom/workers/
abstractworker.rs1use script_bindings::reflector::DomObject;
6use servo_base::id::PipelineId;
7use servo_constellation_traits::StructuredSerializedData;
8use servo_url::ImmutableOrigin;
9
10use crate::dom::bindings::refcounted::Trusted;
11use crate::messaging::CommonScriptMsg;
12
13pub(crate) enum WorkerScriptMsg {
15 Common(CommonScriptMsg),
17 DOMMessage(MessageData),
19}
20
21#[derive(MallocSizeOf)]
22pub(crate) struct MessageData {
23 pub origin: ImmutableOrigin,
24 pub data: Box<StructuredSerializedData>,
25 pub pipeline_id: PipelineId,
26}
27
28pub(crate) struct SimpleWorkerErrorHandler<T: DomObject> {
29 pub(crate) addr: Trusted<T>,
30}
31
32impl<T: DomObject> SimpleWorkerErrorHandler<T> {
33 pub(crate) fn new(addr: Trusted<T>) -> SimpleWorkerErrorHandler<T> {
34 SimpleWorkerErrorHandler { addr }
35 }
36}