pub struct BaoServoDelegate { /* private fields */ }Implementations§
Source§impl BaoServoDelegate
impl BaoServoDelegate
pub fn new() -> Self
pub fn last_error(&self) -> Option<String>
Sourcepub fn set_console_log_tx(&self, tx: Sender<ConsoleMessage>)
pub fn set_console_log_tx(&self, tx: Sender<ConsoleMessage>)
Set the channel for forwarding console messages to CDP. Called when CDP server starts.
Sourcepub fn console_log_tx(&self) -> Option<Sender<ConsoleMessage>>
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.
Sourcepub fn set_event_tx(&self, tx: Sender<ServoEvent>)
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]
Sourcepub fn event_tx(&self) -> Option<Sender<ServoEvent>>
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]
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
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
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]
Returns the number of active SharedWorkers across all pages.
@trace REQ-BRW-004 [entity:SharedWorker]
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
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
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]
Returns a snapshot of all SharedWorker handles in the registry.
Used for CDP observability and lifecycle management.
@trace REQ-BRW-004 [entity:SharedWorker]
Sourcepub fn register_service_worker(
&self,
handle: ServiceWorkerHandle,
) -> ServiceWorkerHandle
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
Sourcepub fn find_service_worker(
&self,
script_url: &str,
scope: &str,
) -> Option<ServiceWorkerHandle>
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
Sourcepub fn find_service_worker_for_url(
&self,
url: &str,
) -> Option<ServiceWorkerHandle>
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
Sourcepub fn reap_terminated_service_workers(&self)
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]
Sourcepub fn service_worker_count(&self) -> usize
pub fn service_worker_count(&self) -> usize
Returns the number of active ServiceWorker registrations across all pages.
@trace REQ-BRW-004 [entity:ServiceWorker]
Sourcepub fn unregister_service_worker(
&self,
id: &ServiceWorkerRegistrationId,
) -> bool
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]
Sourcepub fn get_or_create_service_worker(
&self,
script_url: &str,
scope: &str,
stealth_profile: Option<StealthProfile>,
) -> (ServiceWorkerHandle, bool)
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
Sourcepub fn all_service_workers(&self) -> Vec<ServiceWorkerHandle>
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]
Sourcepub fn verify_service_worker_stealth_consistency(
&self,
page_stealth_profile: &StealthProfile,
) -> Vec<ServiceWorkerRegistrationId>
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
impl Default for BaoServoDelegate
Source§impl ServoDelegate for BaoServoDelegate
impl ServoDelegate for BaoServoDelegate
Source§fn notify_error(&self, error: ServoError)
fn notify_error(&self, error: ServoError)
Source§fn show_console_message(&self, level: ConsoleLogLevel, message: String)
fn show_console_message(&self, level: ConsoleLogLevel, message: String)
Source§fn request_devtools_connection(&self, request: AllowOrDenyRequest)
fn request_devtools_connection(&self, request: AllowOrDenyRequest)
Source§fn notify_devtools_server_started(&self, _port: u16, _token: String)
fn notify_devtools_server_started(&self, _port: u16, _token: String)
port. The token that
be used to bypass the permission prompt from the DevTools client.Source§fn load_web_resource(&self, _load: WebResourceLoad)
fn load_web_resource(&self, _load: WebResourceLoad)
WebResourceLoad::intercept. If not handled, the load will continue as normal. Read moreSource§fn show_notification(&self, _notification: Notification)
fn show_notification(&self, _notification: Notification)
Auto Trait Implementations§
impl !Freeze for BaoServoDelegate
impl !RefUnwindSafe for BaoServoDelegate
impl !Sync for BaoServoDelegate
impl Send for BaoServoDelegate
impl Unpin for BaoServoDelegate
impl UnsafeUnpin for BaoServoDelegate
impl UnwindSafe for BaoServoDelegate
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
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