summaryrefslogtreecommitdiff
path: root/xfa/fgas/font/cfgas_fontmgr.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-07 09:21:17 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-07 09:21:18 -0800
commit833619b4441915c7c55085d44b3221eaef0d9800 (patch)
tree68bf76e83078223ba03f490c2c13f484e40154d4 /xfa/fgas/font/cfgas_fontmgr.h
parent8f875507a986d10335e40a5f7c1679aff9770d0a (diff)
downloadpdfium-833619b4441915c7c55085d44b3221eaef0d9800.tar.xz
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
Diffstat (limited to 'xfa/fgas/font/cfgas_fontmgr.h')
-rw-r--r--xfa/fgas/font/cfgas_fontmgr.h19
1 files changed, 12 insertions, 7 deletions
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 <map>
#include <memory>
#include <vector>
@@ -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<IFX_SeekableReadStream>& pFontStream,
const CFX_WideString* pFaceName);
void GetNames(const uint8_t* name_table, CFX_WideStringArray& Names);
std::vector<uint16_t> 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<IFX_SeekableReadStream>& pFontStream,
+ int32_t iFaceIndex);
+ CFX_RetainPtr<IFX_SeekableReadStream> CreateFontStream(
+ CFX_FontMapper* pFontMapper,
+ IFX_SystemFontInfo* pSystemFontInfo,
+ uint32_t index);
+ CFX_RetainPtr<IFX_SeekableReadStream> CreateFontStream(
+ const CFX_ByteString& bsFaceName);
CFX_FontDescriptors m_InstalledFonts;
CFX_MapPtrTemplate<uint32_t, CFX_FontDescriptorInfos*> m_Hash2CandidateList;
CFX_MapPtrTemplate<uint32_t, CFX_ArrayTemplate<CFGAS_GEFont*>*> m_Hash2Fonts;
- CFX_MapPtrTemplate<CFGAS_GEFont*, IFX_SeekableReadStream*> m_IFXFont2FileRead;
+ std::map<CFGAS_GEFont*, CFX_RetainPtr<IFX_SeekableReadStream> >
+ m_IFXFont2FileRead;
CFX_MapPtrTemplate<FX_WCHAR, CFGAS_GEFont*> m_FailedUnicodes2Nullptr;
CFX_FontSourceEnum_File* const m_pFontSource;
};