Chromium 브라우저는 여러 프로세스가 협업하여 동작하는 프로그램이다. Chromium 브라우저를 실행한 후 작업관리자나 Sysinternals의 Process Explorer로 보면, chrome.exe 이름을 가진 프로세스가 여러 개 실행되고 있는 것을 확인할 수 있다.




프로세스의 종류로는 Browser Process 하나와 다수의 Renderer Process가 있으며, 그밖에 GPU Process, Crashpad-handler Process 등이 있다.

  • Browser Process

    • 다른 프로세스들을 생성하고 관리하는 매우 중요한 프로세스이다. 브라우저 UI를 생성 및 관리한다. 또한, 로컬 파일 생성 등과 같이 높은 권한이 필요한 일들을 처리한다.

    • Chromium 브라우저 실행 시 한개의 Browser Process가 실행된다. Win10에서 Medium Integrity Level로 실행된다.

  • Renderer Process

    • 사용자가 접속한 웹 페이지의 렌더링을 담당하는 프로세스로, Win10에서 Untrusted Integrity Level에서 실행된다. 일반적으로는 새 탭을 열 때마다 프로세스가 하나씩 생성된다고 보면 된다. 하지만, 이는 설정(Process Model)에 따라 달라질 수도 있다. 예를 들어, 각 사이트 마다 프로세스를 하나씩 생성하도록 설정할 수도 있다. Process Model은 다음 링크를 참고하면 된다.

  • GPU Process

    • 2D/3D 그래픽 처리 및 GPU 가속을 담당하는 프로세스이다. 브라우저 실행 시 하나의 프로세스만이 생성된다. Win10에서 Low Integrity Level로 실행된다.

  • Crashpad-handler Process

    • Chromium에서 에러가 발생하였을 때, 그 내용을 구글 서버로 리포트하기 위한 목적의 프로세스이다.

  • 그 밖에 Watcher Process, nacl-loader Process 등이 있다.


사용자가 chrome.exe를 실행하면 Browser Process가 실행되면서 브라우저 UI를 생성하고, 위에서 언급한 각종 프로세스들을 생성하고, 이들과의 통신을 위한 IPC 연결을 맺는 작업을 수행한다. 생성되는 각 프로세스들은 Browser Process의 자식 프로세스로 생성된다. 각 프로세스의 실행파일 이미지는 모두 chrome.exe로 동일하며, 아래와 같이 실행시 인자값(command line argument)에서 --type 옵션의 값에 따라 프로세스의 타입이 결정된다. 참고로 Browser Process는 --type 옵션 값이 설정되지 않는다.

  • Browser process 

    • "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

  • Renderer process

    • "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=renderer --field-trial-handle=1432 --primordial-pipe-token=A2FF2A35419BA2C3B79B412E5C19902E --lang=ko --enable-offline-auto-reload --enable-online-auto-reload-visible-only --blink-settings=disallowFetchForDocWrittenScriptsInMainFrame=false,disallowFetchForDocWrittenScriptsInMainFrameOnSlowConnections=true --enable-pinch --device-scale-factor=1 --num-raster-threads=2 --enable-main-frame-before-activation --content-image-texture-target=0,0,3553;0,1,3553;0,2,3553;0,3,3553;0,4,3553;0,5,3553;0,6,3553;0,7,3553;0,8,3553;0,9,3553;0,10,3553;0,11,3553; 0,12,3553;0,13,3553;0,14,3553;0,15,3553;0,16,3553;1,0,3553;1,1,3553;1,2,3553;1,3,3553;1,4,3553;1,5,3553;1,6,3553;1,7,3553;1,8,3553;1,9,3553;1,10,3553;1,11,3553;1,12,3553;1,13,3553;1,14,3553;1,15,,3553;1,16,3553;2,0,3553;2,1,3553;2,2,3553;2,3,3553;2,4,3553;2,5,3553;2,6,3553;2,7,3553;2,8,3553;2,9,3553;2,10,3553;2,11,3553;2,12,3553;2,13,3553;2,14,3553;2,15,3553;2,16,3553;3,1,3553;3,2,3553;3,3,3553;3,4,3553;3,5,3553;3,6,3553;3,7,3553;3,8,3553;3,9,3553;3,10,3553;3,11,3553;3,12,3553;3,13,3553;3,14,3553;3,15,3553;3,16,3553;4,0,3553;4,1,3553;4,2,3553;4,3,3553;4,4,3553;4,5,3553;4,6,3553;4,7,3553;4,8,3553;4,9,3553;4,10,3553;4,11,3553;4,12,3553;4,13,3553;4,14,3553;4,15,3553;4,16,3553; --service-request-channel-token=A2FF2A35419BA2C3B79B412E5C19902E --renderer-client-id=6 --mojo-platform-channel-handler=4676 /prefetch:1

  • GPU process

    • "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=gpu-process --field-trial-handle=1432 --supports-dual-gpus=false --gpu-driver-bug-workarounds=7,10,11,20,24,26,43,63,76 --disable-gl-extensions="GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent" --gpu-vendor-id=0x8086 --gpu-device-id=0x1616 --gpu-driver-vendor="Intel Corporation" --gpu-driver-version=20,19,1,5,4352 --gpu-driver-date=12-15-2015 --service-request-channel-token=B6CC1F101E9A13FBDF51DF3022554601 --mojo-platform-channel-handle=1448 --ignored=" --type=renderer " /prefetch:2

  • Crashpad-handler process

    • "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=crashpad-handler /prefetch:7 --monitor-self-annotation=ptype=crashpad-handler "--database=C:\Users\John\AppData\Local\Google\Chrome\User Data\Crashpad" "--metrics-dir=C:\Users\John\AppData\Local\Google\Chrome\User Data" --url=https://clients2.google.com/cr/report --annotation=channel= --annotation=plat=Win64 --annotation=prod=Chrome --annotation=ver=59.0.3071.115 --initial-client-data=0x1f0,0x1f4,0x1f8,0x1ec,0x1fc,0x7ff947f419d,0,0x7ff947f419b8,0x7ff947f419e8

  • Watcher process

    • "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --type=watcher --main-thread-id=3480 --on-initialized-event-handle=688 --parent-handle=692 /prefetch:6


Posted by chromium
,

아래 링크에 적힌 내용을 그대로 따라하면 된다.

https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md


Windows 10 SDK 설치 시, 10.0.15063.468 버전을 설치해줘야 컴파일 에러가 나지 않았다.

(이보다 더 최신 버전 설치 시 컴파일 에러 발생)


상기 링크 내용을 그대로 따라하면 Debug 모드로 컴파일 된다.

Release 모드로 컴파일 하고 싶다면, 아래 명령어를 수행한다.


gn gen out\Release "--args=is_debug=false target_cpu=\"x64\""



Posted by chromium
,