Skip to main content

BaoServoDelegate

Struct BaoServoDelegate 

Source
pub struct BaoServoDelegate { /* private fields */ }

Implementations§

Source§

impl BaoServoDelegate

Source

pub fn new() -> Self

Source

pub fn last_error(&self) -> Option<String>

Source

pub fn set_console_log_tx(&self, tx: Sender<ConsoleMessage>)

Set the channel for forwarding console messages to CDP. Called when CDP server starts.

Source

pub fn console_log_tx(&self) -> Option<Sender<ConsoleMessage>>

Get a clone of the console log sender, if one has been set. Used to propagate the channel to per-webview state.

Source

pub fn set_event_tx(&self, tx: Sender<ServoEvent>)

Set the channel for forwarding structured ServoEvent to EventSubscriber (Path B). Called when CDP server starts alongside set_console_log_tx. @trace REQ-CDP-006 [entity:ServoDelegateHooks]

Source

pub fn event_tx(&self) -> Option<Sender<ServoEvent>>

Get a clone of the event sender, if one has been set. Used to propagate the channel to per-webview state. @trace REQ-CDP-006 [entity:ServoDelegateHooks]

Source

pub fn register_shared_worker( &self, handle: SharedWorkerHandle, ) -> SharedWorkerHandle

Register a SharedWorker in the global registry.

DF-WK-7: When a page creates a new SharedWorker, the handle is registered here so other pages can find it by (script_url, name). If a SharedWorker with the same id already exists, the existing handle is returned instead (constellation dedup).

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

Source

pub fn find_shared_worker( &self, script_url: &str, name: &str, ) -> Option<SharedWorkerHandle>

Find an existing SharedWorker by (script_url, name).

Returns a clone of the SharedWorkerHandle if found, None otherwise. Used when a page creates a SharedWorker and the constellation routes to an existing worker (DF-WK-7: “多页 new SharedWorker(url) 同 name → constellation 路由到同一 worker 线程”).

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

Source

pub fn reap_terminated_shared_workers(&self)

Remove terminated SharedWorkers from the registry.

Called after spin_event_loop to clean up SharedWorkers whose threads have exited and have zero connected pages.

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

Source

pub fn shared_worker_count(&self) -> usize

Returns the number of active SharedWorkers across all pages.

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

Source

pub fn route_shared_worker( &self, handle: SharedWorkerHandle, ) -> (SharedWorkerHandle, bool)

Route a SharedWorker connection request to the appropriate worker.

DF-WK-7: “多页 new SharedWorker(url) 同 name → constellation 路由到 同一 worker 线程”. If a SharedWorker with the same (script_url, name) already exists in the registry, return the existing handle (the constellation handles dedup). Otherwise, register a new SharedWorker.

Returns the handle (existing or new) and a boolean indicating whether this is a new SharedWorker (true) or a reconnection (false).

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

Source

pub fn get_or_create_shared_worker( &self, script_url: &str, name: &str, ) -> (SharedWorkerHandle, bool)

Find or create a SharedWorker for the given (script_url, name).

Convenience method combining find_shared_worker with register_shared_worker. Returns the handle and whether it was newly created.

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

Source

pub fn unregister_shared_worker(&self, id: &SharedWorkerId) -> bool

Remove a SharedWorker from the global registry by its ID.

Called when a SharedWorker has been fully terminated and has zero connected pages. This is the final cleanup step in the lifecycle.

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

Source

pub fn all_shared_workers(&self) -> Vec<SharedWorkerHandle>

Returns a snapshot of all SharedWorker handles in the registry.

Used for CDP observability and lifecycle management.

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

Source

pub fn register_service_worker( &self, handle: ServiceWorkerHandle, ) -> ServiceWorkerHandle

Register a ServiceWorker in the global registry.

DF-WK-8: “navigator.serviceWorker.register(url,{scope}) → serviceworker_manager 注册”. If a ServiceWorker with the same registration_id already exists, the existing handle is returned instead (registration dedup).

The handle captures the registering page’s StealthProfile for stealth boundary enforcement (SPEC criterion #19).

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

Source

pub fn find_service_worker( &self, script_url: &str, scope: &str, ) -> Option<ServiceWorkerHandle>

Find an existing ServiceWorker by (script_url, scope).

Returns a clone of the ServiceWorkerHandle if found, None otherwise.

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

Source

pub fn find_service_worker_for_url( &self, url: &str, ) -> Option<ServiceWorkerHandle>

Find a ServiceWorker whose scope matches the given URL.

Per DF-WK-8: “scope 匹配的导航/fetch 经 SW 拦截”. Returns the ServiceWorker whose scope prefix-matches the URL and is in the Activated state (intercepting fetches).

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

Source

pub fn reap_terminated_service_workers(&self)

Remove terminated ServiceWorkers from the registry.

Per SPEC criterion #19: “terminate 后正确注销”. Called after spin_event_loop to clean up ServiceWorkers whose threads have exited.

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

Source

pub fn service_worker_count(&self) -> usize

Returns the number of active ServiceWorker registrations across all pages.

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

Source

pub fn unregister_service_worker( &self, id: &ServiceWorkerRegistrationId, ) -> bool

Unregister a ServiceWorker by its registration ID.

Per SPEC criterion #19: “terminate 后正确注销”. This is the final cleanup step — the ServiceWorker is removed from the global registry, and its fetch interception is disabled.

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

Source

pub fn get_or_create_service_worker( &self, script_url: &str, scope: &str, stealth_profile: Option<StealthProfile>, ) -> (ServiceWorkerHandle, bool)

Find or create a ServiceWorker for the given (script_url, scope).

Convenience method combining find_service_worker with register_service_worker. Returns the handle and whether it was newly created.

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

Source

pub fn all_service_workers(&self) -> Vec<ServiceWorkerHandle>

Returns a snapshot of all ServiceWorker handles in the registry.

Used for CDP observability and lifecycle management.

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

Source

pub fn verify_service_worker_stealth_consistency( &self, page_stealth_profile: &StealthProfile, ) -> Vec<ServiceWorkerRegistrationId>

Verify stealth profile consistency for all ServiceWorker-intercepted fetches.

Per SPEC criterion #19: “SW 拦截并转发的 fetch 仍走主页同一 stealth TLS(JA3/JA4)+HTTP2(AKAMAI) profile (不绕过反指纹)”. This method checks that all active ServiceWorkers have a stealth profile consistent with the given page’s profile.

Returns a list of violations (ServiceWorker registrations where the profile doesn’t match).

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

Trait Implementations§

Source§

impl Default for BaoServoDelegate

Source§

fn default() -> Self

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

impl ServoDelegate for BaoServoDelegate

Source§

fn notify_error(&self, error: ServoError)

Notification that Servo has received a major error.
Source§

fn show_console_message(&self, level: ConsoleLogLevel, message: String)

A console message was logged by content not associated with a specific WebView. Read more
Source§

fn request_devtools_connection(&self, request: AllowOrDenyRequest)

Request a DevTools connection from a DevTools client. Typically an embedder application will show a permissions prompt when this happens to confirm a connection is allowed.
Source§

fn notify_devtools_server_started(&self, _port: u16, _token: String)

Report that the DevTools server has started on the given port. The token that be used to bypass the permission prompt from the DevTools client.
Source§

fn load_web_resource(&self, _load: WebResourceLoad)

Triggered when Servo will load a web (HTTP/HTTPS) resource. The load may be intercepted and alternate contents can be loaded by the client by calling WebResourceLoad::intercept. If not handled, the load will continue as normal. Read more
Source§

fn show_notification(&self, _notification: Notification)

Request to display a notification.

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