0

Mention forwarding headers in the style guide

Change-Id: Ife7b26e4ea37dd68f83e3e7bd6e48ae23a16067b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5953868
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1372800}
This commit is contained in:
Joe Mason
2024-10-23 17:15:17 +00:00
committed by Chromium LUCI CQ
parent b467b4722e
commit 83d069d780

@ -299,6 +299,13 @@ STL containers. However, if it would otherwise make sense to use a type as a
member by-value, don't convert it to a pointer just to be able to
forward-declare the type.
Headers that contain only forward declarations, such as
[`callback_forward.h`](../../base/functional/callback_forward.h), satisfy the
spirit of this rule. Note that the [Mojo bindings
generator](../../mojo/public/cpp/bindings/README.md#Getting-Started)
creates a `.mojom-forward.h` file along with every generated `.mojom.h` file
that can be included for forward declarations of Mojo types.
## File headers
All files in Chromium start with a common license header. That header should