### Build and Install libyuv with CMake (Release) - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Configures and builds the libyuv library using CMake for a release build, specifying an install prefix. Then, installs the built library using 'sudo cmake --build . --target install'. ```shell mkdir out cd out cmake -DCMAKE_INSTALL_PREFIX="/usr/lib" -DCMAKE_BUILD_TYPE="Release" .. cmake --build . --config Release sudo cmake --build . --target install --config Release ``` -------------------------------- ### Install Dependencies for ARM Cross Compile - Linux - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Installs necessary packages using apt-get on a Debian/Ubuntu system to set up an environment for cross-compiling for ARM architecture, including compilers, build tools, and libraries. ```shell sudo apt-get install ssh dkms build-essential linux-headers-generic sudo apt-get install kdevelop cmake git subversion sudo apt-get install graphviz doxygen doxygen-gui sudo apt-get install manpages manpages-dev manpages-posix manpages-posix-dev sudo apt-get install libboost-all-dev libboost-dev libssl-dev sudo apt-get install rpm terminator fish sudo apt-get install g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf ``` -------------------------------- ### Running Intel SDE Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Commands to run libyuv unit tests under the Intel Software Development Emulator (SDE) on Windows and Linux. Requires Intel SDE installation. ```Command Prompt c:\intelsde\sde -hsw -- out\Release\libyuv_unittest.exe --gtest_filter=* ``` ```Bash ~/intelsde/sde -skx -- out/Release/libyuv_unittest --gtest_filter=**I420ToARGB_Opt ``` -------------------------------- ### Example Installation to /usr/local Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libjpeg_turbo/BUILDING.md An example command demonstrating how to install libjpeg-turbo header files in `/usr/local/include` and library files in `/usr/local/lib64`. ```Shell make install prefix=/usr/local libdir=/usr/local/lib64 ``` -------------------------------- ### Basic HTTP Server Setup and Routing in C++ Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/third_party/cpp-httplib/cpp-httplib/README.md Demonstrates how to create a basic HTTP server using cpp-httplib, define GET routes for static paths and paths with regular expressions, and start listening on a specific host and port. ```C++ #include int main(void) { using namespace httplib; Server svr; svr.Get("/hi", [](const Request& req, Response& res) { res.set_content("Hello World!", "text/plain"); }); svr.Get(R"(/numbers/(\d+))", [&](const Request& req, Response& res) { auto numbers = req.matches[1]; res.set_content(numbers, "text/plain"); }); svr.listen("localhost", 1234); } ``` -------------------------------- ### Linking PDFium Libraries (Shell) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/pdfium/docs/getting-started.md This shell command provides an example build line for linking the necessary static PDFium libraries when compiling an application. It includes common libraries and platform-specific flags like -framework AppKit for macOS and -lstdc++ for C++ dependencies. ```Shell PDF_LIBS="-lpdfium -lfpdfapi -lfxge -lfpdfdoc -lfxcrt -lfx_agg \ -lfxcodec -lfx_lpng -lfx_libopenjpeg -lfx_lcms2 -lfx_freetype -ljpeg \ -lfdrm -lpwl -lbigint -lformfiller -ljavascript -lfxedit" PDF_DIR= clang -I $PDF_DIR/public -o init init.c -L $PDF_DIR/out/Debug -lstdc++ -framework AppKit $PDF_LIBS ``` -------------------------------- ### Build RapidJSON Project with Make Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qt3d/src/3rdparty/assimp/contrib/rapidjson/readme.md Executes the build process using the Make utility. This command compiles the RapidJSON library, examples, and tests based on the Makefiles generated by CMake. ```Shell make ``` -------------------------------- ### Install FFmpeg Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/ffmpeg/INSTALL.md Installs the compiled FFmpeg binaries and libraries to the system. ```Shell make install ``` -------------------------------- ### Get libyuv Source with gclient Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Use gclient to configure a working directory and sync the libyuv source code repository from Chromium's Git server. This method is recommended for building as it handles dependencies. ```Shell gclient config --name src https://chromium.googlesource.com/libyuv/libyuv gclient sync ``` -------------------------------- ### Getting PDFium Code - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/pdfium/README.md Commands to create a directory, navigate into it, configure gclient to fetch the PDFium repository, synchronize the code, and change into the downloaded pdfium directory. ```Shell mkdir repo cd repo gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git gclient sync cd pdfium ``` -------------------------------- ### Run libyuv Unittests - Windows - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Executes the libyuv_unittest executable on Windows, disabling exception catching and running all tests. ```shell out\Release\libyuv_unittest.exe --gtest_catch_exceptions=0 --gtest_filter="*" ``` -------------------------------- ### Install Project Node Dependencies - Bash Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/web-animations-js/sources/CONTRIBUTING.md Installs the project's development dependencies listed in the package.json file using npm. This should be run in the repository root after cloning. ```Bash npm install ``` -------------------------------- ### Example BUILD.gn File Structure Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/gn/docs/style_guide.md This snippet provides an example demonstrating the recommended structure for a BUILD.gn file, including the placement and naming conventions for configs, the main target matching the directory name, and associated test targets. ```GN # Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Config for foo is named foo_config and immediately precedes it in the file. config("foo_config") { } # Target matching path name is the first target. executable("foo") { } # Test for foo follows it. test("foo_unittests") { } config("bar_config") { } source_set("bar") { } ``` -------------------------------- ### Run libyuv Unittests as Benchmark - Android - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Executes the libyuv_unittest test suite on Android with additional arguments to configure it for benchmarking, specifying dimensions, repeat count, and flags. ```shell build/android/test_runner.py gtest -s libyuv_unittest -t 7200 --verbose --release --gtest_filter=* -a "--libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=999 --libyuv_flags=-1 --libyuv_cpu_info=-1" ``` -------------------------------- ### Configure .gclient for Android Build - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Adds the 'android' target OS to the .gclient configuration file, enabling Android-specific build steps for the project. ```shell target_os=['android']; ``` -------------------------------- ### Building with Sanitizers Enabled Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Commands using gn and ninja to configure and build the project with a specific sanitizer (msan) enabled. Lists available sanitizers. ```Shell gn gen out/Release "--args=is_debug=false is_msan=true" ``` ```Shell ninja -v -C out/Release ``` -------------------------------- ### Build, Install, and Run SkQP APK (Shell) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/skia/tools/skqp/README.md Builds the SkQP Android application package (APK) using a platform tool, installs the APK onto a connected Android device using adb, clears the device's logcat buffer, and starts the SkQP test runner using adb shell instrument. ```Shell platform_tools/android/bin/android_build_app -C out/skqp-arm skqp adb install -r out/skqp-arm/skqp.apk adb logcat -c adb shell am instrument -w org.skia.skqp ``` -------------------------------- ### Build libyuv Packages with CMake - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Configures and builds the libyuv library using CMake for a release build, then uses 'make package' to create RPM/DEB distribution packages. ```shell mkdir out cd out cmake -DCMAKE_BUILD_TYPE=Release .. make -j4 make package ``` -------------------------------- ### Run libyuv Unittests - Android - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Executes the libyuv_unittest test suite on an Android device using the build system's test runner script with options for verbosity, timeout, and release configuration. ```shell build/android/test_runner.py gtest -s libyuv_unittest -t 7200 --verbose --release --gtest_filter=* ``` -------------------------------- ### Configure FFmpeg Build Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/ffmpeg/INSTALL.md Runs the configuration script to prepare the build environment. Use `--help` for options. Can be run out-of-tree using an absolute path. ```Shell ./configure ``` -------------------------------- ### Build libyuv with Make - Linux - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Compiles the libyuv library on Linux using the provided Makefile (linux.mk). Includes commands for verbose build, cleaning, and specifying the C++ compiler. ```shell make V=1 -f linux.mk ``` ```shell make V=1 -f linux.mk clean ``` ```shell make V=1 -f linux.mk CXX=clang++ ``` -------------------------------- ### Install RapidJSON System-Wide with Make Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qt3d/src/3rdparty/assimp/contrib/rapidjson/readme.md Installs the RapidJSON library files to the system's standard include and library directories. This command requires administrative privileges and makes RapidJSON available for other projects system-wide. ```Shell make install ``` -------------------------------- ### Build libyuv with GN/Ninja - Android ia32 - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Generates build files using GN and compiles the libyuv_unittest target using Ninja for the Android ia32 architecture in both debug and release configurations. ```shell gn gen out/Release "--args=is_debug=false target_os=\"android\" target_cpu=\"x86\"" gn gen out/Debug "--args=is_debug=true target_os=\"android\" target_cpu=\"x86\"" ninja -v -C out/Debug libyuv_unittest ninja -v -C out/Release libyuv_unittest ``` -------------------------------- ### Building and Running with Ninja Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/gn/docs/quick_start.md Commands to build the 'say_hello' target in the 'out/Default' directory using Ninja and then execute the resulting binary. Demonstrates the typical build and run workflow. ```Shell > ninja -C out/Default say_hello ninja: Entering directory 'out/Default' [1/1] Regenerating ninja files [4/4] LINK say_hello > out/Default/say_hello Hello, Bill and Joy. ``` -------------------------------- ### Install Build Dependencies - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/pdfium/README.md Executes a script to install necessary build dependencies for PDFium. This command should be run from within the 'pdfium' source directory. ```Shell ./build/install-build-deps.sh ``` -------------------------------- ### Build libyuv with GN/Ninja - Android armv7 - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Generates build files using GN and compiles the libyuv_unittest target using Ninja for the Android armv7 architecture in both debug and release configurations. ```shell gn gen out/Release "--args=is_debug=false target_os=\"android\" target_cpu=\"arm\"" gn gen out/Debug "--args=is_debug=true target_os=\"android\" target_cpu=\"arm\"" ninja -v -C out/Debug libyuv_unittest ninja -v -C out/Release libyuv_unittest ``` -------------------------------- ### Build Specific libyuv Targets with Ninja - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Compiles individual targets of the libyuv project (libyuv, libyuv_unittest, compare, yuvconvert, psnr, cpuid) using the Ninja build system in debug configuration. ```shell ninja -C out/Debug libyuv ninja -C out/Debug libyuv_unittest ninja -C out/Debug compare ninja -C out/Debug yuvconvert ninja -C out/Debug psnr ninja -C out/Debug cpuid ``` -------------------------------- ### Build libyuv with GN/Ninja - Android arm64 - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Generates build files using GN and compiles the libyuv_unittest target using Ninja for the Android arm64 architecture in both debug and release configurations. ```shell gn gen out/Release "--args=is_debug=false target_os=\"android\" target_cpu=\"arm64\"" gn gen out/Debug "--args=is_debug=true target_os=\"android\" target_cpu=\"arm64\"" ninja -v -C out/Debug libyuv_unittest ninja -v -C out/Release libyuv_unittest ``` -------------------------------- ### C/C++ Documentation Comment Example (Go Style) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/STYLE.md Provides an example of the Go-style documentation comment used for public C/C++ symbols in BoringSSL, starting with the symbol name and using pipes for references. ```C // EVP_DigestVerifyUpdate appends |len| bytes from |data| to the data which // will be verified by |EVP_DigestVerifyFinal|. It returns one on success and // zero otherwise. OPENSSL_EXPORT int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *data, size_t len); ``` -------------------------------- ### Getting Started with GN Build System (Shell) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/gn/README.md Clones the GN repository from Google Source, navigates into the directory, generates build files using the Python script, and builds the project using Ninja. ```Shell git clone https://gn.googlesource.com/gn ``` ```Shell cd gn ``` ```Shell python build/gen.py ``` ```Shell ninja -C out ``` -------------------------------- ### Build libyuv with GN/Ninja - ARM Linux - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Generates build files using GN and compiles the libyuv_unittest target using Ninja for ARM Linux architecture (arm64) in both debug and release configurations. ```shell gn gen out/Release "--args=is_debug=false target_cpu=\"arm64\"" gn gen out/Debug "--args=is_debug=true target_cpu=\"arm64\"" ninja -v -C out/Debug libyuv_unittest ninja -v -C out/Release libyuv_unittest ``` -------------------------------- ### Getting GN Help (Shell) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/angle/doc/DevSetup.md This command displays help information and available options for the GN build system. ```Shell gn help ``` -------------------------------- ### Install Grunt CLI Globally - Bash Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/web-animations-js/sources/CONTRIBUTING.md Installs the Grunt command-line interface and Grunt task runner globally using npm. This allows executing Grunt tasks from any directory in the terminal. ```Bash npm install -g grunt grunt-cli ``` -------------------------------- ### Inserting Intel IACA Macros Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md These macros are inserted into assembly code to mark the start and end of a section to be analyzed by the Intel Architecture Code Analyzer (IACA). ```Assembly IACA_ASM_START ``` ```Assembly IACA_ASM_END ``` -------------------------------- ### Running Shaderc Tool in Docker - Bash Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/shaderc/src/README.md Example command to run a specific Shaderc tool (glslc) inside a Docker container and check its version. ```Bash docker run shaderc/shaderc glslc --version ``` -------------------------------- ### Running discard_server Windows Example Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/usrsctp/usrsctplib/Manual.md Example command to start the discard server on Windows with specific local and remote UDP encapsulation ports. ```Windows Command Prompt discard_server.exe 11111 22222 ``` -------------------------------- ### Running Intel IACA Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Command to run the Intel Architecture Code Analyzer (IACA) on a compiled object file containing the IACA macros. Requires building the code first. ```Bash ~/iaca-lin64/bin/iaca.sh -reduceout -arch HSW out/Release/obj/libyuv_internal/compare_gcc.o ``` -------------------------------- ### Run Specific libyuv Unittest - macOS/Linux - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Executes a specific libyuv unittest on macOS or Linux by providing its name or a pattern to the --gtest_filter flag. ```shell out/Release/libyuv_unittest --gtest_filter=*I420ToARGB_Opt ``` -------------------------------- ### Example Vulnerable Function (Buffer Underwrite) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/testing/libfuzzer/getting_started.md A hypothetical C++ function illustrating a buffer underwrite vulnerability. This example is used to demonstrate how improper handling of fuzz input data (specifically, not copying it to a separate buffer) can prevent sanitizers from detecting such issues. ```cpp void APIToBeFuzzed(uint8_t* buffer, size_t length, uint8_t options) { ... if (options == 0x66) { // Yes, looks ridiculous, but things like that did happen in the real world. *(buffer - 1) = -1; } ... } ``` -------------------------------- ### Example CMakeLists.txt Head Configuration Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/docs/clion_dev.md Provides an example of the expected structure for the beginning of the `CMakeLists.txt` file after modifications. It shows the minimum required CMake version, project name, C++ standard, build type, include directories, and the start of the executable definition. ```CMake cmake_minimum_required(VERSION 3.10) project(chromium) set(CMAKE_CXX_STANDARD 11) set(CMAKE_BUILD_TYPE Debug) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) add_executable(chromium ...) ``` -------------------------------- ### Displaying Setup Script Help (Shell) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/modules/bluetooth/testing/clusterfuzz/README.md This command executes the setup.py script with the -h flag to display its help message, showing available options for local development or generating a ClusterFuzz package. ```sh python setup.py -h ``` -------------------------------- ### Setting up and Running Docserver Locally (Initial) - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/skia/site/dev/tools/markdown.md Commands to install the docserver Go tool, navigate to the source directory, build the tool, and run the server locally for previewing documentation changes. Requires Go and Node.js. ```Shell go get -u go.skia.org/infra/doc/go/docserver cd $GOPATH/src/go.skia.org/infra/doc make docserver --preview --local ``` -------------------------------- ### Running client Windows Example Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/usrsctp/usrsctplib/Manual.md Example command to start the client on Windows, connecting to a server at 192.168.0.1:9 using UDP encapsulation with specified ports. ```Windows Command Prompt client.exe 192.168.0.1 9 0 22222 11111 ``` -------------------------------- ### SessionRateImpact Examples - Configuration Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/components/feature_engagement/README.md Provides examples for the SessionRateImpact configuration, showing how to specify `all`, `none`, or a comma-separated list of feature names. ```Configuration all none IPH_DownloadHome IPH_DonwloadPage,IPH_DownloadHome ``` -------------------------------- ### Install Bootstrap Dependencies on Ubuntu/Debian (apt-get) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/harfbuzz-ng/src/BUILD.md Installs tools required for bootstrapping from git, including autoconf, automake, libtool, pkg-config, ragel, and gtk-doc-tools using apt-get on Ubuntu or Debian. ```bash sudo apt-get install autoconf automake libtool pkg-config ragel gtk-doc-tools ``` -------------------------------- ### Example package.json Version Field - JSON Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/web-animations-js/sources/CONTRIBUTING.md Illustrates how the version number is specified within the package.json file. This field is crucial for managing releases and publishing to npm. ```JSON { "version": "3.13.37" } ``` -------------------------------- ### Canceling a Scheduled Task in Java Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/components/background_task_scheduler/README.md Shows how to cancel a task that has been previously scheduled. This is done by getting the scheduler instance and calling the cancel method, passing the unique ID of the task to be canceled. ```Java BackgroundTaskSchedulerFactory.getScheduler().cancel(TaskIds.YOUR_FEATURE); ``` -------------------------------- ### GN args Command Examples - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/gn/docs/reference.md Provides practical examples demonstrating how to use the 'gn args' command to open the editor for a specific build directory, list arguments with different options (--list, --short, --overrides-only), list a single argument, and list arguments with temporary overrides via the --args flag. ```Shell gn args out/Debug Opens an editor with the args for out/Debug. gn args out/Debug --list --short Prints all arguments with their default values for the out/Debug build. gn args out/Debug --list --short --overrides-only Prints overridden arguments for the out/Debug build. gn args out/Debug --list=target_cpu Prints information about the "target_cpu" argument for the " "out/Debug build. gn args --list --args="os=\"android\" enable_doom_melon=true" Prints all arguments with the default values for a build with the given arguments set (which may affect the values of other arguments). ``` -------------------------------- ### Running Dr Memory Memcheck (Windows) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Command to run the Dr Memory tool on the libyuv unit test executable for memory checking on Windows. Requires Dr Memory installation and adding it to the path. ```Command Prompt drmemory out\Debug\libyuv_unittest.exe --gtest_catch_exceptions=0 --gtest_filter=* ``` -------------------------------- ### Setup for Building and Testing Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/devtools-node-modules/third_party/node_modules/fast-levenshtein/README.md Installs the necessary global grunt-cli and project dependencies required to build and test the fast-levenshtein library. ```bash $ npm install -g grunt-cli $ npm install ``` -------------------------------- ### Creating a One-Off TaskInfo in Java Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/components/background_task_scheduler/README.md Demonstrates how to use the TaskInfo builder to create a configuration for a task that should execute only once after a specified delay. This example sets the task ID, the task class, and the execution delay. ```Java TaskInfo.createOneOffTask(TaskIds.YOUR_FEATURE, MyBackgroundTask.class, TimeUnit.MINUTES.toMillis(200)).build(); ``` -------------------------------- ### Cross-Compile and Disassemble psnr Tool - ARM Linux - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Uses the ARM cross-compiler (arm-linux-gnueabihf-g++) to build the psnr utility from source files and then uses the corresponding objdump tool to disassemble the resulting executable. ```shell cd util arm-linux-gnueabihf-g++ psnr_main.cc psnr.cc ssim.cc -o psnr arm-linux-gnueabihf-objdump -d psnr ``` -------------------------------- ### Initialize Git Submodules for RapidJSON Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qt3d/src/3rdparty/assimp/contrib/rapidjson/readme.md Updates and initializes Git submodules required by RapidJSON, such as googletest, to ensure all dependencies are available for the build process. ```Shell git submodule update --init ``` -------------------------------- ### Build After Version Update - Bash Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/web-animations-js/sources/CONTRIBUTING.md Runs npm install to update dependencies and then executes the Grunt build task. This ensures the build artifacts reflect the new version before publishing. ```Bash npm install && grunt ``` -------------------------------- ### Run PDFium Test Program - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/pdfium/README.md Executes the compiled 'pdfium_test' program from the build output directory. This example shows how to use the --ppm flag to rasterize a PDF file to PPM images. ```Shell /pdfium_test --ppm path/to/myfile.pdf ``` -------------------------------- ### Creating a Periodic TaskInfo in Java Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/components/background_task_scheduler/README.md Shows how to use the TaskInfo builder to create a configuration for a task that should execute repeatedly at a defined interval. This example sets the task ID, the task class, and the periodic interval. ```Java TaskInfo.createPeriodicTask(TaskIds.YOUR_FEATURE, MyBackgroundTask.class, TimeUnit.MINUTES.toMillis(200)).build(); ``` -------------------------------- ### Comparator Examples - Configuration Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/components/feature_engagement/README.md Illustrates valid formats for the comparator part of configurations, showing examples with values (`>=10`, `==0`, `<15`) and the special `any` comparator. ```Configuration >=10 ==0 any <15 ``` -------------------------------- ### Adding Constraints to TaskInfo in Java Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/components/background_task_scheduler/README.md Illustrates how to set additional constraints on a TaskInfo using builder methods. This example shows how to require the device to be charging and specify a required network type (unmetered) before building the task configuration. ```Java TaskInfo.createOneOffTask(TaskIds.YOUR_FEATURE, MyBackgroundTask.class, TimeUnit.MINUTES.toMillis(100) TimeUnit.MINUTES.toMillis(200)) .setRequiresCharging(true) .setRequiredNetworkType(TaskInfo.NETWORK_TYPE_UNMETERED) .build(); ``` -------------------------------- ### Define and Apply Configuration - GN Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/gn/docs/reference.md This example illustrates how to define a configuration object named 'myconfig' with include directories and defines, and then apply this configuration to an 'executable' target named 'mything' using the `configs` list. ```GN config("myconfig") { includes = [ "include/common" ] defines = [ "ENABLE_DOOM_MELON" ] } executable("mything") { configs = [ ":myconfig" ] } ``` -------------------------------- ### Build libyuv with GN/Ninja - Android mips - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Generates build files using GN and compiles the libyuv_unittest target using Ninja for the Android mips architecture with specific flags for R6, MSA, component build, and Clang. ```shell gn gen out/Release "--args=is_debug=false target_os=\"android\" target_cpu=\"mips64el\" mips_arch_variant=\"r6\" mips_use_msa=true is_component_build=true is_clang=true" gn gen out/Debug "--args=is_debug=true target_os=\"android\" target_cpu=\"mips64el\" mips_arch_variant=\"r6\" mips_use_msa=true is_component_build=true is_clang=true" ninja -v -C out/Debug libyuv_unittest ninja -v -C out/Release libyuv_unittest ``` -------------------------------- ### Run Grunt Debug (Specific Test File) - Bash Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/web-animations-js/sources/CONTRIBUTING.md Starts the Karma test server in debug mode for a specified polyfill target and one or more test files. Multiple files can be listed separated by commas. ```Bash grunt debug:web-animations-next:test/web-platform-tests/web-animations/animation/pause.html ``` -------------------------------- ### Hosting Turbolizer Locally with Python Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/v8/tools/turbolizer/README.md Steps to navigate to the Turbolizer directory and start a simple local web server using Python's SimpleHTTPServer module to host the built files. ```shell cd src/tools/turbolizer python -m SimpleHTTPServer 8000 ``` -------------------------------- ### Run Grunt Debug (Interactive Mode) - Bash Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/web-animations-js/sources/CONTRIBUTING.md Starts the Karma test server in an interactive debug mode. This allows developers to run tests in a browser and inspect results using the browser's developer tools. ```Bash grunt debug ``` -------------------------------- ### Common DM Command Line Flags (Shell) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/skia/site/dev/testing/testing.md Provides examples of various command-line flags available for the DM tool, including getting help, filtering by source or CPU/GPU, matching names, and performing a dry run without actual execution. ```sh out/Debug/dm --help # Print all flags, their defaults, and a brief explanation of each. out/Debug/dm --src tests # Run only unit tests. out/Debug/dm --nocpu # Test only GPU-backed work. out/Debug/dm --nogpu # Test only CPU-backed work. out/Debug/dm --match blur # Run only work with "blur" in its name. out/Debug/dm --dryRun # Don't really do anything, just print out what we'd do. ``` -------------------------------- ### Generating Ninja Files with mb gen Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/webrtc/tools_webrtc/mb/docs/user_guide.md Examples demonstrating how to use the `mb gen` command to generate Ninja build files. The first example uses the master and builder flags, while the second uses the config flag to specify the build configuration. The path must be a GN-style source-absolute path. ```Shell % mb gen -m tryserver.chromium.linux -b linux_rel //out/Release % mb gen -c linux_rel_trybot //out/Release ``` -------------------------------- ### Installing Fiddle CLI Tool (Shell) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/skia/site/user/api/usingBookmaker.md Command to install the fiddle command-line interface tool using Go get. ```Shell $ go get go.skia.org/infra/fiddlek/go/fiddlecli ``` -------------------------------- ### Build libyuv with CMake (Debug) - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Configures and builds the libyuv library using CMake for a default debug build. Creates an 'out' directory, runs cmake to generate build files, and then builds the project. ```shell mkdir out cd out cmake .. cmake --build . ``` -------------------------------- ### Interactive supersize Console Session (Python) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/tools/binary_size/README.md Examples of commands and queries that can be run within the interactive Python console started by `supersize console`. Demonstrates exploring symbols, filtering, sorting, disassembling, getting help, and extracting string literals. Operates on the loaded size information object (`size_info`). ```Python >>> ShowExamples() # Get some inspiration. ... >>> sorted = size_info.symbols.WhereInSection('t').Sorted() >>> Print(sorted) # Have a look at the largest symbols. ... >>> sym = sorted.WhereNameMatches('TrellisQuantizeBlock')[0] >>> Disassemble(sym) # Time to learn assembly. ... >>> help(canned_queries) ... >>> Print(canned_queries.TemplatesByName(depth=-1)) ... >>> syms = size_info.symbols.WherePathMatches(r'skia').Sorted() >>> Print(syms, verbose=True) # Show full symbol names with parameter types. ... >>> # Dump all string literals from skia files to "strings.txt". >>> Print((t[1] for t in ReadStringLiterals(syms)), to_file='strings.txt') ``` -------------------------------- ### Configure Chromium Build with libFuzzer and ASan (Bash) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/testing/libfuzzer/getting_started.md Use the `gn gen` command to configure the Chromium build files. This example enables libFuzzer (`use_libfuzzer=true`), Address Sanitizer (`is_asan=true`), disables debug symbols (`is_debug=false`), and disables NaCl (`enable_nacl=false`). The `--check` flag performs a configuration check. ```bash gn gen out/libfuzzer '--args=use_libfuzzer=true is_asan=true is_debug=false enable_nacl=false' --check ``` -------------------------------- ### Example Bot Configuration Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/docs/ios/infra.md A basic example illustrating the top-level structure of a bot configuration file, including optional comments, required GN arguments, and a list of tests to execute. ```json { "comments": [ "Sample config for a bot." ], "gn_args": [ "is_debug=true", "target_cpu=\"x64\"" ], "tests": [ { "app": "ios_chrome_unittests", "device type": "iPhone 5s", "os": "11.0", "xcode build version": "9A235" } ] } ``` -------------------------------- ### Get Collider Dependencies (Bash) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_tools/testing/README.md Sets the GOPATH and uses 'go get' to download the dependencies for the collidermain package without installing them. ```bash GOPATH="$(pwd)/src" go get -d collidermain ``` -------------------------------- ### Generating Help Text Output Example (Text) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/devtools-node-modules/third_party/node_modules/optionator/README.md Provides an example of the formatted help text string generated by the `generateHelp` method based on the options defined during Optionator initialization. ```text "Usage: cmd [options] positional -h, --help displays help -c, --count Int number of things Version 1.0.0 " ``` -------------------------------- ### Install caller-path Package Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/devtools-node-modules/third_party/node_modules/caller-path/readme.md Installs the 'caller-path' package using npm, saving it as a dependency in the project's 'package.json' file. ```Shell $ npm install --save caller-path ``` -------------------------------- ### Starting a Local Server for HTML Report (Bash) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/tools/binary_size/README.md Examples showing how to use the `supersize start_server` command to launch a local web server for viewing the HTML report data file generated by `html_report`. Includes setting a custom address and port. Requires a report data file (`.ndjson`) as input. ```Bash # Starts a local server to view the data in ./report.ndjson tools/binary_size/supersize start_server report.ndjson # Set a custom address and port. tools/binary_size/supersize start_server report.ndjson -a localhost -p 8080 ``` -------------------------------- ### Install Wdiff (Shell) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/docs/layout_tests_linux.md Command to install the `wdiff` tool using apt-get for getting prettier diff output of test results. ```shell sudo apt-get install wdiff ``` -------------------------------- ### Install Python Bindings Dependency on macOS (Homebrew) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/harfbuzz-ng/src/BUILD.md Installs the pygobject3 library using Homebrew on macOS, required for building the Python bindings. ```bash brew install pygobject3 ``` -------------------------------- ### Build, Test, and Install with Meson/Ninja (Shell) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/openh264/src/README.md Commands for configuring, building, testing, and installing the library using the Meson build system and Ninja backend. These commands are executed from the main project directory. ```Shell meson builddir ``` ```Shell ninja -C builddir ``` ```Shell meson test -C builddir -v ``` ```Shell ninja -C builddir install ``` -------------------------------- ### Install Core Dependencies on macOS (Homebrew) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/harfbuzz-ng/src/BUILD.md Installs core build dependencies including FreeType, GLib, and Cairo using Homebrew on macOS. ```bash brew install freetype glib cairo ``` -------------------------------- ### Install Core Dependencies on macOS (MacPorts) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/harfbuzz-ng/src/BUILD.md Installs core build dependencies including FreeType, GLib, and Cairo using MacPorts on macOS. ```bash sudo port install freetype glib2 cairo ``` -------------------------------- ### Defining a Basic GN Toolchain Example Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/gn/docs/reference.md Provides a basic example of defining a toolchain named "my_toolchain" in GN. It demonstrates setting global switches (`lib_switch`, `lib_dir_switch`) and defining specific tools like `cc` (C compiler) and `cxx` (C++ compiler) with their commands, outputs, and descriptions. ```GN toolchain("my_toolchain") { # Put these at the top to apply to all tools below. lib_switch = "-l" lib_dir_switch = "-L" tool("cc") { command = "gcc {{source}} -o {{output}}" outputs = [ "{{source_out_dir}}/{{source_name_part}}.o" ] description = "GCC {{source}}" } tool("cxx") { command = "g++ {{source}} -o {{output}}" outputs = [ "{{source_out_dir}}/{{source_name_part}}.o" ] description = "G++ {{source}}" } }; ``` -------------------------------- ### Installing Linux Build Dependencies (Shell) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/angle/doc/DevSetup.md This script installs necessary development packages required for building ANGLE on Linux systems. ```Shell ./build/install-build-deps.sh ``` -------------------------------- ### OWNERS File Basic Example Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/docs/code_reviews.md Example of a basic OWNERS file listing individual owners. Comments can be included, and comments after an email address can provide specific instructions. ```Configuration # You can include comments like this. a@chromium.org b@chromium.org # Only for the frobinator. ``` -------------------------------- ### Run Dev App Server (Bash) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_tools/testing/README.md Starts the Google App Engine development server using the specified output directory. ```bash python temp/google-cloud-sdk/bin/dev_appserver.py out/app_engine ``` -------------------------------- ### Bookmaker Markup for Example Start (Bookmaker Markup) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/skia/site/user/api/usingBookmaker.md Shows the Bookmaker markup tag used to indicate the beginning of a code example block. ```Bookmaker Markup #Example ``` -------------------------------- ### Initializing PDFium Library (C) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/pdfium/docs/getting-started.md This C code snippet demonstrates the basic steps to initialize and destroy the PDFium library using FPDF_InitLibraryWithConfig and FPDF_DestroyLibrary. It shows how to configure the library using the FPDF_LIBRARY_CONFIG structure. ```C #include int main() { FPDF_LIBRARY_CONFIG config; config.version = 2; config.m_pUserFontPaths = NULL; config.m_pIsolate = NULL; config.m_v8EmbedderSlot = 0; FPDF_InitLibraryWithConfig(&config); FPDF_DestroyLibrary(); return 0; } ``` -------------------------------- ### Build and Run Project Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/docs/cr_user_manual.md Execute the `cr run` command to build, install (if necessary), and run the project with default arguments. ```Shell cr run ``` -------------------------------- ### Install and Run Content Shell APK Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/docs/profiling_content_shell_on_android.md Installs the built `content_shell_apk` onto the device and then launches it. This command is used to start the application after building. ```shell out/Release/bin/content_shell_apk run ``` -------------------------------- ### Running discard_server Unix Example Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/usrsctp/usrsctplib/Manual.md Example command to start the discard server on a Unix-like system with specific local and remote UDP encapsulation ports. ```Shell ./discard_server 11111 22222 ``` -------------------------------- ### Running prelude.ls Tests Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/devtools-node-modules/third_party/node_modules/prelude-ls/README.md Executes the test suite for the prelude.ls project using the make command. ```shell make test ``` -------------------------------- ### GN Desc: Examples Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/gn/docs/reference.md Provides command-line examples demonstrating how to use 'gn desc' to summarize a target, show a dependency tree, and display defines with blame information. ```shell gn desc out/Debug //base:base Summarizes the given target. gn desc out/Foo :base_unittests deps --tree Shows a dependency tree of the "base_unittests" project in the current directory. gn desc out/Debug //base defines --blame Shows defines set for the //base:base target, annotated by where each one was set from. ``` -------------------------------- ### Example Function Declaration (C++) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/googletest/docs/Primer.md A simple C++ function declaration used as an example target for writing tests. The comment describes its purpose. ```C++ int Factorial(int n); // Returns the factorial of n ``` -------------------------------- ### Initial Checkout using fetch Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/doc/developing.md Describes the initial process to obtain the Crashpad source code and its dependencies using the `fetch` command from depot_tools. This command performs the initial git clone and gclient sync. ```Shell $ mkdir ~/crashpad $ cd ~/crashpad $ fetch crashpad ``` -------------------------------- ### Starting Android Emulator for Testing - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/perfetto/docs/testing.md Installs necessary build dependencies and then starts the Android emulator in the background. This is an alternative to connecting a physical device for running tests on Android. ```Shell $ tools/install-build-deps $ tools/run_android_emulator & ``` -------------------------------- ### Building and Running Sample with Makefile Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/googletest/src/googletest/README.md Navigates to the Google Test make directory, builds the library and sample using the provided Makefile, and then executes the sample test. ```Shell cd ${GTEST_DIR}/make make ./sample1_unittest ``` -------------------------------- ### Running client Unix Example Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/usrsctp/usrsctplib/Manual.md Example command to start the client on a Unix-like system, connecting to a server at 127.0.0.1:9 using UDP encapsulation with specified ports. ```Shell ./client 127.0.0.1 9 0 22222 11111 ``` -------------------------------- ### Building Qt WebChannel Module Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebchannel/README.md Standard commands to configure, build, and install the Qt WebChannel module from source using qmake and make. ```Shell qmake-qt5 make make install ``` -------------------------------- ### Basic Usage Example - JavaScript Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/devtools-node-modules/third_party/node_modules/callsites/readme.md Demonstrates how to require the callsites module and use it within a function to get the filename of the current callsite. The example logs the filename of the first callsite in the stack. ```JavaScript var callsites = require('callsites'); function unicorn() { console.log(callsites()[0].getFileName()); //=> /Users/sindresorhus/dev/callsites/test.js } unicorn(); ``` -------------------------------- ### Building prelude.ls Library Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/devtools-node-modules/third_party/node_modules/prelude-ls/README.md Builds the main library files for prelude.ls from the source directory using the make command. ```shell make build ``` -------------------------------- ### Loading PDF with Detailed Error Handling using FPDF_GetLastError (C) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/pdfium/docs/getting-started.md This comprehensive C example shows how to initialize the PDFium library, attempt to load a document from a file, and provide detailed error reporting if the loading fails. It uses `FPDF_GetLastError` to retrieve the specific error code and a switch statement to print a descriptive error message before cleaning up the library resources. ```C #include #include #include int main() { FPDF_LIBRARY_CONFIG config; config.version = 2; config.m_pUserFontPaths = NULL; config.m_pIsolate = NULL; config.m_v8EmbedderSlot = 0; FPDF_InitLibraryWithConfig(&config); FPDF_DOCUMENT doc = FPDF_LoadDocument(test_doc, NULL); if (!doc) { unsigned long err = FPDF_GetLastError(); fprintf(stderr, "Load pdf docs unsuccessful: "); switch (err) { case FPDF_ERR_SUCCESS: fprintf(stderr, "Success"); break; case FPDF_ERR_UNKNOWN: fprintf(stderr, "Unknown error"); break; case FPDF_ERR_FILE: fprintf(stderr, "File not found or could not be opened"); break; case FPDF_ERR_FORMAT: fprintf(stderr, "File not in PDF format or corrupted"); break; case FPDF_ERR_PASSWORD: fprintf(stderr, "Password required or incorrect password"); break; case FPDF_ERR_SECURITY: fprintf(stderr, "Unsupported security scheme"); break; case FPDF_ERR_PAGE: fprintf(stderr, "Page not found or content error"); break; default: fprintf(stderr, "Unknown error %ld", err); } fprintf(stderr, ".\n"); goto EXIT; } FPDF_CloseDocument(doc); EXIT: FPDF_DestroyLibrary(); return 0; } ``` -------------------------------- ### Build Perfetto UI - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/perfetto/ui/README.md Sequence of shell commands to clone the Perfetto repository, navigate into the directory, install necessary build dependencies (excluding Android-specific ones and including UI dependencies), configure the build using gn for a debug build with clang, and compile the UI components using ninja. ```Shell $ git clone https://android.googlesource.com/platform/external/perfetto/ $ cd perfetto $ tools/install-build-deps --no-android --ui $ tools/gn gen out/debug --args='is_debug=true is_clang=true' $ tools/ninja -C out/debug ui ``` -------------------------------- ### Catching Multiple Exceptions (Java) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/styleguide/java/java.md Provides an example of how to catch multiple distinct exception types within a single `catch` block in Java, which is permitted by the style guide. ```Java try { somethingThatThrowsIOException(); somethingThatThrowsParseException(); } catch (IOException | ParseException e) { Log.e(TAG, "Failed to do something with exception: ", e); } ``` -------------------------------- ### Dump all help in markdown format (gn) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/gn/docs/reference.md Demonstrates how to use the --markdown switch with the gn help command to output all help topics in markdown format to standard output. ```shell gn help --markdown all ``` -------------------------------- ### Build and Run Sample Test using Makefile (Shell) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/googletest/README.md Navigates to the make directory within the Google Test source, executes the Makefile to build the library and a sample test, and then runs the built sample test executable. ```Shell cd ${GTEST_DIR}/make make ./sample1_unittest ``` -------------------------------- ### Example mb_config.pyl Structure Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/tools/mb/docs/user_guide.md This snippet shows an example of the dictionary structure expected in the `mb_config.pyl` file, illustrating the `configs` and `mixins` keys and how mixins are referenced and nested. ```Python { 'configs`': { 'linux_release_trybot': ['gn_release', 'trybot'], 'gn_shared_debug': None, }, 'mixins': { 'bot': { 'gn_args': 'use_goma=true dcheck_always_on=false', }, 'debug': { 'gn_args': 'is_debug=true', }, 'gn_release': { 'mixins': ['release'], }, 'release': { 'gn_args': 'is_debug=false', } 'shared': { 'gn_args': 'is_component_build=true', }, 'trybot': { 'gn_args': 'dcheck_always_on=true', } } } ``` -------------------------------- ### Install Bootstrap Dependencies on macOS (Homebrew) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/harfbuzz-ng/src/BUILD.md Installs tools required for bootstrapping from git, including autoconf, automake, libtool, pkgconfig, ragel, and gtk-doc using Homebrew on macOS. ```bash brew install autoconf automake libtool pkgconfig ragel gtk-doc ``` -------------------------------- ### Installing pyelftools from source Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/pyelftools/README.rst Installs the pyelftools library from a source distribution by running the setup.py script. This method is used when installing from a downloaded archive or cloned repository. ```Shell python setup.py install ``` -------------------------------- ### Initialize with Short Options Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/docs/cr_user_manual.md Use shortened options (`--o` for `--out`, `--p` for platform) to initialize a specific build directory and platform configuration. ```Shell cr init --o=out/Debug --p=android ``` -------------------------------- ### Install Bootstrap Dependencies on macOS (MacPorts) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/harfbuzz-ng/src/BUILD.md Installs tools required for bootstrapping from git, including autoconf, automake, libtool, pkgconfig, ragel, and gtk-doc using MacPorts on macOS. ```bash sudo port install autoconf automake libtool pkgconfig ragel gtk-doc ``` -------------------------------- ### Install Core Dependencies on Ubuntu/Debian (apt-get) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/harfbuzz-ng/src/BUILD.md Installs core build dependencies including GCC, G++, FreeType, GLib, and Cairo using apt-get on Ubuntu or Debian systems. ```bash sudo apt-get install gcc g++ libfreetype6-dev libglib2.0-dev libcairo2-dev ``` -------------------------------- ### Run libyuv Unittests with C Code Flags - Android - Shell Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/libyuv/docs/getting_started.md Executes the libyuv_unittest test suite on Android with specific arguments to control flags and CPU info, potentially enabling or disabling certain code paths like C implementations. ```shell build/android/test_runner.py gtest -s libyuv_unittest -t 7200 --verbose --release --gtest_filter=* -a "--libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=999 --libyuv_flags=1 --libyuv_cpu_info=1" ``` -------------------------------- ### Install Core Dependencies on Fedora/RHEL/CentOS (yum) Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/chromium/third_party/harfbuzz-ng/src/BUILD.md Installs core build dependencies including GCC, G++, FreeType, GLib, and Cairo using yum on Fedora, RHEL, or CentOS systems. ```bash sudo yum install gcc gcc-c++ freetype-devel glib2-devel cairo-devel ``` -------------------------------- ### GN: Example Configs and Dependencies Source: https://github.com/nvidia-omniverse/ext-qt5/blob/v5.12.10/qtwebengine/src/3rdparty/gn/docs/reference.md Demonstrates how to modify the 'configs' list on a target, remove default configs, add custom configs, and define conditional 'config' targets that forward to other configs based on build flags. ```GN # Configs on a target. source_set("foo") { # Don't use the default RTTI config that BUILDCONFIG applied to us. configs -= [ "//build:no_rtti" ] # Add some of our own settings. configs += [ ":mysettings" ] } # Create a default_optimization config that forwards to one of a set of more # specialized configs depending on build flags. This pattern is useful # because it allows a target to opt in to either a default set, or a more # specific set, while avoid duplicating the settings in two places. config("super_optimization") { cflags = [ ... ] } config("default_optimization") { if (optimize_everything) { configs = [ ":super_optimization" ] } else { configs = [ ":no_optimization" ] } } ```