Chromium C++ style guide

For other languages, please see the Chromium style guides.

Chromium follows the Google C++ Style Guide unless an exception is listed below.

A checkout should give you clang-format to automatically format C++ code. By policy, Clang's formatting of code should always be accepted in code reviews.

You can propose changes to this style guide by sending an email to [email protected]. Ideally, the list will arrive at some consensus and you can request review for a change to this file. If there's no consensus, src/styleguide/c++/OWNERS get to decide. For further details on how style changes are handled and communicated, see the C++ Style Changes process documentation.

Blink code in third_party/blink uses Blink style.

Modern C++ features

Google and Chromium style targets C++20. Additionally, some features of supported C++ versions remain forbidden. The status of Chromium's C++ support is covered in more detail in Modern C++ use in Chromium.

Naming

  • “Chromium” is the name of the project, not the product, and should never appear in code, variable names, API names etc. Use “Chrome” instead.