summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render/cpdf_imagecacheentry.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-18 13:48:33 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-18 21:21:59 +0000
commitf605c24fa76c9034184ed6a5054200962a0b6c07 (patch)
treeac9e02f447e0d3ca07155082eb84ea546fc73762 /core/fpdfapi/render/cpdf_imagecacheentry.h
parent940967de0b588d3abb9cba5822ae5f5c5fe05017 (diff)
downloadpdfium-f605c24fa76c9034184ed6a5054200962a0b6c07.tar.xz
Add more CFX_UnownedPtr usage.
One lifetime issue was fixed by passing CPDF_RenderStatus into Continue() methods rather than holidng a pointer which was going stale. Bug: Change-Id: I63b9dce4c1a0d1377cc407b5460535f7c916a040 Reviewed-on: https://pdfium-review.googlesource.com/5659 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/render/cpdf_imagecacheentry.h')
-rw-r--r--core/fpdfapi/render/cpdf_imagecacheentry.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/fpdfapi/render/cpdf_imagecacheentry.h b/core/fpdfapi/render/cpdf_imagecacheentry.h
index b17d3fdda2..b908fb78d0 100644
--- a/core/fpdfapi/render/cpdf_imagecacheentry.h
+++ b/core/fpdfapi/render/cpdf_imagecacheentry.h
@@ -10,6 +10,7 @@
#include <memory>
#include "core/fxcrt/cfx_retain_ptr.h"
+#include "core/fxcrt/cfx_unowned_ptr.h"
#include "core/fxcrt/fx_system.h"
class CFX_DIBitmap;
@@ -28,7 +29,7 @@ class CPDF_ImageCacheEntry {
void Reset(const CFX_RetainPtr<CFX_DIBitmap>& pBitmap);
uint32_t EstimateSize() const { return m_dwCacheSize; }
uint32_t GetTimeCount() const { return m_dwTimeCount; }
- CPDF_Stream* GetStream() const { return m_pStream; }
+ CPDF_Stream* GetStream() const { return m_pStream.Get(); }
int StartGetCachedBitmap(CPDF_Dictionary* pFormResources,
CPDF_Dictionary* pPageResources,
@@ -38,7 +39,7 @@ class CPDF_ImageCacheEntry {
CPDF_RenderStatus* pRenderStatus,
int32_t downsampleWidth,
int32_t downsampleHeight);
- int Continue(IFX_Pause* pPause);
+ int Continue(IFX_Pause* pPause, CPDF_RenderStatus* pRenderStatus);
CFX_RetainPtr<CFX_DIBSource> DetachBitmap();
CFX_RetainPtr<CFX_DIBSource> DetachMask();
@@ -46,12 +47,11 @@ class CPDF_ImageCacheEntry {
uint32_t m_MatteColor;
private:
- void ContinueGetCachedBitmap();
+ void ContinueGetCachedBitmap(CPDF_RenderStatus* pRenderStatus);
void CalcSize();
- CPDF_RenderStatus* m_pRenderStatus;
- CPDF_Document* m_pDocument;
- CPDF_Stream* m_pStream;
+ CFX_UnownedPtr<CPDF_Document> const m_pDocument;
+ CFX_UnownedPtr<CPDF_Stream> const m_pStream;
CFX_RetainPtr<CFX_DIBSource> m_pCurBitmap;
CFX_RetainPtr<CFX_DIBSource> m_pCurMask;
CFX_RetainPtr<CFX_DIBSource> m_pCachedBitmap;