#[repr(C)]pub struct DedicatedWorkerGlobalScope {
workerglobalscope: WorkerGlobalScope,
task_queue: TaskQueue<DedicatedWorkerScriptMsg>,
own_sender: Sender<DedicatedWorkerScriptMsg>,
worker: DomRefCell<Option<Trusted<Worker>>>,
parent_sender: Box<dyn ScriptChan + Send>,
image_cache: Arc<dyn ImageCache>,
browsing_context: Option<BrowsingContextId>,
control_receiver: Receiver<DedicatedWorkerControlMsg>,
}
Fields§
§workerglobalscope: WorkerGlobalScope
§task_queue: TaskQueue<DedicatedWorkerScriptMsg>
§own_sender: Sender<DedicatedWorkerScriptMsg>
§worker: DomRefCell<Option<Trusted<Worker>>>
§parent_sender: Box<dyn ScriptChan + Send>
Sender to the parent thread.
image_cache: Arc<dyn ImageCache>
§browsing_context: Option<BrowsingContextId>
§control_receiver: Receiver<DedicatedWorkerControlMsg>
A receiver of control messages, currently only used to signal shutdown.
Implementations§
source§impl DedicatedWorkerGlobalScope
impl DedicatedWorkerGlobalScope
fn __assert_parent_type(&self)
source§impl DedicatedWorkerGlobalScope
impl DedicatedWorkerGlobalScope
fn new_inherited( init: WorkerGlobalScopeInit, worker_name: DOMString, worker_type: WorkerType, worker_url: ServoUrl, from_devtools_receiver: Receiver<DevtoolScriptControlMsg>, runtime: Runtime, parent_sender: Box<dyn ScriptChan + Send>, own_sender: Sender<DedicatedWorkerScriptMsg>, receiver: Receiver<DedicatedWorkerScriptMsg>, closing: Arc<AtomicBool>, image_cache: Arc<dyn ImageCache>, browsing_context: Option<BrowsingContextId>, gpu_id_hub: Arc<IdentityHub>, control_receiver: Receiver<DedicatedWorkerControlMsg>, ) -> DedicatedWorkerGlobalScope
pub fn new( init: WorkerGlobalScopeInit, worker_name: DOMString, worker_type: WorkerType, worker_url: ServoUrl, from_devtools_receiver: Receiver<DevtoolScriptControlMsg>, runtime: Runtime, parent_sender: Box<dyn ScriptChan + Send>, own_sender: Sender<DedicatedWorkerScriptMsg>, receiver: Receiver<DedicatedWorkerScriptMsg>, closing: Arc<AtomicBool>, image_cache: Arc<dyn ImageCache>, browsing_context: Option<BrowsingContextId>, gpu_id_hub: Arc<IdentityHub>, control_receiver: Receiver<DedicatedWorkerControlMsg>, ) -> Root<Dom<DedicatedWorkerGlobalScope>>
sourcepub fn run_worker_scope(
init: WorkerGlobalScopeInit,
worker_url: ServoUrl,
from_devtools_receiver: IpcReceiver<DevtoolScriptControlMsg>,
worker: Trusted<Worker>,
parent_sender: Box<dyn ScriptChan + Send>,
own_sender: Sender<DedicatedWorkerScriptMsg>,
receiver: Receiver<DedicatedWorkerScriptMsg>,
worker_load_origin: WorkerScriptLoadOrigin,
worker_name: String,
worker_type: WorkerType,
closing: Arc<AtomicBool>,
image_cache: Arc<dyn ImageCache>,
browsing_context: Option<BrowsingContextId>,
gpu_id_hub: Arc<IdentityHub>,
control_receiver: Receiver<DedicatedWorkerControlMsg>,
context_sender: Sender<ThreadSafeJSContext>,
) -> JoinHandle<()>
pub fn run_worker_scope( init: WorkerGlobalScopeInit, worker_url: ServoUrl, from_devtools_receiver: IpcReceiver<DevtoolScriptControlMsg>, worker: Trusted<Worker>, parent_sender: Box<dyn ScriptChan + Send>, own_sender: Sender<DedicatedWorkerScriptMsg>, receiver: Receiver<DedicatedWorkerScriptMsg>, worker_load_origin: WorkerScriptLoadOrigin, worker_name: String, worker_type: WorkerType, closing: Arc<AtomicBool>, image_cache: Arc<dyn ImageCache>, browsing_context: Option<BrowsingContextId>, gpu_id_hub: Arc<IdentityHub>, control_receiver: Receiver<DedicatedWorkerControlMsg>, context_sender: Sender<ThreadSafeJSContext>, ) -> JoinHandle<()>
pub fn image_cache(&self) -> Arc<dyn ImageCache>
pub fn script_chan(&self) -> Box<dyn ScriptChan + Send>
pub fn new_script_pair( &self, ) -> (Box<dyn ScriptChan + Send>, Box<dyn ScriptPort + Send>)
fn handle_script_event(&self, msg: WorkerScriptMsg, can_gc: CanGc)
fn handle_mixed_message(&self, msg: MixedMessage, can_gc: CanGc) -> bool
pub fn forward_error_to_worker_object(&self, error_info: ErrorInfo)
fn post_message_impl( &self, cx: SafeJSContext, message: HandleValue<'_>, transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>, ) -> Result<(), Error>
pub(crate) fn browsing_context(&self) -> Option<BrowsingContextId>
Trait Implementations§
source§impl Castable for DedicatedWorkerGlobalScope
impl Castable for DedicatedWorkerGlobalScope
source§impl DedicatedWorkerGlobalScopeMethods for DedicatedWorkerGlobalScope
impl DedicatedWorkerGlobalScopeMethods for DedicatedWorkerGlobalScope
source§fn PostMessage(
&self,
cx: SafeJSContext,
message: HandleValue<'_>,
transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>,
) -> Result<(), Error>
fn PostMessage( &self, cx: SafeJSContext, message: HandleValue<'_>, transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>, ) -> Result<(), Error>
source§fn PostMessage_(
&self,
cx: SafeJSContext,
message: HandleValue<'_>,
options: RootedTraceableBox<StructuredSerializeOptions>,
) -> Result<(), Error>
fn PostMessage_( &self, cx: SafeJSContext, message: HandleValue<'_>, options: RootedTraceableBox<StructuredSerializeOptions>, ) -> Result<(), Error>
fn Close(&self)
fn GetOnmessage(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnmessage(&self, listener: Option<Rc<EventHandlerNonNull>>)
source§impl HasParent for DedicatedWorkerGlobalScope
impl HasParent for DedicatedWorkerGlobalScope
source§fn as_parent(&self) -> &WorkerGlobalScope
fn as_parent(&self) -> &WorkerGlobalScope
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = WorkerGlobalScope
source§impl MallocSizeOf for DedicatedWorkerGlobalScope
impl MallocSizeOf for DedicatedWorkerGlobalScope
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl PartialEq for DedicatedWorkerGlobalScope
impl PartialEq for DedicatedWorkerGlobalScope
source§impl WorkerEventLoopMethods for DedicatedWorkerGlobalScope
impl WorkerEventLoopMethods for DedicatedWorkerGlobalScope
type WorkerMsg = DedicatedWorkerScriptMsg
type ControlMsg = DedicatedWorkerControlMsg
type Event = MixedMessage
fn task_queue(&self) -> &TaskQueue<DedicatedWorkerScriptMsg>
fn handle_event(&self, event: MixedMessage, can_gc: CanGc) -> bool
fn handle_worker_post_event( &self, worker: &Trusted<Worker>, ) -> Option<AutoWorkerReset<'_>>
fn from_control_msg(msg: DedicatedWorkerControlMsg) -> MixedMessage
fn from_worker_msg(msg: DedicatedWorkerScriptMsg) -> MixedMessage
fn from_devtools_msg(msg: DevtoolScriptControlMsg) -> MixedMessage
fn control_receiver(&self) -> &Receiver<DedicatedWorkerControlMsg>
impl DerivedFrom<EventTarget> for DedicatedWorkerGlobalScope
impl DerivedFrom<GlobalScope> for DedicatedWorkerGlobalScope
impl DerivedFrom<WorkerGlobalScope> for DedicatedWorkerGlobalScope
impl Eq for DedicatedWorkerGlobalScope
Auto Trait Implementations§
impl !Freeze for DedicatedWorkerGlobalScope
impl !RefUnwindSafe for DedicatedWorkerGlobalScope
impl !Send for DedicatedWorkerGlobalScope
impl !Sync for DedicatedWorkerGlobalScope
impl Unpin for DedicatedWorkerGlobalScope
impl !UnwindSafe for DedicatedWorkerGlobalScope
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert