summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font/font_int.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2017-01-19 06:56:13 -0800
committerCommit bot <commit-bot@chromium.org>2017-01-19 06:56:13 -0800
commitdd533baad22f5143c093b98e98463a0dc62899ea (patch)
treee5704fa1f4a8e08109d7d42d10b77a2eb8826e35 /core/fpdfapi/font/font_int.h
parente6cf01356e3336dc4f0717a391d9067693a418c1 (diff)
downloadpdfium-dd533baad22f5143c093b98e98463a0dc62899ea.tar.xz
use unique_ptr in fpdf_font_cid.cpp
Also return CFX_MaybeOwned<> from functions so to make cleanup automatic, avoiding a theoretical leak. Review-Url: https://codereview.chromium.org/2641853004
Diffstat (limited to 'core/fpdfapi/font/font_int.h')
-rw-r--r--core/fpdfapi/font/font_int.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/core/fpdfapi/font/font_int.h b/core/fpdfapi/font/font_int.h
index 2410741e53..41d821ec81 100644
--- a/core/fpdfapi/font/font_int.h
+++ b/core/fpdfapi/font/font_int.h
@@ -12,6 +12,7 @@
#include <vector>
#include "core/fpdfapi/font/cpdf_cidfont.h"
+#include "core/fxcrt/cfx_maybe_owned.h"
#include "core/fxcrt/fx_basic.h"
class CPDF_CID2UnicodeMap;
@@ -30,15 +31,18 @@ class CPDF_CMapManager {
CPDF_CMapManager();
~CPDF_CMapManager();
- CPDF_CMap* GetPredefinedCMap(const CFX_ByteString& name, bool bPromptCJK);
+ CFX_MaybeOwned<CPDF_CMap> GetPredefinedCMap(const CFX_ByteString& name,
+ bool bPromptCJK);
CPDF_CID2UnicodeMap* GetCID2UnicodeMap(CIDSet charset, bool bPromptCJK);
private:
- CPDF_CMap* LoadPredefinedCMap(const CFX_ByteString& name, bool bPromptCJK);
- CPDF_CID2UnicodeMap* LoadCID2UnicodeMap(CIDSet charset, bool bPromptCJK);
+ std::unique_ptr<CPDF_CMap> LoadPredefinedCMap(const CFX_ByteString& name,
+ bool bPromptCJK);
+ std::unique_ptr<CPDF_CID2UnicodeMap> LoadCID2UnicodeMap(CIDSet charset,
+ bool bPromptCJK);
- std::map<CFX_ByteString, CPDF_CMap*> m_CMaps;
- CPDF_CID2UnicodeMap* m_CID2UnicodeMaps[6];
+ std::map<CFX_ByteString, std::unique_ptr<CPDF_CMap>> m_CMaps;
+ std::unique_ptr<CPDF_CID2UnicodeMap> m_CID2UnicodeMaps[6];
};
class CFX_StockFontArray {