diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-02-02 12:21:57 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-02-12 08:13:00 +0000 |
commit | 606d85f2a5386472314d39923da28c70c60dc8e7 (patch) | |
tree | a8f4d7bf997f349f45605e6058259fba0630e4d7 /chromium/codelabs | |
parent | 5786336dda477d04fb98483dca1a5426eebde2d7 (diff) | |
download | qtwebengine-chromium-606d85f2a5386472314d39923da28c70c60dc8e7.tar.gz |
BASELINE: Update Chromium to 96.0.4664.181
Change-Id: I762cd1da89d73aa6313b4a753fe126c34833f046
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/codelabs')
-rw-r--r-- | chromium/codelabs/cpp101/codelab.md | 13 | ||||
-rw-r--r-- | chromium/codelabs/cpp101/factor.cc | 5 | ||||
-rw-r--r-- | chromium/codelabs/cpp101/sleep.cc | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/chromium/codelabs/cpp101/codelab.md b/chromium/codelabs/cpp101/codelab.md index 4c30533fca9..c2a9bc49cd0 100644 --- a/chromium/codelabs/cpp101/codelab.md +++ b/chromium/codelabs/cpp101/codelab.md @@ -32,22 +32,23 @@ build system to build a simple C++ binary and demonstrates how typical C++ builds are organized within Chromium. Create a new target in `base/BUILD.gn` for a new executable -named `codelab_hello_world`. Then write the classic "Hello, world!" program in +named `codelab_helloworld`. Then write the classic "Hello, world!" program in C++. You should be able to build it with -`autoninja -C out/Default codelab_hello_world` and execute it directly by +`autoninja -C out/Default codelab_helloworld` and execute it directly by finding the binary within `out/Default`. Sample execution: ```shell $ cd /path/to/chromium/src $ gclient runhooks -$ autoninja -C out/Default codelab_hello_world -$ out/Default/codelab_hello_world +$ autoninja -C out/Default codelab_helloworld +$ out/Default/codelab_helloworld Hello, world! [0923/185218.645640:INFO:hello_world.cc(27)] Hello, world! ``` ### More information +[Targets](https://gn.googlesource.com/gn/+/refs/heads/main/docs/language.md#Targets) [Git Tips](https://chromium.googlesource.com/chromium/src.git/+/main/docs/git_tips.md) and [Git Cookbook](https://chromium.googlesource.com/chromium/src.git/+/main/docs/git_cookbook.md) @@ -56,7 +57,7 @@ and [Git Cookbook](https://chromium.googlesource.com/chromium/src.git/+/main/doc ## Part 1: Using command-line arguments -We will augment our `codelab_hello_world` binary to parse command-line flags and +We will augment our `codelab_helloworld` binary to parse command-line flags and use those values to print messages to the user. Command-line arguments within Chromium are processed by the @@ -83,7 +84,7 @@ use `GetSwitchValueASCII()` and friends to retrieve values passed in. ### Exercise 1: Using command-line arguments -Change `codelab_hello_world` to take a `--greeting` and a `--name` switch. +Change `codelab_helloworld` to take a `--greeting` and a `--name` switch. The greeting, if not specified, should default to "Hello", and the name, if not specified, should default to "World". diff --git a/chromium/codelabs/cpp101/factor.cc b/chromium/codelabs/cpp101/factor.cc index effe828314f..e3b9ef29157 100644 --- a/chromium/codelabs/cpp101/factor.cc +++ b/chromium/codelabs/cpp101/factor.cc @@ -77,9 +77,8 @@ int main(int argc, char* argv[]) { run_loop.QuitClosure()); base::ThreadPool::PostTask( - FROM_HERE, - base::BindOnce(&PrintStatusUpdateRepeatedly, base::TimeTicks::Now(), - base::TimeDelta::FromSeconds(1))); + FROM_HERE, base::BindOnce(&PrintStatusUpdateRepeatedly, + base::TimeTicks::Now(), base::Seconds(1))); run_loop.Run(); diff --git a/chromium/codelabs/cpp101/sleep.cc b/chromium/codelabs/cpp101/sleep.cc index e0aec691730..3e95e906bd8 100644 --- a/chromium/codelabs/cpp101/sleep.cc +++ b/chromium/codelabs/cpp101/sleep.cc @@ -32,7 +32,7 @@ int main(int argc, char* argv[]) { } base::RunLoop run_loop; - base::TimeDelta duration = base::TimeDelta::FromSeconds(duration_seconds); + base::TimeDelta duration = base::Seconds(duration_seconds); base::SequencedTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, base::BindOnce(run_loop.QuitClosure()), duration); |