summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_data_avail.h
AgeCommit message (Collapse)Author
2017-08-31Prevent FPDFAvail_IsDocAvail() from infinite looping.Lei Zhang
BUG=pdfium:875 Change-Id: I3cc29990f0a3398ae903bc14417ec695cca30c6c Reviewed-on: https://pdfium-review.googlesource.com/12391 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Art Snake <art-snake@yandex-team.ru> Reviewed-by: Wei Li <weili@chromium.org>
2017-08-31Remove fx_basic.hDan Sinclair
This CL removes the fx_basic.h header and fixes up includes as needed. Change-Id: I49af32a8327bdbcda40c50a61ffbd75d06609040 Reviewed-on: https://pdfium-review.googlesource.com/12670 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-28Unify CPDF_DataAvail::CheckTrailer.Artem Strygin
Use read validator to check trailer availability Change-Id: Id8c62a6c746f136c05cfa8d646268322e2543b52 Reviewed-on: https://pdfium-review.googlesource.com/11770 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-28Unify CPDF_DataAvail::LoadAllFile.chromium/3199Artem Strygin
Use read validator to check whole file availability. Change-Id: Ic118ccee38557d124ecde3893ee3c18c98c674d5 Reviewed-on: https://pdfium-review.googlesource.com/11712 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-28Unify CPDF_DataAvail::CheckCrossRef.Artem Strygin
Use read validator to check cross ref table availability Change-Id: I050c366a255598ca6d8bcd353afa94c4a09c33a9 Reviewed-on: https://pdfium-review.googlesource.com/11730 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-23Remove useless code.Artem Strygin
Change-Id: Ie1fa04cdcdd426cf76413e7e5fe714ba7922458c Reviewed-on: https://pdfium-review.googlesource.com/11713 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-23Unify CPDF_DataAvail::CheckEnd.Artem Strygin
Use read validator to check "startxref" availability. Change-Id: I258a707e4269fe768898d74db0955302b34ccf34 Reviewed-on: https://pdfium-review.googlesource.com/11711 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-23Unify CPDF_DataAvail::CheckHeader.Artem Strygin
Use read validator to check header availability. Change-Id: Ib482347cb2f112e27a6bcc4e8da865d0ecf1a630 Reviewed-on: https://pdfium-review.googlesource.com/11710 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-15Remove useless code.Artem Strygin
Change-Id: I2c5ea6a0c4487c0200229f4709214bda1f287de8 Reviewed-on: https://pdfium-review.googlesource.com/10990 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-14Refactoring of CPDF_DataAvail::GetObject.Artem Strygin
Use ReadValidator to request exact data on object read. Change-Id: I1d1863097fa2b037e1bb2e4e89b93d26c5d8e066 Reviewed-on: https://pdfium-review.googlesource.com/10510 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-14Refactoring of CPDF_DataAvail::AreObjectsAvailable.chromium/3186Artem Strygin
Use ReadValidator to request exact data on object read. Change-Id: Ie6c3f452e119fa3514e77f1824473c33bb6b855a Reviewed-on: https://pdfium-review.googlesource.com/10491 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-07-28Implement read validator.Artem Strygin
The wrapper for IFX_SeekableReadStream. Which allow us to check data availability on read request and request downloading of non available data on fly. Change-Id: I27c66cd58f43f8432f73104cc3f4c980515a9b56 Reviewed-on: https://pdfium-review.googlesource.com/9050 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: (OOO Jul 28 - Aug 8) dsinclair <dsinclair@chromium.org>
2017-07-26Remove recursion from CPDF_DataAvail::HaveResourceXXX.Artem Strygin
Change-Id: Iacac67bce99b4b4bcc303fb388aaf03f2f99e4f3 Reviewed-on: https://pdfium-review.googlesource.com/9070 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-07-26Remove useless code.Artem Strygin
Change-Id: Ibb7e33dddd79d6266961ebdf56600fc5a091dcb8 Reviewed-on: https://pdfium-review.googlesource.com/9071 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-05-25Mass conversion of remaining class members (non-xfa)Tom Sepez
Change-Id: I8365ba80e3395d59a3cf35dbd9d9162e86e712e3 Reviewed-on: https://pdfium-review.googlesource.com/5970 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-04-13Use vector of unique ptr in cpdf_data_avail.cpp.Tom Sepez
Remove member m_pAcroForm as it is only used in one method, and immediately set upon entry. A local will be fine here. Change-Id: I373f68252249a248061828530098ad759907259a Reviewed-on: https://pdfium-review.googlesource.com/4190 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-07Cleanup string passing in core/fpdf*Tom Sepez
Return strings where possible. Add missing consts to strings passed by ref. Convert non-const cases to pointers. Rename a few methods to be clearer. Change-Id: I86569bc1744f539e6dd67fc73649b272c016328c Reviewed-on: https://pdfium-review.googlesource.com/3951 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-01-09Remove CFX_ArrayTemplate from fpdfapitsepez
Review-Url: https://codereview.chromium.org/2611413002
2017-01-02Use vector of unique_ptrs for page node children.tsepez
Also be sure that a loop terminates without relying on specific behaviour of the callers. Review-Url: https://codereview.chromium.org/2598473002
2016-12-07Refcount all the IFX_ stream classes all the time.tsepez
We can remove a lot of "bOwnsStream" logic in the process. Always pass these by const reference, in case the called method wants to hang on to the stream (one exception is where we stick a raw pointer into a void* slot in a context from another layer). Review-Url: https://codereview.chromium.org/2451493002
2016-12-01Kill some friends in fpdfapi.tsepez
Review-Url: https://codereview.chromium.org/2546813002
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-09Do not load main cross ref table for first page in linearized pdf.art-snake
For the first page in linearized PDFs, it is not necessary to load the main xref table, because it have separate special xref table in the file header. This decreasing the time to show first page in PDF plugin. Review-Url: https://codereview.chromium.org/2483633002
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-07Rename CPDF_Linearized to CPDF_LinearizedHeadertsepez
My OCD insists that classes be named after nouns, and "linearized" feels like an adjective. Remove a redundant "if" while at it. Review-Url: https://codereview.chromium.org/2482973002
2016-11-07Reland of Unify some codeart-snake
Unify some code Move parsing of linearized header into separate CPDF_Linearized class. Original review: https://codereview.chromium.org/2466023002/ Revert review: https://codereview.chromium.org/2474283005/ Revert reason was: Breaking the chrome roll. See https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/331856 ___ Added Fix for fuzzers. Review-Url: https://codereview.chromium.org/2477213003
2016-11-04Revert of Unify some code (patchset #14 id:260001 of ↵chromium/2912chromium/2911dsinclair
https://codereview.chromium.org/2466023002/ ) Reason for revert: Breaking the chrome roll. See https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/331856 Original issue's description: > Unify some code > > Move parsing of linearized header into separate CPDF_Linearized class. > > Committed: https://pdfium.googlesource.com/pdfium/+/71333dc57ac7e4cf7963c83333730b3882ab371f TBR=thestig@chromium.org,brucedawson@chromium.org,art-snake@yandex-team.ru # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/2474283005
2016-11-04Unify some codeart-snake
Move parsing of linearized header into separate CPDF_Linearized class. Review-Url: https://codereview.chromium.org/2466023002
2016-11-02Remove FX_BOOL from coretsepez
Review-Url: https://codereview.chromium.org/2477443002
2016-10-24Rename IFX_ stream nameschromium/2900tsepez
It's been troubling for some time that an IFX_FileStream might actually be an in-memory buffer with no backing file. Review-Url: https://codereview.chromium.org/2443723002
2016-10-12Get rid of CFX_ArrayTemplate<CPDF_Object*>tsepez
They won't work with std::unique_ptr down the road, so replace with std::vector. Review-Url: https://codereview.chromium.org/2411703003
2016-10-04Move core/fpdfapi/fpdf_parser to core/fpdfapi/parserdsinclair
BUG=pdfium:603 Review-Url: https://codereview.chromium.org/2392603004