summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-18 12:47:11 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-18 12:47:11 -0700
commit2c28619de8051661c7f66f2192c6fb9ef14ee905 (patch)
tree4bd15bf0bb72e4127403548bf2f40230bbdd352b /core/include
parent0c1bd7c6ad378ea97a2f54cb0c4761716f6d1057 (diff)
downloadpdfium-2c28619de8051661c7f66f2192c6fb9ef14ee905.tar.xz
Replace some Release() calls with virtual destructors.
Required fixing xfa-specific code. Original Review URL: https://codereview.chromium.org/1192013002. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1176413004.
Diffstat (limited to 'core/include')
-rw-r--r--core/include/fxcodec/fx_codec.h115
-rw-r--r--core/include/fxcrt/fx_arb.h16
-rw-r--r--core/include/fxge/fx_font.h7
3 files changed, 43 insertions, 95 deletions
diff --git a/core/include/fxcodec/fx_codec.h b/core/include/fxcodec/fx_codec.h
index dc2595b105..218999a1ad 100644
--- a/core/include/fxcodec/fx_codec.h
+++ b/core/include/fxcodec/fx_codec.h
@@ -7,13 +7,15 @@
#ifndef CORE_INCLUDE_FXCODEC_FX_CODEC_H_
#define CORE_INCLUDE_FXCODEC_FX_CODEC_H_
+#include "../../../third_party/base/nonstd_unique_ptr.h"
+#include "../fxcrt/fx_basic.h"
#include "../fxcrt/fx_ext.h"
#include "fx_codec_def.h"
#include "fx_codec_provider.h"
class CFX_DIBSource;
class ICodec_ScanlineDecoder;
-class ICodec_ProgressiveDecoder;
+class ICodec_ProgressiveDecoder;
class ICodec_BasicModule;
class ICodec_FaxModule;
class ICodec_JpegModule;
@@ -22,92 +24,43 @@ class ICodec_Jbig2Module;
class ICodec_IccModule;
class ICodec_FlateModule;
class ICodec_Jbig2Encoder;
-class ICodec_PngModule;
-class ICodec_GifModule;
-class ICodec_BmpModule;
-class ICodec_TiffModule;
-class CFX_DIBAttribute;
+class ICodec_PngModule;
+class ICodec_GifModule;
+class ICodec_BmpModule;
+class ICodec_TiffModule;
+class CFX_DIBAttribute;
class ICodec_ScanlineDecoder;
+
class CCodec_ModuleMgr
{
public:
-
- static CCodec_ModuleMgr* Create();
-
- void Destroy();
-
- void InitJbig2Decoder();
-
- void InitJpxDecoder();
-
-
- void InitIccDecoder();
-
-
- ICodec_ProgressiveDecoder* CreateProgressiveDecoder();
-
- ICodec_Jbig2Encoder* CreateJbig2Encoder();
-protected:
CCodec_ModuleMgr();
- ~CCodec_ModuleMgr();
-public:
- ICodec_BasicModule* GetBasicModule()
- {
- return m_pBasicModule;
- }
- ICodec_FaxModule* GetFaxModule()
- {
- return m_pFaxModule;
- }
- ICodec_JpegModule* GetJpegModule()
- {
- return m_pJpegModule;
- }
- ICodec_JpxModule* GetJpxModule()
- {
- return m_pJpxModule;
- }
- ICodec_Jbig2Module* GetJbig2Module()
- {
- return m_pJbig2Module;
- }
- ICodec_IccModule* GetIccModule()
- {
- return m_pIccModule;
- }
- ICodec_FlateModule* GetFlateModule()
- {
- return m_pFlateModule;
- }
- ICodec_PngModule* GetPngModule()
- {
- return m_pPngModule;
- }
- ICodec_GifModule* GetGifModule()
- {
- return m_pGifModule;
- }
- ICodec_BmpModule* GetBmpModule()
- {
- return m_pBmpModule;
- }
- ICodec_TiffModule* GetTiffModule()
- {
- return m_pTiffModule;
- }
-protected:
- ICodec_BasicModule* m_pBasicModule;
- ICodec_FaxModule* m_pFaxModule;
- ICodec_JpegModule* m_pJpegModule;
- ICodec_JpxModule* m_pJpxModule;
- ICodec_Jbig2Module* m_pJbig2Module;
- ICodec_IccModule* m_pIccModule;
- ICodec_FlateModule* m_pFlateModule;
- ICodec_PngModule* m_pPngModule;
- ICodec_GifModule* m_pGifModule;
- ICodec_BmpModule* m_pBmpModule;
- ICodec_TiffModule* m_pTiffModule;
+ ICodec_ProgressiveDecoder* CreateProgressiveDecoder();
+ ICodec_Jbig2Encoder* CreateJbig2Encoder();
+ ICodec_BasicModule* GetBasicModule() const { return m_pBasicModule.get(); }
+ ICodec_FaxModule* GetFaxModule() const { return m_pFaxModule.get(); }
+ ICodec_JpegModule* GetJpegModule() const { return m_pJpegModule.get(); }
+ ICodec_JpxModule* GetJpxModule() const { return m_pJpxModule.get(); }
+ ICodec_Jbig2Module* GetJbig2Module() const { return m_pJbig2Module.get(); }
+ ICodec_IccModule* GetIccModule() const { return m_pIccModule.get(); }
+ ICodec_FlateModule* GetFlateModule() const { return m_pFlateModule.get(); }
+ ICodec_PngModule* GetPngModule() const { return m_pPngModule.get(); }
+ ICodec_GifModule* GetGifModule() const { return m_pGifModule.get(); }
+ ICodec_BmpModule* GetBmpModule() const { return m_pBmpModule.get(); }
+ ICodec_TiffModule* GetTiffModule() const { return m_pTiffModule.get(); }
+protected:
+ nonstd::unique_ptr<ICodec_BasicModule> m_pBasicModule;
+ nonstd::unique_ptr<ICodec_FaxModule> m_pFaxModule;
+ nonstd::unique_ptr<ICodec_JpegModule> m_pJpegModule;
+ nonstd::unique_ptr<ICodec_JpxModule> m_pJpxModule;
+ nonstd::unique_ptr<ICodec_Jbig2Module> m_pJbig2Module;
+ nonstd::unique_ptr<ICodec_IccModule> m_pIccModule;
+ nonstd::unique_ptr<ICodec_FlateModule> m_pFlateModule;
+ nonstd::unique_ptr<ICodec_PngModule> m_pPngModule;
+ nonstd::unique_ptr<ICodec_GifModule> m_pGifModule;
+ nonstd::unique_ptr<ICodec_BmpModule> m_pBmpModule;
+ nonstd::unique_ptr<ICodec_TiffModule> m_pTiffModule;
};
class ICodec_BasicModule
{
diff --git a/core/include/fxcrt/fx_arb.h b/core/include/fxcrt/fx_arb.h
index 8022daab3c..5d3b0eb7da 100644
--- a/core/include/fxcrt/fx_arb.h
+++ b/core/include/fxcrt/fx_arb.h
@@ -61,16 +61,14 @@ void FX_BidiLine(CFX_RTFCharArray &chars, int32_t iCount, int32_t iBaseLevel = 0
class IFX_BidiChar
{
public:
- static IFX_BidiChar* Create();
- virtual void Release() = 0;
- virtual void SetPolicy(FX_BOOL bSeparateNeutral = TRUE) = 0;
- virtual FX_BOOL AppendChar(FX_WCHAR wch) = 0;
- virtual FX_BOOL EndChar() = 0;
- virtual int32_t GetBidiInfo(int32_t &iStart, int32_t &iCount) = 0;
- virtual void Reset() = 0;
+ static IFX_BidiChar* Create();
+ virtual ~IFX_BidiChar() {}
-protected:
- ~IFX_BidiChar() { }
+ virtual void SetPolicy(FX_BOOL bSeparateNeutral = TRUE) = 0;
+ virtual FX_BOOL AppendChar(FX_WCHAR wch) = 0;
+ virtual FX_BOOL EndChar() = 0;
+ virtual int32_t GetBidiInfo(int32_t &iStart, int32_t &iCount) = 0;
+ virtual void Reset() = 0;
};
#endif // CORE_INCLUDE_FXCRT_FX_ARB_H_
diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h
index bd49e01fed..80dd1a4f13 100644
--- a/core/include/fxge/fx_font.h
+++ b/core/include/fxge/fx_font.h
@@ -465,12 +465,9 @@ FX_BOOL OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size,
class IFX_GSUBTable
{
public:
- virtual void Release() = 0;
+ static IFX_GSUBTable* Create(CFX_Font* pFont);
+ virtual ~IFX_GSUBTable() { }
virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0;
-
-protected:
- ~IFX_GSUBTable() { }
};
-IFX_GSUBTable* FXGE_CreateGSUBTable(CFX_Font* pFont);
#endif // CORE_INCLUDE_FXGE_FX_FONT_H_