summaryrefslogtreecommitdiff
path: root/core/fxcodec
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-25 15:53:57 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-25 23:07:41 +0000
commitd0409afc6a994a3e24043b8a96c83c022bcaa189 (patch)
tree15fa78b8a601ec97fc8bee39f8e56590c37babe3 /core/fxcodec
parent2eddb665763f3e089d4c210d2a011d112683f3ea (diff)
downloadpdfium-d0409afc6a994a3e24043b8a96c83c022bcaa189.tar.xz
Mass conversion of remaining class members (non-xfa)
Change-Id: I8365ba80e3395d59a3cf35dbd9d9162e86e712e3 Reviewed-on: https://pdfium-review.googlesource.com/5970 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcodec')
-rw-r--r--core/fxcodec/codec/ccodec_jbig2module.h3
-rw-r--r--core/fxcodec/codec/ccodec_progressivedecoder.h5
-rw-r--r--core/fxcodec/codec/fx_codec_progress.cpp14
-rw-r--r--core/fxcodec/jbig2/JBig2_GrdProc.cpp34
-rw-r--r--core/fxcodec/jbig2/JBig2_GrdProc.h4
-rw-r--r--core/fxcodec/lgif/cgifcontext.h3
6 files changed, 35 insertions, 28 deletions
diff --git a/core/fxcodec/codec/ccodec_jbig2module.h b/core/fxcodec/codec/ccodec_jbig2module.h
index 43abe042f0..e8dec945b8 100644
--- a/core/fxcodec/codec/ccodec_jbig2module.h
+++ b/core/fxcodec/codec/ccodec_jbig2module.h
@@ -10,6 +10,7 @@
#include <memory>
#include "core/fxcodec/fx_codec_def.h"
+#include "core/fxcrt/cfx_unowned_ptr.h"
#include "core/fxcrt/fx_basic.h"
class CJBig2_Context;
@@ -29,7 +30,7 @@ class CCodec_Jbig2Context {
CFX_RetainPtr<CPDF_StreamAcc> m_pSrcStream;
uint8_t* m_dest_buf;
uint32_t m_dest_pitch;
- IFX_Pause* m_pPause;
+ CFX_UnownedPtr<IFX_Pause> m_pPause;
std::unique_ptr<CJBig2_Context> m_pContext;
};
diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.h b/core/fxcodec/codec/ccodec_progressivedecoder.h
index 2b343b7e94..6dd7357b12 100644
--- a/core/fxcodec/codec/ccodec_progressivedecoder.h
+++ b/core/fxcodec/codec/ccodec_progressivedecoder.h
@@ -17,6 +17,7 @@
#include "core/fxcodec/fx_codec_def.h"
#include "core/fxcodec/lgif/cgifcontext.h"
#include "core/fxcrt/cfx_retain_ptr.h"
+#include "core/fxcrt/cfx_unowned_ptr.h"
#include "core/fxcrt/fx_system.h"
#include "core/fxge/fx_dib.h"
@@ -127,12 +128,12 @@ class CCodec_ProgressiveDecoder : public CCodec_BmpModule::Delegate,
};
CFX_RetainPtr<IFX_SeekableReadStream> m_pFile;
- CCodec_ModuleMgr* m_pCodecMgr;
+ CFX_UnownedPtr<CCodec_ModuleMgr> m_pCodecMgr;
FXJPEG_Context* m_pJpegContext;
FXPNG_Context* m_pPngContext;
std::unique_ptr<CGifContext> m_pGifContext;
FXBMP_Context* m_pBmpContext;
- CCodec_TiffContext* m_pTiffContext;
+ CFX_UnownedPtr<CCodec_TiffContext> m_pTiffContext;
FXCODEC_IMAGE_TYPE m_imagType;
uint32_t m_offSet;
uint8_t* m_pSrcBuf;
diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp
index 9e470f3f14..209a9735f0 100644
--- a/core/fxcodec/codec/fx_codec_progress.cpp
+++ b/core/fxcodec/codec/fx_codec_progress.cpp
@@ -302,7 +302,7 @@ CCodec_ProgressiveDecoder::~CCodec_ProgressiveDecoder() {
if (m_pPngContext)
m_pCodecMgr->GetPngModule()->Finish(m_pPngContext);
if (m_pTiffContext)
- m_pCodecMgr->GetTiffModule()->DestroyDecoder(m_pTiffContext);
+ m_pCodecMgr->GetTiffModule()->DestroyDecoder(m_pTiffContext.Get());
FX_Free(m_pSrcBuf);
FX_Free(m_pDecodeBuf);
FX_Free(m_pSrcPalette);
@@ -1213,13 +1213,13 @@ bool CCodec_ProgressiveDecoder::DetectImageType(FXCODEC_IMAGE_TYPE imageType,
return false;
}
int32_t dummy_bpc;
- bool ret = pTiffModule->LoadFrameInfo(m_pTiffContext, 0, &m_SrcWidth,
- &m_SrcHeight, &m_SrcComponents,
- &dummy_bpc, pAttribute);
+ bool ret = pTiffModule->LoadFrameInfo(
+ m_pTiffContext.Get(), 0, &m_SrcWidth, &m_SrcHeight, &m_SrcComponents,
+ &dummy_bpc, pAttribute);
m_SrcComponents = 4;
m_clipBox = FX_RECT(0, 0, m_SrcWidth, m_SrcHeight);
if (!ret) {
- pTiffModule->DestroyDecoder(m_pTiffContext);
+ pTiffModule->DestroyDecoder(m_pTiffContext.Get());
m_pTiffContext = nullptr;
m_status = FXCODEC_STATUS_ERR_FORMAT;
return false;
@@ -2170,7 +2170,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::ContinueDecode() {
m_SrcHeight == m_sizeY && m_startX == 0 && m_startY == 0 &&
m_clipBox.left == 0 && m_clipBox.top == 0 &&
m_clipBox.right == m_SrcWidth && m_clipBox.bottom == m_SrcHeight) {
- ret = pTiffModule->Decode(m_pTiffContext, m_pDeviceBitmap);
+ ret = pTiffModule->Decode(m_pTiffContext.Get(), m_pDeviceBitmap);
m_pDeviceBitmap = nullptr;
m_pFile = nullptr;
if (!ret) {
@@ -2189,7 +2189,7 @@ FXCODEC_STATUS CCodec_ProgressiveDecoder::ContinueDecode() {
m_status = FXCODEC_STATUS_ERR_MEMORY;
return m_status;
}
- ret = pTiffModule->Decode(m_pTiffContext, pDIBitmap);
+ ret = pTiffModule->Decode(m_pTiffContext.Get(), pDIBitmap);
if (!ret) {
m_pDeviceBitmap = nullptr;
m_pFile = nullptr;
diff --git a/core/fxcodec/jbig2/JBig2_GrdProc.cpp b/core/fxcodec/jbig2/JBig2_GrdProc.cpp
index 0d9f991d4c..a8140bdd24 100644
--- a/core/fxcodec/jbig2/JBig2_GrdProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_GrdProc.cpp
@@ -25,6 +25,8 @@ CJBig2_GRDProc::CJBig2_GRDProc()
m_ReplaceRect.right = 0;
}
+CJBig2_GRDProc::~CJBig2_GRDProc() {}
+
bool CJBig2_GRDProc::UseTemplate0Opt3() const {
return (GBAT[0] == 3) && (GBAT[1] == -1) && (GBAT[2] == -3) &&
(GBAT[3] == -1) && (GBAT[4] == 2) && (GBAT[5] == -2) &&
@@ -663,35 +665,35 @@ FXCODEC_STATUS CJBig2_GRDProc::decode_Arith(IFX_Pause* pPause) {
CJBig2_Image* pImage = *m_pImage;
if (GBTEMPLATE == 0) {
if (UseTemplate0Opt3()) {
- m_ProssiveStatus = decode_Arith_Template0_opt3(pImage, m_pArithDecoder,
- m_gbContext, pPause);
+ m_ProssiveStatus = decode_Arith_Template0_opt3(
+ pImage, m_pArithDecoder.Get(), m_gbContext, pPause);
} else {
- m_ProssiveStatus = decode_Arith_Template0_unopt(pImage, m_pArithDecoder,
- m_gbContext, pPause);
+ m_ProssiveStatus = decode_Arith_Template0_unopt(
+ pImage, m_pArithDecoder.Get(), m_gbContext, pPause);
}
} else if (GBTEMPLATE == 1) {
if (UseTemplate1Opt3()) {
- m_ProssiveStatus = decode_Arith_Template1_opt3(pImage, m_pArithDecoder,
- m_gbContext, pPause);
+ m_ProssiveStatus = decode_Arith_Template1_opt3(
+ pImage, m_pArithDecoder.Get(), m_gbContext, pPause);
} else {
- m_ProssiveStatus = decode_Arith_Template1_unopt(pImage, m_pArithDecoder,
- m_gbContext, pPause);
+ m_ProssiveStatus = decode_Arith_Template1_unopt(
+ pImage, m_pArithDecoder.Get(), m_gbContext, pPause);
}
} else if (GBTEMPLATE == 2) {
if (UseTemplate23Opt3()) {
- m_ProssiveStatus = decode_Arith_Template2_opt3(pImage, m_pArithDecoder,
- m_gbContext, pPause);
+ m_ProssiveStatus = decode_Arith_Template2_opt3(
+ pImage, m_pArithDecoder.Get(), m_gbContext, pPause);
} else {
- m_ProssiveStatus = decode_Arith_Template2_unopt(pImage, m_pArithDecoder,
- m_gbContext, pPause);
+ m_ProssiveStatus = decode_Arith_Template2_unopt(
+ pImage, m_pArithDecoder.Get(), m_gbContext, pPause);
}
} else {
if (UseTemplate23Opt3()) {
- m_ProssiveStatus = decode_Arith_Template3_opt3(pImage, m_pArithDecoder,
- m_gbContext, pPause);
+ m_ProssiveStatus = decode_Arith_Template3_opt3(
+ pImage, m_pArithDecoder.Get(), m_gbContext, pPause);
} else {
- m_ProssiveStatus = decode_Arith_Template3_unopt(pImage, m_pArithDecoder,
- m_gbContext, pPause);
+ m_ProssiveStatus = decode_Arith_Template3_unopt(
+ pImage, m_pArithDecoder.Get(), m_gbContext, pPause);
}
}
m_ReplaceRect.left = 0;
diff --git a/core/fxcodec/jbig2/JBig2_GrdProc.h b/core/fxcodec/jbig2/JBig2_GrdProc.h
index 447447fe8b..c6e8ae38d0 100644
--- a/core/fxcodec/jbig2/JBig2_GrdProc.h
+++ b/core/fxcodec/jbig2/JBig2_GrdProc.h
@@ -8,6 +8,7 @@
#define CORE_FXCODEC_JBIG2_JBIG2_GRDPROC_H_
#include "core/fxcodec/fx_codec_def.h"
+#include "core/fxcrt/cfx_unowned_ptr.h"
#include "core/fxcrt/fx_coordinates.h"
#include "core/fxcrt/fx_system.h"
@@ -20,6 +21,7 @@ struct JBig2ArithCtx;
class CJBig2_GRDProc {
public:
CJBig2_GRDProc();
+ ~CJBig2_GRDProc();
CJBig2_Image* decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
JBig2ArithCtx* gbContext);
@@ -112,7 +114,7 @@ class CJBig2_GRDProc {
uint8_t* m_pLine;
FXCODEC_STATUS m_ProssiveStatus;
CJBig2_Image** m_pImage;
- CJBig2_ArithDecoder* m_pArithDecoder;
+ CFX_UnownedPtr<CJBig2_ArithDecoder> m_pArithDecoder;
JBig2ArithCtx* m_gbContext;
uint16_t m_DecodeType;
int m_LTP;
diff --git a/core/fxcodec/lgif/cgifcontext.h b/core/fxcodec/lgif/cgifcontext.h
index 08a66c18e2..20d640ef35 100644
--- a/core/fxcodec/lgif/cgifcontext.h
+++ b/core/fxcodec/lgif/cgifcontext.h
@@ -11,6 +11,7 @@
#include <vector>
#include "core/fxcodec/lgif/fx_gif.h"
+#include "core/fxcrt/cfx_unowned_ptr.h"
#include "core/fxcrt/fx_basic.h"
class CCodec_GifModule;
@@ -44,7 +45,7 @@ class CGifContext {
int32_t decode_status;
uint32_t skip_size;
- CCodec_GifModule* m_Module;
+ CFX_UnownedPtr<CCodec_GifModule> m_Module;
char* err_ptr;
CFX_ByteString cmt_data;
std::unique_ptr<GifGCE> m_GifGCE;