summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-03-28Refcount all CFX_DIBSources (and subclasses) all the time.Tom Sepez
There are currently several ownership models for these objects, including ad-hoc logic for sharing and deletion, and the now-redundant CFX_DIBitmapRef externally-counted handle to the DIBs. Replace them all with the internal refcount scheme. Change-Id: I2db399dfc19219eda384f94cc989353b78ce2872 Reviewed-on: https://pdfium-review.googlesource.com/3166 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-28Remove CFX_ArrayTemplate in CXFA_ValueArrayTom Sepez
Change-Id: I68f317b9fb9b162a5d99cdacc619c85f96a5bf52 Reviewed-on: https://pdfium-review.googlesource.com/3239 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-27Cleanup fx_dib_composite part 6chromium/3054Nicolas Pena
Simplify two more methods. Change-Id: I1bb4c827a14f63c743336df152ff88a6b4e52934 Reviewed-on: https://pdfium-review.googlesource.com/3214 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-03-27Return arrays where appropriate in fxfa.Tom Sepez
Also, remove some default method arguments along the way. Change-Id: Ifbd157499881ed6a3777f3903dd7f0193753cf59 Reviewed-on: https://pdfium-review.googlesource.com/3219 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-03-27Convert new into MakeUniqueDan Sinclair
This Cl converts some new calls into pdfium::MakeUnique calls. Change-Id: Ifa4a67e305ffa75e2be560447ece21ccfa70bf3f Reviewed-on: https://pdfium-review.googlesource.com/3232 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-27Verify available bits in bit streamDan Sinclair
The methods to read n bits from the huffman stream are not correctly checking that the bits are available. This means, we'll end up reading 0 bits due to the checks below and pretend like the read worked. This Cl adds the check that we are not at the end of the bit buffer before attempting the bit read. Bug: chromium:672176 Change-Id: I206f2d54da31c344cf649ca024644d1cce762fe7 Reviewed-on: https://pdfium-review.googlesource.com/3231 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-27Fix some ASAN issues in fx_skia_deviceNicolas Pena
- Flush is needed in ~CFX_FxgeDevice, otherwise it may be called after deleting the bitmap, when calling the destructor of the skia device driver. - SkDashPathEffect::Make copies the given intervals instead of owning them, so free the input to that method. - If StartDIBits creates a new CFX_ImageRenderer, then the corresponding CancelDIBits needs to delete the handle. Bug: chromium:705131 Change-Id: I22c7c51a4070e73538eb8af51a60afeaa67f8bb7 Reviewed-on: https://pdfium-review.googlesource.com/3230 Commit-Queue: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-27Guard against lengths greater then input sizeDan Sinclair
If we get a requested length that is longer then the available buffer size we bail as we won't be able to read the needed data anyway. Bug: chromium:672177 Change-Id: Idb41671c07fe758ec0c1d4d6f84ead0a58fa8339 Reviewed-on: https://pdfium-review.googlesource.com/3221 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-03-27Add Mac 10.12 pixel expectationsNicolas Pena
Bug: pdfium:626 Change-Id: I93a0d02c26d1a44c0fca666cfd09df32ecc1a23d Reviewed-on: https://pdfium-review.googlesource.com/3222 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-27Remove old test expectations after the Mac 10.12 upgrade.Lei Zhang
BUG=chromium:703912 Change-Id: I5b4e582afc95b845e8e5e7a4e14581127c18de2d Reviewed-on: https://pdfium-review.googlesource.com/3193 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-03-27Update to zlib 1.2.11Adenilson Cavalcanti
This is the same version used by Chromium (as also the latest release of zlib). BUG=687631 Change-Id: Ia4bcdee3c36443ba01914d157ea795d7fb881a45 Reviewed-on: https://pdfium-review.googlesource.com/3096 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-27fix new tab crash in skia clip stackCary Clark
The crash on the new tab page is triggered by processing a transparency. This creates a new Skia device in CPDF_RenderStatus::LoadSMask(): // cpdf_renderstatus.cpp # 2557 if (!bitmap_device.Create(width, height, format, nullptr)) which sets the Skia clip stack to empty. It then calls RenderObjectList() RenderSingleObject() ProcessClipPath() which resets the clip stack; // cpdf_renderstatus.cpp # 1882 m_LastClipPath = ClipPath; m_pDevice->RestoreState(true); At this point m_LastClipPath contains {m_Ref={m_pObject={m_pObj=empty } } } The impelemntation in CFX_AggDeviceDriver::RestoreState() is // fx_agg_driver.cpp # 1283 if (m_StateStack.empty()) return; This hides unbalanced save/restores, but reworking PDFium to balance is nontrivial. R=dsinclair@chromium.org BUG=chromium:704442 Bug: Change-Id: Ia70d4dd7bd118e40adc5c029acbaa0b66372d3aa Reviewed-on: https://pdfium-review.googlesource.com/3191 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-27kill another CFX_ArrayTemplate in cfde_txtedtengine.cppTom Sepez
Change-Id: I87521aa9bdc796895f1db144fda22b1cb44d2089 Reviewed-on: https://pdfium-review.googlesource.com/3215 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-27Use std::vector in fxfa/app.Tom Sepez
Change-Id: I83fed055cb92ccff85829d7aea7a9624b8f07456 Reviewed-on: https://pdfium-review.googlesource.com/3218 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-27Ensure empty output directory to avoid duplicate uploadStephan Altmueller
BUG= Change-Id: I491460db0b73e5f6fe0731611400af30e6458537 Reviewed-on: https://pdfium-review.googlesource.com/3121 Reviewed-by: Wei Li <weili@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-27Remove most Mac only FRC corpus test suppressions.Lei Zhang
Now that all the bots are running OS X 10.12, the results are consistent with developer machines. BUG=pdfium:626 Change-Id: I9d0a85679fda8934ad8f76dbabe513974f080004 Reviewed-on: https://pdfium-review.googlesource.com/3194 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-26Use PartitionAlloc for JavaScript ArrayBuffers and strings.Chris Palmer
BUG=pdfium:681 Change-Id: I5073d80d9bd623b73e578d5ba2226c39c371bab0 Reviewed-on: https://pdfium-review.googlesource.com/3097 Commit-Queue: Chris Palmer <palmer@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-24Use std::vector<std::unique_ptr>> in cxfa_ffpageviewchromium/3053Tom Sepez
Change-Id: Ie28afe16c1bcfb6a70c07cd54cc795e0bf5573c4 Reviewed-on: https://pdfium-review.googlesource.com/3216 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-03-24Use unique_ptr in CFieldTree::NodeNicolas Pena
Bug: chromium:704824 Change-Id: I3de1a0bcee3317cfaa7e56578b637e427098230a Reviewed-on: https://pdfium-review.googlesource.com/3213 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-24Refcount CPDF_CMap all the time.chromium/3052chromium/3051Tom Sepez
Change-Id: I85ea9529f4188bf818ee96c37944e4546411f79c Reviewed-on: https://pdfium-review.googlesource.com/3211 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-03-24Fix CFX_FxgeDevice constructor and destructor in SkiaNicolas Pena
Attach and Create methods may be called without _SKIA_SUPPORT_, so the bitmap ownership code can't be if def'd to _SKIA_SUPPORT_. Bug:chromium:704835 Change-Id: If6a7da508156ca3c45898bf101d84dd8295e479f Reviewed-on: https://pdfium-review.googlesource.com/3210 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-03-23Remove dead code in fxet_edit.h.chromium/3050Lei Zhang
Change-Id: Ide1702bbe07bd973293331fe6389b41c057691ba Reviewed-on: https://pdfium-review.googlesource.com/3123 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-03-23Fix CFX_RetainPtr move-assign semantics.Tom Sepez
Ensure moved value becomes a nullptr after the move. Update comment while we're at it. Change-Id: I7a2999d5f5c5142cc7826cd7880b1e2317b5445f Reviewed-on: https://pdfium-review.googlesource.com/3163 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-03-23Use std::map<> in CPLST_SelectTom Sepez
Replace integer state value with an enum. Change-Id: I78eacf90465692946640ea5a031af03259fd417f Reviewed-on: https://pdfium-review.googlesource.com/3155 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-03-23Remove unused CXFA_WidgetAccIterator methodsDan Sinclair
These methods are not called and are un-implemented. Change-Id: Ib2d7f8ae110dd56ec331bb6a6696b49b63cabe3f Reviewed-on: https://pdfium-review.googlesource.com/3165 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-23Tighten up XFA VisibilityDan Sinclair
This Cl changes the protected sections to be private where possible in XFA. Change-Id: Ibeb6ad00389686b666b1c3c5e136b9eefe35ec9e Reviewed-on: https://pdfium-review.googlesource.com/3164 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-23Cleanup fx_dib_composite part 5Nicolas Pena
Simplify CompositeRow_Argb2Argb method. Change-Id: I8febf50375d5a0a56ba0eb77e921a506a6e327de Reviewed-on: https://pdfium-review.googlesource.com/3161 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-23Roll v8Dan Sinclair
Pull latest v8. Change-Id: I6aa1a80d27c6cd0e748d256dbfd813112efa352c Reviewed-on: https://pdfium-review.googlesource.com/3162 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-23fix skia path debugCary Clark
SHOW_SKIA_PATH code had bit-rotted. R=dsinclair@chromium.org BUG= Change-Id: I8961853aa0373fb0a04f829b8e78722197e8f5af Reviewed-on: https://pdfium-review.googlesource.com/3122 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-23Cleanup some xfa/fxfa code.Dan Sinclair
This CL moves the .h files to have names corresponding to the contained classes. The .cpp files are moved alongside the .h files. Any extra classes in the .h files have been split into their own files. Change-Id: I14b4efc02417f0df946500e87b6c502e77020db8 Reviewed-on: https://pdfium-review.googlesource.com/3160 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-23Fix two CloneNonCycle issuesWei Li
CloneNonCycle() tries to detect cyclic object references without copying them. There are two issues: -- for elements in an array or a dictionary, they should be able to refer to the same object, which are not cyclic; -- for cyclic referenced elements in an array or a dictionary, do not clone the element at all. Having nullptr or <key, nullptr> as an element, like we did before, might cause crash when the element being accessed. BUG=chromium:701860 Change-Id: Id0304accde76ed06fa5ce640994c7628359600fb Reviewed-on: https://pdfium-review.googlesource.com/3156 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-23Handle the Clip command list being emptyDan Sinclair
If the command list is already empty when we attempt to restore the clip we will access outside the command array. BUG=chromium:704442 Change-Id: Ib7c44e14f0de175f1c10c1a538d16987aa49bf8a Reviewed-on: https://pdfium-review.googlesource.com/3159 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-23Revert "Remove CFX_FixedBufGrow"Nicolás Peña
This reverts commit 55d1d0191ea8316df32858d8cc62fb7c620e8613. Reason for revert: Slowing down corpus tests by a lot on Mac/Win Original change's description: > Remove CFX_FixedBufGrow > > This Cl replaces the CFX_FixedBufGrow class with std::vector. > > Change-Id: I85c85b7a8de4794840b561e09841bb464cfa9dfe > Reviewed-on: https://pdfium-review.googlesource.com/3138 > Reviewed-by: Tom Sepez <tsepez@chromium.org> > Commit-Queue: dsinclair <dsinclair@chromium.org> > TBR=tsepez@chromium.org,dsinclair@chromium.org,pdfium-reviews@googlegroups.com # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: Iaee27570f140b2033b5d8fb8f3077fc839558d64 Reviewed-on: https://pdfium-review.googlesource.com/3158 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-03-23Cleanup DocType definesDan Sinclair
This Cl synchronizes the DocType's defined in XFA with the DOCTYPE flag used in public/. The internal XFA version is converted to an enum class. Change-Id: I1f7be71a200c1ec0f09f9b08099791da1f4fa2e4 Reviewed-on: https://pdfium-review.googlesource.com/3152 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-23Remove unused XFA_VALIDATE codeDan Sinclair
The XFA Validation flag is always set to preSubmit. This Cl removes the flag and other values and just uses the preSubmit option. Change-Id: Ic2e88d72ad94b605a2da355c4c0a56def47df73e Reviewed-on: https://pdfium-review.googlesource.com/3153 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-23Remove unused invalidate flagDan Sinclair
The flag passed to the DocEnvironment::InvalidateRect method is not used. Remove. Change-Id: I2a996e0bbf7f6a010c985bf4e9df0084dc0a7ea3 Reviewed-on: https://pdfium-review.googlesource.com/3154 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-03-23Remove dead CFX_Edit code and fix some typos.Lei Zhang
Change-Id: Ieaac36e06db3d1e2b857d999a7d3d9cd5c5a9506 Reviewed-on: https://pdfium-review.googlesource.com/3118 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-22Return errors after validation instead of ASSERT in CPDF_DataAvailNicolas Pena
Change-Id: I909deca1d0bfc6de5ac0fd2e6956f9b918caf17a Reviewed-on: https://pdfium-review.googlesource.com/3157 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-03-22Use std::vector in cfde_txtedtenginechromium/3049Tom Sepez
Change-Id: I651782e6eb6b14580a89d9d613404e7984a76cf0 Reviewed-on: https://pdfium-review.googlesource.com/3141 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-03-22Use unique_ptr in xfa_ffpushbutton.hTom Sepez
Change-Id: I605c1219b1090eb13d22237fa1d61d9defe137d5 Reviewed-on: https://pdfium-review.googlesource.com/3151 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-22Use unique_ptr for CFDE_XMLDoc::m_pRootTom Sepez
Remove some less helpful helper methods. Change-Id: Id027e31b6584156263c4aa0c2888e91fa44e4b0b Reviewed-on: https://pdfium-review.googlesource.com/3150 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-03-22Convert to use info.Holder instead of info.ThisDan Sinclair
The definition of info.This is changing in v8. We want to work with the Holder and not what info.This will be returning in the future. Change-Id: Ic988f62d225569398cfde84ab51c72ae620a991a Reviewed-on: https://pdfium-review.googlesource.com/3147 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-22Remove unused docview flagDan Sinclair
When creating the XFA doc view we always pass the same docview flag (0). So, the map will only ever have one item in it. This Cl simplifies the code by removing the map and just dealing with a single doc view. Change-Id: If17e2cda4c3f6c1f45dec921844f09538cc890fc Reviewed-on: https://pdfium-review.googlesource.com/3149 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-22Cleanup fx_dib_composite Part 4Nicolas Pena
More method simplification, new helper GetGrayWithBlend Change-Id: Ice28591c590e2210f3b2864ac16b2d57abedeeb0 Reviewed-on: https://pdfium-review.googlesource.com/3145 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-22Fix ASSERT in CPDF_Data_AvailNicolas Pena
If ParseIndirectObjectAt fails, the replaced object will be null. So we can't ASSERT the output of ValidatePage. CL introducing the ASSERT: https://codereview.chromium.org/2483633002/ BUG=chromium:702897 Change-Id: Ib6e8c0bccaf2c05893f0abef27d431e112064865 Reviewed-on: https://pdfium-review.googlesource.com/3146 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-03-22Fix Mac tests on 10.12Nicolas Pena
md5's with text are changed, so need to allow both the previous and the new one. Pixel tests with text also fail on 10.12, so suppressing those. Found many unexpected successes, so will unsuppress those once all bots are 10.12 BUG=chromium:703912 Change-Id: I6b34aa2f581eb8ea705f3876960b49c89e249347 Reviewed-on: https://pdfium-review.googlesource.com/3144 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-03-22Use moar unique_ptrs in CXFA_DocumentTom Sepez
Change-Id: I3300b3013396885ae2c9f85caee630915799e181 Reviewed-on: https://pdfium-review.googlesource.com/3143 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-22Use unique_ptr in cfx_saxreader.hTom Sepez
Change-Id: Ia024aff32e7e6fb2d5f6454b9856518a76365de2 Reviewed-on: https://pdfium-review.googlesource.com/3142 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-22Remove CFX_FixedBufGrowDan Sinclair
This Cl replaces the CFX_FixedBufGrow class with std::vector. Change-Id: I85c85b7a8de4794840b561e09841bb464cfa9dfe Reviewed-on: https://pdfium-review.googlesource.com/3138 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-21Make CPVT_WordPlace more conformant with the prevailing idioms.Tom Sepez
Add relational operators to replace CmpWord(). Leave CmpLine() for the moment as it saves some work. Remove CmpSec() and just inline comparison of the one member. Invert IsExist() as IsEmpty(). There is a big philosophical discussion as to whether things that are empty exist. I say they do, but they're just empty. Rename Default() to Reset(). Default sounds like a noun. Add AdvanceSection() method and call as appropriate. Change-Id: I01d9479f63a4860e0fd228255540d6d94dc24a9f Reviewed-on: https://pdfium-review.googlesource.com/3139 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>