summaryrefslogtreecommitdiff
path: root/fpdfsdk/include
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/include')
-rw-r--r--fpdfsdk/include/fsdk_mgr.h5
-rw-r--r--fpdfsdk/include/javascript/IJavaScript.h21
2 files changed, 3 insertions, 23 deletions
diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h
index 6b7e2873e7..270160eeb6 100644
--- a/fpdfsdk/include/fsdk_mgr.h
+++ b/fpdfsdk/include/fsdk_mgr.h
@@ -22,7 +22,6 @@
#include "javascript/IJavaScript.h"
class CFFL_IFormFiller;
-class CJS_RuntimeFactory;
class CPDFSDK_ActionHandler;
class CPDFSDK_Annot;
class CPDFSDK_Document;
@@ -207,7 +206,6 @@ class CPDFDoc_Environment final {
CFX_ByteString GetAppName() const { return ""; }
IFX_SystemHandler* GetSysHandler() const { return m_pSysHandler; }
FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; }
- CJS_RuntimeFactory* GetRuntimeFactory() const { return m_pJSRuntimeFactory; }
CFFL_IFormFiller* GetIFormFiller(); // Creates if not present.
CPDFSDK_AnnotHandlerMgr* GetAnnotHandlerMgr(); // Creates if not present.
@@ -217,13 +215,12 @@ class CPDFDoc_Environment final {
private:
CPDFSDK_AnnotHandlerMgr* m_pAnnotHandlerMgr;
CPDFSDK_ActionHandler* m_pActionHandler;
- IFXJS_Runtime* m_pJSRuntime;
+ nonstd::unique_ptr<IFXJS_Runtime> m_pJSRuntime;
FPDF_FORMFILLINFO* const m_pInfo;
CPDFSDK_Document* m_pSDKDoc;
CPDF_Document* const m_pPDFDoc;
CFFL_IFormFiller* m_pIFormFiller;
IFX_SystemHandler* m_pSysHandler;
- CJS_RuntimeFactory* m_pJSRuntimeFactory;
};
class CPDFSDK_Document {
diff --git a/fpdfsdk/include/javascript/IJavaScript.h b/fpdfsdk/include/javascript/IJavaScript.h
index 47e4c17faf..3791b886c4 100644
--- a/fpdfsdk/include/javascript/IJavaScript.h
+++ b/fpdfsdk/include/javascript/IJavaScript.h
@@ -133,30 +133,13 @@ class IFXJS_Context {
class IFXJS_Runtime {
public:
+ virtual ~IFXJS_Runtime() {}
+
virtual IFXJS_Context* NewContext() = 0;
virtual void ReleaseContext(IFXJS_Context* pContext) = 0;
virtual IFXJS_Context* GetCurrentContext() = 0;
-
virtual void SetReaderDocument(CPDFSDK_Document* pReaderDoc) = 0;
virtual CPDFSDK_Document* GetReaderDocument() = 0;
-
- protected:
- virtual ~IFXJS_Runtime() {}
-};
-
-class CJS_RuntimeFactory {
- public:
- CJS_RuntimeFactory() : m_bInit(false), m_nRef(0) {}
- ~CJS_RuntimeFactory();
-
- IFXJS_Runtime* NewJSRuntime(CPDFDoc_Environment* pApp);
- void DeleteJSRuntime(IFXJS_Runtime* pRuntime);
- void AddRef();
- void Release();
-
- private:
- bool m_bInit;
- int m_nRef;
};
#endif // FPDFSDK_INCLUDE_JAVASCRIPT_IJAVASCRIPT_H_