
Given the following code snippets: void Foo(Enum e) { switch (e) { case ...: ... return; } } int Bar(Enum e) { switch (e) { case ...: ... return val; } } If the switch statements do not have a default case, since all defined enum values are handled, then undefined enum values can cause undefined behavior as suggested in https://abseil.io/tips/147. Avoid this by guarding the UB code path with NOTREACHED(). Clang actually generates "ud2" instructions in debug builds in the places where this CL adds NOTREACHED(). Whereas in release builds, Clang does whatever it wants. Also do IWYU for base/notreached.h in this directory. Change-Id: I4bbfe8ed091627608bc84f9658fe2c01dc47fec1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5813603 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Peter Boström <pbos@chromium.org> Cr-Commit-Position: refs/heads/main@{#1347070}
//pdf
contains the PDF plugin, its Blink-based replacement, as well as PDF
utility functions that leverage PDFium. It can use low-level components that
live below the content layer, as well as other foundational code like
//printing
. It should not use //content
or anything in //components
that
lives above the content layer. Code that lives above the content layer should
live in //components/pdf
, or in the embedder. All the code here should run in
sandboxed child processes.
TODO(crbug.com/40186598): Remove existing //content
dependencies.