pub struct TabProcess {
pub tab_id: TabId,
pub state: TabProcessState,
pub vm: JsVm,
pub gc: GcHeap,
pub dom_api: DomApi,
pub limits: ResourceLimits,
pub usage: ResourceUsage,
pub inbox: Vec<IpcMessage>,
pub capabilities: TabCapabilities,
pub last_error: Option<String>,
pub origin: String,
}Expand description
An isolated tab process with its own JS VM, DOM, and GC
Fields§
§tab_id: TabIdAssociated tab ID
state: TabProcessStateProcess state
vm: JsVmJavaScript virtual machine (isolated per tab)
gc: GcHeapGarbage collector (isolated per tab)
dom_api: DomApiDOM API (isolated per tab)
limits: ResourceLimitsResource limits
usage: ResourceUsageResource usage
inbox: Vec<IpcMessage>Pending IPC messages to deliver
capabilities: TabCapabilitiesCapabilities bitmap (what this tab is allowed to do)
last_error: Option<String>Last error message
origin: StringOrigin (scheme + host + port) for same-origin policy
Implementations§
Source§impl TabProcess
impl TabProcess
pub fn new(tab_id: TabId) -> Self
Sourcepub fn check_limits(&self) -> Option<TabError>
pub fn check_limits(&self) -> Option<TabError>
Check if a resource limit would be exceeded
Sourcepub fn update_usage(&mut self)
pub fn update_usage(&mut self)
Update resource usage from current state
Sourcepub fn execute_script(&mut self, source: &str) -> Result<(), TabError>
pub fn execute_script(&mut self, source: &str) -> Result<(), TabError>
Execute JavaScript in this tab’s context
Sourcepub fn set_origin(&mut self, origin: &str)
pub fn set_origin(&mut self, origin: &str)
Set the origin for same-origin checks
Sourcepub fn is_same_origin(&self, target_origin: &str) -> bool
pub fn is_same_origin(&self, target_origin: &str) -> bool
Check if a target origin matches this tab’s origin