Fix -Wnon-virtual-dtor compiler warnings.
[pdfium.git] / fpdfsdk / include / javascript / IJavaScript.h
index 3087b6a..8ea9a4e 100644 (file)
@@ -7,13 +7,17 @@
 #ifndef _IJAVASCRIPT_H_
 #define _IJAVASCRIPT_H_
 
-class IFXJS_Context  
+namespace v8 {
+class Platform;
+}
+
+class IFXJS_Context
 {
 public:
+        virtual ~IFXJS_Context() { }
        virtual FX_BOOL                         Compile(const CFX_WideString& script, CFX_WideString& info) = 0;
        virtual FX_BOOL                         RunScript(const CFX_WideString& script, CFX_WideString& info) = 0;
 
-public:
        virtual void                            OnApp_Init() = 0;
 
        virtual void                            OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString& strTargetName) = 0;
@@ -27,7 +31,7 @@ public:
        virtual void                            OnPage_Close(CPDFSDK_Document* pTarget) = 0;
        virtual void                            OnPage_InView(CPDFSDK_Document* pTarget) = 0;
        virtual void                            OnPage_OutView(CPDFSDK_Document* pTarget) = 0;
-       
+
        virtual void                            OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
        virtual void                            OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
        virtual void                            OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
@@ -84,6 +88,9 @@ public:
        virtual void                            Exit() = 0;
        virtual void                            Enter() = 0;
        virtual FX_BOOL                         IsEntered() = 0;
+
+protected:
+         ~IFXJS_Runtime() { }
 };
 
 class CPDFDoc_Environment;
@@ -92,7 +99,7 @@ class CJS_GlobalData;
 class CJS_RuntimeFactory
 {
 public:
-       CJS_RuntimeFactory():m_bInit(FALSE),m_nRef(0),m_pGlobalData(NULL),m_nGlobalDataCount(0) {}
+       CJS_RuntimeFactory():m_bInit(FALSE),m_nRef(0),m_pGlobalData(NULL),m_nGlobalDataCount(0),m_platform(NULL) {}
        ~CJS_RuntimeFactory();
        IFXJS_Runtime*                                  NewJSRuntime(CPDFDoc_Environment* pApp);
        void                                                    DeleteJSRuntime(IFXJS_Runtime* pRuntime);
@@ -106,6 +113,7 @@ private:
        int m_nRef;
        CJS_GlobalData*                                 m_pGlobalData;
        FX_INT32                                                m_nGlobalDataCount;
+        v8::Platform*                                          m_platform;
 };
 
 #endif //_IJAVASCRIPT_H_