From 7d4f6a89d7e2c5d13b7d630d6348950044a5465e Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 31 Mar 2017 17:10:34 -0700 Subject: Refcount CPDF_Image all the time. Remove the old externally-counted CPDF_CountedImage type. Change-Id: Ia0b288586272da3f2daf7dfc153f08e62794321a Reviewed-on: https://pdfium-review.googlesource.com/3553 Reviewed-by: Lei Zhang Commit-Queue: Lei Zhang --- core/fpdfapi/page/cpdf_imageobject.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'core/fpdfapi/page/cpdf_imageobject.h') diff --git a/core/fpdfapi/page/cpdf_imageobject.h b/core/fpdfapi/page/cpdf_imageobject.h index 1bbfc0509c..484fb7baa6 100644 --- a/core/fpdfapi/page/cpdf_imageobject.h +++ b/core/fpdfapi/page/cpdf_imageobject.h @@ -27,19 +27,16 @@ class CPDF_ImageObject : public CPDF_PageObject { const CPDF_ImageObject* AsImage() const override; void CalcBoundingBox(); - CPDF_Image* GetImage() const { return m_pImage; } - void SetOwnedImage(std::unique_ptr pImage); - void SetUnownedImage(CPDF_Image* pImage); - + CFX_RetainPtr GetImage() const { return m_pImage; } + void SetImage(const CFX_RetainPtr& pImage); void set_matrix(const CFX_Matrix& matrix) { m_Matrix = matrix; } const CFX_Matrix& matrix() const { return m_Matrix; } private: - void Release(); + void MaybePurgeCache(); CFX_Matrix m_Matrix; - CPDF_Image* m_pImage; - bool m_pImageOwned; + CFX_RetainPtr m_pImage; }; #endif // CORE_FPDFAPI_PAGE_CPDF_IMAGEOBJECT_H_ -- cgit v1.2.3