#[repr(C)]pub(crate) struct DedicatedWorkerGlobalScope {
workerglobalscope: WorkerGlobalScope,
task_queue: TaskQueue<DedicatedWorkerScriptMsg>,
own_sender: Sender<DedicatedWorkerScriptMsg>,
worker: DomRefCell<Option<Trusted<Worker>>>,
parent_event_loop_sender: ScriptEventLoopSender,
image_cache: Arc<dyn ImageCache>,
browsing_context: Option<BrowsingContextId>,
control_receiver: Receiver<DedicatedWorkerControlMsg>,
queued_worker_tasks: DomRefCell<Vec<MessageData>>,
}Fields§
§workerglobalscope: WorkerGlobalScope§task_queue: TaskQueue<DedicatedWorkerScriptMsg>§own_sender: Sender<DedicatedWorkerScriptMsg>§worker: DomRefCell<Option<Trusted<Worker>>>§parent_event_loop_sender: ScriptEventLoopSenderSender 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.
queued_worker_tasks: DomRefCell<Vec<MessageData>>Implementations§
Source§impl DedicatedWorkerGlobalScope
impl DedicatedWorkerGlobalScope
fn __assert_parent_type(&self)
Source§impl DedicatedWorkerGlobalScope
impl DedicatedWorkerGlobalScope
pub(crate) fn webview_id(&self) -> Option<WebViewId>
fn new_inherited( init: WorkerGlobalScopeInit, worker_name: DOMString, worker_type: WorkerType, worker_url: ServoUrl, from_devtools_receiver: Receiver<DevtoolScriptControlMsg>, runtime: Runtime, parent_event_loop_sender: ScriptEventLoopSender, 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>, insecure_requests_policy: InsecureRequestsPolicy, font_context: Option<Arc<FontContext>>, ) -> DedicatedWorkerGlobalScope
pub(crate) fn new( init: WorkerGlobalScopeInit, worker_name: DOMString, worker_type: WorkerType, worker_url: ServoUrl, from_devtools_receiver: Receiver<DevtoolScriptControlMsg>, runtime: Runtime, parent_event_loop_sender: ScriptEventLoopSender, 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>, insecure_requests_policy: InsecureRequestsPolicy, font_context: Option<Arc<FontContext>>, ) -> DomRoot<DedicatedWorkerGlobalScope>
Sourcepub(crate) fn run_worker_scope(
init: WorkerGlobalScopeInit,
worker_url: ServoUrl,
from_devtools_receiver: IpcReceiver<DevtoolScriptControlMsg>,
worker: Trusted<Worker>,
parent_event_loop_sender: ScriptEventLoopSender,
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>,
insecure_requests_policy: InsecureRequestsPolicy,
policy_container: PolicyContainer,
font_context: Option<Arc<FontContext>>,
) -> JoinHandle<()>
pub(crate) fn run_worker_scope( init: WorkerGlobalScopeInit, worker_url: ServoUrl, from_devtools_receiver: IpcReceiver<DevtoolScriptControlMsg>, worker: Trusted<Worker>, parent_event_loop_sender: ScriptEventLoopSender, 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>, insecure_requests_policy: InsecureRequestsPolicy, policy_container: PolicyContainer, font_context: Option<Arc<FontContext>>, ) -> JoinHandle<()>
Sourcefn replace_worker(
&self,
new_worker: Option<Trusted<Worker>>,
) -> Option<Trusted<Worker>>
fn replace_worker( &self, new_worker: Option<Trusted<Worker>>, ) -> Option<Trusted<Worker>>
The non-None value of the worker field can contain a rooted TrustedWorkerAddress
version of the main thread’s worker object. This is set while handling messages and then
unset otherwise, ensuring that the main thread object can be garbage collected. See
AutoWorkerReset.
pub(crate) fn image_cache(&self) -> Arc<dyn ImageCache>
pub(crate) fn event_loop_sender(&self) -> Option<ScriptEventLoopSender>
pub(crate) fn new_script_pair( &self, ) -> (ScriptEventLoopSender, ScriptEventLoopReceiver)
pub(crate) fn fire_queued_messages(&self, can_gc: CanGc)
fn dispatch_message_event(&self, msg: MessageData, can_gc: CanGc)
fn handle_script_event(&self, msg: WorkerScriptMsg, can_gc: CanGc)
fn handle_mixed_message(&self, msg: MixedMessage, can_gc: CanGc) -> bool
pub(crate) fn forward_error_to_worker_object(&self, error_info: ErrorInfo)
Sourcefn post_message_impl(
&self,
cx: SafeJSContext,
message: HandleValue<'_>,
transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>,
) -> ErrorResult
fn post_message_impl( &self, cx: SafeJSContext, message: HandleValue<'_>, transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>, ) -> ErrorResult
pub(crate) fn browsing_context(&self) -> Option<BrowsingContextId>
pub(crate) fn report_csp_violations(&self, violations: Vec<Violation>)
pub(crate) fn forward_simple_error_at_worker(&self, worker: Trusted<Worker>)
Trait Implementations§
§impl Castable for DedicatedWorkerGlobalScope
impl Castable for DedicatedWorkerGlobalScope
Source§impl DedicatedWorkerGlobalScopeMethods<DomTypeHolder> for DedicatedWorkerGlobalScope
impl DedicatedWorkerGlobalScopeMethods<DomTypeHolder> for DedicatedWorkerGlobalScope
Source§fn PostMessage(
&self,
cx: SafeJSContext,
message: HandleValue<'_>,
transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>,
) -> ErrorResult
fn PostMessage( &self, cx: SafeJSContext, message: HandleValue<'_>, transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>, ) -> ErrorResult
Source§fn PostMessage_(
&self,
cx: SafeJSContext,
message: HandleValue<'_>,
options: RootedTraceableBox<StructuredSerializeOptions>,
) -> ErrorResult
fn PostMessage_( &self, cx: SafeJSContext, message: HandleValue<'_>, options: RootedTraceableBox<StructuredSerializeOptions>, ) -> ErrorResult
fn GetOnmessage(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnmessage(&self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>)
fn GetOnmessageerror(&self) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnmessageerror( &self, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
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 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 from_timer_msg() -> 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<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_(&self, realm: InRealm<'_>) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
Returns the [
GlobalScope] of the realm that the DomObject was created in. If this
object is a Node, this will be different from it’s owning Document if adopted by. For
Nodes it’s almost always better to use NodeTraits::owning_global.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