pub struct SharedWorkerGlobalScopeState {
pub scope: WorkerGlobalScopeState,
pub shared_worker_id: SharedWorkerId,
pub has_onconnect: bool,
pub connect_count: usize,
}Expand description
The SharedWorkerGlobalScope state tracked by bao_browser.
This struct represents the bao-side view of a Shared Worker’s global scope. The actual DOM SharedWorkerGlobalScope lives in servo’s ScriptThread; this struct tracks the state that bao needs for lifecycle management, CDP observability, and stealth consistency verification.
@trace REQ-BRW-004 [entity:SharedWorkerGlobalScope]
Fields§
§scope: WorkerGlobalScopeStateThe base WorkerGlobalScope state. @trace REQ-BRW-004 [entity:SharedWorkerGlobalScope] [entity:WorkerGlobalScope]
The SharedWorkerId identifying this Shared Worker. Links the scope to its SharedWorkerHandle. @trace REQ-BRW-004 [entity:SharedWorkerGlobalScope]
has_onconnect: boolWhether onconnect event handler is registered. Tracked for CDP observability (Runtime binding reporting). @trace REQ-BRW-004 [entity:SharedWorkerGlobalScope]
connect_count: usizeNumber of connect events fired (equals number of pages that have connected since the SharedWorker was created). @trace REQ-BRW-004 [entity:SharedWorkerGlobalScope] DF-WK-7
Implementations§
Sourcepub fn new(
shared_worker_id: SharedWorkerId,
config: &SharedWorkerScopeConfig,
) -> Self
pub fn new( shared_worker_id: SharedWorkerId, config: &SharedWorkerScopeConfig, ) -> Self
Create a SharedWorkerGlobalScopeState for the given SharedWorker.
@trace REQ-BRW-004 [entity:SharedWorkerGlobalScope]
Sourcepub fn location(&self) -> Option<&WorkerLocation>
pub fn location(&self) -> Option<&WorkerLocation>
Get the WorkerLocation for this scope.
@trace REQ-BRW-004 [entity:SharedWorkerGlobalScope] [entity:WorkerLocation]
Get the WorkerNavigator for this scope.
@trace REQ-BRW-004 [entity:SharedWorkerGlobalScope] [entity:WorkerNavigator]
Sourcepub fn set_onconnect(&mut self)
pub fn set_onconnect(&mut self)
Mark onconnect handler as registered.
@trace REQ-BRW-004 [entity:SharedWorkerGlobalScope]
Sourcepub fn page_connected(&mut self)
pub fn page_connected(&mut self)
Increment the connect event count (when a new page connects).
@trace REQ-BRW-004 [entity:SharedWorkerGlobalScope] DF-WK-7
Trait Implementations§
Source§fn clone(&self) -> SharedWorkerGlobalScopeState
fn clone(&self) -> SharedWorkerGlobalScopeState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
Blanket Implementations§
Source§impl<T> AsCtxPtr for Twhere
T: ?Sized,
impl<T> AsCtxPtr for Twhere
T: ?Sized,
Source§fn as_ctx_ptr(&self) -> *mut Selfwhere
Self: Sized,
fn as_ctx_ptr(&self) -> *mut Selfwhere
Self: Sized,
self’s address as *mut Self for deferred-task / scopeguard /
ref_guard ctx slots. The closures/trampolines deref it as shared
(&*p) — every method they reach is &self post-R-2, so no write
provenance is required; the *mut spelling is purely to match the
existing DerefOnDrop / HasAutoFlush / RefCount ABI.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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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