dymokomi/luce-browser-engine
Source of release 0.6.1
0.6.1 / src / webview / module.lucb
#==============================================================================================
#
# webview - embedding the engine in an application: LibWebView and WebContent, in process
#
# DESCRIPTION:
# Ladybird splits embedding a page into two halves joined by IPC: LibWebView
# (Libraries/LibWebView: ViewImplementation, the Application's process-wide setup,
# URL.cpp's sanitize_url, SearchEngine, ErrorHTML.h) in the UI process, and WebContent
# (Services/WebContent: PageHost, PageClient, ConnectionFromClient's input queue) in a
# process per tab. The port runs the page in the application's process, so this module
# holds the parts of both that apply, with each IPC message a direct call:
#
# event_loop.lucb the Core event loop over an embedder's run loop (the adapter of
# UI/AppKit's EventLoopImplementationMacOS): timers and deferred
# invocations, a wake hook, pumping without blocking
# roots.lucb C-heap memory the collector scans (GC::ConservativeVector)
# resources.lucb the resource:// files the loader reads, written once
# platform.lucb what WebContent's main and LibWebView's Application install
# search_engine.lucb SearchEngine.cpp
# url.lucb URL.cpp: sanitize_url, location_looks_like_url
# error_page.lucb ErrorHTML.h and ViewImplementation::load_navigation_error_page
# page_client.lucb WebContent::PageClient (and PageHost's page)
# view.lucb ViewImplementation and WebContentClient: loading, history,
# viewport, what the page reported
# view_input.lucb ViewImplementation::enqueue_input_event and
# ConnectionFromClient's input queue
# view_pixels.lucb the presented frame: server_did_paint and its pixels
# view_gpu.lucb the presented display list drawn by the GPU player
# api.lucb the functions a Luce application calls
# tests_*.lucb the module's tests
#
# Every function that reaches the engine runs with the main thread VM's heap as the
# current allocator (DESIGN.md ยง3.3), and memory this module keeps in the C heap is a
# conservative root region (roots.lucb), so the managed values it holds stay alive.
#
# Copyright (c) 2020-2026, the Ladybird developers.
# Copyright (c) 2026 the luce-browser authors.
# SPDX-License-Identifier: BSD-2-Clause (see LICENSE)
#
#==============================================================================================
import c
import interop
import os
import memory
import strings
import time
import thread
from luce_std import files, math, net, paths
from luce_browser_foundation import ak, gc, web_url
from luce_browser_render import gfx, web_fonts, display_list, gpu_player
from luce_gpu import gpu
import web