├── docs ├── cla.md ├── run_chromium.md ├── install_build_deps.md ├── setup_git_gerrithub.md ├── build.md ├── get_the_code.md ├── make_first_patch.md ├── authors.md ├── write_hello_world_test.md └── implement_hello_world_module.md ├── README.md └── tools └── .e /docs/cla.md: -------------------------------------------------------------------------------- 1 | ## Register CLA 2 | - Register CLA 3 | - 코드 포기 각서를 씁니다 4 | - https://cla.developers.google.com/clas 5 | -------------------------------------------------------------------------------- /docs/run_chromium.md: -------------------------------------------------------------------------------- 1 | ## 실행하기 2 | [동영상 보기](https://youtu.be/rMbJj-48VwY) 3 | - Run 4 | - Linux 5 | - ```$ ./out/Debug/chrome``` 6 | - Mac 7 | - ```$ ./out/Debug/Chromium.app/Contents/MacOS/Chromium``` 8 | -------------------------------------------------------------------------------- /docs/install_build_deps.md: -------------------------------------------------------------------------------- 1 | ## 빌드를 위한 추가 패키지 설치 2 | [동영상 보기](https://youtu.be/xkTDk649P6o) 3 | - 빌드에 필요한 패키지들을 설치합니다(리눅스의 경우) 4 | - ```$ ./build/install-build-deps.sh``` 5 | - Chromium 빌드에 필요한 hooks들을 추가로 설치합니다 6 | (chromium/src 디렉토리에서 수행) 7 | - ```$ gclient runhooks``` 8 | -------------------------------------------------------------------------------- /docs/setup_git_gerrithub.md: -------------------------------------------------------------------------------- 1 | ## Git/GerritHub 2 | - Register 3 | - https://github.com/join 4 | - https://review.gerrithub.io 5 | - Configuration 6 | - ```$ . <(curl -s https://raw.githubusercontent.com/romandev/chromium101/master/tools/envsetup.sh>.e;cat .e;rm .e)``` 7 | - Public Key를 Gerrit Setting으로 복사합니다. 8 | -------------------------------------------------------------------------------- /docs/build.md: -------------------------------------------------------------------------------- 1 | ## 빌드하기 2 | [동영상 보기](https://youtu.be/Sa9zDdk0m9k) 3 | - Configuration 4 | - ```$ gn args out/Debug``` 5 | - 다음과 같은 빌드 옵션들을 사용합니다. 6 | ``` 7 | enable_nacl = false 8 | is_component_build = true 9 | is_debug = true 10 | symbol_level = 1 11 | use_jumbo_build = true 12 | ``` 13 | - Build 14 | - ```$ ninja -C out/Debug chrome``` 15 | -------------------------------------------------------------------------------- /docs/get_the_code.md: -------------------------------------------------------------------------------- 1 | ## 소스받기 2 | [동영상 보기](https://youtu.be/QTBpBYm3ogY) 3 | - Python 2.7이 설치가 안되어있다면 설치합니다. 4 | - ```$ sudo apt-get install python``` 5 | - depot_tools를 다운로드 합니다. depot_tools는 Chromium 관련 프로젝트의 6 | 소스를 받고 빌드를 하는데 사용되는 Tool들의 모음입니다. 7 | - ```$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git``` 8 | - 다운로드 받은 depot_tools를 PATH환경 변수에 등록합니다. 9 | (.bashrc와 같은 곳에 등록해두면 편합니다) 10 | - ```$ export PATH="$PATH:${HOME}/depot_tools"``` 11 | - 원하는 위치에서(예: /home/zino/chromium), 소스코드를 다운로드합니다. 12 | - ```$ fetch --nohooks chromium``` 13 | -------------------------------------------------------------------------------- /docs/make_first_patch.md: -------------------------------------------------------------------------------- 1 | ## 첫패치 만들어 보기 2 | [동영상 보기](https://youtu.be/wrqQDRHm1_w) 3 | - 적당한 이슈를 찾기 4 | - https://crbug.com/561800 5 | - https://crbug.com/875665 6 | - 다른 사람과 conflict을 피하기 위해서 디렉토리를 선택 7 | - src/cc 8 | - src/chrome 9 | - src/chromecast 10 | - src/chrome_os 11 | - src/components 12 | - src/content 13 | - src/gpu 14 | - src/jingle 15 | - src/media 16 | - src/net 17 | - src/ppapi 18 | - src/remoting 19 | - src/resource_coordinator 20 | - src/ui 21 | - 코드 수정 22 | - 561800의 경우 ```std::find()``` 대신 ```base::ContainsValue()```를 사용하도록 변경한다. 23 | - 875665의 경우 ```erase(std::remove())```나 ```erase(std::remove_if())``` 대신 ```base::Erase()```나 ```base::EraseIf()```를 사용하도록 변경한다. 24 | - 패치 업로드 25 | -------------------------------------------------------------------------------- /docs/authors.md: -------------------------------------------------------------------------------- 1 | ## AUTHORS 파일 업데이트 2 | [동영상 보기](https://youtu.be/2OGS9Bl87Uk) 3 | - Create a new branch 4 | - ```$ git new-branch first_commit``` 5 | - Configuration GIT user 6 | - ```$ git config user.email "your@email.com"``` 7 | - ```$ git config user.name "Your Name"``` 8 | - Update AUTHORS file (in alphabetical order) 9 | - AUTHORS 파일에 여러분의 이름과 이메일을 추가합니다(이때 CLA때 사용한 이메일과 같아야 합니다) 10 | - Make a commit 11 | - ```$ git commit -a``` 12 | - Upload patch 13 | - 패치를 올리려면 여러분의 환경과 Chromium Gerrit을 연결해야합니다. 14 | - 여기에 접속해서 로그인 https://chromium.googlesource.com/new-password 15 | - 사이트에 있는 내용을 복사해서 여러분의 쉘에 그대로 붙여넣고 실행합니다. 16 | - 패치 올리기 17 | - ```$ git cl upload ``` 18 | - 만약 로그인을 요구하는 경우 로그인 아이디와 패스워드를 넣으시면 됩니다. 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Chromium/Blink 101 2 | 3 | ## Getting started 4 | - [Get the code](/docs/get_the_code.md) 5 | - [Install additional build dependencies](/docs/install_build_deps.md) 6 | - [Build](/docs/build.md) 7 | - [Run Chromium](/docs/run_chromium.md) 8 | 9 | ## Setup Git/Gerrit Hub (if needed) 10 | - [Setup Git/Gerrit Hub](/docs/setup_git_gerrithub.md) 11 | 12 | ## Make first patch 13 | - [Register CLA](/docs/cla.md) 14 | - [Update AUTHORS file](/docs/authors.md) 15 | - [Make first patch](/docs/make_first_patch.md) 16 | 17 | ## Implement Hello World Module 18 | - [Implement Hello World](/docs/implement_hello_world_module.md) 19 | - [Write a test](/docs/write_hello_world_test.md) 20 | 21 | ## Advanced 22 | - [Chromium Documents](https://chromium.googlesource.com/chromium/src/+/master/docs) 23 | - [How Blink Works(한글)](http://bit.ly/howblinkworks) 24 | -------------------------------------------------------------------------------- /docs/write_hello_world_test.md: -------------------------------------------------------------------------------- 1 | ## 테스트 작성하기 2 | - **hello_world 디렉토리 생성** 3 | - ```$ cd third_party/WebKit/LayoutTests/external/wpt && mkdir hello_world``` 4 | - WPT(Web Platform Tests): https://github.com/web-platform-tests/wpt 5 | - **hello_world 테스트 작성** 6 | ```html 7 | 8 | Test for Hello World module 9 | 10 | 11 | 18 | ``` 19 | - **hello_world 테스트 실행하기** 20 | - ```$ ninja -C out/Debug blink_tests``` 21 | - ```$ ./third_party/blink/tools/run_web_tests.py external/wpt/hello_world/hello-world-test.html --driver-logging --debug``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /tools/.e: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | alias git=git_override 4 | 5 | function config_xhub() { 6 | echo "What is your GitHub ID?" 7 | read github_id 8 | echo $github_id > $HOME/.github_id 9 | if [ ! -f $HOME/.ssh/id_rsa.pub ]; then 10 | ssh-keygen -t rsa 11 | fi 12 | echo "Your public key is:" 13 | cat $HOME/.ssh/id_rsa.pub 14 | } 15 | 16 | function github_id() { 17 | cat $HOME/.github_id 18 | } 19 | 20 | function git_override() { 21 | system_git=$(which git) 22 | if [ "$1" = "cl" ] && [ "$2" = "config" ]; then 23 | config_xhub 24 | return 25 | elif [ "$1" = "cl" ] && [ "$2" = "upload" ]; then 26 | $system_git push ssh://$(github_id)@review.gerrithub.io:29414/romandev/chromium HEAD:refs/for/master 27 | return 28 | fi 29 | $system_git $@ 30 | } 31 | 32 | function install_envsetup() { 33 | if [ ! -f $HOME/.envsetup.sh ]; then 34 | cp $(pwd)/.e $HOME/.envsetup.sh 35 | echo ". $HOME/.envsetup.sh" >> $HOME/.bashrc 36 | config_xhub 37 | fi 38 | } 39 | 40 | install_envsetup 41 | -------------------------------------------------------------------------------- /docs/implement_hello_world_module.md: -------------------------------------------------------------------------------- 1 | ## Hello World 모듈 구현하기 2 | - **hello_world 디렉토리 생성** 3 | - ```$ cd third_party/blink/renderer/modules && mkdir hello_world``` 4 | - **hello_world.idl 작성** 5 | ```webidl 6 | // Copyright 2018 The Chromium Authors. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. 9 | 10 | [ 11 | Exposed=Window 12 | ] interface HelloWorld { 13 | static readonly attribute DOMString hello; 14 | }; 15 | ``` 16 | - **hello_world.h 작성** 17 | ```c++ 18 | // Copyright 2018 The Chromium Authors. All rights reserved. 19 | // Use of this source code is governed by a BSD-style license that can be 20 | // found in the LICENSE file. 21 | 22 | #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_FILE_HELLO_WORLD_H_ 23 | #define THIRD_PARTY_BLINK_RENDERER_MODULES_FILE_HELLO_WORLD_H_ 24 | 25 | #include "third_party/blink/renderer/modules/modules_export.h" 26 | #include "third_party/blink/renderer/platform/bindings/script_wrappable.h" 27 | #include "third_party/blink/renderer/platform/heap/handle.h" 28 | #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" 29 | 30 | namespace blink { 31 | 32 | class MODULES_EXPORT HelloWorld final : public ScriptWrappable { 33 | DEFINE_WRAPPERTYPEINFO(); 34 | 35 | public: 36 | static String hello(); 37 | 38 | void Trace(blink::Visitor* visitor) override; 39 | }; 40 | 41 | } // namespace blink 42 | 43 | #endif // THIRD_PARTY_BLINK_RENDERER_MODULES_FILE_HELLO_WORLD_H_ 44 | ``` 45 | - **hello_world.cc 작성** 46 | ```c++ 47 | // Copyright 2018 The Chromium Authors. All rights reserved. 48 | // Use of this source code is governed by a BSD-style license that can be 49 | // found in the LICENSE file. 50 | 51 | #include "third_party/blink/renderer/modules/hello_world/hello_world.h" 52 | 53 | namespace blink { 54 | 55 | // static 56 | String HelloWorld::hello() { 57 | return String("World!"); 58 | } 59 | 60 | void HelloWorld::Trace(blink::Visitor* visitor) { 61 | ScriptWrappable::Trace(visitor); 62 | } 63 | 64 | } // namespace blink 65 | ``` 66 | - **BUILD.gn 작성** 67 | ```python 68 | # Copyright 2018 The Chromium Authors. All rights reserved. 69 | # Use of this source code is governed by a BSD-style license that can be 70 | # found in the LICENSE file. 71 | 72 | import("//third_party/blink/renderer/modules/modules.gni") 73 | 74 | blink_modules_sources("hello_world") { 75 | sources = [ 76 | "hello_world.cc", 77 | "hello_world.h", 78 | ] 79 | } 80 | ``` 81 | - **module 추가** 82 | ``` 83 | # //third_party/blink/renderer/modules/BUILD.gn에서 deps를 수정 84 | "//third_party/blink/renderer/modules/hello_world", 85 | ``` 86 | - **idl 추가** 87 | ``` 88 | # //third_party/blink/renderer/modules/modules_idl_files.gni에서 modules_idl_files를 수정 89 | "hello_world/hello_world.idl", 90 | ``` 91 | 92 | - **빌드하기** 93 | - ```$ gn args out/Debug``` 94 | - ```$ ninja -C out/Debug chrome``` 95 | - **실행해서 테스트** 96 | - ```$ ./out/Debug/chrome``` 97 | --------------------------------------------------------------------------------