summaryrefslogtreecommitdiff
path: root/core/fxcrt
AgeCommit message (Collapse)Author
2017-01-04Add missing operator<() to CFX_RetainPtr.tsepez
Use std::less<>() rather than a direct ptr1 < ptr2 comparison to be strictly correct in face of unspecified behaviour when ptr1 and ptr2 don't point within the same "object" (e.g. segment of memory on a brain-dead segmented architecture). This will allow their use as keys in maps. Review-Url: https://codereview.chromium.org/2616683002
2017-01-03Add CFX_RetainPtr Leak() and Unleak() methodstsepez
Required to pass pointers across C-APIs. Need this to clean up CPDFXFA_Page and retain ptrs. Review-Url: https://codereview.chromium.org/2583093003
2017-01-03Kill last use of CFX_PtrList.tsepez
I'd been waiting on this hoping the code would be refactored out of existence, but it looks to be used. Use tests against x.end() in place of a "null position". This is greatly complicated by the use of "tail position", which now calcluated by std::prev(x.end()) unless the list is empty. Review-Url: https://codereview.chromium.org/2592163002
2016-12-28Make CFX_Observable copy constructable.chromium/2969chromium/2968chromium/2967chromium/2966tsepez
Fix some naming to make things clearer. Review-Url: https://codereview.chromium.org/2587233002
2016-12-15Return unique_ptr from CFX_BinaryBuf::DetachBuffer()tsepez
In turn, make CPDF_Stream() take an unique_ptr. Review-Url: https://codereview.chromium.org/2584683002
2016-12-14Remove unused m_OtfFontData.chromium/2953tsepez
In turn, this makes CFX_BinaryBuf::AttachData() unused. Review-Url: https://codereview.chromium.org/2578793002
2016-12-13Replace CFX_FloatArray with std::vectortsepez
Review-Url: https://codereview.chromium.org/2567503002
2016-12-08Replace CFX_WideStringCArray with std::vector.chromium/2946tsepez
Review-Url: https://codereview.chromium.org/2562833002
2016-12-08Remove last usage of CFX_ObjectArray.tsepez
Review-Url: https://codereview.chromium.org/2558373002
2016-12-08Replace CFX_WideStringArray with std::vectortsepez
Minimalist changes with the tidying of the code to use better loop iterators as a follow-up. Review-Url: https://codereview.chromium.org/2556963004
2016-12-07Replace CFX_ByteStringArray with std::vector.tsepez
Also convernt one nearby array to vector as well. Review-Url: https://codereview.chromium.org/2559903002
2016-12-07Properly ref count IFX_FileAccess.tsepez
Review-Url: https://codereview.chromium.org/2562563002
2016-12-07Catch stray Retains() and Releases() outside of RetainPtr<>.tsepez
The previous CLs made the code clean, so now we can mark more things private, and add friends as appropriate. Review-Url: https://codereview.chromium.org/2560783003
2016-12-07Refcount all the IFX_ stream classes all the time.tsepez
We can remove a lot of "bOwnsStream" logic in the process. Always pass these by const reference, in case the called method wants to hang on to the stream (one exception is where we stick a raw pointer into a void* slot in a context from another layer). Review-Url: https://codereview.chromium.org/2451493002
2016-12-02Tidy fx_stream.htsepez
Group related IFX_ classes. Move #defines to .cpp file that uses them. Replace loose function with static method. Review-Url: https://codereview.chromium.org/2548583004
2016-12-01Make concrete stream classes private to .cpp, part 2tsepez
Fix naming to say "Stream" Review-Url: https://codereview.chromium.org/2543043002
2016-12-01Make more concrete stream classes private to .cpp filestsepez
Review-Url: https://codereview.chromium.org/2545653003
2016-11-30Convert loose FX_Create* functions into static methodstsepez
Also remove a bool that is always false. Review-Url: https://codereview.chromium.org/2539203002
2016-11-29Add pdfium::MakeRetain<>() helper function.tsepez
Part of the work to get rid of |new|s. Stripped from a forthcoming CL. Review-Url: https://codereview.chromium.org/2536973003
2016-11-28Use CFX_MaybeOwned<> in fpdf_edit_create.cppchromium/2936tsepez
Fix missing second template parameter in cfx_maybe_owned.h Review-Url: https://codereview.chromium.org/2522313002
2016-11-23Add CFX_MaybeOwned<> template.tsepez
This will allow us to get rid of more .release()s of unique_ptrs, as shown by the changed cpdf_colorspace usage. Review-Url: https://codereview.chromium.org/2526903002
2016-11-21Fixup lint flags.Dan Sinclair
The -build/include setting was masking out build/include_what_you_use. This CL restores them, fixes any build errors, and adds NOLINT as needed. As well, the runtime/explicit and runtime/printf flags are aslo enabled and NOLINT'd. lint cleanups Change-Id: Ib013b3eb29c8d0e48cad74c5df9028684130719f Reviewed-on: https://pdfium-review.googlesource.com/2030 Reviewed-by: Tom Sepez <tsepez@chromium.org>
2016-11-16Make CPDF_Object subclass constructors intern stringstsepez
Make CDPF_Arrays intern the object they create. Allow passing nullptr as a CFX_WeakPtr shortcut as well. Review-Url: https://codereview.chromium.org/2509123002
2016-11-08Define IsFloatEqual macro properly.thestig
BUG=chromium:663253 Review-Url: https://codereview.chromium.org/2482373002
2016-11-03Remove FX_BOOL entirely.tsepez
FX_BOOL was a type just like a regular C++ bool, except that it took 4x the space and frequently was used to hold values besides true or false. Review-Url: https://codereview.chromium.org/2471353002
2016-11-02Remove FX_BOOL from coretsepez
Review-Url: https://codereview.chromium.org/2477443002
2016-10-31Re-land "Change FX_BOOL definition from int to bool."chromium/2906tsepez
This reverts commit 747dcf7 Review-Url: https://codereview.chromium.org/2468723002
2016-10-29Revert of Change FX_BOOL definition from int to bool. (patchset #15 ↵dsinclair
id:250001 of https://codereview.chromium.org/2453473003/ ) Reason for revert: Potentially blocking the roll, speculative revert. See: https://codereview.chromium.org/2464643002/ Original issue's description: > Change FX_BOOL definition from int to bool. > > If this CL sticks, we can then remove it entirely. > > Committed: https://pdfium.googlesource.com/pdfium/+/dd65283408d9137e2f142e78dff2a1826baab5fd TBR=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/2461893002
2016-10-28Change FX_BOOL definition from int to bool.tsepez
If this CL sticks, we can then remove it entirely. Review-Url: https://codereview.chromium.org/2453473003
2016-10-26Fix some FX_BOOL / int noise in fxcrt.chromium/2902tsepez
Review-Url: https://codereview.chromium.org/2450183003
2016-10-24Rename IFX_ stream nameschromium/2900tsepez
It's been troubling for some time that an IFX_FileStream might actually be an in-memory buffer with no backing file. Review-Url: https://codereview.chromium.org/2443723002
2016-10-17Rename CFX_CountRef to CFX_SharedCopyOnWritetsepez
Avoid confusing this class with other ref-counted objects. Review-Url: https://codereview.chromium.org/2426673002
2016-10-13Clean up fx_basic_util a littlenpm
- Nit fixes. - Remove unused methods. - Replace FX_BOOL with bool. Review-Url: https://codereview.chromium.org/2419433004
2016-10-03Add ptr_util.h from base until std::make_unique<> availabletsepez
Review-Url: https://codereview.chromium.org/2386273004
2016-10-03Rename CFX_WeakPtr::Clear() to DestroyObject()tsepez
|Clear| is too easily mistaken for "clear this pointer only." Review-Url: https://codereview.chromium.org/2385303002
2016-09-29Move core/fxcrt/include to core/fxcrtdsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2382723003
2016-09-28Replace a few more std::unique_ptr.reset() with WrapUnique assignments.thestig
And fix a typo. TBR=tsepez@chromium.org Review-Url: https://codereview.chromium.org/2382443004
2016-09-28Implement weak pointerschromium/2876chromium/2875tsepez
These will be a replacement for CFX_CountRef in future CLs, since CFX_CountRef is manually incremented and error-prone. Review-Url: https://codereview.chromium.org/2377143002
2016-09-28Revert "Rename CPDF_CountedObject to CFX_WeakPtr::Handle"tsepez
This reverts commit fe0179ded8202939ea4f2b92a879b8dede7821ea. This is blocking incremental revision, will try again. Review-Url: https://codereview.chromium.org/2377033003
2016-09-22Rename CPDF_CountedObject to CFX_WeakPtr::Handlechromium/2869tsepez
This better describes its purpose, and reduces confusion with the CFX_CountRef class, which is unrelated. The WeakPtr class itself that manipulates handles is NYI. Review-Url: https://codereview.chromium.org/2366673003
2016-09-22Null CPDF_CountedObj::m_pObj prior to deletiontsepez
This gives additional protection in case of re-entry. Also make CFX_CountRef more robust in face of errors. BUG=649229 Review-Url: https://codereview.chromium.org/2364673002
2016-09-15Add string pools to save storage.tsepez
Adds string hashes so CFX strings will interoperate with STL unordered containers. These will be employed per-document in a subsequent cl. BUG=pdfium:597 Review-Url: https://codereview.chromium.org/2341683005
2016-09-15Add short-cut in CFX_{Byte,Wide}String::Operator<()tsepez
Strings are never less than themselves, and this will occur given the shared CoW nature of these strings. Review-Url: https://codereview.chromium.org/2347433004
2016-09-14Cleanup CPDFXFA_Document.dsinclair
Remove unused params and methods. Cleanup formatting. Review-Url: https://codereview.chromium.org/2322003002
2016-09-13Add check for trivial string equalitytsepez
BUG= Review-Url: https://codereview.chromium.org/2338623005
2016-09-13CFX_FloatPoint default constructor and equals operatorschromium/2860tsepez
Review-Url: https://codereview.chromium.org/2341453002
2016-09-12Make CFX_Obeservable::Observer into a pointer-ish type;tsepez
This may be a better design because it avoids having a level of indirection that the Observer required. Review-Url: https://codereview.chromium.org/2326763002
2016-09-08explicit operator bool for CFX_RetainPtr and CFX_CountRefchromium/2855tsepez
Review-Url: https://codereview.chromium.org/2324733003
2016-09-08Replace CJS_Runtime::Observer with CFX_Runtime<CJS_Runtime>::Observertsepez
Previously, the observer set a flag which conditionalized a null pointer return. Now, we just clear the pointer. Destruction order matters, so add a method to trigger notifications. Review-Url: https://codereview.chromium.org/2322743002
2016-09-07Make Observers into a templated classtsepez
Review-Url: https://codereview.chromium.org/2311343003