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

Unified Diff: fpdfsdk/fpdf_ext.cpp

Issue 2180443002: Use actual type instead CFX_Deletable (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: one more fix 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/fpdfapi/include/cpdf_pagerendercontext.h ('k') | fpdfsdk/fpdf_progressive.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdf_ext.cpp
diff --git a/fpdfsdk/fpdf_ext.cpp b/fpdfsdk/fpdf_ext.cpp
index d262e3c0a5c8bca98f1289fcdfad188aef0d37b9..bb2c9ff0a565acaa75433186ae729d1970d54d3e 100644
--- a/fpdfsdk/fpdf_ext.cpp
+++ b/fpdfsdk/fpdf_ext.cpp
@@ -12,6 +12,7 @@
#include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
#include "core/fpdfapi/include/cpdf_modulemgr.h"
#include "core/fxcrt/include/fx_basic.h"
+#include "core/fxcrt/include/fx_memory.h"
#include "core/fxcrt/include/fx_xml.h"
#include "fpdfsdk/include/fsdk_define.h"
@@ -19,33 +20,15 @@
#include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h"
#endif // PDF_ENABLE_XFA
-#define FPDFSDK_UNSUPPORT_CALL 100
-
-class CFSDK_UnsupportInfo_Adapter : public CFX_Deletable {
- public:
- explicit CFSDK_UnsupportInfo_Adapter(UNSUPPORT_INFO* unsp_info)
- : m_unsp_info(unsp_info) {}
-
- void ReportError(int nErrorType);
-
- private:
- UNSUPPORT_INFO* const m_unsp_info;
-};
-
-void CFSDK_UnsupportInfo_Adapter::ReportError(int nErrorType) {
- if (m_unsp_info && m_unsp_info->FSDK_UnSupport_Handler) {
- m_unsp_info->FSDK_UnSupport_Handler(m_unsp_info, nErrorType);
- }
-}
-
FX_BOOL FPDF_UnSupportError(int nError) {
CFSDK_UnsupportInfo_Adapter* pAdapter =
- static_cast<CFSDK_UnsupportInfo_Adapter*>(
- CPDF_ModuleMgr::Get()->GetUnsupportInfoAdapter());
+ CPDF_ModuleMgr::Get()->GetUnsupportInfoAdapter();
if (!pAdapter)
return FALSE;
- pAdapter->ReportError(nError);
+ UNSUPPORT_INFO* info = static_cast<UNSUPPORT_INFO*>(pAdapter->GetUnspInfo());
+ if (info && info->FSDK_UnSupport_Handler)
+ info->FSDK_UnSupport_Handler(info, nError);
return TRUE;
}
@@ -54,8 +37,8 @@ FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info) {
if (!unsp_info || unsp_info->version != 1)
return FALSE;
- CPDF_ModuleMgr::Get()->SetUnsupportInfoAdapter(std::unique_ptr<CFX_Deletable>(
- new CFSDK_UnsupportInfo_Adapter(unsp_info)));
+ CPDF_ModuleMgr::Get()->SetUnsupportInfoAdapter(
+ WrapUnique(new CFSDK_UnsupportInfo_Adapter(unsp_info)));
return TRUE;
}
« no previous file with comments | « core/fpdfapi/include/cpdf_pagerendercontext.h ('k') | fpdfsdk/fpdf_progressive.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698