summaryrefslogtreecommitdiff
path: root/core/fpdfapi/edit/cpdf_creator.h
AgeCommit message (Collapse)Author
2018-06-26Add some more consts to unowned pointers.Tom Sepez
Ideally, unowned ptrs might well be const, as updating something through an unowned reference is best avoided. Change-Id: Ida8111ffe0ee1e30bbf6b7718b0929dfb5cafdff Reviewed-on: https://pdfium-review.googlesource.com/36050 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-06-21Use enum for stages of CPDF_Creator.Henrique Nakashima
Change-Id: Ic750e04a24524d47ba77b9b7cd5a29605965f68b Reviewed-on: https://pdfium-review.googlesource.com/35390 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-06-08Move getting the CPDF_CryptoHandler into CPDF_Creator::WriteStream()Henrique Nakashima
No reason to get it outside and pass it in. Change-Id: I75e3bbd361c04e195004d7c538145dfd56294816 Reviewed-on: https://pdfium-review.googlesource.com/34731 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-06-08Move member initializations to cpdf_creator.hHenrique Nakashima
Change-Id: If19338b63b09ca79aa07c6fbb8eb7e42a689360e Reviewed-on: https://pdfium-review.googlesource.com/34730 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-06-08Instead of CPDF_Creator::m_dwFlags, store its two supported bits.Henrique Nakashima
m_IsIncremental and m_IsOriginal are extracted as soon as the flags are set, so there is no more need for getters. Change-Id: I34331a33d83c1fcbdea6ea1f3e39dfc58d6f85ea Reviewed-on: https://pdfium-review.googlesource.com/34711 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-06-08Remove unused methods in CPDF_Creator, mark others as private.Henrique Nakashima
Also remove the member variable m_dwEncryptObjNum which is never read. Change-Id: Ieb674d6d9783ef298ba3ece1544437b15ad0afe2 Reviewed-on: https://pdfium-review.googlesource.com/34694 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-06-08Remove CPDF_Creator::InitOldObjNumOffsets(). It does nothing.Henrique Nakashima
This method is called, but it returns void and has no side effects: all called methods are const, and no member or static variable is modified. Change-Id: I12084000621728b9994fe7b487852928e7b1180e Reviewed-on: https://pdfium-review.googlesource.com/34690 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-05-28Add const/non-const versions of remaining CPDF_Dictionary methods.Lei Zhang
GetObjectFor() and GetDirectObjectFor(). Change-Id: I588cd994dfccf0ffd4c8f91362a4806dc109251e Reviewed-on: https://pdfium-review.googlesource.com/32991 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-10-03Move the CryptoHandler into the SecurityHandlerArtem Strygin
Change-Id: Idb5928e65833641d0443d955e4f2866d0f94cf5f Reviewed-on: https://pdfium-review.googlesource.com/15291 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-10-03Change the ownership of the CPDF_CryptoHandler.Artem Strygin
Change-Id: I3ae8337c1a77063470eb5baa97db62ea2e90688b Reviewed-on: https://pdfium-review.googlesource.com/15230 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
2017-09-21Move CFX_UnownedPtr to UnownedPtrDan Sinclair
This CL moves CFX_UnownedPtr to UnownedPtr and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: I6d1fa463f365e5cb3aafa8c8a7a5f7eff62ed8e0 Reviewed-on: https://pdfium-review.googlesource.com/14620 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-21Rename CFX_RetainPtr to RetainPtrDan Sinclair
This CL renames CFX_RetainPtr to RetainPtr and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: I8798a9f79cb0840d3f037e8d04937cedd742914e Reviewed-on: https://pdfium-review.googlesource.com/14616 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@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-05-24Convert to CFX_UnownedPtr, part 4.Tom Sepez
Fix strange ownership issue in cpdf_type3char.cpp, and describe the absolutely insane stuff happening there. Change-Id: Iae70f9eca8f125ed3ef677729f1776ba9f10183c Reviewed-on: https://pdfium-review.googlesource.com/5830 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-05-15Remove unused flags from CPDF_CreatorNicolas Pena
The only user of CPDF_Creator is FPDF_Doc_Save, and it only uses flags 1 or 2 when calling Create. Thus, the other two flags will never be set. Change-Id: Ib2eb0ce5585469c7749f0ab350855f1c6a2bba08 Reviewed-on: https://pdfium-review.googlesource.com/5491 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-05-10Store the offset in the archive bufferDan Sinclair
This Cl moves the implementation of the archive buffer behind an IFX_ArchiveStream interface. The buffer holds the current offset and the offset parameter is removed from the CPDF_Creator and various other methods. Change-Id: Ia54e803b58bbfb6ef03fec4a940d2c056d541356 Reviewed-on: https://pdfium-review.googlesource.com/5255 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-05-10Cleaning up Edit codeDan Sinclair
This Cl conslidates if statements, converts int returns to bools where possible and various other cleanups in fpdfapi/edit. Change-Id: Ia31ecc69843117eb5ebfff449a6046a267d08e89 Reviewed-on: https://pdfium-review.googlesource.com/5190 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-05-09Edit code cleanupDan Sinclair
Minor cleans in the fpdfapi/edit code. Change-Id: I7bb2f4add7c6e84f072501035b1f77c218174cca Reviewed-on: https://pdfium-review.googlesource.com/5152 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-05-09Move FPDF_FILEWRITE adapter to own fileDan Sinclair
This Cl moves the adapater out of the fpdfsave.cpp file into its own h/cpp files. The adapter was renamed for clarity. The CPDF_Creator was modified to take the adapter as a constructor param and the Create methods consolidated. Change-Id: Icb104f195ef532dda053c859aae356a8d4a7a54c Reviewed-on: https://pdfium-review.googlesource.com/5151 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-05-09Remove CPDF_Creator friendsDan Sinclair
This CL removes the friend declarations from CPDF_Creator and adds accessor methods instead. Change-Id: I6d8f67b5944aed34af00ff6ea9d23fe7d17cec18 Reviewed-on: https://pdfium-review.googlesource.com/5112 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-05-04Remove some unused IFX_Pause paramsDan Sinclair
This Cl removes IFX_Pause parameters which are always null. Change-Id: I6d36e52380a8f688c5e20f5e19c671f3bcc12868 Reviewed-on: https://pdfium-review.googlesource.com/4874 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-13Move another opertator<<() prototype into correct .h file.Tom Sepez
Prototype should be in header for .cpp file actually implementing it. Change-Id: I8f771a4840e09da419cee384e3d6dc2e7bba1cc4 Reviewed-on: https://pdfium-review.googlesource.com/4170 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-04-13Refcount CPDF_CryptoHandlerchromium/3076chromium/3075chromium/3074chromium/3073chromium/3072Tom Sepez
Avoid tracking ownership via m_bLocalCryptoHandler. Also remove m_bEncryptCloned, as it is always false. Replace some methods with direct calls to underlying code. Change-Id: Ifa9d6f721c59d07e3b8e258f76832ca9f2ea0fc9 Reviewed-on: https://pdfium-review.googlesource.com/4111 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-03-21Replace CFX_FileSizeListArray with a std::mapDan Sinclair
This CL replaces the FileSizeListArray code with a std::map. Change-Id: Ic158ad95e7055693168d186ba428806a59b04c95 Reviewed-on: https://pdfium-review.googlesource.com/3136 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-14Convert CPDF_Creator::m_Pos to uint32_tDan Sinclair
Currently m_Pos is a FX_POSITION. The value stored into the void* is typically a uint32_t. We sometimes read that uint32_t value as a size_t to compare against vector lengths. This Cl converts all usages to be uint32_t and uses pdfium::CollectionSize to get the correct typed vector size. Change-Id: I5f452817ab6049e03477945e4622c6911c89f877 Reviewed-on: https://pdfium-review.googlesource.com/3032 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-01-09Remove CFX_ArrayTemplate from fpdfapitsepez
Review-Url: https://codereview.chromium.org/2611413002
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-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-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-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-04Move core/fpdfapi/fpdf_edit to core/fpdfapi/editdsinclair
BUG=pdfium:603 Review-Url: https://codereview.chromium.org/2386263003