Skip to content

Commit

Permalink
Remove guidance disallowing namespaces in //chrome
Browse files Browse the repository at this point in the history
Namespaces are now allowed, see
docs/chrome_browser_design_principles.md

Change-Id: Ie726e8e6cd61eeef75d6fe1e275975e865fccc3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5527705
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1312303}
  • Loading branch information
erikchen authored and Chromium LUCI CQ committed Jun 7, 2024
1 parent 994b4a9 commit 3ee9cb0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions styleguide/c++/c++-dos-and-donts.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,12 @@ if existing code uses the old one.

## Named namespaces

Named namespaces are discouraged in top-level embedders (e.g., `chrome/`). See
[this thread](https://groups.google.com/a/chromium.org/d/msg/chromium-dev/8ROncnL1t4k/J7uJMCQ8BwAJ)
for background and discussion.
Most code should be in a namespace, with the exception of code under
`//chrome`, which may be in the global namespace (do not use the `chrome::`
namespace). Minimize use of nested namespaces, as they do not actually
improve encapsulation; if a nested namespace is needed, do not reuse the
name of any top-level namespace. For more detailed guidance and rationale,
see https://abseil.io/tips/130.

## Guarding with DCHECK_IS_ON()

Expand Down

0 comments on commit 3ee9cb0

Please sign in to comment.