summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/pageint.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/pageint.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/pageint.h')
-rw-r--r--core/fpdfapi/page/pageint.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/core/fpdfapi/page/pageint.h b/core/fpdfapi/page/pageint.h
index 9637155343..a7a00f02ee 100644
--- a/core/fpdfapi/page/pageint.h
+++ b/core/fpdfapi/page/pageint.h
@@ -12,11 +12,13 @@
#include "core/fpdfapi/page/cpdf_colorspace.h"
#include "core/fpdfapi/page/cpdf_countedobject.h"
+#include "core/fxcrt/cfx_retain_ptr.h"
class CPDF_ExpIntFunc;
class CPDF_Pattern;
class CPDF_SampledFunc;
class CPDF_StitchFunc;
+class CPDF_Stream;
class CPDF_StreamAcc;
class CPDF_Function {
@@ -134,11 +136,12 @@ class CPDF_StitchFunc : public CPDF_Function {
static const uint32_t kRequiredNumInputs = 1;
};
-class CPDF_IccProfile {
+class CPDF_IccProfile : public CFX_Retainable {
public:
- CPDF_IccProfile(const uint8_t* pData, uint32_t dwSize);
- ~CPDF_IccProfile();
+ template <typename T, typename... Args>
+ friend CFX_RetainPtr<T> pdfium::MakeRetain(Args&&... args);
+ CPDF_Stream* GetStream() const { return m_pStream; }
bool IsValid() const { return IsSRGB() || IsSupported(); }
bool IsSRGB() const { return m_bsRGB; }
bool IsSupported() const { return !!m_pTransform; }
@@ -146,7 +149,11 @@ class CPDF_IccProfile {
uint32_t GetComponents() const { return m_nSrcComponents; }
private:
+ CPDF_IccProfile(CPDF_Stream* pStream, const uint8_t* pData, uint32_t dwSize);
+ ~CPDF_IccProfile() override;
+
const bool m_bsRGB;
+ CPDF_Stream* const m_pStream;
void* m_pTransform = nullptr;
uint32_t m_nSrcComponents = 0;
};