chromium-architecture

Перевод схемы архитектуры chromium

Stars
12

Chromium

Chromium - , Blink Google The Chromium Authors . Chromium Google Chrome, 60%. , , Firefox, Edge, Safari , . , Chromium Google Chrome, . Google Chrome = Chromium + Google Update + + .

Chromium / Chrome , --single-process. , , :

  1. ,         ;
    
  2.   .       IPC  Mojo.
    

2 5 ( ). Browser process ( ) . . , , Renderer process ( ). Utility process ( ), , . Linux Zygote process (). , : , , GPU process ( ).

  • Browser process

    , Browser process . , , , (, ).

Browser process , . -, Renderer thread. , . DB, File Cache , , . Process Launcher thread, , , Zygote GPU. , Browser process Worker thread ( ). ( DNS) WorkerPool. , Browser process . . . . Browser process , IPC. , . Browser process URL.

  • Zygote process

, Linux, , Zygote process. , , Renderer process. , Chromium. TaskAnnotator TaskRunner. Zygote process , , , , , . , Zygote process , , Renderer process.

 ,         .    ,    .   Chrome         .     Chrome    . ,      -  .     ,      .    exec   ,       ,      ,       .   ,    Chrome   (),     (fork)  ,      .  ,           ,     .  -   ,       ,       .
  • Renderer process

    Linux Renderer process Zygote process, , . Renderer process , ( Chrome/Chromium, Renderer process). , , - . Renderer process . : I/O thread ( -), Compositor thread ( ) Raster thread ( ). , (IPC , , ), ScriptController V8.

  • Utility process

    Linux Utility process Browser process. Utility process . . ResourceBundle, icu V8 Engine. . Utility process . , Utility process, .

  • GPU process

    , GPU. , . , GL/GLES . : , , .

  • Startup

    •  (Main)
      
    • Main ContentMain BrowserMain
    • BrowserMain MainMessageLoop
  • Threads

    • I/O thread

    • DB thread
      • sqlite
    • Cache thread

    • Worker threads
      • , (event loop)
      • , WorkerPool, ( )
      • POSIX  -POSIX-
        
  • Loop

    • MainMessageLoop

      • ,
      • IPC
        
  • IPC / Mojo

    • ,
    • MainMessageLoop
    • ,
    • ,
  • TaskAnnotator

    •  TaskAnnotator,     
      
    •   .    ,   ,     
      
  • ResourceLoader

    •  (Renderer, Worker  ..)
      
    • URLRequests
      
    • URLRequests
  • URL

    •  URL-
      
    • URL / URL-
    • URL
    • URL-
      
    • URL
    • () URL
    • Omnibox ( Chromium)
  • SQL

    • , sqlite3
    • / url
    • favicons
  • net

    • NetworkDelegate
    • URLRequest
      
    • URLRequests
    • cookie
    • cookie   URL- 
      
    • cookie URL-
    • SSL-
    • , SSL
    • SSL
  • Compositor (cc)

    • PaintFrame

      •  (, )
        
      • Aura     
        
    • Swap

      • 2D-
      • swap-
    • RasterTask

      •  :
        
        • :
        • : ,
      •    2D-
        
      • Skia,      (drawColor, drawPicture, drawRect, fillRect,  ..)
        
  • X11/Windows/Mac

    • , Chromium
  • UIEvent

    •    ui (    )
      
    •     , , mousemove, mouseclick, keypress  . .
      
    • URL- (URLBar), URLBar
    • Aura:
      • UI framework,
      •    Chrome OS / Chrome / Chromium
        
      • Chrome OS, Chrome / Chromium
      • Aura ,
  • Startup

    •  "Browser process"
      
  • Zygote

    •  Zygote-
      
  • Fork

    • Zygote- (forked), Renderer
  • Loop

    • MainMessageLoop

      • ,
      • IPC
        
  • IPC / Mojo

    • ,
    • MainMessageLoop
    • ,
    • ,
  • TaskAnnotator

    •  TaskAnnotator,     
      
    •   .    ,   ,     
      
  • callback

    •  ,     
      
  • Scheduler

    • ,
    • TaskQueueManager
      • N          .        :
        
  • blink::HTMLDocumentParser

    • HTML-
    • DOM
  • autofill

    • AutofillAgent Autofill, WebKit
    • APR (AutofillAgent per RenderFrame)
    • Autofill :
      • Autocomplete
      • ,   ,         ,   .
        
  • icu

    •  unicode         ,        
      
    • icu , ,
  • content::ResourceDispatcher

  • blink::TimerBase

  • blink::FrameLoader

    • ()
      
  • blink::EventHandler

    • , , , , ,
    • hit- (hit detection, picking, pick correlation)
  • blink::EventDispatcher

    • ,
  • blink::Document

    • blink::DocumentLoader
    • CSS (blink::StyleResolver)
  • media::DecoderStream

    • DemuxerStream , (Audio/VideoRendererImpl)
  • blink::ScriptRunner

    • JavaScript
  • content::RenderThread

    • , Renderer Zygote ( )
  • blink::V8Initializer

    •     V8
      
  • extensions

    • extensions-
    • Chrome      content-
      
  • blink::WorkerThread

    • ,
    •   WorkerThread
      
    • WorkerScriptController::initializeContextifNeeded JavaScript V8
  • Compositor (cc)

    • :
    • , ( )
  • Skia

    • Blink-
    • Skia,     (drawColor, drawPicture, drawRect, fillRect  ..)
      
  • blink::ImageDecoder

    • ImageDecoder , (, JPEGImageDecoder). ImageFrame.
  • content::WebGraphicsContext3DCommandBuffer

    • 3D
    • GpuChannelHost, :
    • IPC- GPU
    • GPU GpuChannel
    •    ,    -
      
  • RasterTask

    •  :
      
      • :
      • : ,
    • gpu::gles2::QueryTracker
  • gpu::gles2

    • QueryTracker

    • QueryManager
      • ,    ,   QueryManager   
        
    • content::CommandBufferProxyImpl
    • -, CommandBufferStub
  • Startup

    •  "Browser process" (  Zygote-)
      
  • Renderer

    • Renderer- (forked) Zygote-
  • Loop

    • MainMessageLoop

      • ,
      • IPC
  • IPC / Mojo

    • ,
    • MainMessageLoop
    • ,
    • ,
  • TaskAnnotator

    •  TaskAnnotator,     
      
    •   .    ,   ,     
      
  • Scheduler

    • , ,
    • TaskQueueManager
      • N          .        :
        
  • content::MessageRouter

    • MessageRouter , , ,
    •      , MessageRouter     ,      
      
  • content::RenderWidget

    • RenderWidget WebWidget RenderWidgetHost,
    •  OnMessageReceived
      
    •  blink::handleInputEvent
      
    • , , , tooltip, hit-
    • IPC
  • content::InputHandler

    • content::InputHandlerManager
      • InputHandlerProxy WebView
    • content::InputHandlerProxy
      • -, . InputHandlerProxy . InputHandler , WebWidget
      • Compositor
  • Compositor (cc)

    • Compositor gfx GL/GLES
  • blink::ScriptController

    • JavaScript V8ScriptRunner
  • V8

    • JavaScript- Blink
    • JavaScript

    •  DOM-
      
  • Startup

  • Utility

  • Loop

    • MainMessageLoop

      • ,
      • IPC
        
  • IPC / Mojo

    • ,
    • MainMessageLoop
    • ,
    • ,
  • Extensions

    • ExtensionsHandler
      • IPC Chrome
    • UtilityHandler
      •  IPC,   ,   
        
    • unpack extensions
      • extensions::Unpacker

        • , ,
  • ResourceBundle

    • ResourceBundle
  • icu

    • icu
    • TimeZone
  • V8Initializer

    • V8
    • V8
  • Startup

    •   GPU
      
  • Loop

    • MainMessageLoop

      • ,
      • IPC
        
  • IPC / Mojo

    • ,
    • MainMessageLoop
    • ,
    • ,
  • TaskAnnotator

    •  TaskAnnotator,     
      
    •   .    ,   ,     
      
  • GPU Command Buffer

    • IPC (, )
    • (Set/Get buffer, Flush, Create/Destroy Images ..)
  • gfx::GLSurface

    • , GL,
  • gfx::GLContext

    • OpenGL,
  • GLES2 Decoder

    • GLES2
    • GL
  • Shader, Texture, , Draw elements

    • OpenGL
    • (bind, remove, setTarget . .)
    • GLContext
      
  • Swap buffers

    • swap
    • ,