
In cases where the viewport is too large, an image buffer allocation will fail and cause a crash inside SkBitmap::allocPixels(). Switch to SkBitmap::tryAllocPixels() to avoid this crash. Presumably when the viewport gets resized back to a normal size, OnViewportChanged() will run again, successfully allocation the buffer, and the PDF Viewer will recover. Bug: 386572857 Change-Id: I1db92e2aed0b515316636e408c2942daf9ce4f65 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6180508 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Lei Zhang <thestig@chromium.org> Cr-Commit-Position: refs/heads/main@{#1407620}
//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.