Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: xfa/fgas/font/fgas_gefont.h

Issue 2297303004: Fix leaked internal font (Closed)
Patch Set: address comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | xfa/fgas/font/fgas_gefont.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fgas/font/fgas_gefont.h
diff --git a/xfa/fgas/font/fgas_gefont.h b/xfa/fgas/font/fgas_gefont.h
index cdb19338a27ededc2fd572f8975d5020cbe2fdeb..05c7640afb24b49742ce768745079cc0053d0e54 100644
--- a/xfa/fgas/font/fgas_gefont.h
+++ b/xfa/fgas/font/fgas_gefont.h
@@ -24,7 +24,10 @@ class CFGAS_GEFont {
uint32_t dwFontStyles,
uint16_t wCodePage,
IFGAS_FontMgr* pFontMgr);
- static CFGAS_GEFont* LoadFont(CFX_Font* pExtFont, IFGAS_FontMgr* pFontMgr);
+ static CFGAS_GEFont* LoadFont(CFX_Font* pExternalFont,
+ IFGAS_FontMgr* pFontMgr);
+ static CFGAS_GEFont* LoadFont(std::unique_ptr<CFX_Font> pInternalFont,
+ IFGAS_FontMgr* pFontMgr);
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
static CFGAS_GEFont* LoadFont(const uint8_t* pBuffer,
int32_t iLength,
@@ -74,7 +77,8 @@ class CFGAS_GEFont {
FX_BOOL LoadFontInternal(const uint8_t* pBuffer, int32_t length);
FX_BOOL LoadFontInternal(IFX_Stream* pFontStream, FX_BOOL bSaveStream);
#endif
- FX_BOOL LoadFontInternal(CFX_Font* pExtFont);
+ FX_BOOL LoadFontInternal(CFX_Font* pExternalFont);
+ FX_BOOL LoadFontInternal(std::unique_ptr<CFX_Font> pInternalFont);
FX_BOOL InitFont();
FX_BOOL GetCharBBoxInternal(FX_WCHAR wUnicode,
CFX_Rect& bbox,
@@ -96,7 +100,7 @@ class CFGAS_GEFont {
CFX_Font* m_pFont;
IFGAS_FontMgr* const m_pFontMgr;
int32_t m_iRefCount;
- FX_BOOL m_bExtFont;
+ bool m_bExternalFont;
std::unique_ptr<IFX_Stream, ReleaseDeleter<IFX_Stream>> m_pStream;
std::unique_ptr<IFX_FileRead, ReleaseDeleter<IFX_FileRead>> m_pFileRead;
std::unique_ptr<CFX_UnicodeEncoding> m_pFontEncoding;
« no previous file with comments | « no previous file | xfa/fgas/font/fgas_gefont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698