diff options
author | weili <weili@chromium.org> | 2016-08-04 16:37:48 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-04 16:37:48 -0700 |
commit | 1b4f6b36b3ed8d1f6cea96bc32c1b376f4a499bc (patch) | |
tree | aa3ba6730495096411f2a3555c74e83f5d1fca11 /xfa/fgas/font/fgas_gefont.h | |
parent | 52a5005c453a9e08384e375ae51c5f1ad628fe86 (diff) | |
download | pdfium-1b4f6b36b3ed8d1f6cea96bc32c1b376f4a499bc.tar.xz |
Use smart pointers for class owned pointers
For classes under xfa/fgas, xfa/fwl/basewidget, and xfa/fwl/core,
use smart pointers instead of raw pointer to make memory management
easier.
BUG=pdfium:518
Review-Url: https://codereview.chromium.org/2207093005
Diffstat (limited to 'xfa/fgas/font/fgas_gefont.h')
-rw-r--r-- | xfa/fgas/font/fgas_gefont.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/xfa/fgas/font/fgas_gefont.h b/xfa/fgas/font/fgas_gefont.h index a94583fa65..37aa03eda9 100644 --- a/xfa/fgas/font/fgas_gefont.h +++ b/xfa/fgas/font/fgas_gefont.h @@ -9,6 +9,7 @@ #include <map> +#include "core/fxcrt/include/fx_memory.h" #include "xfa/fgas/crt/fgas_utils.h" #include "xfa/fgas/font/fgas_font.h" @@ -92,16 +93,16 @@ class CFGAS_GEFont { uint32_t m_dwLogFontStyle; #endif CFX_Font* m_pFont; - IFGAS_FontMgr* m_pFontMgr; + IFGAS_FontMgr* const m_pFontMgr; int32_t m_iRefCount; FX_BOOL m_bExtFont; - IFX_Stream* m_pStream; - IFX_FileRead* m_pFileRead; - CFX_UnicodeEncoding* m_pFontEncoding; - CFX_DiscreteArrayTemplate<uint16_t>* m_pCharWidthMap; - CFX_MassArrayTemplate<CFX_Rect>* m_pRectArray; - CFX_MapPtrToPtr* m_pBBoxMap; - CXFA_PDFFontMgr* m_pProvider; + 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; + std::unique_ptr<CFX_DiscreteArrayTemplate<uint16_t>> m_pCharWidthMap; + std::unique_ptr<CFX_MassArrayTemplate<CFX_Rect>> m_pRectArray; + std::unique_ptr<CFX_MapPtrToPtr> m_pBBoxMap; + CXFA_PDFFontMgr* m_pProvider; // not owned. CFX_ArrayTemplate<CFGAS_GEFont*> m_SubstFonts; std::map<FX_WCHAR, CFGAS_GEFont*> m_FontMapper; }; |