Age | Commit message (Collapse) | Author |
|
BUG=pdfium:611
Review-Url: https://codereview.chromium.org/2377393002
|
|
BUG=pdfium:611
Review-Url: https://codereview.chromium.org/2382723003
|
|
In all cases, bool can be used instead without problems.
Review-Url: https://codereview.chromium.org/2368693002
|
|
After this CL: only one global CFX_FontCache used. Any cached items
from it, are released, when they are not being used.
This is restore part of reverted CL:
Original CL: https://codereview.chromium.org/2158023002
Revert reason: BUG=647612
Fix bug CL: https://codereview.chromium.org/2350193003
Review-Url: https://codereview.chromium.org/2350243002
|
|
https://codereview.chromium.org/2158023002/ )
Reason for revert:
Causes heap-use-after-free. See crbug.com/647612.
Original issue's description:
> Fix memory leaking on ClosePage.
> CFX_FontCache refactoring:
> after this CL: Only one global CFX_FontCache used. Any cached items from it, are released, when its are not used.
>
> BUG=79367,48791
>
> The fonts was not cleared after unloading pages.
>
> Test pdf:
>
> http://www.nasa.gov/pdf/750614main_NASA_FY_2014_Budget_Estimates-508.pdf
>
> For this file, we have ~5 fonts per page, which equal ~1 Mb per page.
> In this PDF we have 670 pages, as result after slow scrolling(reading) full document we have ~600 Mb fonts data in memory.
>
> memory usage of PDF Plugin:
> before this CL: ~660 Mb
> after this CL: ~100 Mb
>
> Committed: https://pdfium.googlesource.com/pdfium/+/cde5101eb15b24519e89fa500fe37038bc8e2201
TBR=tsepez@chromium.org,brucedawson@chromium.org,npm@chromium.org,art-snake@yandex-team.ru
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=79367,48791
Review-Url: https://codereview.chromium.org/2350763002
|
|
PWL_FontMap does not need its own charset definitions. fx_edit.h does
not need to define DEFAULT_CHARSET. XFA have their own definitions.
They look different in that most are MAC or MSWin charset definitions.
So they are left untouched. public/fpdf_sysfontinfo.h duplicate ones
were left untouched due to being in public folder.
Review-Url: https://codereview.chromium.org/2347313002
|
|
CFX_FontCache refactoring:
after this CL: Only one global CFX_FontCache used. Any cached items from it, are released, when its are not used.
BUG=79367,48791
The fonts was not cleared after unloading pages.
Test pdf:
http://www.nasa.gov/pdf/750614main_NASA_FY_2014_Budget_Estimates-508.pdf
For this file, we have ~5 fonts per page, which equal ~1 Mb per page.
In this PDF we have 670 pages, as result after slow scrolling(reading) full document we have ~600 Mb fonts data in memory.
memory usage of PDF Plugin:
before this CL: ~660 Mb
after this CL: ~100 Mb
Review-Url: https://codereview.chromium.org/2158023002
|
|
- Methods GetPagesDict, ProcessNonbCJK, CalculateFlags, and
CalculateEncodingDict created to reduce duplicated code.
- Code nits
Review-Url: https://codereview.chromium.org/2323793003
|
|
A few issues are fixed:
--Change variable |m_bLogic| in CFX_Font to |m_bShallowCopy| to
reflect its meaning better;
--For a shallow copy of font, we must guarantee that the copied font
will not be deleted until the shallow copy is deleted. So need to
increase the src font's refcount when copying it;
--The stream |m_pOwnedStream| needs to have matched new/delete
These errors need to be fixed before we can properly delete all the
fonts to address the leaks.
BUG=pdfium:242
Review-Url: https://codereview.chromium.org/2322043002
|
|
Review-Url: https://codereview.chromium.org/2292503002
|
|
Moved ScopedFontTransform from fx_ge_text namespace to fx_font
Moved some arrays used by both CFX_Font and CFX_FaceCache from fx_ge_text to
inside CFX_Font class
Review-Url: https://codereview.chromium.org/2263623002
|
|
Review-Url: https://codereview.chromium.org/2260533002
|
|
Moved classes CFX_FontCache and CFX_AutoFontCache into a separate file.
Review-Url: https://codereview.chromium.org/2246223002
|
|
CFX_SubstFont::m_ExtHandle is never assigned a value different from nullptr.
Similarly, IFX_SystemFontInfo::RetainFont has two implementations.
Both of these return nullptr, so this method is not needed.
Review-Url: https://codereview.chromium.org/2252833002
|
|
Move CFX_FolderFontInfo, CFX_FontMgr, and CFX_FontMapper into their own
classes. There are namespaces in each of the new files, having methods
from the original namespace in fx_ge_fontmap, according to what each
class needs.
Review-Url: https://codereview.chromium.org/2185533006
|
|
This macro isn't buying us anything and reduces transparency.
Review-Url: https://codereview.chromium.org/2179953002
|
|
For the class owned member variables, use std::unique_ptr or
std::vector for memory management.
BUG=pdfium:518
Review-Url: https://codereview.chromium.org/2169793002
|
|
Review-Url: https://codereview.chromium.org/2075383002
|
|
Fix nits along the way.
Review-Url: https://codereview.chromium.org/2083943003
|
|
Review-Url: https://codereview.chromium.org/2077243002
|
|
This change contains files in core directory which were not covered
in part I. This is part of the efforts to make PDFium code compilable
by Clang chromium style plugins.
The changes are mainly the following:
-- move inline constructor/destructor of complex class/struct out-of-line;
-- add constructor/destructor of complex class/struct if not
explicitly defined;
-- add explicit out-of-line copy constructor when needed;
-- move inline virtual functions out-of-line;
-- Properly mark virtual functions with 'override';
-- some minor cleanups;
BUG=pdfium:469
Review-Url: https://codereview.chromium.org/2060913003
|
|
Make the return types/arguments match reality.
Review-Url: https://codereview.chromium.org/2053483002
|
|
Review-Url: https://codereview.chromium.org/2032613003
|
|
So everyone can avoid doing Byte to WideString conversions.
Also remove CFX_GEFont::GetPsName() and deduplicate a couple of
GetPsName() calls.
Review-Url: https://codereview.chromium.org/2019173002
|
|
Review-Url: https://codereview.chromium.org/2004313007
|
|
Review-Url: https://codereview.chromium.org/1990583002
|
|
Some Freetype implementations (like the one packaged with Fedora) do
not support hinting due to patents 6219025, 6239783, 6307566, 6225973,
6243070, 6393145, 6421054, 6282327, and 6624828; the latest one expires
10/7/19. This makes LCD antialiasing very ugly, so we instead fall back
on NORMAL antialiasing.
A before/after on Fedora: https://bugs.chromium.org/p/chromium/issues/detail?id=479400#c31
BUG=479400
Review-Url: https://codereview.chromium.org/1982263004
|
|
Add missing helper function to CFX_ByteTextBuf to avoid the
anti-pattern CFX_ByteString(sBuf.AsStringC()), using the name
"Make" to indicate there's an allocation going on in this case.
Change some method arguments to take pre-existing ByteStrings where
possible.
Review-Url: https://codereview.chromium.org/1977093002
|
|
This CL removes IFX_ArabicChar, IFX_RTFBreak, IFX_TxtBreak, IFX_WordBreak,
IFX_FormatString, and IFX_GSUBTable. References were updated to be the concrete
classes.
The CFX_GSUBTable was also removed as it is unused.
BUG=pdfium:468
Review URL: https://codereview.chromium.org/1882213002
|
|
Attempting to open bug_434.pdf on my Linux box would fail with:
../../xfa/fxfa/app/xfa_fwltheme.cpp:96: virtual FWL_ERR
CXFA_FWLTheme::Initialize(): Assertion `__null != m_pCalendarFont' failed.
I tracked the regression back to [1].
The issue seems to be in CFX_FontManager::AddInstalledFont we will only add
one font for a given Charset. In my case I end up loading 6 charsets, but the
fonts are all strange ones. When I open the PDF, it fails to find 'Arial'
because I've registered these other fonts.
To fix this I changed the m_FaceArray into a struct of {name, chraset}. Then
we record all fonts into this list and search over that list for the charset
when needed. This allows bug_434.pdf to open and the test to pass successfully.
1- https://pdfium.googlesource.com/pdfium/+/fe73e7849b8b4ce49408d2f52f3fc29b370b82b5
Review URL: https://codereview.chromium.org/1874433002
|
|
Neither are implemented. Removed.
BUG=pdfium:468
Review URL: https://codereview.chromium.org/1872463002
|
|
Interface is never implemented.
BUG=pdfium:468
Review URL: https://codereview.chromium.org/1864893003
|
|
This CL is a straight move of the fxge includes into core/fxge/include.
Review URL: https://codereview.chromium.org/1868533002
|