26 if (!root_->IsInline())
27 parsed_objnums_.insert(root_->GetObjNum());
43 if (!LoadRootObject())
54 if (!non_parsed_objects_.empty())
57 while (root_ && root_->IsReference()) {
58 const uint32_t ref_obj_num = root_->AsReference()->GetRefObjNum();
59 if (HasObjectParsed(ref_obj_num)) {
66 holder_->GetOrParseIndirectObject(ref_obj_num);
67 if (validator_->has_read_problems())
70 parsed_objnums_.insert(ref_obj_num);
71 root_ = std::move(direct);
73 std::stack<uint32_t> non_parsed_objects_in_root;
74 if (AppendObjectSubRefs(root_, &non_parsed_objects_in_root)) {
75 non_parsed_objects_ = std::move(non_parsed_objects_in_root);
82 std::set<uint32_t> checked_objects;
83 std::stack<uint32_t> objects_to_check = std::move(non_parsed_objects_);
84 non_parsed_objects_ = std::stack<uint32_t>();
85 while (!objects_to_check.empty()) {
86 const uint32_t obj_num = objects_to_check.top();
87 objects_to_check.pop();
89 if (HasObjectParsed(obj_num))
92 if (!checked_objects.insert(obj_num).second)
97 holder_->GetOrParseIndirectObject(obj_num);
101 if (validator_->has_read_problems() ||
102 !AppendObjectSubRefs(std::move(direct), &objects_to_check)) {
103 non_parsed_objects_.push(obj_num);
106 parsed_objnums_.insert(obj_num);
108 return non_parsed_objects_.empty();
112 std::stack<uint32_t>* refs)
const {
118 while (RetainPtr<
const CPDF_Object> obj = walker.GetNext()) {
123 const bool skip = (walker.GetParent() && obj == root_) ||
124 walker.dictionary_key() ==
"Parent" ||
125 (obj != root_ && ExcludeObject(obj.Get()));
130 if (validator_->has_read_problems())
138 if (obj->IsReference())
139 refs->push(obj->AsReference()->GetRefObjNum());
146 parsed_objnums_.clear();
154 return pdfium::Contains(parsed_objnums_, obj_num);