#[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<Mutex<Identities>>, 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<Mutex<Identities>>, 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<Mutex<Identities>>,
control_receiver: Receiver<DedicatedWorkerControlMsg>,
context_sender: Sender<ContextForRequestInterrupt>
) -> 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<Mutex<Identities>>, control_receiver: Receiver<DedicatedWorkerControlMsg>, context_sender: Sender<ContextForRequestInterrupt> ) -> 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)
fn handle_mixed_message(&self, msg: MixedMessage) -> 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<PostMessageOptions>
) -> Result<(), Error>
fn PostMessage_( &self, cx: SafeJSContext, message: HandleValue<'_>, options: RootedTraceableBox<PostMessageOptions> ) -> 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 MutDomObject for DedicatedWorkerGlobalScope
impl MutDomObject for DedicatedWorkerGlobalScope
source§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
Initializes the Reflector
source§impl PartialEq<DedicatedWorkerGlobalScope> for DedicatedWorkerGlobalScope
impl PartialEq<DedicatedWorkerGlobalScope> for DedicatedWorkerGlobalScope
source§fn eq(&self, other: &DedicatedWorkerGlobalScope) -> bool
fn eq(&self, other: &DedicatedWorkerGlobalScope) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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) -> bool
fn handle_worker_post_event( &self, worker: &Trusted<Worker> ) -> Option<AutoWorkerReset<'_>>
fn from_control_msg(&self, msg: DedicatedWorkerControlMsg) -> MixedMessage
fn from_worker_msg(&self, msg: DedicatedWorkerScriptMsg) -> MixedMessage
fn from_devtools_msg(&self, msg: DevtoolScriptControlMsg) -> MixedMessage
fn control_receiver(&self) -> &Receiver<DedicatedWorkerControlMsg>
impl DerivedFrom<EventTarget> for DedicatedWorkerGlobalScope
impl DerivedFrom<GlobalScope> for DedicatedWorkerGlobalScope
impl DerivedFrom<WorkerGlobalScope> for DedicatedWorkerGlobalScope
Auto Trait Implementations§
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<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>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,
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, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
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