Age | Commit message (Collapse) | Author |
|
This CL renames CFX_RetainPtr to RetainPtr and places in the fxcrt
namespace.
Bug: pdfium:898
Change-Id: I8798a9f79cb0840d3f037e8d04937cedd742914e
Reviewed-on: https://pdfium-review.googlesource.com/14616
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the fx_basic.h header and fixes up includes as needed.
Change-Id: I49af32a8327bdbcda40c50a61ffbd75d06609040
Reviewed-on: https://pdfium-review.googlesource.com/12670
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Add a test for one of our types that fails unless this is the case.
Mark all our other move ctors as |noexcept|.
Change-Id: Ib106f219183d5abf94504af420a43c94b8f40e22
Reviewed-on: https://pdfium-review.googlesource.com/3251
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Ensure moved value becomes a nullptr after the move.
Update comment while we're at it.
Change-Id: I7a2999d5f5c5142cc7826cd7880b1e2317b5445f
Reviewed-on: https://pdfium-review.googlesource.com/3163
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
The issue at hand is caused by a raw pointer rather than a
retained pointer in InheritedData::m_pFontFamily. But the
larger issue is that it's bad to Get() raw pointers from
these, especially when its so cheap to pass them by const
reference.
One reason to Get() a raw pointer is to aid in down-casts, so
add a helper to CFX_RetainPtr to give us downcasted retained
pointers.
BUG=pdfium:665
Change-Id: Ic8624af09664ff603de2e1fda8dbde0cf889f80d
Reviewed-on: https://pdfium-review.googlesource.com/2871
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
It's a ref-counted class, so if we're in the destructor, the ref
count has hit zero. We can't make a new ref pointer to itself here,
as it will re-invoke the destructor when it goes out of scope. This
should have been an obvious anti-pattern in hindsight.
The object in question can't be in the m_pFontManager, since the font
manager retains a reference, and we wouldn't get to this destructor
while that is present. So the cleanup isn't required.
Fixing this revealed a free-delete mismatch in cxfa_textlayout.cpp.
I also converted to use unique_ptrs in a few places near this issue.
Fixing this revealed a UAF in CFGAS_GEFont, memcpy'ing a RetainPtr
is not a good idea as it doesn't bump the ref count.
Also protect and friend the CFGAS_GEFont destructor, to make sure
random deletes don't happen.
Also kill off a const cast, and remove unnecessary conversion to
retain_ptr when we already have one.
TEST=look for absence of -11 in XFA corpus test logs, bots not
currently noticing the segv. Argh.
Review-Url: https://codereview.chromium.org/2631703003
|
|
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
|
|
Required to pass pointers across C-APIs. Need this to clean
up CPDFXFA_Page and retain ptrs.
Review-Url: https://codereview.chromium.org/2583093003
|
|
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
|
|
Part of the work to get rid of |new|s. Stripped from a forthcoming CL.
Review-Url: https://codereview.chromium.org/2536973003
|
|
BUG=pdfium:611
Review-Url: https://codereview.chromium.org/2382723003
|