Struct script::dom::workerglobalscope::WorkerGlobalScope
source · #[repr(C)]pub struct WorkerGlobalScope {Show 14 fields
globalscope: GlobalScope,
worker_name: DOMString,
worker_type: WorkerType,
worker_id: WorkerId,
worker_url: DomRefCell<ServoUrl>,
closing: Arc<AtomicBool>,
runtime: DomRefCell<Option<Runtime>>,
location: MutNullableDom<WorkerLocation>,
navigator: MutNullableDom<WorkerNavigator>,
policy_container: DomRefCell<PolicyContainer>,
_devtools_sender: Option<IpcSender<DevtoolScriptControlMsg>>,
devtools_receiver: Option<Receiver<DevtoolScriptControlMsg>>,
navigation_start: CrossProcessInstant,
performance: MutNullableDom<Performance>,
}
Fields§
§globalscope: GlobalScope
§worker_name: DOMString
§worker_type: WorkerType
§worker_id: WorkerId
§worker_url: DomRefCell<ServoUrl>
§closing: Arc<AtomicBool>
§runtime: DomRefCell<Option<Runtime>>
§location: MutNullableDom<WorkerLocation>
§policy_container: DomRefCell<PolicyContainer>
§_devtools_sender: Option<IpcSender<DevtoolScriptControlMsg>>
A Sender
for sending messages to devtools. This is unused but is stored here to
keep the channel alive.
devtools_receiver: Option<Receiver<DevtoolScriptControlMsg>>
A Receiver
for receiving messages from devtools.
performance: MutNullableDom<Performance>
Implementations§
source§impl WorkerGlobalScope
impl WorkerGlobalScope
pub fn new_inherited( init: WorkerGlobalScopeInit, worker_name: DOMString, worker_type: WorkerType, worker_url: ServoUrl, runtime: Runtime, devtools_receiver: Receiver<DevtoolScriptControlMsg>, closing: Arc<AtomicBool>, gpu_id_hub: Arc<IdentityHub>, ) -> Self
sourcepub fn clear_js_runtime(&self)
pub fn clear_js_runtime(&self)
Clear various items when the worker event-loop shuts-down.
pub fn runtime_handle(&self) -> ParentRuntime
pub fn devtools_receiver(&self) -> Option<&Receiver<DevtoolScriptControlMsg>>
pub fn get_cx(&self) -> JSContext
pub fn is_closing(&self) -> bool
pub fn get_url(&self) -> Ref<'_, ServoUrl>
pub fn set_url(&self, url: ServoUrl)
pub fn get_worker_id(&self) -> WorkerId
pub fn task_canceller(&self) -> TaskCanceller
pub fn pipeline_id(&self) -> PipelineId
pub fn policy_container(&self) -> Ref<'_, PolicyContainer>
source§impl WorkerGlobalScope
impl WorkerGlobalScope
pub fn execute_script(&self, source: DOMString, can_gc: CanGc)
pub fn script_chan(&self) -> Box<dyn ScriptChan + Send>
pub fn dom_manipulation_task_source(&self) -> DOMManipulationTaskSource
pub fn file_reading_task_source(&self) -> FileReadingTaskSource
pub fn networking_task_source(&self) -> NetworkingTaskSource
pub fn performance_timeline_task_source(&self) -> PerformanceTimelineTaskSource
pub fn port_message_queue(&self) -> PortMessageQueue
pub fn timer_task_source(&self) -> TimerTaskSource
pub fn remote_event_task_source(&self) -> RemoteEventTaskSource
pub fn websocket_task_source(&self) -> WebsocketTaskSource
pub fn new_script_pair( &self, ) -> (Box<dyn ScriptChan + Send>, Box<dyn ScriptPort + Send>)
sourcepub fn process_event(&self, msg: CommonScriptMsg) -> bool
pub fn process_event(&self, msg: CommonScriptMsg) -> bool
Process a single event as if it were the next event in the queue for this worker event-loop. Returns a boolean indicating whether further events should be processed.
pub fn close(&self)
Trait Implementations§
source§impl Castable for WorkerGlobalScope
impl Castable for WorkerGlobalScope
source§impl DomObject for WorkerGlobalScope
impl DomObject for WorkerGlobalScope
source§impl HasParent for WorkerGlobalScope
impl HasParent for WorkerGlobalScope
source§fn as_parent(&self) -> &GlobalScope
fn as_parent(&self) -> &GlobalScope
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = GlobalScope
source§impl IDLInterface for WorkerGlobalScope
impl IDLInterface for WorkerGlobalScope
source§impl MallocSizeOf for WorkerGlobalScope
impl MallocSizeOf for WorkerGlobalScope
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 WorkerGlobalScope
impl MutDomObject for WorkerGlobalScope
source§impl PartialEq for WorkerGlobalScope
impl PartialEq for WorkerGlobalScope
source§impl Traceable for WorkerGlobalScope
impl Traceable for WorkerGlobalScope
source§impl WorkerGlobalScopeMethods for WorkerGlobalScope
impl WorkerGlobalScopeMethods for WorkerGlobalScope
source§fn StructuredClone(
&self,
cx: JSContext,
value: HandleValue<'_>,
options: RootedTraceableBox<StructuredSerializeOptions>,
retval: MutableHandleValue<'_>,
) -> Result<(), Error>
fn StructuredClone( &self, cx: JSContext, value: HandleValue<'_>, options: RootedTraceableBox<StructuredSerializeOptions>, retval: MutableHandleValue<'_>, ) -> Result<(), Error>
fn Self_(&self) -> Root<Dom<WorkerGlobalScope>>
fn Location(&self) -> Root<Dom<WorkerLocation>>
fn GetOnerror(&self) -> Option<Rc<OnErrorEventHandlerNonNull>>
fn SetOnerror(&self, listener: Option<Rc<OnErrorEventHandlerNonNull>>)
fn ImportScripts( &self, url_strings: Vec<DOMString>, can_gc: CanGc, ) -> Result<(), Error>
fn Crypto(&self) -> Root<Dom<Crypto>>
fn Btoa(&self, btoa: DOMString) -> Result<DOMString, Error>
fn Atob(&self, atob: DOMString) -> Result<DOMString, Error>
fn SetTimeout( &self, _cx: JSContext, callback: StringOrFunction, timeout: i32, args: Vec<HandleValue<'_>>, ) -> i32
fn ClearTimeout(&self, handle: i32)
fn SetInterval( &self, _cx: JSContext, callback: StringOrFunction, timeout: i32, args: Vec<HandleValue<'_>>, ) -> i32
fn ClearInterval(&self, handle: i32)
fn QueueMicrotask(&self, callback: Rc<VoidFunction>)
fn CreateImageBitmap( &self, image: ImageBitmapSource, options: &ImageBitmapOptions, can_gc: CanGc, ) -> Rc<Promise>
fn Fetch( &self, input: RequestOrUSVString, init: RootedTraceableBox<RequestInit>, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
fn Performance(&self) -> Root<Dom<Performance>>
fn Origin(&self) -> USVString
fn IsSecureContext(&self) -> bool
impl DerivedFrom<EventTarget> for WorkerGlobalScope
impl DerivedFrom<GlobalScope> for WorkerGlobalScope
impl DerivedFrom<WorkerGlobalScope> for DedicatedWorkerGlobalScope
impl DerivedFrom<WorkerGlobalScope> for ServiceWorkerGlobalScope
impl DerivedFrom<WorkerGlobalScope> for WorkerGlobalScope
impl Eq for WorkerGlobalScope
Auto Trait Implementations§
impl !Freeze for WorkerGlobalScope
impl !RefUnwindSafe for WorkerGlobalScope
impl !Send for WorkerGlobalScope
impl !Sync for WorkerGlobalScope
impl Unpin for WorkerGlobalScope
impl !UnwindSafe for WorkerGlobalScope
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