Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e2cea87
Use nullptr instead of FooPtr<T>()
leizleiz Oct 12, 2026
1e1e501
Use MaybeOwned in CPDF_Parser
leizleiz Oct 12, 2026
56c5b97
Remove the ability to intern strings from CPDF_String
leizleiz Oct 12, 2026
f871ae4
Change ByteStringPool to use absl::flat_hash_set
leizleiz Oct 12, 2026
c31605b
Use libyuv for DIB format, alpha, and transforms
fbarchard Oct 12, 2026
bf4dc62
Add display list file comparison helpers to EmbedderTest
tsepez Oct 12, 2026
a898334
Support optional SSIM threshold in fuzzy matching suppressions
tsepez Oct 13, 2026
d4a751b
Add unit tests for CFX_DIBBase::TransformTo()
leizleiz Oct 13, 2026
abdb477
Add unit tests for CFX_DIBBase::StretchTo()
leizleiz Oct 13, 2026
0ee2754
Sort conditionals in core/fxge/BUILD.gn
leizleiz Oct 13, 2026
6153dfa
Combine V8 and XFA columns in SUPPRESSIONS
tsepez Oct 13, 2026
69b5290
Add TODO to revert CFXPath expectations for open, 3-sided paths
leizleiz Oct 13, 2026
b02da6c
Stop recognizing open, 3-sided paths as rectangles.
leizleiz Oct 13, 2026
e8ff093
Hide ByteStringPool details inside bytestring_pool.cpp
leizleiz Oct 13, 2026
ff0c927
Add unit tests for 4-point rects with redundant or collinear points
leizleiz Oct 13, 2026
69efacb
Normalize 4-point rects with redundant or collinear points in CFX_Path
leizleiz Oct 14, 2026
c2cae14
Use CFX_Path::GetRectOppositeCorner() in more places
leizleiz Oct 14, 2026
e764cc0
Guard against re-entrant destruction of the CJS_Runtime
tsepez Oct 14, 2026
e34a934
Check custom property name length in CSS declaration parsers
tsepez Oct 14, 2026
c9c7444
Remove ShouldDrawDeviceText() from CFX_RenderDevice
tsepez Oct 14, 2026
affabff
Add CFX_GEModule::PlatformIface::DestroyPlatformFont()
tsepez Oct 14, 2026
bb7b5e6
Use display lists for text removal tests in FPDFEditEmbedderTest
tsepez Oct 14, 2026
ff42b57
Simplify CFX_Path::GetRect() checks in cfx_path_unittest.cpp
leizleiz Oct 14, 2026
616a2ca
Tweak GetNormalizedPoints() inside cfx_path.cpp to return earlier
leizleiz Oct 14, 2026
ac3cf16
CHECK on FFE teardown if embedder is inside a callback.
tsepez Oct 14, 2026
3ea7ec1
Introduce two-argument AutoRestorer constructor.
tsepez Oct 14, 2026
1276841
Stop trying to clang-format //third_party code
leizleiz Oct 14, 2026
f536928
Use two-argument AutoRestorer constructor in additional files.
tsepez Oct 14, 2026
b87fc9a
Make CFFL_FieldAction a true aggregate.
tsepez Oct 14, 2026
4986146
Remove unnecessary public access specifiers from structs
tsepez Oct 14, 2026
5b39cca
Use display lists for font subsetting tests in FPDFSaveEmbedderTest
tsepez Oct 14, 2026
c7fe62c
Use display lists for text addition and positioning tests
tsepez Oct 15, 2026
fe163fd
Clean up CPDF_SyntaxParser constructors
leizleiz Oct 15, 2026
c10905a
Fix building cpvt_section_unittest.cpp with GCC
leizleiz Oct 15, 2026
609a364
pdfium_test: With --render-repeats, do full loads on each repeat
nico Oct 15, 2026
ab5e0a9
Resample the horizontal stretch's 1- and 2-tap columns with Highway
jerbob92 Oct 15, 2026
7c55203
Use display list comparisons in form fill embedder tests
tsepez Oct 15, 2026
4744d6e
Merge commit '7c55203ed' into embedpdf/sync/7c55203ed
bobsingor Oct 17, 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
6 changes: 2 additions & 4 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,9 @@ deps = {
Var('chromium_git') + '/external/github.com/harfbuzz/harfbuzz.git@' +
Var('harfbuzz_revision'),

'third_party/highway/src': {
'url': Var('chromium_git') + '/external/github.com/google/highway.git@' +
'third_party/highway/src':
Var('chromium_git') + '/external/github.com/google/highway.git@' +
Var('highway_revision'),
'condition': 'checkout_v8',
},

'third_party/icu':
Var('chromium_git') + '/chromium/deps/icu.git@' + Var('icu_revision'),
Expand Down
14 changes: 14 additions & 0 deletions core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ TEST_F(CPDFPageContentGeneratorTest, ProcessRect) {
buf.str("");
TestProcessPath(&generator, &buf, pPathObj.get());
EXPECT_EQ("q 0 0 100 100 re n Q\n", ByteString(buf));

// Same as above, but closed without repeating the first point.
pPathObj = std::make_unique<CPDF_PathObject>();
pPathObj->path().AppendPoint(CFX_PointF(0, 0), CFX_Path::Point::Type::kMove);
pPathObj->path().AppendPoint(CFX_PointF(50, 0), CFX_Path::Point::Type::kLine);
pPathObj->path().AppendPoint(CFX_PointF(100, 0),
CFX_Path::Point::Type::kLine);
pPathObj->path().AppendPoint(CFX_PointF(100, 100),
CFX_Path::Point::Type::kLine);
pPathObj->path().AppendPointAndClose(CFX_PointF(0, 100),
CFX_Path::Point::Type::kLine);
buf.str("");
TestProcessPath(&generator, &buf, pPathObj.get());
EXPECT_EQ("q 0 0 100 100 re n Q\n", ByteString(buf));
}

TEST_F(CPDFPageContentGeneratorTest, Bug937) {
Expand Down
8 changes: 5 additions & 3 deletions core/fpdfapi/page/cpdf_clippath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "core/fpdfapi/page/cpdf_clippath.h"

#include <optional>
#include <utility>

#include "core/fpdfapi/page/cpdf_textobject.h"
Expand Down Expand Up @@ -86,10 +87,11 @@ void CPDF_ClipPath::AppendPathWithAutoMerge(
PathData* pData = ref_.GetPrivateCopy();
if (!pData->path_and_type_list_.empty()) {
const CPDF_Path& old_path = pData->path_and_type_list_.back().first;
if (old_path.IsRect()) {
std::optional<CFX_PointF> corner = old_path.GetRectOppositeCorner();
if (corner.has_value()) {
CFX_PointF point0 = old_path.GetPoint(0);
CFX_PointF point2 = old_path.GetPoint(2);
CFX_FloatRect old_rect(point0.x, point0.y, point2.x, point2.y);
CFX_FloatRect old_rect(point0.x, point0.y, corner.value().x,
corner.value().y);
CFX_FloatRect new_rect = path.GetBoundingBox();
if (old_rect.Contains(new_rect)) {
pData->path_and_type_list_.pop_back();
Expand Down
11 changes: 8 additions & 3 deletions core/fpdfapi/page/cpdf_contentparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "core/fpdfapi/page/cpdf_contentparser.h"

#include <algorithm>
#include <optional>
#include <utility>
#include <variant>

Expand Down Expand Up @@ -367,15 +368,19 @@ CPDF_ContentParser::Stage CPDF_ContentParser::CheckClip(
if (clip_path.GetTextCount() > 0) {
continue;
}
if (pObj->IsShading()) {
continue;
}

CPDF_Path path = clip_path.GetPath(0);
if (!path.IsRect() || pObj->IsShading()) {
std::optional<CFX_PointF> corner = path.GetRectOppositeCorner();
if (!corner.has_value()) {
continue;
}

CFX_PointF point0 = path.GetPoint(0);
CFX_PointF point2 = path.GetPoint(2);
CFX_FloatRect old_rect(point0.x, point0.y, point2.x, point2.y);
CFX_FloatRect old_rect(point0.x, point0.y, corner.value().x,
corner.value().y);
if (old_rect.Contains(pObj->GetRect())) {
clip_path.SetNull();
}
Expand Down
4 changes: 0 additions & 4 deletions core/fpdfapi/page/cpdf_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ CFX_FloatRect CPDF_Path::GetBoundingBoxForStrokePath(float line_width,
return ref_.GetObject()->GetBoundingBoxForStrokePath(line_width, miter_limit);
}

bool CPDF_Path::IsRect() const {
return ref_.GetObject()->IsRect();
}

std::optional<CFX_PointF> CPDF_Path::GetRectOppositeCorner() const {
return ref_.GetObject()->GetRectOppositeCorner();
}
Expand Down
1 change: 0 additions & 1 deletion core/fpdfapi/page/cpdf_path.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class CPDF_Path {
CFX_FloatRect GetBoundingBoxForStrokePath(float line_width,
float miter_limit) const;

bool IsRect() const;
std::optional<CFX_PointF> GetRectOppositeCorner() const;
void Transform(const CFX_Matrix& matrix);

Expand Down
4 changes: 2 additions & 2 deletions core/fpdfapi/page/cpdf_streamparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,12 @@ RetainPtr<CPDF_Object> CPDF_StreamParser::ReadLeafObject() {
}

if (first_char == '(') {
return pdfium::MakeRetain<CPDF_String>(pool_, ReadString());
return pdfium::MakeRetain<CPDF_String>(ReadString());
}

if (first_char == '<') {
CHECK_EQ(word_size_, 1); // Caller handled all other cases.
return pdfium::MakeRetain<CPDF_String>(pool_, ReadHexString(),
return pdfium::MakeRetain<CPDF_String>(ReadHexString(),
CPDF_String::DataType::kIsHex);
}

Expand Down
5 changes: 2 additions & 3 deletions core/fpdfapi/parser/cpdf_dictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
#include "core/fxcrt/containers/contains.h"
#include "core/fxcrt/fx_stream.h"

CPDF_Dictionary::CPDF_Dictionary()
: CPDF_Dictionary(WeakPtr<ByteStringPool>()) {}
CPDF_Dictionary::CPDF_Dictionary() : CPDF_Dictionary(nullptr) {}

CPDF_Dictionary::CPDF_Dictionary(const WeakPtr<ByteStringPool>& pPool)
: pool_(pPool) {}
Expand Down Expand Up @@ -372,7 +371,7 @@ RetainPtr<CPDF_Object> CPDF_Dictionary::RemoveFor(ByteStringView key) {
CHECK(!IsLocked());
auto it = map_.find(key);
if (it == map_.end()) {
return RetainPtr<CPDF_Object>();
return nullptr;
}
// EmbedPDF(write-generation, reads-dont-write): a write past the layer's
// door, or one during a read-only walk, is a bug.
Expand Down
2 changes: 1 addition & 1 deletion core/fpdfapi/parser/cpdf_indirect_object_holder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const CPDF_Object* FilterInvalidObjNum(const CPDF_Object* obj) {
} // namespace

CPDF_IndirectObjectHolder::CPDF_IndirectObjectHolder()
: byte_string_pool_(std::make_unique<ByteStringPool>()) {}
: byte_string_pool_(ByteStringPool::Create()) {}

CPDF_IndirectObjectHolder::~CPDF_IndirectObjectHolder() {
byte_string_pool_.DeleteObject(); // Make weak.
Expand Down
3 changes: 1 addition & 2 deletions core/fpdfapi/parser/cpdf_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ template <typename T>
struct CanInternStrings {
static constexpr bool value = std::is_same<T, CPDF_Array>::value ||
std::is_same<T, CPDF_Dictionary>::value ||
std::is_same<T, CPDF_Name>::value ||
std::is_same<T, CPDF_String>::value;
std::is_same<T, CPDF_Name>::value;
};

#endif // CORE_FPDFAPI_PARSER_CPDF_OBJECT_H_
20 changes: 9 additions & 11 deletions core/fpdfapi/parser/cpdf_object_avail_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class CPDF_ObjectAvailExcludeTypeKey final : public CPDF_ObjectAvail {

TEST(ObjectAvailTest, OneObject) {
TestHolder holder;
holder.AddObject(1, pdfium::MakeRetain<CPDF_String>(nullptr, "string"),
holder.AddObject(1, pdfium::MakeRetain<CPDF_String>("string"),
TestHolder::ObjectState::Unavailable);
CPDF_ObjectAvail avail(holder.GetValidator(), &holder, 1);
EXPECT_EQ(CPDF_DataAvail::kDataNotAvailable, avail.CheckAvail());
Expand All @@ -131,7 +131,7 @@ TEST(ObjectAvailTest, OneReferencedObject) {
TestHolder holder;
holder.AddObject(1, pdfium::MakeRetain<CPDF_Reference>(&holder, 2),
TestHolder::ObjectState::Unavailable);
holder.AddObject(2, pdfium::MakeRetain<CPDF_String>(nullptr, "string"),
holder.AddObject(2, pdfium::MakeRetain<CPDF_String>("string"),
TestHolder::ObjectState::Unavailable);
CPDF_ObjectAvail avail(holder.GetValidator(), &holder, 1);
EXPECT_EQ(CPDF_DataAvail::kDataNotAvailable, avail.CheckAvail());
Expand Down Expand Up @@ -235,9 +235,8 @@ TEST(ObjectAvailTest, Exclude) {
2);

// Add string, which is refered by array item. It is should not be checked.
holder.AddObject(
3, pdfium::MakeRetain<CPDF_String>(nullptr, "Not available string"),
TestHolder::ObjectState::Unavailable);
holder.AddObject(3, pdfium::MakeRetain<CPDF_String>("Not available string"),
TestHolder::ObjectState::Unavailable);
CPDF_ObjectAvailExcludeArray avail(holder.GetValidator(), &holder, 1);
EXPECT_EQ(CPDF_DataAvail::kDataAvailable, avail.CheckAvail());
}
Expand All @@ -254,16 +253,15 @@ TEST(ObjectAvailTest, ReadErrorOnExclude) {
holder.GetTestObject(2)->GetMutableDict()->SetNewFor<CPDF_Reference>(
"Type", &holder, 3);
// The value of "Type" key is not available at start
holder.AddObject(3, pdfium::MakeRetain<CPDF_String>(nullptr, "Exclude me"),
holder.AddObject(3, pdfium::MakeRetain<CPDF_String>("Exclude me"),
TestHolder::ObjectState::Unavailable);

holder.GetTestObject(2)->GetMutableDict()->SetNewFor<CPDF_Reference>(
"OtherData", &holder, 4);
// Add string, which is referred by dictionary item. It is should not be
// checked, because the dictionary with it, should be skipped.
holder.AddObject(
4, pdfium::MakeRetain<CPDF_String>(nullptr, "Not available string"),
TestHolder::ObjectState::Unavailable);
holder.AddObject(4, pdfium::MakeRetain<CPDF_String>("Not available string"),
TestHolder::ObjectState::Unavailable);

CPDF_ObjectAvailExcludeTypeKey avail(holder.GetValidator(), &holder, 1);

Expand Down Expand Up @@ -291,7 +289,7 @@ TEST(ObjectAvailTest, IgnoreNotExistsObject) {

TEST(ObjectAvailTest, CheckTwice) {
TestHolder holder;
holder.AddObject(1, pdfium::MakeRetain<CPDF_String>(nullptr, "string"),
holder.AddObject(1, pdfium::MakeRetain<CPDF_String>("string"),
TestHolder::ObjectState::Unavailable);

CPDF_ObjectAvail avail(holder.GetValidator(), &holder, 1);
Expand All @@ -313,7 +311,7 @@ TEST(ObjectAvailTest, SelfReferedInlinedObject) {
"Dict");

root->SetNewFor<CPDF_Reference>("Self", &holder, 1);
holder.AddObject(2, pdfium::MakeRetain<CPDF_String>(nullptr, "Data"),
holder.AddObject(2, pdfium::MakeRetain<CPDF_String>("Data"),
TestHolder::ObjectState::Unavailable);

CPDF_ObjectAvail avail(holder.GetValidator(), &holder, root);
Expand Down
8 changes: 3 additions & 5 deletions core/fpdfapi/parser/cpdf_object_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ class PDFObjectsTest : public testing::Test {
auto number_int_obj = pdfium::MakeRetain<CPDF_Number>(1245);
auto number_float_obj = pdfium::MakeRetain<CPDF_Number>(9.00345f);
// String objects.
auto str_reg_obj =
pdfium::MakeRetain<CPDF_String>(nullptr, L"A simple test");
auto str_spec_obj = pdfium::MakeRetain<CPDF_String>(nullptr, L"\t\n");
auto str_reg_obj = pdfium::MakeRetain<CPDF_String>(L"A simple test");
auto str_spec_obj = pdfium::MakeRetain<CPDF_String>(L"\t\n");
// Name object.
auto name_obj = pdfium::MakeRetain<CPDF_Name>(nullptr, "space");
// Array object.
Expand Down Expand Up @@ -809,8 +808,7 @@ TEST(PDFArrayTest, AddReferenceAndGetObjectAt) {
auto boolean_obj = pdfium::MakeRetain<CPDF_Boolean>(true);
auto int_obj = pdfium::MakeRetain<CPDF_Number>(-1234);
auto float_obj = pdfium::MakeRetain<CPDF_Number>(2345.089f);
auto str_obj =
pdfium::MakeRetain<CPDF_String>(nullptr, "Adsfdsf 343434 %&&*\n");
auto str_obj = pdfium::MakeRetain<CPDF_String>("Adsfdsf 343434 %&&*\n");
auto name_obj = pdfium::MakeRetain<CPDF_Name>(nullptr, "Title:");
auto null_obj = pdfium::MakeRetain<CPDF_Null>();
auto indirect_objs = std::to_array<RetainPtr<CPDF_Object>>(
Expand Down
3 changes: 1 addition & 2 deletions core/fpdfapi/parser/cpdf_page_object_avail_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ TEST(PageObjectAvailTest, ExcludePages) {
holder.GetTestObject(3)->GetMutableDict()->SetNewFor<CPDF_Reference>(
"OtherPageData", &holder, 4);
// Add unavailable object related to other page.
holder.AddObject(4,
pdfium::MakeRetain<CPDF_String>(nullptr, "Other page data"),
holder.AddObject(4, pdfium::MakeRetain<CPDF_String>("Other page data"),
TestHolder::ObjectState::Unavailable);

CPDF_PageObjectAvail avail(holder.GetValidator(), &holder, 1);
Expand Down
14 changes: 6 additions & 8 deletions core/fpdfapi/parser/cpdf_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ CPDF_Parser::CPDF_Parser(ParsedObjectsHolder* holder)
: objects_holder_(holder),
cross_ref_table_(std::make_unique<CPDF_CrossRefTable>()) {
if (!holder) {
owned_objects_holder_ = std::make_unique<ObjectsHolderStub>();
objects_holder_ = owned_objects_holder_.get();
objects_holder_ = std::make_unique<ObjectsHolderStub>();
}
}

Expand Down Expand Up @@ -1078,7 +1077,7 @@ uint32_t CPDF_Parser::GetTrailerObjectNumber() const {
RetainPtr<CPDF_Dictionary> CPDF_Parser::GetCombinedTrailer() const {
return cross_ref_table_->trailer()
? ToDictionary(cross_ref_table_->trailer()->Clone())
: RetainPtr<CPDF_Dictionary>();
: nullptr;
}

uint32_t CPDF_Parser::GetInfoObjNum() const {
Expand All @@ -1100,7 +1099,7 @@ uint32_t CPDF_Parser::GetRootObjNum() const {
// EmbedPDF(save-traversal): a save parses from the loaded bytes without
// filling the document's caches.
RetainPtr<CPDF_Object> CPDF_Parser::ParseIndirectObject(uint32_t objnum) {
return ParseIndirectObjectInternal(objnum, objects_holder_, nullptr);
return ParseIndirectObjectInternal(objnum, objects_holder_.Get(), nullptr);
}

RetainPtr<CPDF_Object> CPDF_Parser::ParseIndirectObjectForSave(
Expand Down Expand Up @@ -1232,7 +1231,7 @@ const CPDF_ObjectStream* CPDF_Parser::GetObjectStream(uint32_t object_number) {
// document's caches stay untouched.
RetainPtr<CPDF_Object> CPDF_Parser::ParseIndirectObjectAt(FX_FILESIZE pos,
uint32_t objnum) {
return ParseIndirectObjectAtWithHolder(pos, objnum, objects_holder_);
return ParseIndirectObjectAtWithHolder(pos, objnum, objects_holder_.Get());
}

RetainPtr<CPDF_Object> CPDF_Parser::ParseIndirectObjectAtWithHolder(
Expand Down Expand Up @@ -1300,7 +1299,7 @@ RetainPtr<CPDF_Dictionary> CPDF_Parser::LoadTrailer() {
return nullptr;
}

return ToDictionary(syntax_->GetObjectBody(objects_holder_));
return ToDictionary(syntax_->GetObjectBody(objects_holder_.Get()));
}

uint32_t CPDF_Parser::GetPermissions(bool get_owner_perms) const {
Expand Down Expand Up @@ -1446,8 +1445,7 @@ CPDF_Parser::Error CPDF_Parser::LoadLinearizedMainXRefTable() {
return SUCCESS;
}

const AutoRestorer<uint32_t> save_metadata_objnum(&metadata_objnum_);
metadata_objnum_ = 0;
AutoRestorer<uint32_t> save_metadata_objnum(&metadata_objnum_, 0);
object_stream_map_.clear();

if (!LoadLinearizedAllCrossRefTable(main_xref_offset) &&
Expand Down
5 changes: 2 additions & 3 deletions core/fpdfapi/parser/cpdf_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include "core/fpdfapi/parser/cpdf_reference_index.h"
#include "core/fxcrt/bytestring.h"
#include "core/fxcrt/fx_types.h"
#include "core/fxcrt/maybe_owned.h"
#include "core/fxcrt/retain_ptr.h"
#include "core/fxcrt/unowned_ptr.h"

class CPDF_Array;
class CPDF_Dictionary;
Expand Down Expand Up @@ -265,8 +265,7 @@ class CPDF_Parser {
void SetPassword(const ByteString& password) { password_ = password; }

std::unique_ptr<CPDF_SyntaxParser> syntax_;
std::unique_ptr<ParsedObjectsHolder> owned_objects_holder_;
UnownedPtr<ParsedObjectsHolder> objects_holder_;
MaybeOwned<ParsedObjectsHolder> objects_holder_;

// EmbedPDF(save-traversal): a save's bounded index of each object's
// references.
Expand Down
7 changes: 5 additions & 2 deletions core/fpdfapi/parser/cpdf_parser_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_linearized_header.h"
#include "core/fpdfapi/parser/cpdf_object.h"
#include "core/fpdfapi/parser/cpdf_read_validator.h"
#include "core/fpdfapi/parser/cpdf_syntax_parser.h"
#include "core/fxcrt/cfx_fileaccess_stream.h"
#include "core/fxcrt/cfx_read_only_span_stream.h"
Expand Down Expand Up @@ -121,8 +122,10 @@ class CPDF_TestParser final : public CPDF_Parser {
// Setup reading from a buffer and initial states.
bool InitTestFromBufferWithOffset(pdfium::span<const uint8_t> buffer,
FX_FILESIZE header_offset) {
SetSyntaxParserForTesting(CPDF_SyntaxParser::CreateForTesting(
pdfium::MakeRetain<CFX_ReadOnlySpanStream>(buffer), header_offset));
SetSyntaxParserForTesting(std::make_unique<CPDF_SyntaxParser>(
pdfium::MakeRetain<CPDF_ReadValidator>(
pdfium::MakeRetain<CFX_ReadOnlySpanStream>(buffer), nullptr),
header_offset));
return true;
}

Expand Down
Loading