0x371 Browser

Summary of implementations and architecture related to browsers engines, in particular, blink (chromium’s engine)

Multiprocess Architecture

  • browser process: the main process which hosts UI and manages tab, plugin processes
  • renderer process: tab-specific process, can IPC with browser process, contained in sandbox (for security). Each iframe is separated into one process (site-isolation)

Memory Management

  • GC: oilpan

Renderer Model

Blink’s renderer is a stage-based engine, easy to implement partial invalidation

  • Stage 1: parse HTML into DOM tree
  • Stage 2: apply CSS style to DOM
  • Stage 3: compute layout (x, y coordinate) for each element, building layout tree
  • Stage 4: partition regions into independent layers
  • Stage 5: raster

Others

  • Chrome source code is around 25m lines (Linux kernel has 28m)