0
Files
src/pdf
Lei Zhang cc4a3146d3 Add NOTREACHED() to many //pdf switch statements
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}
2024-08-26 23:57:20 +00:00
..
2024-08-26 16:46:15 +00:00
2024-08-26 16:46:15 +00:00
2024-07-18 23:10:37 +00:00
2024-07-18 23:10:37 +00:00
2024-07-18 23:10:37 +00:00
2024-05-30 04:08:39 +00:00

//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.