summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-04-28Change bool type to fix warnings.chromium/2720dsinclair
Switching the Is{SHIFT|CTRL|ALT|}KeyDown methods to bool from FX_BOOL generated cfx_systemhandler.cpp(129): warning C4800: 'FX_BOOL': forcing value to bool 'true' or 'false' (performance warning) on the win_chromium_x64_rel_ng and win8_chromium_ng bots. This CL switches back to FX_BOOL. Attempting to move everything to bool has huge ripple effects. I removed IsINSERTKeyDown as it was always false. Review-Url: https://codereview.chromium.org/1929963002
2016-04-28More FWL interface cleanup.dsinclair
This CL merges the IFWL_Target class into IFWL_Widget and IFWL_Thread into IFWL_App. The IFWL_WidgetMgrDelegate, IFWL_NoteDriver and IFWL_NotThread are removed in favour of their concrete classes. Review-Url: https://codereview.chromium.org/1921853006
2016-04-28Cleanup IFDE_CSS interfaces.dsinclair
This CL removes the follwing in favour of their concrete class. * IFDE_CSSDeclaration * IFDE_CSSSelector * IFDE_CSSSyntaxParser * IFDE_CSSStyleSelector Review-Url: https://codereview.chromium.org/1928763002
2016-04-28Remove output redirect from corpus test runner.dsinclair
The corpus tests redirect output to a string but they just output it later anyway. This CL removes the output redirect and removes the redirect_output flag which will always be False now. Review-Url: https://codereview.chromium.org/1927633002
2016-04-27Replace CFX_PtrArray with typesafe CFX_ArrayTemplate<>, part 3tsepez
Review-Url: https://codereview.chromium.org/1924093003
2016-04-27Revert of Use visual studio toolchain from depot_tools for PDFium ↵weili
compilation (patchset #3 id:40001 of https://codereview.chromium.org/1897523002/ ) Reason for revert: Clang build is broken. drm build has some problem. Will revert this change for now. Original issue's description: > Use visual studio toolchain from depot_tools for PDFium compilation > > Change to use visual studio toolchain from depot_tools by default. > Setting DEPOT_TOOLS_WIN_TOOLCHAIN=0 allows compilation using system > toolchain as before. > > Using toolchain from depot_tools unifies the compilation > environment, and brings the benefits of automated update, bug fixes > etc. > > Committed: https://pdfium.googlesource.com/pdfium/+/590f2d9e057a0d5b17a9706affd3c6115265021b TBR=brucedawson@chromium.org,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/1922373003
2016-04-27Replace CFX_PtrArray with type-safe CFX_ArrayTemplate, Part 2tsepez
Capitalize m_bindItems while we're at it. Review-Url: https://codereview.chromium.org/1932513002
2016-04-27Adding default_exe_manifest to two binariesbrucedawson
gn builds are missing Windows manifests for pdfium_diff.exe and pdfium_test.exe. These manifests are necessary in order to get predictable behavior on Windows. BUG=602505 Review-Url: https://codereview.chromium.org/1927593003
2016-04-27Replace CFX_PtrArray with type-safe CFX_ArrayTemplate<>, Part 1.tsepez
Ideally, these will become std::vector<>, but in the mean time this is quicker and allow us to remove casts. Doing so has already turned up one place where the wrong type of object was being used. Review-Url: https://codereview.chromium.org/1924073002
2016-04-27Use visual studio toolchain from depot_tools for PDFium compilationweili
Change to use visual studio toolchain from depot_tools by default. Setting DEPOT_TOOLS_WIN_TOOLCHAIN=0 allows compilation using system toolchain as before. Using toolchain from depot_tools unifies the compilation environment, and brings the benefits of automated update, bug fixes etc. Review-Url: https://codereview.chromium.org/1897523002
2016-04-27Use the correct default goma directory on Windowsweili
Update the default goma directory to the current one. Review-Url: https://codereview.chromium.org/1924903002
2016-04-27Allow overriding GN build flagsdsinclair
In order to enable XFA from GN builds we need to be able to override pdf_enable_xfa. To do this a build_overrides/pdfium.gni file needs to be created in Chrome. To use that, we have to create a build_overrides/pdfium.gni file in PDFium that just uses the default values. BUG=chromium:62400 Review-Url: https://codereview.chromium.org/1923333002
2016-04-27More IFX_ interface cleanup.dsinclair
Remove IFX_FontProvider, IFX_FontSourceEnum, IFX_SAXReader and IFX_SAXReaderHandler. Review-Url: https://codereview.chromium.org/1930533002
2016-04-27Standardize on ASSERT.dsinclair
There are currently three ways to assert in the code (ASSERT, FXSYS_assert and assert). This CL standardizes on ASSERT. The benefit of ASSERT is that it can be overridden if the platform requies and we can pickup the Chromium version if it has already been defined in the build. This does change behaviour. Currently FXSYS_assert is always defined but ASSERT is only defined in debug builds. So, the FXSYS_assert's would fire in Release builds. That will no longer happen. BUG=pdfium:219 Review-Url: https://codereview.chromium.org/1914303003
2016-04-27Fix incorrect v8 TryCatch.etienneb
The Try-Catch object must live the whole lexical scope. Without the giving a name to the object, this is equivalent to create a temporary that is destroy at the end of the statement. /src/pdfium/pdfium/out/Debug/../../fpdfsdk/javascript/JS_Value.cpp:154:3: warning: object destroyed immediately after creation; did you mean to name the object? [misc-unused-raii] This issue was found by clang-tidy R=dsinclair BUG=589955 Review-Url: https://codereview.chromium.org/1929513002
2016-04-27Remove IFX_SystemHandler.dsinclair
This CL folds IFX_SystemHandler into CFX_SystemHandler. Methods which either had no implementation, or returned a default value have been removed. Review URL: https://codereview.chromium.org/1923093002
2016-04-26CPDF_Document::LoadPattern() and friends always have a valid matrix.thestig
So pass by const-ref instead of by pointer. Review URL: https://codereview.chromium.org/1923153002
2016-04-26Move CPDF_Document code into cpdf_document.cpp.thestig
Review URL: https://codereview.chromium.org/1925453002
2016-04-26Remove several IPDF_ interfaces and CPDF_RenderModule.dsinclair
This CL removes the interfaces: * IPDF_ObjectRenderer * IPDF_OCContext * IPDF_RenderModule * IPDF_PageModule The CPDF_RenderModule was just wrapping new and delete calls. This Cl moves those up to the callers and removes the CPDF_RenderModule class. Review URL: https://codereview.chromium.org/1918323003
2016-04-26CFX_ByteString::Reserve(), ReleaseBuffer() fixes.tsepez
Also identical fixes for CFX_WideString. Reserve() on an empty string would not actually reserve a buffer. Currently unused, but there are places where this would really help. ReleaseBuffer() would rarely return memory to the system, since it would short-circuit thinking it could operate in place. Tune the algorithm slightly so that we hold on when the savings is small. Bounds check release buffer args rather than just asserting. Add tests for all of these. Review URL: https://codereview.chromium.org/1916303004
2016-04-26Clean up CPDF_Page.thestig
- Merge CPDF_Page::Load() into ctor. - Remove always nullptr param for CPDF_Page::ParseContent(). - Remove unneeded indirection in IPDF_RenderModule. - Delete CPDF_ParseOptions. - Fix up CPDF_Pattern. Review URL: https://codereview.chromium.org/1918113002
2016-04-26Fix Wvarargs warning in XFA error code.chromium/2722chromium/2721chromium/2719chromium/2718dsinclair
Chrome has enabled the -Wvarargs warning that was added to clang, this fails with PDFium XFA builds due to two warnings: ../../xfa/fxfa/fm2js/xfa_lexer.cpp:539:16: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs] va_start(ap, msg); ^ ../../xfa/fxfa/fm2js/xfa_lexer.cpp:535:40: note: parameter of type 'XFA_FM_ERRMSG' is declared here void CXFA_FMLexer::Error(XFA_FM_ERRMSG msg, ...) { The issue is that XFA_FM_ERRMSG is an enum and we violate the promotion rules for passing the value to va_start. I removed the enum and named the flags explicitly then pass in the string as the argument. BUG=chromium:606726 Review URL: https://codereview.chromium.org/1921323002
2016-04-26Remove no-op ShowFileDialog(s).tsepez
Two different versions, one in xfa and one in fpdfsdk, both do nothing. Review URL: https://codereview.chromium.org/1915323002
2016-04-26Skip GYP if GYP_PDFIUM_NO_ACTION set.dsinclair
This CL updates the gyp_pdfium script to early exit if GYP_PDFIUM_NO_ACTION=1 is set in the users environment. This allows using GN to generate the out/Debug directory and not have it clobbered on a gclient sync. Review URL: https://codereview.chromium.org/1915953002
2016-04-26Fix unittest with embedded NUL character.etienneb
There is an embedded NUL character (previously line 40). The test was working because the beginning ot the string is identical. But, the rest of the string wasn't compare at all. TESTED: manually etienneb@burger:~/src/pdfium/pdfium$ out/Debug/pdfium_embeddertests --gtest_filter=*.EmptyCreation Note: Google Test filter = *.EmptyCreation [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from FPDFEditEmbeddertest [ RUN ] FPDFEditEmbeddertest.EmptyCreation [ OK ] FPDFEditEmbeddertest.EmptyCreation (13 ms) [----------] 1 test from FPDFEditEmbeddertest (13 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test case ran. (13 ms total) [ PASSED ] 1 test. R=dsinclair BUG=589955 Review URL: https://codereview.chromium.org/1916083002
2016-04-26Roll v8 to 0ff89ea7 and update gyp referencesmachenbach
Contents: https://chromium.googlesource.com/v8/v8/+log/47bcec78..0ff89ea75 BUG=chromium:606547 Review URL: https://codereview.chromium.org/1920863003
2016-04-25Continue documentation cleanupdsinclair
Reformat some more public/ header documentation. Review URL: https://codereview.chromium.org/1917103002
2016-04-25Fixup page removal for XFA documents.dsinclair
Currently when you call DelegePage on a CPDFXFA_Document the page will not be correctly removed. The page is left in the underlying document and, if GetPage was never called for that page index nothing will happen. This CL updates the code to always remove the page_index from the underlying CPDF_Document then, if needed, the original code runs to clear out the XFA page list for that page. BUG=chromium:596373 Review URL: https://codereview.chromium.org/1921033003
2016-04-25Use std::map in xfa_ffdoc.cpptsepez
Review URL: https://codereview.chromium.org/1917493002
2016-04-25Fix incorrect offset computation.etienneb
This issue was found by clang-tidy linter. BUG=589955 Review URL: https://codereview.chromium.org/1921713003
2016-04-25Pass CFX_*StringCs to FX_HashCode_GETA and _GETW hash functions.tsepez
Too many calls were of the form fn(x.c_str(), x.GetLength()) which is an anti-pattern given the StringC classes which tie these together. There are a few places where explicit CFX_*StringCs are constructed, but this can be avoided by changing the args to these functions in the same manner. Removed String_ from name of functions since it added little value. Also removed default argument. Review URL: https://codereview.chromium.org/1919563002
2016-04-25Combine the javascript and pixel test runners.dsinclair
These runners are very similar in their implementation. Combine them into a single test runner. Corpus will, hopefully, be combined into this test runner in the future. Review URL: https://codereview.chromium.org/1906803005
2016-04-25Standalone GN on macdsinclair
Without the mac_deployment_target_build_override variable in build.gni the following error is produced. ERROR at //build/config/mac/mac_sdk.gni:17:27: Undefined identifier mac_deployment_target = mac_deployment_target_build_override ^----------------------------------- Added needed gtest/gtest_mac.* files. BUG=pdfium:106 Review URL: https://codereview.chromium.org/1907193002
2016-04-22Change the code to avoid three unit test failures on release buildweili
We have three failed unit tests -- FX_AllocOverflow(), FX_AllocOverflow2D(), and FX_TryAllocOverflow() on Linux and Mac release builds, because Clang aggressively optimizes the code. Adding some usage of the return value of a function can avoid the function being optimized away by Clang. Review URL: https://codereview.chromium.org/1915693002
2016-04-22Add a simple check for V4 cross reference tableweili
Some unknown software generates cross reference table with the claimed object numbers are all off by one. Add a simple verification function to detect this scenario, thus have a chance to rebuild the correct cross reference table. To avoid unnecessary checks and potiential performance hit, we only check for the very first non free entry. BUG=602650 Review URL: https://codereview.chromium.org/1910063004
2016-04-22Remove CFX_MapPtrTemplate usage in fsdk_baseform.cpptsepez
Replace one instance with std::map. Remove another instance that is never inserted into. Review URL: https://codereview.chromium.org/1919433002
2016-04-22Fix standalone mac builddsinclair
Missing default statement in the switch. Duplicated the method signature on both sides of the #ifdef to make it clearer what was going on. Review URL: https://codereview.chromium.org/1905303003
2016-04-22Remove #ifdef platform which is always true.tsepez
fx_system.h errors out during compile if _FXM_PLATFORM_ is not one of the four values tested in the ifdef. Remove duplicated code, and use unique_ptr for cleanup. Review URL: https://codereview.chromium.org/1912023002
2016-04-21Remove next batch of CFX_ arrays from fpdf_edit_doc.cpptsepez
Review URL: https://codereview.chromium.org/1904303002
2016-04-21Remove more CFX_ArrayTemplate from fpdf_edit_doc.cpptsepez
Review URL: https://codereview.chromium.org/1909213002
2016-04-21Remove one warning from PDFium compilation in Crosweili
The original code caused an optimization warning when gcc tries to get rid of 'count > m_Length - index' in CFX_ByteStringC::Mid() while assuming there is no signed integer overflow. This could also be avoided once FX_STRSIZE is no longer a signed integer type. Review URL: https://codereview.chromium.org/1906213002
2016-04-21Replace CFX_ArrayTemplate with std::vector in CPDF_ObjectStreamtsepez
Replace two parallel arrays with an array of pairs. Several methods always returned same value, make void instead. Review URL: https://codereview.chromium.org/1908153002
2016-04-21Remove unused CFX_IntArray.tsepez
The only place its used, elements are added to it but the array is not used otherwise. Review URL: https://codereview.chromium.org/1906133002
2016-04-21Remove IFDE_CSSTagProvider.dsinclair
There is only one subsclass, use that instead. Remove the use of WideStringC in the API. BUG=pdfium:468 Review URL: https://codereview.chromium.org/1911843002
2016-04-21Remove CFWL_Note.dsinclair
This CL removes the CFWL_Note class. The two subclasses, CFWL_Event and CFWL_Message are distinct types and should not be related by the subclass. The code has been updated to pass the correct types as needed. The various FWL_EVTHASH and FWL_MSGHASH defines have all been removed and turned into an FWL_EventType and FWL_MessageType enum classes. BUG=pdfium:474 Review URL: https://codereview.chromium.org/1901183002
2016-04-21Add a missing initialisation for CPDF_ContentMarkItem.chromium/2717chromium/2716chromium/2715ochang
R=dsinclair@chromium.org BUG=chromium:605491 Review URL: https://codereview.chromium.org/1910143002
2016-04-21Replace CFX_RectArray with std::vector<CFX_FloatRect>tsepez
Use RVO now that we use an array type compatible with it. Review URL: https://codereview.chromium.org/1906903002
2016-04-21Make CFX_BasicArray non-copyable.tsepez
Its implicit copy constructor is unsafe, since it ends up sharing the underlying data. Fix one place where it was being unintentionally invoked. Review URL: https://codereview.chromium.org/1908073003
2016-04-21Remove CFX_ArrayTemplate from fpdf_parser_decode.cpptsepez
Replace two parallel arrays with single array of pairs. Review URL: https://codereview.chromium.org/1911673002
2016-04-21Assert that CFX_ strings are pointer-size.tsepez
The principle has been implicit in the implementation, but make it obvious for future generations. Review URL: https://codereview.chromium.org/1904143002