summaryrefslogtreecommitdiff
path: root/xfa
AgeCommit message (Collapse)Author
2016-06-01Clean up part of CXFA_Node classweili
Mainly clean up Script_NodeClass_Xxx() functions. There are no behavior or API changes. The clean up mainly includes moving static functions into namespace, remove unnecessary conditions or braces, changing NULL->nullptr and local FX_BOOL->bool. Review-Url: https://codereview.chromium.org/2018733002
2016-06-01Track shared isolates better in FXJSE.tsepez
Fix the asymmetry between creating only some isolates and releasing all of them, even the shared ones, by being more careful not to trash those we didn't create. Review-Url: https://codereview.chromium.org/2025193002
2016-06-01Remove use of v8:Lockerstsepez
The entire code base is single-threaded, hence the lockers ought not be required. Review-Url: https://codereview.chromium.org/2026933002
2016-06-01Fix some signed/unsigned comparisons in xfa_fm2jscontext.cppochang
Looks like this causes compile warnings on ARM where wchar_t is unsigned. Review-Url: https://codereview.chromium.org/2023173002
2016-06-01Remove XFA_HFM2JSCONTEXT.dsinclair
This CL removes XFA_HFM2JSCONTEXT and the supporting code. XFA_HFM2JSCONTEXT was replaced by CXFA_FM2JSContext. The translate method was moved to CXFA_FM2JSContext. Review-Url: https://codereview.chromium.org/2024833003
2016-05-31Remove unused CFXJSE_ScopeUtil_IsolateHandleRootOrNormalContexttsepez
Reformat along the way, and mark unimplemented methods as delete. Review-Url: https://codereview.chromium.org/2024283002
2016-05-31Replace void* with CFXJSE_HostObect and make wrapped objects inherit from ittsepez
This will avoid a re-occurrence of BUG 613607 should someone again optimize away CXFA_Object's virtual dtor. Review-Url: https://codereview.chromium.org/2019333006
2016-05-31Fix compile error ‘isnan’ was not declared in this scopephajdan.jr
BUG=none Review-Url: https://codereview.chromium.org/2022793002
2016-05-31xfa_fm2jscontext method clean - pt IIdsinclair
Cleanup ::Max, ::Floor, ::Count, ::Ceil, ::Avg and ::Abs. Remove unneeded strings from reservesForDecode (saves 4k when building pdfium_test). Review-Url: https://codereview.chromium.org/2024133002
2016-05-31xfa_fm2jscontext formatting and cleanup - pt Idsinclair
Review-Url: https://codereview.chromium.org/2025723002
2016-05-31Replace CFXJSE_Value create/destroy with new and delete.dsinclair
In most cases, the destroy calls were removed and the object wrapped in a unique_ptr. Review-Url: https://codereview.chromium.org/2014323003
2016-05-31Fix a leak in CXFA_FontMgr.thestig
Review-Url: https://codereview.chromium.org/2024713002
2016-05-27Workaround dubious casting between CXFA_Object and void* in FXJSEtsepez
This is just a crock to get things working until we fix the underlying issue. When there's single-inheritance, it may often work in practice to C-style (reinterpret) cast a Derived* ptr to void* and then back to a Base* ptr. One place where this blows up is if Derived has virtual functions but Base does not, in which case the world will be offset by the size of a vtable ptr. Because of the use of void* types in FXJSE, the above was happening when setting a CXFA_ThisProxy (Derived, virtual) to be a global object (void*). This would then be cast back to a CFXA_Object (Base, non-virtual) and chaos is ensured. Not sure how far back this goes. Along the way, pick up some tidying which was necessary for simplicity while tracking this down. BUG=613607 Review-Url: https://codereview.chromium.org/2015143005
2016-05-27Avoid two C-style FX_WCHAR* casts in pdfiumbrucedawson
FX_WCHAR* casts were hiding a number of misuses of narrow strings in pdfium, which /analyze identified. Now that those are fixed I did a search for other instances of (FX_WCHAR*) to see if any other bugs were lurking. No bugs were found but one unnecessary cast and one that should be a const_cast were identified. This change fixes those. No behavioral change. Review-Url: https://codereview.chromium.org/2024463002
2016-05-27Fix two bugs found by /analyze toolweili
The first one is about bitwise AND on zero, the result would always be zero. The second one is about using wrong bitmasks, the result would cause branches never get executed. BUG=chromium:613623, chromium:427616 Review-Url: https://codereview.chromium.org/2016243003
2016-05-27Add back-pointer to "Associated widget" to CFWL_WidgetImp.tsepez
This is the last use of CFX_PrivateData, which is now removed. Review-Url: https://codereview.chromium.org/2016743002
2016-05-27Make sure CFDE_XMLSyntaxParser's buffer is null terminated.ochang
BUG=chromium:614962 Review-Url: https://codereview.chromium.org/2017803002
2016-05-26Fix MSVC C4800 build warnings.thestig
TBR=weili@chromium.org Review-Url: https://codereview.chromium.org/2017863002
2016-05-26Remove default arguments from CFX_FxgeDevice.thestig
Remove unused dithering code. Review-Url: https://codereview.chromium.org/2010813003
2016-05-26Add opaque "layout item" to widgets for caller's use.tsepez
This avoids another use of CFX_PrivateData. Note that in the old code, we'd be calling through a m_pImpl onto the same underlying object as we passed as the "key" argument when setting the value, which explains why the get calls, happening one object lower, pass the same argument as which they are being inovked against. Review-Url: https://codereview.chromium.org/2010923002
2016-05-26Make additional FXJSE_CLASS_DESCRIPTORS constanttsepez
Also, no need to track these in the contexts since they are global. Review-Url: https://codereview.chromium.org/2014363002
2016-05-26Make fm2jscontext's class descriptor a static constant.tsepez
Review-Url: https://codereview.chromium.org/2010183002
2016-05-26Rename FXJSE_CLASS to avoid confusion with CFXJSE_CLASStsepez
BUG= Review-Url: https://codereview.chromium.org/2010013003
2016-05-26Enable chromium_code standard for XFA codeweili
Clean up the left code which causes warnings. Enable using chromium_code for XFA compilation, also re-enable all the msvs warning flags except 4267 (same as the main pdfium code). BUG=pdfium:29,pdfium:475 Review-Url: https://codereview.chromium.org/2009813004
2016-05-26Remove unused FWL_Error::OutOfMemorytsepez
Interestingly, callers don't take different action based on the specific code, but that's a matter for another day. Review-Url: https://codereview.chromium.org/2010973003
2016-05-26Remove FXJSE_HOBJECT and FXJSE_HVALUE for CFXJSE_Value*dsinclair
This CL replaces FXJSE_HOBJECT and FXJSE_HVALUE with the concrete CFXJSE_Value* type. All variables are renamed to match. Review-Url: https://codereview.chromium.org/2012253002
2016-05-26Remove default arguments in CFX_RenderDevice.thestig
Review-Url: https://codereview.chromium.org/2011943004
2016-05-26Remove default argument from RestoreState() methods.thestig
Review-Url: https://codereview.chromium.org/2009803003
2016-05-26Replace FXJSE_HCLASS with CFXJSE_Class*dsinclair
This CL removes FXJSE_HCLASS and replaces with CFXJSE_Class*. All variables have been updated to the new type. Review-Url: https://codereview.chromium.org/2014213002
2016-05-26Remove one (of several) usages of SetPrivateData from IFWL_Widgettsepez
Allow an upper layer to store an "event key" directly in the widget. Also fix some dubious logic in key allocation. Review-Url: https://codereview.chromium.org/2012143003
2016-05-26Replace FXJSE_HCONTEXT with CFXJSE_Context*dsinclair
This Cl removes FXJSE_HCONTEXT and replaces it with the concrete CFXJSE_Context. All varibles have been updated as well to match the new type. Review-Url: https://codereview.chromium.org/2013963005
2016-05-26Fix windows build breakage at 25fa42f398d1Tom Sepez
TBR=dsinclair@chromium.org Review URL: https://codereview.chromium.org/2018563002 .
2016-05-26Revert of Remove parameters which are always null (patchset #1 id:1 of ↵dsinclair
https://codereview.chromium.org/2009413002/ ) Reason for revert: Suspect that the lack of this parameter being passed accurately to GetObject is leading to https://bugs.chromium.org/p/chromium/issues/detail?id=613607, and that the right fix will be to pass it. Original issue's description: > Remove parameters which are always null > > These parameters are never set, remove them and their supporting code. > > Committed: https://pdfium.googlesource.com/pdfium/+/818e1900a3811e1bde1e594e4966db612f845966 TBR=tsepez@chromium.org,thestig@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/2014863002
2016-05-25Clean up fx_ge.h and IWYU.thestig
Review-Url: https://codereview.chromium.org/2009253003
2016-05-25Remove parameters which are always nulldsinclair
These parameters are never set, remove them and their supporting code. Review-Url: https://codereview.chromium.org/2009413002
2016-05-25Banish CFX_PrivateData to the XFA sidetsepez
Remove an unused inheritance. The remaining usages are a little more intricate. Review-Url: https://codereview.chromium.org/2015743002
2016-05-25Rename FXJSE_HRUNTIME to v8::Isolatedsinclair
This CL renames all of the instances of FXJSE_HRUNTIME to be v8::Isolate* and updates the various varible names to match the new type. Review-Url: https://codereview.chromium.org/2010833002
2016-05-25Complete or comment a couple Script_NodeClass functionsweili
There are a few functions which are not completed in CXFA_Node class. Complete or comment two functions in this change list. The implementation follows Adobe's XFA 2.1 references here: http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=001363.html. Also, remove a data structure no longer needed -- the code which used it has been removed. BUG=pdfium:29 Review-Url: https://codereview.chromium.org/2011553004
2016-05-25Rename fwl_widgetmgrimp.{cpp,h} to cfwl_widgetmgr.{cpp,h}tsepez
Review-Url: https://codereview.chromium.org/2004293004
2016-05-24Correctly implement GetPartState() functionweili
The original function doesn't seem right. Re-implement it. Review-Url: https://codereview.chromium.org/2001203002
2016-05-24Replace CFX_DSPATemplate with std::binary_search.dsinclair
This CL replaces the last instance of CFX_DSPATemplate with std::binary_search. Review-Url: https://codereview.chromium.org/2007443003
2016-05-24Remove IWFL_WidgetMgr in favor of CFWL_WidgetMgr.tsepez
The pure virtual class isn't buying us anything, and is costing us an otherwise unneeded vtable. Fix pre-existing presubmit warning in fwl_noteimp.cpp:88: If statement had no body and no else clause ... Remove switch on enum() and make separate GetWidget() methods. Review-Url: https://codereview.chromium.org/2004213002
2016-05-23Rename IFX_Unknown to IFX_Retainable.tsepez
Rename addRef() method to Retain() to match Release(). This CL does not convert to CFX_RetainPtrs, which will happen in a follow-on. Review-Url: https://codereview.chromium.org/2005933002
2016-05-23Remove unused class CXFA_FFDocWidgetIteratorweili
This class is not used anywhere. Also there are no implementation of its member functions except MoveToNext() function which was implemented wrong -- direct return in a while loop? BUG=pdfium:29 Review-Url: https://codereview.chromium.org/2007623002
2016-05-23Remove Release() from CFX_RTFBreaktsepez
Use unique_ptrs in several places in xfa_textlayout.h Review-Url: https://codereview.chromium.org/2003843002
2016-05-23Clean up more XFA code which causes warningsweili
This is part of efforts to bring XFA to chromium_code standard. Most of them will have behavior change. The details of these problems are: xfa/fgas/layout/fgas_rtfbreak.cpp: Wrong condition with misused variable xfa/fgas/localization/fgas_locale.cpp Unnecessary condition xfa/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp xfa/fxfa/app/xfa_fffield.cpp Unreachable code should be the correct code xfa/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp xfa/fxbarcode/qrcode/BC_QRDetector.cpp Wrong condition logic BUG=pdfium:29 Review-Url: https://codereview.chromium.org/2000073003
2016-05-20Return no style in GetItemStyles() for item of null pointerweili
The error handling in GetItemStyles() of list box is wrong. -1 is 0xFFFFFFFF in uint32_t, which suggests all the style bits on. This was discovered by a signed/unsigned mismatch warning. BUG=pdfium:29 Review-Url: https://codereview.chromium.org/2005583002
2016-05-20Use enum type for char type variablesweili
The mixed use of enum and uint32_t causes warnings. And it is more meaningful to use enum for char type variables. BUG=pdfium:29 Review-Url: https://codereview.chromium.org/2001733002
2016-05-20Remove Release() from CFX_Barcodetsepez
Review-Url: https://codereview.chromium.org/2000883002
2016-05-20Fix /analyze warnings in fxbarcode/tsepez
Part of the fix to the issues in bug 613623. These are all real bugs arising from non-use of L""-style literals band-aided over with casts. Remove the casts, and fix the literals or replace with empty string constructors. BUG=613623, 427616 Review-Url: https://codereview.chromium.org/1999933002