Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: core/fxcodec/codec/fx_codec_jbig.cpp

Issue 2178613002: Remove CFX_Deletable (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@fix3
Patch Set: address comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fxcodec/codec/ccodec_jbig2module.h ('k') | core/fxcodec/include/JBig2_DocumentContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcodec/codec/fx_codec_jbig.cpp
diff --git a/core/fxcodec/codec/fx_codec_jbig.cpp b/core/fxcodec/codec/fx_codec_jbig.cpp
index 8f2d07f49099579bb5ce5867a22162d06ad8f6c2..adc57fd1ad42a114659b334d630719b05ec542cb 100644
--- a/core/fxcodec/codec/fx_codec_jbig.cpp
+++ b/core/fxcodec/codec/fx_codec_jbig.cpp
@@ -9,32 +9,20 @@
#include <list>
#include "core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h"
+#include "core/fxcodec/include/JBig2_DocumentContext.h"
#include "core/fxcodec/jbig2/JBig2_Context.h"
#include "core/fxcodec/jbig2/JBig2_Image.h"
#include "core/fxcrt/include/fx_memory.h"
-// Holds per-document JBig2 related data.
-class JBig2DocumentContext : public CFX_Deletable {
- public:
- std::list<CJBig2_CachePair>* GetSymbolDictCache() {
- return &m_SymbolDictCache;
- }
-
- ~JBig2DocumentContext() override {
- for (auto it : m_SymbolDictCache) {
- delete it.second;
- }
- }
+JBig2_DocumentContext::JBig2_DocumentContext() {}
- private:
- std::list<CJBig2_CachePair> m_SymbolDictCache;
-};
+JBig2_DocumentContext::~JBig2_DocumentContext() {}
-JBig2DocumentContext* GetJBig2DocumentContext(
- std::unique_ptr<CFX_Deletable>* pContextHolder) {
- if (!pContextHolder->get())
- pContextHolder->reset(new JBig2DocumentContext());
- return static_cast<JBig2DocumentContext*>(pContextHolder->get());
+JBig2_DocumentContext* GetJBig2DocumentContext(
+ std::unique_ptr<JBig2_DocumentContext>* pContextHolder) {
+ if (!pContextHolder)
+ pContextHolder->reset(new JBig2_DocumentContext());
+ return pContextHolder->get();
}
CCodec_Jbig2Context::CCodec_Jbig2Context()
@@ -52,7 +40,7 @@ CCodec_Jbig2Module::~CCodec_Jbig2Module() {}
FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(
CCodec_Jbig2Context* pJbig2Context,
- std::unique_ptr<CFX_Deletable>* pContextHolder,
+ std::unique_ptr<JBig2_DocumentContext>* pContextHolder,
uint32_t width,
uint32_t height,
CPDF_StreamAcc* src_stream,
@@ -63,7 +51,7 @@ FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(
if (!pJbig2Context)
return FXCODEC_STATUS_ERR_PARAMS;
- JBig2DocumentContext* pJBig2DocumentContext =
+ JBig2_DocumentContext* pJBig2DocumentContext =
GetJBig2DocumentContext(pContextHolder);
pJbig2Context->m_width = width;
pJbig2Context->m_height = height;
« no previous file with comments | « core/fxcodec/codec/ccodec_jbig2module.h ('k') | core/fxcodec/include/JBig2_DocumentContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698