summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_indirect_object_holder.cpp
AgeCommit message (Collapse)Author
2017-10-05Remove CPDF_Object friendsDan Sinclair
This CL removes the friends from CPDF_Object and adds accessors as needed. The m_GenNum was moved to a private member as none of the overriding classes needed access. Change-Id: If23a1a6752dea31eb80669a36694973f3c581123 Reviewed-on: https://pdfium-review.googlesource.com/15470 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-18Convert string class namesRyan Harrison
Automated using git grep & sed. Replace StringC classes with StringView classes. Remove the CFX_ prefix and put string classes in fxcrt namespace. Change AsStringC() to AsStringView(). Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*, Foo). Couple of tests needed to have their names regularlized. BUG=pdfium:894 Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d Reviewed-on: https://pdfium-review.googlesource.com/14151 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-09-05Refactoring of CPDF_IndirectObjectHolder.Artem Strygin
CPDF_IndirectObjectHolder is optimized. Recursively parsing of same object has been fixed. Change-Id: I22e5cfd6b03eee0677f2b1f8ba32bf29cad441fc Reviewed-on: https://pdfium-review.googlesource.com/12590 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
2017-08-28Add a nullptr check in ReplaceIndirectObjectIfHigherGeneration().Lei Zhang
Avoid pushing nullptrs into the orphans list. Change-Id: I2d52c83e6f20e89be101365d3cca0960b4941a4f Reviewed-on: https://pdfium-review.googlesource.com/12190 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-28Move replaced indirect objects to the orphans list.Lei Zhang
ReplaceIndirectObjectIfHigherGeneration() deletes replaced objects, but those objects may be in use. So move them to the orphans list instead to avoid potential dangling pointers. BUG=chromium:757705 Change-Id: Ide83a1b85b754166d298fd50e655ca331ba4f942 Reviewed-on: https://pdfium-review.googlesource.com/11670 Reviewed-by: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-02-16Avoid a potential leak in CPDF_IndirectObjectHolderTom Sepez
Keep a vector of object superseeded by another object. These will no longer be returned from the holder, but it will clean them Change-Id: If9754ff6614bd79e9de6ce8c3492230435813218 Reviewed-on: https://pdfium-review.googlesource.com/2790 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-01-23Update safe numerics package to get bitwise opstsepez
Fix callers conventions to avoid ambiguity. Fix bad bounds check unmasked by change. Directly include headers no longer pulled in by numerics itself. Review-Url: https://codereview.chromium.org/2640143003
2016-11-21Fixup lint flags.Dan Sinclair
The -build/include setting was masking out build/include_what_you_use. This CL restores them, fixes any build errors, and adds NOLINT as needed. As well, the runtime/explicit and runtime/printf flags are aslo enabled and NOLINT'd. lint cleanups Change-Id: Ib013b3eb29c8d0e48cad74c5df9028684130719f Reviewed-on: https://pdfium-review.googlesource.com/2030 Reviewed-by: Tom Sepez <tsepez@chromium.org>
2016-11-16Move ByteStringPool from document to indirect object holder.tsepez
Since the indirect object holder is now in the object creation business, this will allow it to intern strings in a subsequent CL. Review-Url: https://codereview.chromium.org/2509773003
2016-11-15Make AddIndirectObject() take a unique_ptr.tsepez
Add convenience routines to create and add object in one step. Review-Url: https://codereview.chromium.org/2489283003
2016-11-07Use unique_ptr return from CPDF_Parser::ParseIndirectObject()tsepez
In turn, propgate to callers. This introduces a few release() calls that will go away as more code is converted. It also removes a couple of WrapUnique calls that are no longer needed as ownership of the object flows along. Review-Url: https://codereview.chromium.org/2479303002
2016-11-04Pass object to ReplaceIndirectObjectIfHigherGeneration() by unique_ptr.tsepez
Review-Url: https://codereview.chromium.org/2477003002
2016-11-04CHECK for re-addition of indirect objectstsepez
Review-Url: https://codereview.chromium.org/2471263005
2016-11-04Reland "Remove CPDF_Object::Release() in favor of direct delete"tsepez
This reverts commit f0d5b6c35fa343108a3ab7a25bc2cc2b3cf105b3. Review-Url: https://codereview.chromium.org/2478303002
2016-11-04Assert objnum non-zero in ReplaceIndirectObjectIfHigherGeneration()tsepez
Removes a path where it might not have taken ownership of an object, at the expense of making callers check first. This eases making the second argument an unique_ptr someday. Review-Url: https://codereview.chromium.org/2475823002
2016-11-04Revert of Remove CPDF_Object::Release() in favor of direct delete (patchset ↵dsinclair
#11 id:200001 of https://codereview.chromium.org/2384883003/ ) Reason for revert: Looks like it's blocking the roll. https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_ng/builds/186619 Original issue's description: > Remove CPDF_Object::Release() in favor of direct delete > > Follow-on once we prove Release always deletes in previous CL. > > Committed: https://pdfium.googlesource.com/pdfium/+/4de3d095c9d9e961f93750cf1ebd489fd515be12 TBR=thestig@chromium.org,tsepez@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/2478253002
2016-11-03Remove CPDF_Object::Release() in favor of direct deletetsepez
Follow-on once we prove Release always deletes in previous CL. Review-Url: https://codereview.chromium.org/2384883003
2016-10-14Revert "Update CPDF_IndirectObjectHolder APIs for unique objects."Tom Sepez
This reverts commit 3ba098595ae56b64eacc0c25ab76b89a4d78d920. TBR=thestig@chromium.org,weili@chromium.org Review URL: https://codereview.chromium.org/2424533003 .
2016-10-14Update CPDF_IndirectObjectHolder APIs for unique objects.tsepez
Doing so highlights a few places where ownership is dubious. Add convenience functions to return an unowned reference to a newly-created indirect object. Review-Url: https://codereview.chromium.org/2419173002
2016-10-04Move core/fpdfapi/fpdf_parser to core/fpdfapi/parserdsinclair
BUG=pdfium:603 Review-Url: https://codereview.chromium.org/2392603004