summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_docpagedata.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-04-03 15:40:22 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-04 17:02:49 +0000
commit6088612c21898eb79cfbde401984176dd94c385c (patch)
tree4e9ad42317d7057b170f8f9cb6898bb30e63a481 /core/fpdfapi/page/cpdf_docpagedata.h
parent37cc5fb6b3407ce8e079bc1bdd0606713b975532 (diff)
downloadpdfium-6088612c21898eb79cfbde401984176dd94c385c.tar.xz
RefCount CPDF_IccProfile all the time
Make the IccProfile track its stream so that it has a proper key with which to purge the docpagedata map. Change-Id: Ib05ebc1afb828f1f5e5df62a1a33a1bfdecf507d Reviewed-on: https://pdfium-review.googlesource.com/3619 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_docpagedata.h')
-rw-r--r--core/fpdfapi/page/cpdf_docpagedata.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/core/fpdfapi/page/cpdf_docpagedata.h b/core/fpdfapi/page/cpdf_docpagedata.h
index d95c3c788d..24e0006efd 100644
--- a/core/fpdfapi/page/cpdf_docpagedata.h
+++ b/core/fpdfapi/page/cpdf_docpagedata.h
@@ -50,8 +50,8 @@ class CPDF_DocPageData {
CFX_RetainPtr<CPDF_Image> GetImage(uint32_t dwStreamObjNum);
void MaybePurgeImage(uint32_t dwStreamObjNum);
- CPDF_IccProfile* GetIccProfile(CPDF_Stream* pIccProfileStream);
- void ReleaseIccProfile(const CPDF_IccProfile* pIccProfile);
+ CFX_RetainPtr<CPDF_IccProfile> GetIccProfile(CPDF_Stream* pProfileStream);
+ void MaybePurgeIccProfile(CPDF_Stream* pProfileStream);
CPDF_StreamAcc* GetFontFileStreamAcc(CPDF_Stream* pFontStream);
void ReleaseFontFileStreamAcc(const CPDF_Stream* pFontStream);
@@ -61,7 +61,6 @@ class CPDF_DocPageData {
private:
using CPDF_CountedFont = CPDF_CountedObject<CPDF_Font>;
- using CPDF_CountedIccProfile = CPDF_CountedObject<CPDF_IccProfile>;
using CPDF_CountedStreamAcc = CPDF_CountedObject<CPDF_StreamAcc>;
CPDF_ColorSpace* GetColorSpaceImpl(CPDF_Object* pCSObj,
@@ -74,7 +73,7 @@ class CPDF_DocPageData {
std::map<const CPDF_Object*, CPDF_CountedColorSpace*> m_ColorSpaceMap;
std::map<const CPDF_Stream*, CPDF_CountedStreamAcc*> m_FontFileMap;
std::map<const CPDF_Dictionary*, CPDF_CountedFont*> m_FontMap;
- std::map<const CPDF_Stream*, CPDF_CountedIccProfile*> m_IccProfileMap;
+ std::map<const CPDF_Stream*, CFX_RetainPtr<CPDF_IccProfile>> m_IccProfileMap;
std::map<uint32_t, CFX_RetainPtr<CPDF_Image>> m_ImageMap;
std::map<const CPDF_Object*, CPDF_CountedPattern*> m_PatternMap;
};