summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-11-07More FX_SAFE_INT32 in CJBig2_TRDProcNicolas Pena
Bug: chromium:781780 Change-Id: Ie92d8b570c37e9b3364d1ff4502f444a275ee6c2 Reviewed-on: https://pdfium-review.googlesource.com/17910 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-11-07Change CPDF_PSProc::AddOperator() to do binary search.Lei Zhang
Change-Id: If64a8410c992d5c7bd6504367f11ce946c1ef6aa Reviewed-on: https://pdfium-review.googlesource.com/17871 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-11-07Remove unused parameter from ByteString::FormatFloat().Lei Zhang
Nobody sets |precision| and the method does not read it either. Change-Id: I0f45fe953c005f817d331cbf73e38f7b15a77b81 Reviewed-on: https://pdfium-review.googlesource.com/17890 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-11-07Prevent an OOM error in libtiff.Lei Zhang
BUG=chromium:781582 Change-Id: I17711956884d1902cbd86f2163155b256402ecda Reviewed-on: https://pdfium-review.googlesource.com/17891 Reviewed-by: Chris Palmer <palmer@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-06Cleanup CFXJSE_Value::SetObjectDan Sinclair
All of the callers to SetObject pass in the class so we can remove the class check. The SetJSObject method is no longer needed. The SetHostObject method has been merged into the SetObject method. Change-Id: Id80931b88cc0656d021350ea8d62369513b86b9d Reviewed-on: https://pdfium-review.googlesource.com/17858 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-06Consolidate CFXJSE_Engine constructionDan Sinclair
This CL removes the Initialize method from CFXJSE_Engine and moves the code to the constuctor. The DefineJsContext and DefineJSClass methods are also removed and done directly in the constructor. Change-Id: I3f849509a17a6bda22b520c640f23ee110e939af Reviewed-on: https://pdfium-review.googlesource.com/17857 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-06Cleanup some nits in CFXJSE_EngineDan Sinclair
Change-Id: Ibac2cf311a7e9d88ffb3eb1115210c2cbcc3c4a8 Reviewed-on: https://pdfium-review.googlesource.com/17856 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-06Remove CXFA_Validate::SetTestValueDan Sinclair
The method is called once, so fold into caller. Change-Id: I850e822969e203ce8f204ba2d8e5d99330b36e4b Reviewed-on: https://pdfium-review.googlesource.com/17855 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-06Remove unused externsDan Sinclair
The XFA children externs are never created and never used. Remove. Change-Id: I8a0ce006a2aeebe7dcb6c15d350b4054cdaa81b9 Reviewed-on: https://pdfium-review.googlesource.com/17854 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-06Cleanup CXFA_WidgetAccDan Sinclair
This CL cleans up some CXFA_WidgetAcc methods and hides the need for a CFXJSE_Value inside the class. The API which required the Value always used it to retrieve a boolean value, so make a new API which returns the bool. Change-Id: Ic50a9a73c992a9db8b57ce5f9f5ac17c88267809 Reviewed-on: https://pdfium-review.googlesource.com/17853 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-06Add a CPDF_PSEngine test.Lei Zhang
Change-Id: Ia267f40dc4ebe9e1d28b6a333eddcff749414ffa Reviewed-on: https://pdfium-review.googlesource.com/17870 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-06Improve ByteString{View}::operator<().Lei Zhang
Make it possible to compare: 1) const char* < ByteStringView 2) ByteString < const char* 3) ByteString < ByteStringView 4) const char* < ByteString Do the same for WideString{View}. With new unit test cases. Change-Id: I31da526b1ab78b8d51ec1c99bf29046fe13754d5 Reviewed-on: https://pdfium-review.googlesource.com/17872 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-06Mark string pointers as const in string unit tests.Lei Zhang
Change-Id: I4895ee9c0cbe1aaf1fe9913d39ce11e6ad855dd3 Reviewed-on: https://pdfium-review.googlesource.com/17873 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-06Remove C-style casts in CPDF_PSEngine.Lei Zhang
Fix a few other nits. Change-Id: I12f79b3f83d1695957ba067291f2ee03a7d189ca Reviewed-on: https://pdfium-review.googlesource.com/17810 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-06Remove CXFA_FFDocHandlerDan Sinclair
None of the methods on this class are ever called. We check it once to make sure it exists, but the call to get it will create it so it will always exist. Change-Id: I5b53567c4835f4bb4fe52c42baf28d4290ea517f Reviewed-on: https://pdfium-review.googlesource.com/17852 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-06Call CJX methods directly instead of proxyingDan Sinclair
This CL updates the XFA JS code to call the methods on the CJX objects directly instead of proxying through the CXFA objects. The script methods have been removed from the CXFA objects. Change-Id: I2d7b502473a8e88a7af88b10aa0da602d4998394 Reviewed-on: https://pdfium-review.googlesource.com/17851 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-06Move CXFA_ResolveProcessor to CFXJSE_ResolveProcessor.chromium/3261Dan Sinclair
The resolve processor is only used by cfxjse classes, so move to live in fxjs/. Change-Id: I41b8c8e0a491a2b4ee04c1410cbddef63d843105 Reviewed-on: https://pdfium-review.googlesource.com/17850 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-06Revert "Simplify CPDF_HintsTable."dsinclair
This reverts commit 33591752d2cb14f2e07726ca52afce6efbdc07c9. Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=781529 Original change's description: > Simplify CPDF_HintsTable. > > Use CPDF_LinearizedHeader directly. > > Change-Id: Id12402ef6e6f92fef68d0932df2e1ccb2dcf06aa > Reviewed-on: https://pdfium-review.googlesource.com/15770 > Reviewed-by: Lei Zhang <thestig@chromium.org> > Commit-Queue: Lei Zhang <thestig@chromium.org> TBR=thestig@chromium.org,tsepez@chromium.org,art-snake@yandex-team.ru # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: Idaf8d4c91e869d92b44211cfe48f162037ed7327 Reviewed-on: https://pdfium-review.googlesource.com/17830 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-06Pack struct FXCMAP_CMap more densely to save 1 KB.Lei Zhang
Change-Id: Ida9738f4ad7ef266c2edb794f12dcf49b64fc590 Reviewed-on: https://pdfium-review.googlesource.com/17750 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-11-06Mark some CPDF_StreamContentParser members as const.Lei Zhang
Change-Id: I6c4ee5400307c8321f2558287f4d7571c373fcaa Reviewed-on: https://pdfium-review.googlesource.com/17795 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-11-06Make XFA_MAPMODULESDATA a unique_ptrDan Sinclair
Change-Id: Icd72ee8d098fa0140119519f7079745bd5280a84 Reviewed-on: https://pdfium-review.googlesource.com/17592 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-06Remove recursive paramter from CJX_Node::MoveBufferMapDataDan Sinclair
The recursive paramter is always true, so remove it and fixup code as needed. Change-Id: I18395c1bca415d8a5d85c1eee6a32870c5d7f7e3 Reviewed-on: https://pdfium-review.googlesource.com/17591 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-04Remove flag parameter from CXFA_Node::CreateSamePacketNodechromium/3260Dan Sinclair
The parameter is never changed from the default so, removed and moved the default value into the method as needed. Change-Id: Ifab40ac511b9a0ab879e5c696c6e0b6c84e14541 Reviewed-on: https://pdfium-review.googlesource.com/17616 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-04Remove default values from CXFA_Node::GetNodeListDan Sinclair
This CL removes the default values and inlines in the call sites. Change-Id: Iae95653a5d724918c5944f860a0743053e98fe88 Reviewed-on: https://pdfium-review.googlesource.com/17615 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-04Remove default params for CXFA_Node::{Insert|Remove}ChildDan Sinclair
This CL removes the default values and inlines in the call sites as needed. Change-Id: I68925d57b6230400429421ce728dd5524e5fc9a1 Reviewed-on: https://pdfium-review.googlesource.com/17710 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-04Simplify CPDF_HintsTable.Artem Strygin
Use CPDF_LinearizedHeader directly. Change-Id: Id12402ef6e6f92fef68d0932df2e1ccb2dcf06aa Reviewed-on: https://pdfium-review.googlesource.com/15770 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-04Remove default values from CXFA_Node::{CountChildren|GetChild}chromium/3259Dan Sinclair
This CL removes the default values and inlines into the call sites as needed. Change-Id: I554e9d5ac781003695f90522f9c6c3160653eb59 Reviewed-on: https://pdfium-review.googlesource.com/17572 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-04Remove default values from CXFA_Node::{Remove|Insert|Item}Dan Sinclair
This CL removes the default values and inlines into the call sites as needed. Change-Id: I8ba6acfc99b5db508ce8711108e0676465eda47b Reviewed-on: https://pdfium-review.googlesource.com/17670 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-04Remove default from CJX_Node::MoveBufferMapDataDan Sinclair
This CL removes the default value from the bRecursive flag. Change-Id: I88882fd1206d82facd977f97bda4e585571ce5e0 Reviewed-on: https://pdfium-review.googlesource.com/17571 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-03Remove C-style casts in cpdf_colorspace.cpp.Lei Zhang
Change-Id: Icce0751713dc39d2b3f3c3f23f7ed45df3d4952f Reviewed-on: https://pdfium-review.googlesource.com/17771 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-03Remove flags param from FXMEM_DefaultAlloc() and friends.Lei Zhang
Change-Id: I24404be0065156a1cfdec31bafdf72c27fa70142 Reviewed-on: https://pdfium-review.googlesource.com/17792 Reviewed-by: Chris Palmer <palmer@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-03Check for NULL pointer in _TIFFfree().chromium/3258Lei Zhang
PartitionAlloc does not handle free(NULL), so _TIFFfree() needs to do the check, just like png_free_default() and _cmsFree() for other third party code. BUG=chromium:780709 Change-Id: I4e2ff0ba642c66e4a73e151c9ab42ebb42d34a5b Reviewed-on: https://pdfium-review.googlesource.com/17791 Reviewed-by: Chris Palmer <palmer@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-03Simplify CPDF_SecurityHandler.Lei Zhang
Remove unused method params, impossible code, and mark methods const. Change-Id: Iee95c7b931461e2aadcf2422650a0cd48c8f7696 Reviewed-on: https://pdfium-review.googlesource.com/17790 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-03The component count in CPDF_IndexedCS should be unsigned.Lei Zhang
Since the source of the component count is unsigned. Adjust related variables to also be unsigned. In CPDF_IndexedCS::GetRGB(), switch integer overflow code to use FX_SAFE_SIZE_T, and write to the out params correctly on failure. Change-Id: If7405b4c5e9022ba1992fff2be2bcc1a7826adf4 Reviewed-on: https://pdfium-review.googlesource.com/17770 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-02Move parsing logic from FPDF_DataAvail into CPDF_DataAvail.Artem Strygin
Change-Id: Iacae9723e88eeae52154276b2478e4fd8c309c2d Reviewed-on: https://pdfium-review.googlesource.com/15512 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-11-02Split CJX_Node::RemoveMapModuleKeyDan Sinclair
This CL splits RemoveMapModuleKey to extract ClearMapModuleBuffer which is called on destroy to clear the buffer. This also fixes a potential bug where when we lookup the key, if the hashcode for the key returns 0 we will end up with a nullptr key. Change-Id: Ic2b0529a999f6f789dd81fbc4e02ecfbbf7a7632 Reviewed-on: https://pdfium-review.googlesource.com/17614 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Encapsulate CPDF_FormObject members.Lei Zhang
Also remove a conditional in the CPDF_Form ctor that cannot be true. Change-Id: Icd00233969cea33e9c63d0d6a9d07226c2b173f2 Reviewed-on: https://pdfium-review.googlesource.com/17070 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-02Remove useless code.Artem Strygin
Change-Id: Id355fd03da476674181bae479ccebe50059dfa4f Reviewed-on: https://pdfium-review.googlesource.com/15511 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-11-02Remove default params from some Map Module methodsDan Sinclair
This CL removes the default value from {Set|Get}MapModuleBuffer and inlines into the call sites. Change-Id: Ia003bec3908a1531e572e25ea0a762973b8beebe Reviewed-on: https://pdfium-review.googlesource.com/17630 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Roll {Set|Get}ScriptContent into {Set|Get}ContentDan Sinclair
The SetContent method was a proxy to SetScriptContent. The GetContent added a default param value. The methods have been merged and the GetContent call sites updated to pass in the needed value. Change-Id: I61f950bef8beec7157bdb22e0a25904729f9e00a Reviewed-on: https://pdfium-review.googlesource.com/17613 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Remove default values from CJX_Node::{TryUserData|GetScriptContent}Dan Sinclair
This CL removes the default values an inlines into the call sites. Change-Id: Ic4d05db306eafc037a2f312a6780dbae79097b6c Reviewed-on: https://pdfium-review.googlesource.com/17612 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Fix visibility of some CJX_Node methodsDan Sinclair
This CL fixes the visibility of several CJX_Node methods by making them private. The corresponding methods in CXFA_Node were removed as they aren't called. The OnChanged and OnChanging methods are moved to CJX_Node as they make more sense on the JS object. Change-Id: I2f791915508ec7732647de0db700c06edc4e011d Reviewed-on: https://pdfium-review.googlesource.com/17611 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Refactoring of cross refs availability check.Artem Strygin
Use CPDF_CrossRefAvail to check crossrefs. Change-Id: Ia333cff4e86eaab5bad17424c1bb8ef9bdbca8ff Reviewed-on: https://pdfium-review.googlesource.com/15510 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-11-02Rename Transparency to iTransparency.Lei Zhang
Fix a mismatched parameter name in cpdf_renderstatus.h too. Change-Id: I9765838e6ab93db37791fc282e553b6cb9c51ec5 Reviewed-on: https://pdfium-review.googlesource.com/17050 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-02Remove default values from Set{UserData|Object} and GetUserData.Dan Sinclair
This CL removes the default values and inlines at the call sites. Change-Id: I47ff04a01c30af89949e9c8dd5d51f7ffaef1f98 Reviewed-on: https://pdfium-review.googlesource.com/17610 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Remove some C-style const char* casts.Lei Zhang
Change-Id: I4785dd277b9da072ee3c55e2aaeb688bbf02852e Reviewed-on: https://pdfium-review.googlesource.com/17391 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-11-02Remove default value from CJX_Node::{Set|Try}MeasureDan Sinclair
This CL removes the default values from {Set|Try}Measure and inlines into the call sites. Change-Id: I2356b92d419203cc1cdbea865b6e04b728430f5a Reviewed-on: https://pdfium-review.googlesource.com/17551 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Remove default values from CJX_Node::{Set|Try}BooleanDan Sinclair
This CL removes the default values and inlines into the call sites. Change-Id: I922d40550384196b4288a648043d267538a66095 Reviewed-on: https://pdfium-review.googlesource.com/17590 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Remove default values from CJX_Node::{Set|Try}EnumDan Sinclair
This CL removes the default value and inlines into the call sites. Change-Id: Ib6bc2b27189be3596e83a8b29b7a6a744278ed34 Reviewed-on: https://pdfium-review.googlesource.com/17570 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-11-02Remove default values from CJX_Node::TryContentDan Sinclair
This CL removes the default values from TryContent and inlines into the call sites. Change-Id: I2d3f41f77364a0b923931479a60e07eae98dd5a9 Reviewed-on: https://pdfium-review.googlesource.com/17550 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>