summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-05-01Backfill some FX String unit tests for == and !=.Tom Sepez
... and there are a few inconsistencies which we can now fix. Also add a comment about why these strings aren't headed for the dust-bin long term. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1122573002
2015-05-01Save 4 bytes per CFX_ByteString where intptr_t smaller than long.Tom Sepez
Also prevent theoretical roll-over where long smaller than intptr_t. See bug for discussion. BUG=pdfium:149 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1117413002
2015-05-01Save 8 bytes in each CFX_ByteString/WideString (on "LP64" platforms).Tom Sepez
(Also makes the calculation robust in face of changes to the header). BUG=pdfium:149 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1118983003
2015-05-01Adjust the visibility of the standalone targets in the GN build.Dirk Pranke
As part of the migration from GYP->GN, we want to make sure that we can track when new targets are added to either the GYP or GN builds and that we are building everything we expect to build. In GN, unlike GYP, if a build file gets referenced from other files, building 'all' will cause every target to be built in it. This means in particular, that we can end up trying to build targets that are not necessarily intended to be visible to the rest of the build. To get around this, any target that is defined but hidden (like 'pdfium_unittests', ) should still be visible to a top-level target called "//:gn_visibility". R=tsepez@chromium.org, brettw@chromium.org BUG=461019 Review URL: https://codereview.chromium.org/1120183002
2015-04-30Take adavange of unused bytes at end of widestringTom Sepez
Follow-on to https://codereview.chromium.org/1120703003/ R=thestig@chromium.org Review URL: https://codereview.chromium.org/1112423003
2015-04-30Try to take advantage of unused bytes at end of CFX_ByteString.Tom Sepez
Given the representation of StringData, it seems sub-optimal not to be doing this. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1120703003
2015-04-30Provide an array buffer allocator to V8.chromium/2395chromium/2394chromium/2393chromium/2392chromium/2391chromium/2390chromium/2389chromium/2388Tom Sepez
This allows PDFium to work with current V8, so unpin v8 in the pdfium DEPS file. (I also re-ordered one field in CJS_Runtime, just to put two bools together (may pack tighter), and to put all the v8 stuff together). BUG=pdfium:146 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1118043002
2015-04-29Add suppressions for all new failing corpus tests.Tom Sepez
TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1111393004
2015-04-29Corpus roll to pick up the 2015-04-28 Foxit drop.Tom Sepez
This will undoubtedly red up the tree, as we don't have trybots. A follow-up CL will add the suppressions required for each platform at the moment. The new suppressions in this CL are for cases where we didn't generate an expected result file (due to the issue in fx/FRC_3.5_part1/Introduction.txt). R=thestig@chromium.org Review URL: https://codereview.chromium.org/1111213005
2015-04-28Make CFX_WideString::LockBuffer() completely unused.Tom Sepez
Then remove CFX_{Wide,Byte}String::LockBuffer(). Prelude to a vast simplification. There's an additional copy now in one place, so shoot me. BUG=pdfium:144 R=thestig@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/ee7412f5aef353e5c6f1a64d0e1708ed926869d9 Committed: https://pdfium.googlesource.com/pdfium/+/5a256ad29483eb2b13e6e2c89fe0f77a9103f68f Review URL: https://codereview.chromium.org/1053613004
2015-04-28Pin V8 version until initialization issue in b584bab resolved.Tom Sepez
TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1108913004
2015-04-28Revert "Make CFX_WideString::LockBuffer() completely unused."Tom Sepez
This reverts commit 5a256ad29483eb2b13e6e2c89fe0f77a9103f68f. Reason for revert: broke JS tests. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1112673002
2015-04-28Make CFX_WideString::LockBuffer() completely unused.Tom Sepez
Then remove CFX_{Wide,Byte}String::LockBuffer(). Prelude to a vast simplification. There's an additional copy now in one place, so shoot me. BUG=pdfium:144 R=thestig@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/ee7412f5aef353e5c6f1a64d0e1708ed926869d9 Review URL: https://codereview.chromium.org/1053613004
2015-04-27Revert "Make CFX_WideString::LockBuffer() completely unused."Tom Sepez
This reverts commit ee7412f5aef353e5c6f1a64d0e1708ed926869d9. Reason for revert: VS compile broke. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1106333003
2015-04-27Make CFX_WideString::LockBuffer() completely unused.Tom Sepez
Then remove CFX_{Wide,Byte}String::LockBuffer(). Prelude to a vast simplification. There's an additional copy now in one place, so shoot me. BUG=pdfium:144 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1053613004
2015-04-27SEGV in CFX_BaseSegmentedArray::Iterate() when CS has malformed dictionary.Tom Sepez
Failure to check document-controlled value before using it. BUG=481363 R=palmer@chromium.org, thestig@chromium.org Review URL: https://codereview.chromium.org/1110653002
2015-04-27Fix windows-specific usage of CFX_WideStr::operator LPCWSTR().Tom Sepez
Carry-on from https://codereview.chromium.org/1108903002/ R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1103343002
2015-04-27Reduce usage of operator LPCWSTR from CFX_WideString().Tom Sepez
This involves adding some explicit c_str() calls. Doing so flagged PDF_EncodeText() and FindOptionValue() as having suboptimal signatures, in that we are often throwing away a perfectly fine length and recomputing it. There are still some platform-specific code that needs the operator. R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1101933003
2015-04-27Revert "Kill operator LPCWSTR from CFX_WideString()."Tom Sepez
This reverts commit 15a62973b9b89c3e229cc0ab501c45967f91b325. Reason for revert: broke build on windows, mac. I must have missed some platform-specific conversions. TBR=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1108883002
2015-04-27Kill operator LPCWSTR from CFX_WideString().Tom Sepez
This involves adding some explicit c_str() calls. Doing so flagged PDF_EncodeText() and FindOptionValue() as having suboptimal signatures, in that we are often throwing away a perfectly fine length and recomputing it. R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1101933003
2015-04-23Remove unused nParamNum values from JS method tables.Tom Sepez
The code to validate the number of parameters happens inside each particular method, rather than prior to method dispatch. As such, there's no point in having this number take up space in the table. Add some test to cover at least some of the per-method validations, and update error messages to be more useful. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1084183008
2015-04-23Kill overloaded cast operators in CJS_Value.Tom Sepez
The red-flag here is the explicit invocation of things like params[1].operator CFX_WideString() rather than static_cast<CFX_WideString>(params[1]) to invoke the conversion. Turns out the above won't compile due to ambiguity given the number of implicit constructors for widestrings. CJS_Value has both constructors and assignment operators for the primitive types, which means that conversions can take place unexpectedly in both directions, a second red flag. We don't want the compiler invoking these at will since it may hide bugs. In fact, when they are removed, three such places were discovered. Also rename ToJSValue to ToV8Value to match the other ToV8xxxxx functions added. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1096813008
2015-04-23Fix segmentation fault 'denial of service condition'JUN FANG
BUG=467392 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1064713008
2015-04-22Add missing operators for CFX_WideStringC.Tom Sepez
Part 2 of 4. R=thestig@chromium.org TBR=brucedawson@chromium.org BUG=pdfium:142 Review URL: https://codereview.chromium.org/1099193002
2015-04-22Add missing operators for CFX_ByteStringC.Tom Sepez
Removing the implicit cast operator forces a build breakage should we use ByteStringC in STL containers. Adding an operator< restores correct behaviour. Adding an operator[] avoids re-writing some code to call GetPtr() prior to array indexing. Part 1 of 4. R=thestig@chromium.org TBR=brucedawson@chromium.org BUG=pdfium:142. Review URL: https://codereview.chromium.org/1090303003
2015-04-22Add missing operators for CFX_WideStringTom Sepez
Part 4 of 4. BUG=pdfium:142 R=brucedawson@chromium.org, thestig@chromium.org Review URL: https://codereview.chromium.org/1084293003
2015-04-22Add missing operators for CFX_ByteString.Tom Sepez
Part 3 of 4. BUG=pdfium:142 R=brucedawson@chromium.org, thestig@chromium.org Review URL: https://codereview.chromium.org/1099213002
2015-04-21Fix a regression with cut off images.chromium/2387chromium/2386chromium/2385chromium/2384chromium/2383chromium/2382chromium/2381chromium/2380chromium/2379chromium/2378Lei Zhang
This regressed in commit 3f41851 due to shadow variables. BUG=478164 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1101443004
2015-04-21Kill CFX_StringBufTemplate.Tom Sepez
It's unused. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1098203002
2015-04-21Fix a crashier due to images with abnormal sizeJUN FANG
BUG=453553 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1093323003
2015-04-20Remove Release() from IFX_Edit_UndoItem.Tom Sepez
Also delete unused CFFL_Edit_UndoItem class. BUG=https://code.google.com/p/pdfium/issues/detail?id=140 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1098043002
2015-04-20Remove release method from CBA_AnnotItetator.chromium/2377Tom Sepez
Also remove virtual methods, since this is neither subclassed nor a subclass. BUG=https://code.google.com/p/pdfium/issues/detail?id=140 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1097843003
2015-04-20Remove Release() from CPDF_PageObjectTom Sepez
BUG=pdfium:140 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1093213002
2015-04-17Remove unused FX_NEW definition.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1096853002
2015-04-17Fix all remaining instances of FX_NEW.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1084613006
2015-04-17Replace FX_NEW with new, remove tests from fpdfsdkTom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1089823004
2015-04-17Set m_FontType in CPDF_Font() constructor.Tom Sepez
This can't change for the life of the object, so tidy up some wild uses throughout the code. Also kill pointless Initialize() method. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1060813003
2015-04-17Add nonstd::unique_ptr as a workaround until std::unique_ptr is allowed.Tom Sepez
This is a copy of breakpad's standalone scoped_ptr, which has been renamed to nonstd::unique_ptr, and from which more complicated classes have been removed. The reset() method has also been tweaked to more closely match c++11, and an implicit conversion to bool has been added. BUG=https://code.google.com/p/pdfium/issues/detail?id=55 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1091283002
2015-04-16Make CFX_StockFontArray more robust.Lei Zhang
- Check bounds when accessing array. - Remove potential memory leak. - Merge duplicate code. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1094763002
2015-04-16Replace FX_NEW with new, remove tests from fpdfapiTom Sepez
Very few places where a change is required, but remove FX_NEW to show they've been audited. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1075953004
2015-04-16Replace FX_NEW with new, remove tests from fpdftextTom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1085363003
2015-04-16Replace FX_NEW with new, remote tests from fxcodecTom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1084303002
2015-04-16Replace FX_NEW with new, remove tests in fpdfdoc.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1090693002
2015-04-16Supress the two noisiest warnings on linux standalone builds.Tom Sepez
Code might someday be made clean for -Wmissing-field-initializers and -Wsign-compare, but for now this produces too much noise to be useful. The -Wmissing-field-initializers warning is misguided in a high percentage of cases, and actually leads to bad fixes. R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1094713002
2015-04-16Fix pdfium standalone to compile with VS 2015.Bruce Dawson
This change disables several warnings that fire frequently in pdfium and are not practical to fix at this time. R=tsepez@chromium.org BUG=440500 Review URL: https://codereview.chromium.org/1096463005
2015-04-16Remove checks in fxge/{apple,win32,skia,dib} now that FX_NEW cant return 0Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1062863006
2015-04-16Remove checks in fxge/ge now that FX_NEW can't return 0.Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1081443004
2015-04-15Remove checks in fxcrt now that FX_NEW can't return 0.Tom Sepez
Replace them with |new| so that we can tell by the presence of FX_NEW the places that still need to be audited. R=thestig@google.com, thestig@chromium.org Review URL: https://codereview.chromium.org/1052553006
2015-04-15Fix offset outside bounds of constant string warningsJUN FANG
BUG=380476 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1061013003
2015-04-15Don't use NEON optimized code in lpng_v163chromium/2376chromium/2375chromium/2374chromium/2373chromium/2372Sam Clegg
The source files required to use the NEON function are not included so we should not try to reference those symbols. BUG=477162 TEST=ninja -C out_arm/Release/ pdfium_diff R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1085023003