summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render/cpdf_docrenderdata.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-04-03 14:51:26 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-03 21:52:09 +0000
commit05e6a807311df5c3dfc4cafa56b85614f9bae6d3 (patch)
tree42abc36d38fe479e7b32c13b401c53cb3bd13be3 /core/fpdfapi/render/cpdf_docrenderdata.h
parent3a1d9b48cb5485cdb93f1cc9857e5d829868629c (diff)
downloadpdfium-05e6a807311df5c3dfc4cafa56b85614f9bae6d3.tar.xz
RefCount CPDF_Type3Cache all the time.chromium/3062
Prefer internal refcounts to external scheme. Change-Id: Ia99d5fc635a51a38f41b1d64ea44d8202685ddc7 Reviewed-on: https://pdfium-review.googlesource.com/3617 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/render/cpdf_docrenderdata.h')
-rw-r--r--core/fpdfapi/render/cpdf_docrenderdata.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/core/fpdfapi/render/cpdf_docrenderdata.h b/core/fpdfapi/render/cpdf_docrenderdata.h
index 5daee34176..7952f95991 100644
--- a/core/fpdfapi/render/cpdf_docrenderdata.h
+++ b/core/fpdfapi/render/cpdf_docrenderdata.h
@@ -23,8 +23,8 @@ class CPDF_DocRenderData {
explicit CPDF_DocRenderData(CPDF_Document* pPDFDoc);
~CPDF_DocRenderData();
- CPDF_Type3Cache* GetCachedType3(CPDF_Type3Font* pFont);
- void ReleaseCachedType3(CPDF_Type3Font* pFont);
+ CFX_RetainPtr<CPDF_Type3Cache> GetCachedType3(CPDF_Type3Font* pFont);
+ void MaybePurgeCachedType3(CPDF_Type3Font* pFont);
CFX_RetainPtr<CPDF_TransferFunc> GetTransferFunc(CPDF_Object* pObj);
void MaybePurgeTransferFunc(CPDF_Object* pOb);
@@ -32,11 +32,8 @@ class CPDF_DocRenderData {
void Clear(bool bRelease);
private:
- using CPDF_Type3CacheMap =
- std::map<CPDF_Font*, CPDF_CountedObject<CPDF_Type3Cache>*>;
-
CPDF_Document* m_pPDFDoc; // Not Owned
- CPDF_Type3CacheMap m_Type3FaceMap;
+ std::map<CPDF_Font*, CFX_RetainPtr<CPDF_Type3Cache>> m_Type3FaceMap;
std::map<CPDF_Object*, CFX_RetainPtr<CPDF_TransferFunc>> m_TransferFuncMap;
};