⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

TabProcess

Struct TabProcess 

Source
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: TabId

Associated tab ID

§state: TabProcessState

Process state

§vm: JsVm

JavaScript virtual machine (isolated per tab)

§gc: GcHeap

Garbage collector (isolated per tab)

§dom_api: DomApi

DOM API (isolated per tab)

§limits: ResourceLimits

Resource limits

§usage: ResourceUsage

Resource usage

§inbox: Vec<IpcMessage>

Pending IPC messages to deliver

§capabilities: TabCapabilities

Capabilities bitmap (what this tab is allowed to do)

§last_error: Option<String>

Last error message

§origin: String

Origin (scheme + host + port) for same-origin policy

Implementations§

Source§

impl TabProcess

Source

pub fn new(tab_id: TabId) -> Self

Source

pub fn start(&mut self)

Start the process

Source

pub fn suspend(&mut self)

Suspend the process (background tab)

Source

pub fn resume(&mut self)

Resume a suspended process

Source

pub fn crash(&mut self, error: &str)

Mark as crashed

Source

pub fn terminate(&mut self)

Terminate and clean up

Source

pub fn check_limits(&self) -> Option<TabError>

Check if a resource limit would be exceeded

Source

pub fn update_usage(&mut self)

Update resource usage from current state

Source

pub fn tick(&mut self) -> Result<(), TabError>

Process one tick of execution

Source

pub fn execute_script(&mut self, source: &str) -> Result<(), TabError>

Execute JavaScript in this tab’s context

Source

pub fn set_origin(&mut self, origin: &str)

Set the origin for same-origin checks

Source

pub fn is_same_origin(&self, target_origin: &str) -> bool

Check if a target origin matches this tab’s origin

Auto Trait Implementations§

§

impl Freeze for TabProcess

§

impl RefUnwindSafe for TabProcess

§

impl Send for TabProcess

§

impl Sync for TabProcess

§

impl Unpin for TabProcess

§

impl UnwindSafe for TabProcess

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.