#[repr(C)]pub struct ServiceWorkerGlobalScope {
workerglobalscope: WorkerGlobalScope,
task_queue: TaskQueue<ServiceWorkerScriptMsg>,
own_sender: Sender<ServiceWorkerScriptMsg>,
time_out_port: Receiver<Instant>,
swmanager_sender: IpcSender<ServiceWorkerMsg>,
scope_url: ServoUrl,
control_receiver: Receiver<ServiceWorkerControlMsg>,
}
Fields§
§workerglobalscope: WorkerGlobalScope
§task_queue: TaskQueue<ServiceWorkerScriptMsg>
§own_sender: Sender<ServiceWorkerScriptMsg>
§time_out_port: Receiver<Instant>
A port on which a single “time-out” message can be received, indicating the sw should stop running, while still draining the task-queue
swmanager_sender: IpcSender<ServiceWorkerMsg>
§scope_url: ServoUrl
§control_receiver: Receiver<ServiceWorkerControlMsg>
A receiver of control messages, currently only used to signal shutdown.
Implementations§
source§impl ServiceWorkerGlobalScope
impl ServiceWorkerGlobalScope
fn __assert_parent_type(&self)
source§impl ServiceWorkerGlobalScope
impl ServiceWorkerGlobalScope
fn new_inherited( init: WorkerGlobalScopeInit, worker_url: ServoUrl, from_devtools_receiver: Receiver<DevtoolScriptControlMsg>, runtime: Runtime, own_sender: Sender<ServiceWorkerScriptMsg>, receiver: Receiver<ServiceWorkerScriptMsg>, time_out_port: Receiver<Instant>, swmanager_sender: IpcSender<ServiceWorkerMsg>, scope_url: ServoUrl, control_receiver: Receiver<ServiceWorkerControlMsg>, closing: Arc<AtomicBool>, ) -> ServiceWorkerGlobalScope
pub fn new( init: WorkerGlobalScopeInit, worker_url: ServoUrl, from_devtools_receiver: Receiver<DevtoolScriptControlMsg>, runtime: Runtime, own_sender: Sender<ServiceWorkerScriptMsg>, receiver: Receiver<ServiceWorkerScriptMsg>, time_out_port: Receiver<Instant>, swmanager_sender: IpcSender<ServiceWorkerMsg>, scope_url: ServoUrl, control_receiver: Receiver<ServiceWorkerControlMsg>, closing: Arc<AtomicBool>, ) -> Root<Dom<ServiceWorkerGlobalScope>>
sourcepub fn run_serviceworker_scope(
scope_things: ScopeThings,
own_sender: Sender<ServiceWorkerScriptMsg>,
receiver: Receiver<ServiceWorkerScriptMsg>,
devtools_receiver: IpcReceiver<DevtoolScriptControlMsg>,
swmanager_sender: IpcSender<ServiceWorkerMsg>,
scope_url: ServoUrl,
control_receiver: Receiver<ServiceWorkerControlMsg>,
context_sender: Sender<ThreadSafeJSContext>,
closing: Arc<AtomicBool>,
) -> JoinHandle<()>
pub fn run_serviceworker_scope( scope_things: ScopeThings, own_sender: Sender<ServiceWorkerScriptMsg>, receiver: Receiver<ServiceWorkerScriptMsg>, devtools_receiver: IpcReceiver<DevtoolScriptControlMsg>, swmanager_sender: IpcSender<ServiceWorkerMsg>, scope_url: ServoUrl, control_receiver: Receiver<ServiceWorkerControlMsg>, context_sender: Sender<ThreadSafeJSContext>, closing: Arc<AtomicBool>, ) -> JoinHandle<()>
fn handle_mixed_message(&self, msg: MixedMessage, can_gc: CanGc) -> bool
fn has_timed_out(&self) -> bool
fn handle_script_event(&self, msg: ServiceWorkerScriptMsg, can_gc: CanGc)
pub fn script_chan(&self) -> Box<dyn ScriptChan + Send>
fn dispatch_activate(&self, can_gc: CanGc)
Trait Implementations§
source§impl Castable for ServiceWorkerGlobalScope
impl Castable for ServiceWorkerGlobalScope
source§impl DomObject for ServiceWorkerGlobalScope
impl DomObject for ServiceWorkerGlobalScope
source§impl HasParent for ServiceWorkerGlobalScope
impl HasParent for ServiceWorkerGlobalScope
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 ServiceWorkerGlobalScope
impl MallocSizeOf for ServiceWorkerGlobalScope
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 PartialEq for ServiceWorkerGlobalScope
impl PartialEq for ServiceWorkerGlobalScope
source§impl ServiceWorkerGlobalScopeMethods for ServiceWorkerGlobalScope
impl ServiceWorkerGlobalScopeMethods for ServiceWorkerGlobalScope
fn GetOnmessage(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnmessage(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnmessageerror(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnmessageerror(&self, listener: Option<Rc<EventHandlerNonNull>>)
source§impl Traceable for ServiceWorkerGlobalScope
impl Traceable for ServiceWorkerGlobalScope
source§impl WorkerEventLoopMethods for ServiceWorkerGlobalScope
impl WorkerEventLoopMethods for ServiceWorkerGlobalScope
type WorkerMsg = ServiceWorkerScriptMsg
type ControlMsg = ServiceWorkerControlMsg
type Event = MixedMessage
fn task_queue(&self) -> &TaskQueue<ServiceWorkerScriptMsg>
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: ServiceWorkerControlMsg) -> MixedMessage
fn from_worker_msg(msg: ServiceWorkerScriptMsg) -> MixedMessage
fn from_devtools_msg(msg: DevtoolScriptControlMsg) -> MixedMessage
fn control_receiver(&self) -> &Receiver<ServiceWorkerControlMsg>
impl DerivedFrom<EventTarget> for ServiceWorkerGlobalScope
impl DerivedFrom<GlobalScope> for ServiceWorkerGlobalScope
impl DerivedFrom<WorkerGlobalScope> for ServiceWorkerGlobalScope
impl Eq for ServiceWorkerGlobalScope
Auto Trait Implementations§
impl !Freeze for ServiceWorkerGlobalScope
impl !RefUnwindSafe for ServiceWorkerGlobalScope
impl !Send for ServiceWorkerGlobalScope
impl !Sync for ServiceWorkerGlobalScope
impl Unpin for ServiceWorkerGlobalScope
impl !UnwindSafe for ServiceWorkerGlobalScope
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