From 833619b4441915c7c55085d44b3221eaef0d9800 Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 7 Dec 2016 09:21:17 -0800 Subject: Refcount all the IFX_ stream classes all the time. 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 --- xfa/fgas/font/cfgas_fontmgr.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'xfa/fgas/font/cfgas_fontmgr.h') diff --git a/xfa/fgas/font/cfgas_fontmgr.h b/xfa/fgas/font/cfgas_fontmgr.h index 7b68525188..28a8bb528a 100644 --- a/xfa/fgas/font/cfgas_fontmgr.h +++ b/xfa/fgas/font/cfgas_fontmgr.h @@ -7,6 +7,7 @@ #ifndef XFA_FGAS_FONT_CFGAS_FONTMGR_H_ #define XFA_FGAS_FONT_CFGAS_FONTMGR_H_ +#include #include #include @@ -214,7 +215,7 @@ class CFGAS_FontMgr { bool EnumFontsFromFontMapper(); bool EnumFontsFromFiles(); void RegisterFace(FXFT_Face pFace, const CFX_WideString* pFaceName); - void RegisterFaces(IFX_SeekableReadStream* pFontStream, + void RegisterFaces(const CFX_RetainPtr& pFontStream, const CFX_WideString* pFaceName); void GetNames(const uint8_t* name_table, CFX_WideStringArray& Names); std::vector GetCharsets(FXFT_Face pFace) const; @@ -236,16 +237,20 @@ class CFGAS_FontMgr { CFGAS_GEFont* LoadFont(const CFX_WideString& wsFaceName, int32_t iFaceIndex, int32_t* pFaceCount); - FXFT_Face LoadFace(IFX_SeekableReadStream* pFontStream, int32_t iFaceIndex); - IFX_SeekableReadStream* CreateFontStream(CFX_FontMapper* pFontMapper, - IFX_SystemFontInfo* pSystemFontInfo, - uint32_t index); - IFX_SeekableReadStream* CreateFontStream(const CFX_ByteString& bsFaceName); + FXFT_Face LoadFace(const CFX_RetainPtr& pFontStream, + int32_t iFaceIndex); + CFX_RetainPtr CreateFontStream( + CFX_FontMapper* pFontMapper, + IFX_SystemFontInfo* pSystemFontInfo, + uint32_t index); + CFX_RetainPtr CreateFontStream( + const CFX_ByteString& bsFaceName); CFX_FontDescriptors m_InstalledFonts; CFX_MapPtrTemplate m_Hash2CandidateList; CFX_MapPtrTemplate*> m_Hash2Fonts; - CFX_MapPtrTemplate m_IFXFont2FileRead; + std::map > + m_IFXFont2FileRead; CFX_MapPtrTemplate m_FailedUnicodes2Nullptr; CFX_FontSourceEnum_File* const m_pFontSource; }; -- cgit v1.2.3