#[repr(C)]pub(crate) struct DedicatedWorkerGlobalScope {Show 19 fields
workerglobalscope: WorkerGlobalScope,
webview_id: WebViewId,
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>,
animation_frame_provider_supported: Arc<AtomicBool>,
animation_frame_provider_registered: Cell<bool>,
animation_frame_ident: Cell<u32>,
animation_frame_list: DomRefCell<VecDeque<(u32, Rc<FrameRequestCallback<DomTypeHolder>>)>>,
current_animation_frame_list: DomRefCell<VecDeque<(u32, Rc<FrameRequestCallback<DomTypeHolder>>)>>,
running_animation_callbacks: Cell<bool>,
animation_frame_callbacks_active: Cell<bool>,
animation_frame_tick_sender: Option<GenericSender<WorkerAnimationFrameTick>>,
animation_frame_tick_receiver: Option<RoutedReceiver<WorkerAnimationFrameTick>>,
control_receiver: Receiver<DedicatedWorkerControlMsg>,
queued_worker_tasks: DomRefCell<Vec<MessageData>>,
}Fields§
§workerglobalscope: WorkerGlobalScope§webview_id: WebViewIdThe WebViewId of the WebView that this worker is associated with.
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>§animation_frame_provider_supported: Arc<AtomicBool>§animation_frame_provider_registered: Cell<bool>§animation_frame_ident: Cell<u32>§animation_frame_list: DomRefCell<VecDeque<(u32, Rc<FrameRequestCallback<DomTypeHolder>>)>>Pending animation frame callbacks for a later worker rendering update.
current_animation_frame_list: DomRefCell<VecDeque<(u32, Rc<FrameRequestCallback<DomTypeHolder>>)>>Callbacks snapshotted for the current worker rendering update.
running_animation_callbacks: Cell<bool>Whether we’re in the process of running animation callbacks.
animation_frame_callbacks_active: Cell<bool>Whether Constellation currently treats this worker as having callbacks.
animation_frame_tick_sender: Option<GenericSender<WorkerAnimationFrameTick>>A sender for animation frame ticks.
animation_frame_tick_receiver: Option<RoutedReceiver<WorkerAnimationFrameTick>>A receiver for animation frame ticks.
control_receiver: Receiver<DedicatedWorkerControlMsg>A receiver of control messages.
queued_worker_tasks: DomRefCell<Vec<MessageData>>Implementations§
Source§impl DedicatedWorkerGlobalScope
impl DedicatedWorkerGlobalScope
fn __assert_parent_type(&self)
Source§impl DedicatedWorkerGlobalScope
impl DedicatedWorkerGlobalScope
fn new_inherited( init: WorkerGlobalScopeInit, webview_id: WebViewId, worker_name: DOMString, worker_type: WorkerType, worker_url: ServoUrl, from_devtools_receiver: RoutedReceiver<DevtoolScriptControlMsg>, runtime: Runtime, parent_event_loop_sender: ScriptEventLoopSender, own_sender: Sender<DedicatedWorkerScriptMsg>, receiver: Receiver<DedicatedWorkerScriptMsg>, closing: Arc<AtomicBool>, animation_frame_provider_supported: Arc<AtomicBool>, image_cache: Arc<dyn ImageCache>, browsing_context: Option<BrowsingContextId>, animation_frame_tick_sender: Option<GenericSender<WorkerAnimationFrameTick>>, animation_frame_tick_receiver: Option<RoutedReceiver<WorkerAnimationFrameTick>>, gpu_id_hub: Arc<IdentityHub>, control_receiver: Receiver<DedicatedWorkerControlMsg>, insecure_requests_policy: InsecureRequestsPolicy, font_context: Arc<FontContext>, ) -> DedicatedWorkerGlobalScope
pub(crate) fn new( init: WorkerGlobalScopeInit, webview_id: WebViewId, worker_name: DOMString, worker_type: WorkerType, worker_url: ServoUrl, from_devtools_receiver: RoutedReceiver<DevtoolScriptControlMsg>, runtime: Runtime, parent_event_loop_sender: ScriptEventLoopSender, own_sender: Sender<DedicatedWorkerScriptMsg>, receiver: Receiver<DedicatedWorkerScriptMsg>, closing: Arc<AtomicBool>, animation_frame_provider_supported: Arc<AtomicBool>, image_cache: Arc<dyn ImageCache>, browsing_context: Option<BrowsingContextId>, animation_frame_tick_sender: Option<GenericSender<WorkerAnimationFrameTick>>, animation_frame_tick_receiver: Option<RoutedReceiver<WorkerAnimationFrameTick>>, gpu_id_hub: Arc<IdentityHub>, control_receiver: Receiver<DedicatedWorkerControlMsg>, insecure_requests_policy: InsecureRequestsPolicy, font_context: Arc<FontContext>, debugger_global: &DebuggerGlobalScope, cx: &mut JSContext, ) -> DomRoot<DedicatedWorkerGlobalScope>
Sourcepub(crate) fn run_worker_scope(
init: WorkerGlobalScopeInit,
webview_id: WebViewId,
worker_url: UrlWithBlobClaim,
from_devtools_receiver: GenericReceiver<DevtoolScriptControlMsg>,
worker: Trusted<Worker>,
parent_event_loop_sender: ScriptEventLoopSender,
own_sender: Sender<DedicatedWorkerScriptMsg>,
receiver: Receiver<DedicatedWorkerScriptMsg>,
worker_load_origin: WorkerScriptLoadOrigin,
worker_options: &WorkerOptions,
closing: Arc<AtomicBool>,
animation_frame_provider_supported: 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: Arc<FontContext>,
) -> JoinHandle<()>
pub(crate) fn run_worker_scope( init: WorkerGlobalScopeInit, webview_id: WebViewId, worker_url: UrlWithBlobClaim, from_devtools_receiver: GenericReceiver<DevtoolScriptControlMsg>, worker: Trusted<Worker>, parent_event_loop_sender: ScriptEventLoopSender, own_sender: Sender<DedicatedWorkerScriptMsg>, receiver: Receiver<DedicatedWorkerScriptMsg>, worker_load_origin: WorkerScriptLoadOrigin, worker_options: &WorkerOptions, closing: Arc<AtomicBool>, animation_frame_provider_supported: 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: Arc<FontContext>, ) -> JoinHandle<()>
pub(crate) fn webview_id(&self) -> WebViewId
pub(crate) fn animation_frame_provider_supported(&self) -> bool
pub(crate) fn animation_frame_provider_supported_flag(&self) -> Arc<AtomicBool> ⓘ
fn register_animation_frame_provider(&self)
fn unregister_animation_frame_provider(&self)
fn send_animation_frame_callbacks_state(&self, active: bool)
fn set_animation_frame_callbacks_active(&self, active: bool)
fn remove_animation_frame_callback_from( list: &DomRefCell<VecDeque<(u32, Rc<FrameRequestCallback<DomTypeHolder>>)>>, ident: u32, )
fn has_animation_frame_callbacks(&self) -> bool
Sourcepub(crate) fn request_animation_frame(
&self,
callback: Rc<FrameRequestCallback<DomTypeHolder>>,
) -> Fallible<u32>
pub(crate) fn request_animation_frame( &self, callback: Rc<FrameRequestCallback<DomTypeHolder>>, ) -> Fallible<u32>
Sourcepub(crate) fn cancel_animation_frame(&self, ident: u32) -> ErrorResult
pub(crate) fn cancel_animation_frame(&self, ident: u32) -> ErrorResult
Sourcepub(crate) fn run_the_animation_frame_callbacks(&self, cx: &mut JSContext)
pub(crate) fn run_the_animation_frame_callbacks(&self, cx: &mut JSContext)
pub(crate) fn clear_animation_frame_callbacks_and_unregister(&self)
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, cx: &mut JSContext)
fn dispatch_message_event(&self, cx: &mut JSContext, msg: MessageData)
fn handle_script_event(&self, msg: WorkerScriptMsg, cx: &mut JSContext)
Sourcefn handle_mixed_message(&self, msg: MixedMessage, cx: &mut JSContext) -> bool
fn handle_mixed_message(&self, msg: MixedMessage, cx: &mut JSContext) -> bool
Sourcepub(crate) fn forward_error_to_worker_object(&self, error_info: ErrorInfo)
pub(crate) fn forward_error_to_worker_object(&self, error_info: ErrorInfo)
Sourcefn post_message_impl(
&self,
cx: &mut JSContext,
message: HandleValue<'_>,
transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>,
) -> ErrorResult
fn post_message_impl( &self, cx: &mut JSContext, 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)
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: &mut JSContext,
message: HandleValue<'_>,
transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>,
) -> ErrorResult
fn PostMessage( &self, cx: &mut JSContext, message: HandleValue<'_>, transfer: CustomAutoRooterGuard<'_, Vec<*mut JSObject>>, ) -> ErrorResult
Source§fn PostMessage_(
&self,
cx: &mut JSContext,
message: HandleValue<'_>,
options: RootedTraceableBox<StructuredSerializeOptions>,
) -> ErrorResult
fn PostMessage_( &self, cx: &mut JSContext, message: HandleValue<'_>, options: RootedTraceableBox<StructuredSerializeOptions>, ) -> ErrorResult
Source§fn RequestAnimationFrame(
&self,
callback: Rc<FrameRequestCallback<DomTypeHolder>>,
) -> Fallible<u32>
fn RequestAnimationFrame( &self, callback: Rc<FrameRequestCallback<DomTypeHolder>>, ) -> Fallible<u32>
Source§fn CancelAnimationFrame(&self, ident: u32) -> ErrorResult
fn CancelAnimationFrame(&self, ident: u32) -> ErrorResult
fn GetOnmessage( &self, cx: &mut JSContext, ) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnmessage( &self, cx: &mut JSContext, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
fn GetOnmessageerror( &self, cx: &mut JSContext, ) -> Option<Rc<EventHandlerNonNull<DomTypeHolder>>>
fn SetOnmessageerror( &self, cx: &mut JSContext, listener: Option<Rc<EventHandlerNonNull<DomTypeHolder>>>, )
Source§impl DomObject for DedicatedWorkerGlobalScope
impl DomObject for DedicatedWorkerGlobalScope
type ReflectorType = ()
Source§fn reflector(&self) -> &Reflector<Self::ReflectorType>
fn reflector(&self) -> &Reflector<Self::ReflectorType>
Source§impl Drop for DedicatedWorkerGlobalScope
impl Drop for DedicatedWorkerGlobalScope
Source§impl HasOrigin for DedicatedWorkerGlobalScope
impl HasOrigin for DedicatedWorkerGlobalScope
fn origin(&self) -> MutableOrigin
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 IDLInterface for DedicatedWorkerGlobalScope
impl IDLInterface for DedicatedWorkerGlobalScope
Source§const PROTO_FIRST: u16 = 192
const PROTO_FIRST: u16 = 192
Source§const PROTO_LAST: u16 = 192
const PROTO_LAST: u16 = 192
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
Source§impl ToJSValConvertible for DedicatedWorkerGlobalScope
impl ToJSValConvertible for DedicatedWorkerGlobalScope
Source§fn safe_to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)
fn safe_to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)
self to a JSVal. JSAPI failure causes a panic.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, cx: &mut JSContext) -> 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 from_animation_frame_tick_msg( msg: WorkerAnimationFrameTick, ) -> Option<MixedMessage>
fn animation_frame_tick_receiver( &self, ) -> Option<&RoutedReceiver<WorkerAnimationFrameTick>>
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 UnsafeUnpin 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
Source§impl<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
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§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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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>
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 more