Struct script::dom::workerglobalscope::WorkerGlobalScope
source · #[repr(C)]pub struct WorkerGlobalScope {Show 13 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>,
from_devtools_sender: Option<IpcSender<DevtoolScriptControlMsg>>,
from_devtools_receiver: Receiver<DevtoolScriptControlMsg>,
navigation_start_precise: u64,
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>
§from_devtools_sender: Option<IpcSender<DevtoolScriptControlMsg>>
Optional IpcSender
for sending the DevtoolScriptControlMsg
to the server from within the worker
from_devtools_receiver: Receiver<DevtoolScriptControlMsg>
This Receiver
will be ignored later if the corresponding
IpcSender
doesn’t exist
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, from_devtools_receiver: Receiver<DevtoolScriptControlMsg>, closing: Arc<AtomicBool>, gpu_id_hub: Arc<Mutex<Identities>> ) -> Self
sourcepub fn clear_js_runtime(&self, cx_for_interrupt: ContextForRequestInterrupt)
pub fn clear_js_runtime(&self, cx_for_interrupt: ContextForRequestInterrupt)
Clear various items when the worker event-loop shuts-down.
pub fn runtime_handle(&self) -> ParentRuntime
pub fn from_devtools_sender(&self) -> Option<IpcSender<DevtoolScriptControlMsg>>
pub fn from_devtools_receiver(&self) -> &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
source§impl WorkerGlobalScope
impl WorkerGlobalScope
pub fn execute_script(&self, source: DOMString)
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§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
Initializes the Reflector
source§impl PartialEq<WorkerGlobalScope> for WorkerGlobalScope
impl PartialEq<WorkerGlobalScope> for WorkerGlobalScope
source§fn eq(&self, other: &WorkerGlobalScope) -> bool
fn eq(&self, other: &WorkerGlobalScope) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Traceable for WorkerGlobalScope
impl Traceable for WorkerGlobalScope
source§impl WorkerGlobalScopeMethods for WorkerGlobalScope
impl WorkerGlobalScopeMethods for WorkerGlobalScope
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>) -> 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 ) -> Rc<Promise>
fn Fetch( &self, input: RequestOrUSVString, init: RootedTraceableBox<RequestInit>, comp: InRealm<'_> ) -> 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
Auto Trait Implementations§
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> 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> 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