| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef FPDFSDK_SRC_JAVASCRIPT_JS_OBJECT_H_ | 7 #ifndef FPDFSDK_SRC_JAVASCRIPT_JS_OBJECT_H_ |
| 8 #define FPDFSDK_SRC_JAVASCRIPT_JS_OBJECT_H_ | 8 #define FPDFSDK_SRC_JAVASCRIPT_JS_OBJECT_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> |
| 11 | 12 |
| 12 #include "JS_Runtime.h" | 13 #include "JS_Runtime.h" |
| 13 #include "fpdfsdk/include/fsdk_define.h" // For FX_UINT | 14 #include "fpdfsdk/include/fsdk_define.h" // For FX_UINT |
| 14 #include "fpdfsdk/include/jsapi/fxjs_v8.h" | 15 #include "fpdfsdk/include/jsapi/fxjs_v8.h" |
| 15 #include "third_party/base/nonstd_unique_ptr.h" | |
| 16 | 16 |
| 17 class CJS_Context; | 17 class CJS_Context; |
| 18 class CJS_Object; | 18 class CJS_Object; |
| 19 class CJS_Timer; | 19 class CJS_Timer; |
| 20 class CPDFDoc_Environment; | 20 class CPDFDoc_Environment; |
| 21 class CJS_EmbedObj { | 21 class CJS_EmbedObj { |
| 22 public: | 22 public: |
| 23 explicit CJS_EmbedObj(CJS_Object* pJSObject); | 23 explicit CJS_EmbedObj(CJS_Object* pJSObject); |
| 24 virtual ~CJS_EmbedObj(); | 24 virtual ~CJS_EmbedObj(); |
| 25 | 25 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 static int MsgBox(CPDFDoc_Environment* pApp, | 61 static int MsgBox(CPDFDoc_Environment* pApp, |
| 62 const FX_WCHAR* swMsg, | 62 const FX_WCHAR* swMsg, |
| 63 const FX_WCHAR* swTitle, | 63 const FX_WCHAR* swTitle, |
| 64 FX_UINT nType, | 64 FX_UINT nType, |
| 65 FX_UINT nIcon); | 65 FX_UINT nIcon); |
| 66 static void Alert(CJS_Context* pContext, const FX_WCHAR* swMsg); | 66 static void Alert(CJS_Context* pContext, const FX_WCHAR* swMsg); |
| 67 | 67 |
| 68 v8::Isolate* GetIsolate() { return m_pIsolate; } | 68 v8::Isolate* GetIsolate() { return m_pIsolate; } |
| 69 | 69 |
| 70 protected: | 70 protected: |
| 71 nonstd::unique_ptr<CJS_EmbedObj> m_pEmbedObj; | 71 std::unique_ptr<CJS_EmbedObj> m_pEmbedObj; |
| 72 v8::Global<v8::Object> m_pV8Object; | 72 v8::Global<v8::Object> m_pV8Object; |
| 73 v8::Isolate* m_pIsolate; | 73 v8::Isolate* m_pIsolate; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 class CJS_Timer : public CJS_Runtime::Observer { | 76 class CJS_Timer : public CJS_Runtime::Observer { |
| 77 public: | 77 public: |
| 78 CJS_Timer(CJS_EmbedObj* pObj, | 78 CJS_Timer(CJS_EmbedObj* pObj, |
| 79 CPDFDoc_Environment* pApp, | 79 CPDFDoc_Environment* pApp, |
| 80 CJS_Runtime* pRuntime, | 80 CJS_Runtime* pRuntime, |
| 81 int nType, | 81 int nType, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 107 | 107 |
| 108 // data | 108 // data |
| 109 const int m_nType; // 0:Interval; 1:TimeOut | 109 const int m_nType; // 0:Interval; 1:TimeOut |
| 110 const FX_DWORD m_dwTimeOut; | 110 const FX_DWORD m_dwTimeOut; |
| 111 const CFX_WideString m_swJScript; | 111 const CFX_WideString m_swJScript; |
| 112 CJS_Runtime* const m_pRuntime; | 112 CJS_Runtime* const m_pRuntime; |
| 113 CPDFDoc_Environment* const m_pApp; | 113 CPDFDoc_Environment* const m_pApp; |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 #endif // FPDFSDK_SRC_JAVASCRIPT_JS_OBJECT_H_ | 116 #endif // FPDFSDK_SRC_JAVASCRIPT_JS_OBJECT_H_ |
| OLD | NEW |