Skip to main content

BaoWebViewState

Struct BaoWebViewState 

Source
pub struct BaoWebViewState {
    pub url: Option<Url>,
    pub title: Option<String>,
    pub load_status: LoadStatus,
    pub frame_ready: bool,
    pub dom_proxies_dirty: bool,
    pub console_log_tx: Option<Sender<ConsoleMessage>>,
    pub event_tx: Option<Sender<ServoEvent>>,
    pub worker_scope_config: WorkerScopeConfig,
    /* private fields */
}

Fields§

§url: Option<Url>§title: Option<String>§load_status: LoadStatus§frame_ready: bool§dom_proxies_dirty: bool

Set to true after navigation completes (LoadStatus::Complete). evaluate_js checks this flag and refreshes stale DOM proxies before executing scripts.

§console_log_tx: Option<Sender<ConsoleMessage>>

Channel for forwarding per-webview console messages to CDP Log domain.

§event_tx: Option<Sender<ServoEvent>>

Channel for forwarding structured ServoEvent to the EventSubscriber path (Path B). When set, events are also pushed here in addition to console_log_tx. @trace REQ-CDP-006 [entity:ServoDelegateHooks]

§worker_scope_config: WorkerScopeConfig

Worker scope config for propagating stealth-consistent properties to new Workers. Populated from the page’s StealthProfile when the page is created. @trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope] [criterion:12..17]

Implementations§

Source§

impl BaoWebViewState

Source

pub fn track_worker(&mut self, handle: WorkerHandle)

Track a newly created Worker for this webview.

Called when servo’s Worker::Constructor completes (DF-WK-1). The WorkerHandle is wrapped in an AutoCloseWorker guard that ensures termination on page unload or panic unwinding.

@trace REQ-BRW-004 [entity:Worker] [criterion:10]

Source

pub fn track_worker_guard(&mut self, guard: AutoCloseWorker)

Track a newly created Worker with a pre-allocated AutoCloseWorker.

@trace REQ-BRW-004 [entity:Worker] [criterion:10]

Source

pub fn terminate_all_workers(&mut self)

Auto-terminate all active Workers on page unload (crash-safe).

SPEC criterion #10: “页面卸载时自动终止所有 Worker (GlobalScope::track_worker + AutoCloseWorker)”. Called from notify_load_status_changed when a new navigation starts (LoadStatus::Started after a previous Complete).

SPEC criterion #18: “三路径 teardown 均 crash-safe: worker 线程 JSContext 干净销毁 + 线程 join 无悬挂 + REALM_PROFILES 条目注销

  • 无 EBUSY 类 mutex destroy SIGSEGV“

This method performs crash-safe teardown for each Worker:

  1. Sets the closing flag (signals the worker event loop to exit)
  2. Unregisters each Worker’s stealth profile from REALM_PROFILES
  3. Marks each Worker as terminated
  4. Drops WebWorker instances (their Drop impl joins the thread)

Also clears all Worker channel bridges — dropping the channels signals worker threads that the parent has disconnected (DF-WK-4/5). Also clears script loading states and marks any in-progress loads as cancelled (DF-WK-2).

@trace REQ-BRW-004 [entity:Worker] [criterion:10] [criterion:6] [criterion:18] @trace REQ-BRW-004 [entity:Worker] [DF-WK-2]

Source

pub fn reap_terminated_workers(&mut self)

Remove fully-terminated Workers from the tracking list.

Called after spin_event_loop to clean up Workers whose threads have exited (terminated flag set by Worker teardown). Also reaps their channel bridges and script load states.

@trace REQ-BRW-004 [entity:Worker] [criterion:6] @trace REQ-BRW-004 [entity:Worker] [DF-WK-2]

Source

pub fn active_worker_count(&self) -> usize

Returns the number of active (non-terminated) Workers.

@trace REQ-BRW-004 [entity:Worker]

Source

pub fn terminate_worker_via_path( &mut self, worker_id: &WorkerId, path: WorkerTeardownPath, ) -> Option<WorkerTeardownResult>

Terminate a specific Worker via the given teardown path (crash-safe).

This is the single-Worker teardown method implementing SPEC criterion #18 for the worker.terminate() and self.close() paths. The PageUnload path is handled by terminate_all_workers.

Crash-safe teardown protocol:

  1. Set the closing flag (signals the worker event loop to exit)
  2. Unregister the Worker’s stealth profile from REALM_PROFILES
  3. Mark the Worker as terminated
  4. Drop the WebWorker instance (its Drop impl joins the thread)

Returns the WorkerTeardownResult for observability, or None if the Worker was not found.

@trace REQ-BRW-004 [entity:Worker] [criterion:4] [criterion:5] [criterion:18]

Source

pub fn register_dedicated_worker_scope( &mut self, worker_id: WorkerId, scope: DedicatedWorkerGlobalScopeState, )

Register a DedicatedWorkerGlobalScope state under the given WorkerId.

Called when a Worker is created (DF-WK-1), populating the scope state for CDP observability and stealth consistency verification.

@trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope]

Source

pub fn register_web_worker(&mut self, worker_id: WorkerId, handle: WorkerHandle)

Register a WorkerHandle reference for the given WorkerId (DEC-WK-001).

The WorkerHandle tracks the Worker’s closing/terminated flags + global_addr for REALM_PROFILES cleanup. Storing it here keeps the handle alive for CDP observability + page-unload termination tracking. The actual Worker thread lifecycle is owned by servo.

@trace REQ-BRW-004 [entity:Worker] [criterion:1] [criterion:18]

Source

pub fn web_worker(&self, worker_id: &WorkerId) -> Option<&WorkerHandle>

Get a reference to a WorkerHandle by WorkerId.

@trace REQ-BRW-004 [entity:Worker]

Source

pub fn dedicated_worker_scope( &self, worker_id: &WorkerId, ) -> Option<&DedicatedWorkerGlobalScopeState>

Get a reference to a DedicatedWorkerGlobalScope state.

@trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope]

Source

pub fn dedicated_worker_scope_mut( &mut self, worker_id: &WorkerId, ) -> Option<&mut DedicatedWorkerGlobalScopeState>

Get a mutable reference to a DedicatedWorkerGlobalScope state.

@trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope]

Source

pub fn remove_dedicated_worker_scope( &mut self, worker_id: &WorkerId, ) -> Option<DedicatedWorkerGlobalScopeState>

Remove a DedicatedWorkerGlobalScope state (called when a Worker is reaped).

@trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope]

Source

pub fn dedicated_worker_scope_count(&self) -> usize

Returns the number of tracked DedicatedWorkerGlobalScope states.

@trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope]

Source

pub fn dedicated_worker_scopes(&self) -> Vec<&DedicatedWorkerGlobalScopeState>

Returns a snapshot of all DedicatedWorkerGlobalScope states.

Used for CDP observability (Runtime domain) and stealth consistency verification (criterion #12-17).

@trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope]

Source

pub fn dedicated_worker_scope_by_url( &self, url: &str, ) -> Option<&DedicatedWorkerGlobalScopeState>

Look up a DedicatedWorkerGlobalScope state by the Worker’s script URL (CDP worker targetId — the WorkerId is the script URL).

@trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope] [criterion:19]

Source

pub fn register_worker_script_load_state( &mut self, worker_id: WorkerId, state: WorkerScriptLoadState, )

Register a script loading state for a Worker.

Called when a Worker is created with a URL-based script source. Tracks the loading progress for CDP observability.

@trace REQ-BRW-004 [entity:Worker] [DF-WK-2]

Source

pub fn update_worker_script_load_state( &mut self, worker_id: &WorkerId, state: WorkerScriptLoadState, )

Update the script loading state for a Worker.

Called as the Worker script loading progresses through stages (Pending → Fetching → Validating → Decoding → Compiling → Ready/Failed).

@trace REQ-BRW-004 [entity:Worker] [DF-WK-2]

Source

pub fn worker_script_load_state( &self, worker_id: &WorkerId, ) -> Option<&WorkerScriptLoadState>

Get the script loading state for a Worker.

@trace REQ-BRW-004 [entity:Worker] [DF-WK-2]

Source

pub fn remove_worker_script_load_state( &mut self, worker_id: &WorkerId, ) -> Option<WorkerScriptLoadState>

Remove the script loading state for a Worker (called when reaped).

@trace REQ-BRW-004 [entity:Worker] [DF-WK-2]

Source

pub fn worker_script_load_state_count(&self) -> usize

Returns the number of tracked Worker script loading states.

@trace REQ-BRW-004 [entity:Worker] [DF-WK-2]

Source

pub fn worker_lifecycle_states(&self) -> Vec<(WorkerId, WorkerLifecycleState)>

Returns a snapshot of all active Workers’ lifecycle states.

Used for CDP observability and debugging.

@trace REQ-BRW-004 [entity:Worker] [criterion:18]

Source

pub fn set_worker_scope_config(&mut self, config: WorkerScopeConfig)

Set the Worker scope config from the page’s StealthProfile.

Called when a page is created with a StealthProfile to ensure Workers spawned from that page inherit the same stealth properties.

@trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope] [criterion:12..17]

Source

pub fn forward_worker_message_event(&self, event: WorkerMessageEvent)

Forward a Worker postMessage event to the CDP event path.

DF-WK-4 / DF-WK-5: When event_tx is set, push a ServoEvent::Console for CDP observability. Supports both metadata-only events (from servo internal message handling) and full structured-clone events (from bao channel bridge).

@trace REQ-BRW-004 [entity:Worker] [criterion:6] [DF-WK-4] [DF-WK-5]

Source

pub fn forward_worker_structured_message(&self, msg: &WorkerStructuredMessage)

Forward a Worker structured-clone message to the CDP event path.

DF-WK-4 / DF-WK-5: When event_tx is set, push a ServoEvent::Console for CDP observability with payload metadata. Includes message_id for trace correlation and payload size.

@trace REQ-BRW-004 [entity:Worker] [criterion:6] [DF-WK-4] [DF-WK-5]

Source

pub fn forward_worker_error_event(&self, event: WorkerErrorEvent)

Forward a Worker error event to the CDP event path.

SPEC criterion #9: “onerror 事件正确传播到主线程 (ErrorEvent 包含 message/filename/lineno/colno)”. When event_tx is set, push a ServoEvent::PageError for CDP observability (maps to Runtime.exceptionThrown).

@trace REQ-BRW-004 [entity:Worker] [criterion:9]

Source

pub fn register_worker_channel(&mut self, bridge: WorkerChannelBridge)

Register a channel bridge for a Worker’s postMessage channel.

Called when a Worker is created and its channel bridge is set up. The bridge enables page→worker (DF-WK-4) and worker→page (DF-WK-5) structured-clone message passing.

@trace REQ-BRW-004 [entity:Worker] [criterion:6] DF-WK-4 / DF-WK-5

Source

pub fn create_worker_channel( &mut self, worker_id: WorkerId, ) -> WorkerChannelEndpoints

Create and register a channel bridge for a Worker.

Convenience method that creates the bridge and endpoints, registers the bridge, and returns the endpoints for the worker thread.

@trace REQ-BRW-004 [entity:Worker] [criterion:6] DF-WK-4 / DF-WK-5

Source

pub fn remove_worker_channel( &mut self, worker_id: &WorkerId, ) -> Option<WorkerChannelBridge>

Remove a Worker’s channel bridge (e.g., after termination).

@trace REQ-BRW-004 [entity:Worker] [criterion:6]

Source

pub fn worker_channel( &self, worker_id: &WorkerId, ) -> Option<&WorkerChannelBridge>

Get a reference to a Worker’s channel bridge.

@trace REQ-BRW-004 [entity:Worker] [criterion:6]

Source

pub fn post_to_worker( &self, worker_id: &WorkerId, payload: StructuredClonePayload, ) -> Result<(), String>

Post a structured-clone message to a Worker (DF-WK-4).

Sends the payload through the Worker’s channel bridge. Returns Err if the worker is not found or the channel is closed.

@trace REQ-BRW-004 [entity:Worker] [criterion:6] DF-WK-4

Source

pub fn drain_all_worker_messages( &self, ) -> (Vec<WorkerStructuredMessage>, Vec<WorkerId>)

Drain all pending worker→page messages from all Workers (DF-WK-5).

Called during spin_event_loop to process all queued messages from workers. Each message is forwarded to CDP for observability. Returns all available messages and a set of WorkerIds whose channels are disconnected (worker thread has exited).

@trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope] [criterion:6] DF-WK-5 @trace REQ-BRW-004 [criterion:18] crash-safe teardown detection

Source

pub fn drain_and_forward_worker_messages(&self) -> Vec<WorkerId>

Drain worker→page messages and forward each to CDP (DF-WK-5).

Convenience method combining drain_all_worker_messages with forward_worker_structured_message for each message. Returns the set of WorkerIds whose channels are disconnected.

@trace REQ-BRW-004 [entity:DedicatedWorkerGlobalScope] [criterion:6] DF-WK-5 @trace REQ-BRW-004 [criterion:18] crash-safe teardown detection

Source

pub fn reap_terminated_worker_channels(&mut self)

Remove channel bridges for all terminated Workers.

Called after reap_terminated_workers to clean up channel state for Workers that have fully exited.

@trace REQ-BRW-004 [entity:Worker] [criterion:6]

Source

pub fn worker_channel_count(&self) -> usize

Returns the number of registered Worker channel bridges.

@trace REQ-BRW-004 [entity:Worker] [criterion:6]

Source

pub fn track_shared_worker_port(&mut self, port_ref: SharedWorkerPortRef)

Track a SharedWorker port reference for this webview.

DF-WK-7: When a page creates a SharedWorker, the constellation routes to the same worker thread if (url, name) matches. The page receives a MessagePort via the connect event. This method tracks the port reference so it can be disconnected on page unload.

@trace REQ-BRW-004 [entity:SharedWorker] DF-WK-7

Source

pub fn disconnect_shared_worker_ports(&mut self)

Disconnect all SharedWorker ports on page unload.

Unlike DedicatedWorkers (which are terminated), SharedWorkers survive page unload. Only the per-page MessagePorts are disconnected by dropping the SharedWorkerPortRef (which decrements the connected-pages counter in the SharedWorkerHandle).

Also clears the per-page SharedWorker channel bridges — dropping the channels signals the worker thread that the page has disconnected (DF-WK-7). SharedWorkerGlobalScope states are NOT cleared here — they belong to the global registry in BaoServoDelegate and survive page unload.

@trace REQ-BRW-004 [entity:SharedWorker] DF-WK-7

Source

pub fn shared_worker_port_count(&self) -> usize

Returns the number of active SharedWorker port references.

@trace REQ-BRW-004 [entity:SharedWorker]

Source

pub fn forward_shared_worker_connect_event( &self, event: SharedWorkerConnectEvent, )

Forward a SharedWorker connect event to the CDP event path.

DF-WK-7: When a page connects to a SharedWorker (either creating a new one or reusing an existing one), the worker fires a connect event. This method forwards the metadata for CDP observability.

@trace REQ-BRW-004 [entity:SharedWorker] [entity:SharedWorkerGlobalScope] DF-WK-7

Source

pub fn register_shared_worker_channel( &mut self, bridge: SharedWorkerChannelBridge, )

Register a SharedWorker channel bridge for this webview.

DF-WK-7: Each SharedWorker gets a channel bridge that aggregates per-page port channels. This method registers the bridge so messages can be drained during spin_event_loop.

@trace REQ-BRW-004 [entity:SharedWorker] DF-WK-7

Source

pub fn create_shared_worker_channel(&mut self, shared_worker_id: SharedWorkerId)

Create a new SharedWorker channel bridge and register it.

Convenience method that creates the bridge and registers it. Returns a mutable reference to the bridge for adding ports.

@trace REQ-BRW-004 [entity:SharedWorker] DF-WK-7

Source

pub fn add_shared_worker_port( &mut self, shared_worker_id: SharedWorkerId, ) -> SharedWorkerPortEndpoints

Add a port to an existing SharedWorker channel bridge.

DF-WK-7: When a page connects to a SharedWorker, a new port channel is created. Returns the port endpoints for the worker thread. If no bridge exists for the SharedWorkerId, one is created first.

@trace REQ-BRW-004 [entity:SharedWorker] DF-WK-7

Source

pub fn shared_worker_channel( &self, id: &SharedWorkerId, ) -> Option<&SharedWorkerChannelBridge>

Get a reference to a SharedWorker channel bridge.

@trace REQ-BRW-004 [entity:SharedWorker] DF-WK-7

Source

pub fn remove_shared_worker_channel( &mut self, id: &SharedWorkerId, ) -> Option<SharedWorkerChannelBridge>

Remove a SharedWorker channel bridge.

@trace REQ-BRW-004 [entity:SharedWorker] DF-WK-7

Source

pub fn drain_all_shared_worker_messages( &self, ) -> (Vec<WorkerStructuredMessage>, Vec<SharedWorkerId>)

Drain all pending SharedWorker→page messages from all SharedWorkers (DF-WK-7).

Called during spin_event_loop to process all queued messages from SharedWorkers across all connected pages. Each message is forwarded to CDP for observability. Returns messages and any disconnected SharedWorkerIds.

@trace REQ-BRW-004 [entity:SharedWorkerGlobalScope] DF-WK-7 @trace REQ-BRW-004 [criterion:18] crash-safe teardown detection

Source

pub fn drain_and_forward_shared_worker_messages(&self) -> Vec<SharedWorkerId>

Drain SharedWorker messages and forward each to CDP (DF-WK-7).

Returns the set of disconnected SharedWorkerIds.

@trace REQ-BRW-004 [entity:SharedWorkerGlobalScope] DF-WK-7 @trace REQ-BRW-004 [criterion:18] crash-safe teardown detection

Source

pub fn post_to_worker_via_shared_port( &self, id: &SharedWorkerId, port_index: usize, payload: StructuredClonePayload, ) -> Result<(), String>

Post a message to a SharedWorker via a specific port index.

Convenience method combining shared_worker_channel lookup with post_to_worker_from_port.

@trace REQ-BRW-004 [entity:SharedWorker] DF-WK-7

Source

pub fn reap_disconnected_shared_worker_ports(&mut self)

Clean up SharedWorker channel ports for disconnected workers.

@trace REQ-BRW-004 [entity:SharedWorker] DF-WK-7

Source

pub fn shared_worker_channel_count(&self) -> usize

Returns the total number of SharedWorker port channels.

@trace REQ-BRW-004 [entity:SharedWorker]

Source

pub fn register_shared_worker_scope( &mut self, id: SharedWorkerId, scope: SharedWorkerGlobalScopeState, )

Register a SharedWorkerGlobalScope state under the given SharedWorkerId.

Called when a SharedWorker is created, populating the scope state for CDP observability and stealth consistency verification (CRIT-STL-WK).

@trace REQ-BRW-004 [entity:SharedWorkerGlobalScope]

Source

pub fn shared_worker_scope( &self, id: &SharedWorkerId, ) -> Option<&SharedWorkerGlobalScopeState>

Get a reference to a SharedWorkerGlobalScope state.

@trace REQ-BRW-004 [entity:SharedWorkerGlobalScope]

Source

pub fn shared_worker_scope_mut( &mut self, id: &SharedWorkerId, ) -> Option<&mut SharedWorkerGlobalScopeState>

Get a mutable reference to a SharedWorkerGlobalScope state.

@trace REQ-BRW-004 [entity:SharedWorkerGlobalScope]

Source

pub fn remove_shared_worker_scope( &mut self, id: &SharedWorkerId, ) -> Option<SharedWorkerGlobalScopeState>

Remove a SharedWorkerGlobalScope state (called when a SharedWorker is reaped).

@trace REQ-BRW-004 [entity:SharedWorkerGlobalScope]

Source

pub fn shared_worker_scope_count(&self) -> usize

Returns the number of tracked SharedWorkerGlobalScope states.

@trace REQ-BRW-004 [entity:SharedWorkerGlobalScope]

Source

pub fn shared_worker_scopes(&self) -> Vec<&SharedWorkerGlobalScopeState>

Returns a snapshot of all SharedWorkerGlobalScope states.

Used for CDP observability (Runtime domain) and stealth consistency verification (criterion #12-17).

@trace REQ-BRW-004 [entity:SharedWorkerGlobalScope]

Source

pub fn shared_worker_scope_by_script_url( &self, script_url: &str, ) -> Option<&SharedWorkerGlobalScopeState>

Look up a SharedWorkerGlobalScope state by the Worker’s script URL (CDP worker targetId — first match when several share a script URL).

@trace REQ-BRW-004 [entity:SharedWorkerGlobalScope] [criterion:19]

Source

pub fn set_shared_worker_scope_config( &mut self, shared_worker_id: &SharedWorkerId, config: &SharedWorkerScopeConfig, )

Set the SharedWorker scope config from the first connecting page’s StealthProfile.

DF-WK-9: SharedWorkerGlobalScope inherits the first connecting page’s StealthProfile and it remains fixed for the worker’s lifetime (per DEC-WK-007).

@trace REQ-BRW-004 [entity:SharedWorkerGlobalScope] [criterion:12..17] DF-WK-9

Source

pub fn set_controlling_service_worker(&mut self, handle: ServiceWorkerHandle)

Set the controlling ServiceWorker for this webview’s page.

A page can be controlled by at most one ServiceWorker at a time. Per DF-WK-8: When a ServiceWorker becomes activated and its scope matches the page’s URL, it becomes the controller for that page.

@trace REQ-BRW-004 [entity:ServiceWorker] [criterion:19] DF-WK-8

Source

pub fn clear_controlling_service_worker(&mut self)

Clear the controlling ServiceWorker reference for this webview.

Called on page unload or when the ServiceWorker is unregistered. Per SPEC criterion #19: “SW 持久生命周期(跨页存活)下 profile 继承注册页 且 terminate 后正确注销” — the ServiceWorker itself survives (tracked in BaoServoDelegate registry), only the per-page reference is cleared.

@trace REQ-BRW-004 [entity:ServiceWorker] [criterion:19]

Source

pub fn controlling_service_worker(&self) -> Option<&ServiceWorkerHandle>

Get a reference to the controlling ServiceWorker, if any.

@trace REQ-BRW-004 [entity:ServiceWorker]

Source

pub fn is_controlled_by_service_worker(&self) -> bool

Check if this page is controlled by a ServiceWorker.

@trace REQ-BRW-004 [entity:ServiceWorker]

Source

pub fn is_url_in_service_worker_scope(&self, url: &str) -> bool

Check if a URL falls within the controlling ServiceWorker’s scope.

Per DF-WK-8: “scope 匹配的导航/fetch 经 SW 拦截”. Returns false if no ServiceWorker is controlling this page.

@trace REQ-BRW-004 [entity:ServiceWorker] [criterion:19] DF-WK-8

Source

pub fn register_service_worker_scope( &mut self, scope: ServiceWorkerGlobalScopeState, )

Register a ServiceWorkerGlobalScope state for the controlling ServiceWorker.

@trace REQ-BRW-004 [entity:ServiceWorkerGlobalScope] DF-WK-8 / DF-WK-10

Source

pub fn service_worker_scope(&self) -> Option<&ServiceWorkerGlobalScopeState>

Get a reference to the ServiceWorkerGlobalScope state.

@trace REQ-BRW-004 [entity:ServiceWorkerGlobalScope]

Source

pub fn service_worker_scope_mut( &mut self, ) -> Option<&mut ServiceWorkerGlobalScopeState>

Get a mutable reference to the ServiceWorkerGlobalScope state.

@trace REQ-BRW-004 [entity:ServiceWorkerGlobalScope]

Source

pub fn remove_service_worker_scope( &mut self, ) -> Option<ServiceWorkerGlobalScopeState>

Remove the ServiceWorkerGlobalScope state.

@trace REQ-BRW-004 [entity:ServiceWorkerGlobalScope]

Source

pub fn forward_service_worker_fetch_event(&self, event: ServiceWorkerFetchEvent)

Forward a ServiceWorker fetch interception event to the CDP event path.

Per SPEC criterion #19: “CDP Network 域可观测 SW 发起的请求/响应”. When a ServiceWorker intercepts a fetch, this method forwards the metadata for CDP Network domain observability.

@trace REQ-BRW-004 [entity:ServiceWorker] [criterion:19] DF-WK-8

Source

pub fn set_service_worker_scope_config( &mut self, config: &ServiceWorkerScopeConfig, )

Set the ServiceWorker scope config from the registering page’s StealthProfile.

DF-WK-10: ServiceWorkerGlobalScope inherits the registering page’s profile. Per SPEC criterion #19: SW-intercepted fetch uses the same stealth profile.

@trace REQ-BRW-004 [entity:ServiceWorkerGlobalScope] [criterion:19] DF-WK-10

Trait Implementations§

Source§

impl Default for BaoWebViewState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsCtxPtr for T
where T: ?Sized,

Source§

fn as_ctx_ptr(&self) -> *mut Self
where 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> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> Filterable for T

Source§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

Convert
Source§

impl<T> MaybeBoxed<T> for T

Source§

fn maybe_boxed(self) -> T

Convert
Source§

impl<T> MaybeSendSync for T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Send for T
where T: ?Sized,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T> Sync for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more