Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d87a861
Roll goldctl from 212e4f24d414 to bcc67c5b5447
Nov 16, 2026
c787761
Roll Instrumented Libraries from 83128b60913a to 490c778c3a20 (2 revi…
Nov 16, 2026
5f70cd3
Move pdf_jpx_fuzzer decoding logic into pdf_jpx_fuzzer_common
nullThink Nov 16, 2026
0d0cf3a
Roll third_party/freetype/src/ 25167984d..d5d4bef0c (1 commit)
leizleiz Nov 16, 2026
0b43db1
Roll third_party/freetype/src/ d5d4bef0c..a5877f48f (12 commits)
leizleiz Nov 16, 2026
dd810f1
Use GCedVector for stack-local collections across node creation
tsepez Nov 16, 2026
20e2d23
Use vector of Persistent for CFXJSE_Engine::ResolveResult::objects
tsepez Nov 16, 2026
873ded4
Use in-process python difflib in test_runner.py
tsepez Nov 17, 2026
4c92ae8
Expand BGRA-to-mask compositor test coverage
tycket033-tech Nov 17, 2026
cb73733
Use 16-bit lanes for BGRA-to-mask compositing
tycket033-tech Nov 17, 2026
2bc1255
Introduce run_drawing_tests.py and testing/resources/drawing
tsepez Nov 17, 2026
aff9502
Migrate pure display list embedder tests to drawing tests
tsepez Nov 18, 2026
68f43ef
Roll third_party/rust/ 79a8603b9..7661f9bcc (48 commits)
tsepez Nov 18, 2026
86e81c6
Convert cfde_textout_unittest to DisplayListDeviceDriver
tsepez Nov 18, 2026
c6a3053
Convert cfx_barcode_unittest to DisplayListDeviceDriver
tsepez Nov 19, 2026
c9a1ea6
Clear host bindings in ~CFXJSE_Context() and guard context init
tsepez Nov 19, 2026
78f446f
Roll third_party/rust/ 7661f9bcc..aee344506 (3 commits)
tsepez Nov 19, 2026
721a620
Fix float-cast-overflow in FindTextlineFlowOrientation()
a-googler Nov 19, 2026
2a0fa0c
Roll third_party/llvm-libc/src/ d8f204500..7840ec9fb (285 commits)
leizleiz Nov 19, 2026
96cb92b
Roll third_party/freetype/src/ a5877f48f..2b01fa2d6 (3 commits)
leizleiz Nov 19, 2026
e5275e1
Roll v8/ bb54fc4e8..b5156d2a7 (305 commits)
leizleiz Nov 19, 2026
fcdc443
Remove unnecessary CFFL_TextObject::OnChar() overrides
leizleiz Nov 20, 2026
b5232da
Fix gn check --check-generated cycle for skrifa_cxx
tsepez Nov 20, 2026
b1a236f
Create ScopedFPDFXObject
Nov 20, 2026
30f1c04
Remove obsolete fxge.SkiaStateText embedder test
tsepez Nov 20, 2026
171c17b
Remove skrifa demo outlines.{h,cpp} and extern C++ bridge
tsepez Nov 20, 2026
0fb188c
Split CPDF_Document::DestructionObserverIface from Observable
tsepez Nov 20, 2026
b47c2e3
Devirtualize ObservedPtr via ObservedPtrBase
tsepez Nov 20, 2026
afcec98
Replace EmbedderTest::HashBitmap() with BitmapsEqual()
tsepez Nov 21, 2026
66ed17e
Guard remaining IPDF_JSPLATFORM call-outs with in_active_ffi_callback_
tsepez Nov 21, 2026
5a04ac9
Roll Code Coverage from 084f00efb99d to ed426db3b2fb (13 revisions)
Nov 23, 2026
8a07c5d
Highway: MultiplyAlpha()/MultiplyAlphaMask() kBgra
amd-nithyavs Nov 23, 2026
6372d80
Expose PDF_ENABLE_FONTATIONS and PDF_ENABLE_FREETYPE in public config
tsepez Nov 23, 2026
bd217de
Remove unused empty list assignments in BUILD.gn files
tsepez Nov 23, 2026
8e8d160
Sync S19: merge upstream PDFium up to bd217de841 (Nov 23 2026)
bobsingor Nov 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ group("default") {

config("pdfium_common_config") {
cflags = []
cflags_cc = []
ldflags = []
include_dirs = [ "." ]
include_dirs = [
".",
target_gen_dir,
]
inputs = [ "unsafe_buffers_paths.txt" ]
defines = []

Expand All @@ -31,14 +32,6 @@ config("pdfium_common_config") {
defines += [ "PDF_ENABLE_CLICK_LOGGING" ]
}

if (pdf_enable_fontations) {
defines += [ "PDF_ENABLE_FONTATIONS" ]
}

if (pdf_enable_freetype) {
defines += [ "PDF_ENABLE_FREETYPE" ]
}

if (pdf_enable_rust_bmp) {
defines += [ "PDF_ENABLE_RUST_BMP" ]
}
Expand Down Expand Up @@ -165,6 +158,12 @@ config("pdfium_public_config") {
if (pdf_use_skia) {
defines += [ "PDF_USE_SKIA" ]
}
if (pdf_enable_fontations) {
defines += [ "PDF_ENABLE_FONTATIONS" ]
}
if (pdf_enable_freetype) {
defines += [ "PDF_ENABLE_FREETYPE" ]
}
}

config("pdfium_core_config") {
Expand All @@ -174,7 +173,6 @@ config("pdfium_core_config") {
":pdfium_public_config",
"//build/config/compiler:noshadowing",
]
defines = []
if (is_clang) {
cflags += [
"-Wcovered-switch-default",
Expand Down
16 changes: 8 additions & 8 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling code_coverage
# and whatever else without interference from each other.
'code_coverage_revision': '084f00efb99dc9a1726ed68cc2e05d25bc52802b',
'code_coverage_revision': 'ed426db3b2fbd831f3fa795d6c2603b812a8c6f7',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling cpu_features
# and whatever else without interference from each other.
Expand Down Expand Up @@ -142,15 +142,15 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling freetype
# and whatever else without interference from each other.
'freetype_revision': '25167984d2435930f9178e8d9d2ca3bdfa71a4e7',
'freetype_revision': '2b01fa2d6723bf12490822268c9627697ed89643',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling GN CIPD package version
# and whatever else without interference from each other.
'gn_version': 'git_revision:98f6dd2be85d0eba8f31ee3ad1def5402383cff3',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling goldctl CIPD package version
# and whatever else without interference from each other.
'goldctl_version': 'git_revision:d528c7cb34ccc8dc701485b2ec6981044203bed5',
'goldctl_version': 'git_revision:bcc67c5b5447ca23aa2771884031fa18ac6176ac',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling gtest
# and whatever else without interference from each other.
Expand All @@ -170,7 +170,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling instrumented_lib
# and whatever else without interference from each other.
'instrumented_lib_revision': '83128b60913a82a39d01055312687a27bb959b59',
'instrumented_lib_revision': '490c778c3a20405a7bfbe42bc426e5d18e5b3bab',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling jinja2
# and whatever else without interference from each other.
Expand Down Expand Up @@ -204,7 +204,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling llvm-libc
# and whatever else without interference from each other.
'llvm_libc_revision': 'd8f2045008e230f3c5f50095d918c11f1997e477',
'llvm_libc_revision': '7840ec9fbb6be122103494a8f763e45775ef6353',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling markupsafe
# and whatever else without interference from each other.
Expand All @@ -224,15 +224,15 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling pdfium_tests
# and whatever else without interference from each other.
'pdfium_tests_revision': 'f7a1d03ba45e874b7d3cdf722959a2b8ba4dbfa5',
'pdfium_tests_revision': '2bcc4fdc9abe4c4c115c82c486ac4c46f1d474c5',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling result_adapter_revision
# and whatever else without interference from each other.
'result_adapter_revision': 'git_revision:5fb3ca203842fd691cab615453f8e5a14302a1d8',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling rust
# and whatever else without interference from each other.
'rust_revision': '79a8603b966b612119e3498bcf7e535dfa096c1c',
'rust_revision': 'aee3445062d8cf2b53941d0ee7eb14fcab91e5b1',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling simdutf
# and whatever else without interference from each other.
Expand Down Expand Up @@ -268,7 +268,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling v8
# and whatever else without interference from each other.
'v8_revision': 'bb54fc4e853a1ef1640b160e5e854d0a3b514e29',
'v8_revision': 'b5156d2a71b52cab0b53a82a165c77612179098b',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling zlib
# and whatever else without interference from each other.
Expand Down
5 changes: 3 additions & 2 deletions PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,9 @@ def _CheckTestDuplicates(input_api, output_api):
for f in input_api.AffectedFiles():
if f.Action() == 'D':
continue
if not f.LocalPath().startswith(('testing/resources/pixel/',
'testing/resources/javascript/')):
if not f.LocalPath().startswith(
('testing/resources/drawing/', 'testing/resources/javascript/',
'testing/resources/pixel/')):
continue
end_len = 0
if f.LocalPath().endswith('.in'):
Expand Down
1 change: 0 additions & 1 deletion core/fpdfapi/parser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ pdfium_embeddertest_source_set("embeddertests") {
sources = [
"cpdf_parser_embeddertest.cpp",
"cpdf_security_handler_embeddertest.cpp",
"fpdf_parser_decode_embeddertest.cpp",
"object_tree_traversal_util_embeddertest.cpp",
]
deps = [
Expand Down
6 changes: 3 additions & 3 deletions core/fpdfapi/parser/cpdf_data_avail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ CPDF_DataAvail::CPDF_DataAvail(FileAvail* pFileAvail,
CPDF_DataAvail::~CPDF_DataAvail() {
hint_tables_.reset();
if (document_) {
document_->RemoveObserver(this);
document_->RemoveDestructionObserver(this);
}
}

void CPDF_DataAvail::OnObservableDestroyed() {
void CPDF_DataAvail::OnDocumentDestroyed() {
document_ = nullptr;
form_avail_.reset();
pages_array_.clear();
Expand Down Expand Up @@ -1096,7 +1096,7 @@ CPDF_DataAvail::ParseDocument(
}
auto document = std::make_unique<CPDF_Document>(std::move(pRenderData),
std::move(pPageData));
document->AddObserver(this);
document->AddDestructionObserver(this);

CPDF_ReadValidator::ScopedSession read_session(GetValidator());
CPDF_Parser::Error error =
Expand Down
6 changes: 3 additions & 3 deletions core/fpdfapi/parser/cpdf_data_avail.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CPDF_PageObjectAvail;
class CPDF_ReadValidator;
class CPDF_SyntaxParser;

class CPDF_DataAvail final : public Observable::ObserverIface {
class CPDF_DataAvail final : public CPDF_Document::DestructionObserverIface {
public:
// Must match PDF_DATA_* definitions in public/fpdf_dataavail.h, but cannot
// #include that header. fpdfsdk/fpdf_dataavail.cpp has static_asserts
Expand Down Expand Up @@ -74,8 +74,8 @@ class CPDF_DataAvail final : public Observable::ObserverIface {
RetainPtr<IFX_SeekableReadStream> pFileRead);
~CPDF_DataAvail() override;

// Observable::ObserverIface:
void OnObservableDestroyed() override;
// CPDF_Document::DestructionObserverIface:
void OnDocumentDestroyed() override;

DocAvailStatus IsDocAvail(DownloadHints* pHints);
DocAvailStatus IsPageAvail(uint32_t dwPage, DownloadHints* pHints);
Expand Down
27 changes: 27 additions & 0 deletions core/fpdfapi/parser/cpdf_document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,15 @@ CPDF_Document::~CPDF_Document() {
extension_.reset();
}

void CPDF_Document::AddDestructionObserver(DestructionObserverIface* observer) {
destruction_notifier_.AddObserver(observer);
}

void CPDF_Document::RemoveDestructionObserver(
DestructionObserverIface* observer) {
destruction_notifier_.RemoveObserver(observer);
}

// static
bool CPDF_Document::IsValidPageObject(const CPDF_Object* obj) {
// See ISO 32000-1:2008 spec, table 30.
Expand Down Expand Up @@ -1140,6 +1149,24 @@ void CPDF_Document::InvalidateCachedInfoDict() {
info_dict_.Reset();
}

CPDF_Document::DestructionNotifier::DestructionNotifier() = default;

CPDF_Document::DestructionNotifier::~DestructionNotifier() {
for (auto* observer : observers_) {
observer->OnDocumentDestroyed();
}
}

void CPDF_Document::DestructionNotifier::AddObserver(
DestructionObserverIface* observer) {
CHECK(observers_.insert(observer).second);
}

void CPDF_Document::DestructionNotifier::RemoveObserver(
DestructionObserverIface* observer) {
CHECK_EQ(observers_.erase(observer), 1u);
}

CPDF_Document::StockFontClearer::StockFontClearer(
CPDF_Document::PageDataIface* pPageData)
: page_data_(pPageData) {}
Expand Down
31 changes: 29 additions & 2 deletions core/fpdfapi/parser/cpdf_document.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ class CPDF_Document : public Observable,
virtual ~LinkListIface() = default;
};

class DestructionObserverIface {
public:
virtual ~DestructionObserverIface() = default;
virtual void OnDocumentDestroyed() = 0;
};

class PageDataIface {
public:
PageDataIface();
Expand Down Expand Up @@ -126,6 +132,9 @@ class CPDF_Document : public Observable,
extension_ = std::move(pExt);
}

void AddDestructionObserver(DestructionObserverIface* observer);
void RemoveDestructionObserver(DestructionObserverIface* observer);

// EmbedPDF(signatures): an opaque cache an SDK layer (the revision view)
// attaches to this document for its lifetime. The bytes a document was
// loaded from never change, so nothing invalidates it; it is destroyed
Expand Down Expand Up @@ -373,8 +382,20 @@ class CPDF_Document : public Observable,
virtual bool ShouldReplaceDeletedPageWithNull(uint32_t page_obj_num) const;

private:
// EmbedPDF(measurement): see GetMeasureStorage().
std::unique_ptr<CPDF_MeasureStorage> measure_storage_;
class DestructionNotifier {
public:
DestructionNotifier();
DestructionNotifier(const DestructionNotifier&) = delete;
DestructionNotifier& operator=(const DestructionNotifier&) = delete;
~DestructionNotifier();

void AddObserver(DestructionObserverIface* observer);
void RemoveObserver(DestructionObserverIface* observer);

private:
std::set<DestructionObserverIface*> observers_;
};

class [[maybe_unused, nodiscard]] StockFontClearer {
public:
FX_STACK_ALLOCATED();
Expand Down Expand Up @@ -419,6 +440,12 @@ class CPDF_Document : public Observable,
void ResetTraversal();
CPDF_Parser::Error HandleLoadResult(CPDF_Parser::Error error);

// Must be first, so it is destroyed after all other members.
DestructionNotifier destruction_notifier_;

// EmbedPDF(measurement): see GetMeasureStorage().
std::unique_ptr<CPDF_MeasureStorage> measure_storage_;

std::unique_ptr<CPDF_Parser> parser_;
RetainPtr<CPDF_Dictionary> root_dict_;
RetainPtr<CPDF_Dictionary> info_dict_;
Expand Down
42 changes: 0 additions & 42 deletions core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions core/fpdfapi/render/fpdf_render_pattern_embeddertest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ TEST_F(FPDFRenderPatternEmbedderTest, ShadingStrokePaintsAfterSolidFill) {
}
}

TEST_F(FPDFRenderPatternEmbedderTest, LoadError547706) {
// Test shading where object is a dictionary instead of a stream.
ASSERT_TRUE(OpenDocument("bug_547706.pdf"));
ScopedPage page = LoadScopedPage(0);
ASSERT_TRUE(page);
CompareDisplayList(RenderLoadedPageToDisplayList(page.get()), "bug_547706");
}

TEST_F(FPDFRenderPatternEmbedderTest, ZeroTilingPatternStep509964646) {
// Rendering a tiling pattern with a zero step should not hang.
ASSERT_TRUE(OpenDocument("bug_509964646.pdf"));
Expand Down
15 changes: 12 additions & 3 deletions core/fpdftext/cpdf_textpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "core/fxcrt/fx_extension.h"
#include "core/fxcrt/fx_unicode.h"
#include "core/fxcrt/notreached.h"
#include "core/fxcrt/numerics/safe_conversions.h"
#include "core/fxcrt/span.h"
#include "core/fxcrt/stl_util.h"
#include "core/fxcrt/zip.h"
Expand Down Expand Up @@ -908,8 +909,15 @@ bool CPDF_TextPage::GetRect(int rectIndex, CFX_FloatRect* pRect) const {

CPDF_TextPage::TextOrientation CPDF_TextPage::FindTextlineFlowOrientation()
const {
const int32_t nPageWidth = static_cast<int32_t>(page_->GetPageWidth());
const int32_t nPageHeight = static_cast<int32_t>(page_->GetPageHeight());
const float page_width = page_->GetPageWidth();
const float page_height = page_->GetPageHeight();
if (!pdfium::IsValueInRangeForNumericType<int32_t>(page_width) ||
!pdfium::IsValueInRangeForNumericType<int32_t>(page_height)) {
return TextOrientation::kUnknown;
}

const int32_t nPageWidth = static_cast<int32_t>(page_width);
const int32_t nPageHeight = static_cast<int32_t>(page_height);
if (nPageWidth <= 0 || nPageHeight <= 0) {
return TextOrientation::kUnknown;
}
Expand Down Expand Up @@ -962,7 +970,8 @@ CPDF_TextPage::TextOrientation CPDF_TextPage::FindTextlineFlowOrientation()
fLineHeight = rect.Height();
}
}
const int32_t nDoubleLineHeight = 2 * fLineHeight;
const int32_t nDoubleLineHeight =
pdfium::saturated_cast<int32_t>(2 * fLineHeight);
if ((nEndV - nStartV) < nDoubleLineHeight) {
return TextOrientation::kHorizontal;
}
Expand Down
1 change: 0 additions & 1 deletion core/fxcodec/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ source_set("fxcodec") {
"../../third_party:zlib",
"../fxge",
]
defines = []
if (pdf_enable_brotli) {
sources += [
"brotli/brotli_decoder.cpp",
Expand Down
Loading