Skip to main content

Module lifecycle

Module lifecycle 

Source
Expand description

Cooperative cancel and FINALIZE ledger. One-shot lifecycle: INIT → EXECUTE → FINALIZE → EXIT.

§Flow

  1. Lifecycle::new creates cancel token and resource ledger
  2. Commands may mark Chrome PID / profile in ResourceLedger
  3. Lifecycle::finalize is idempotent and safe to call multiple times
  4. Drop also calls finalize as a safety net

§Safety

On Unix, finalize may send SIGTERM/SIGKILL to a recorded Chrome PID as last resort when primary Browser.close reap did not clear the ledger. Profile dirs and Chrome Singleton side-channels are wiped only when recorded in this ledger (never a host-wide chrome wipe).

Structs§

Lifecycle
Runtime token for cooperative cancel and FINALIZE.
ResourceLedger
Ledger of resources owned by this invocation (browser, profile, temp dirs).

Functions§

mark_profile_dir
Record a temporary Chrome profile directory on the ledger for FINALIZE wipe.
mark_side_channel
Record a side-channel path (SingletonLock, etc.) owned by this launch.