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_JAVASCRIPT_CJS_RUNTIME_H_ | 7 #ifndef FPDFSDK_JAVASCRIPT_CJS_RUNTIME_H_ |
8 #define FPDFSDK_JAVASCRIPT_CJS_RUNTIME_H_ | 8 #define FPDFSDK_JAVASCRIPT_CJS_RUNTIME_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 void EndBlock() { m_bBlocking = FALSE; } | 57 void EndBlock() { m_bBlocking = FALSE; } |
58 FX_BOOL IsBlocking() const { return m_bBlocking; } | 58 FX_BOOL IsBlocking() const { return m_bBlocking; } |
59 | 59 |
60 v8::Isolate* GetIsolate() const { return m_isolate; } | 60 v8::Isolate* GetIsolate() const { return m_isolate; } |
61 v8::Local<v8::Context> NewJSContext(); | 61 v8::Local<v8::Context> NewJSContext(); |
62 | 62 |
63 void SetConstArray(const CFX_WideString& name, v8::Local<v8::Array> array); | 63 void SetConstArray(const CFX_WideString& name, v8::Local<v8::Array> array); |
64 v8::Local<v8::Array> GetConstArray(const CFX_WideString& name); | 64 v8::Local<v8::Array> GetConstArray(const CFX_WideString& name); |
65 | 65 |
66 #ifdef PDF_ENABLE_XFA | 66 #ifdef PDF_ENABLE_XFA |
67 FX_BOOL GetHValueByName(const CFX_ByteStringC& utf8Name, | 67 FX_BOOL GetValueByName(const CFX_ByteStringC& utf8Name, |
68 FXJSE_HVALUE hValue) override; | 68 CFXJSE_Value* pValue) override; |
69 FX_BOOL SetHValueByName(const CFX_ByteStringC& utf8Name, | 69 FX_BOOL SetValueByName(const CFX_ByteStringC& utf8Name, |
70 FXJSE_HVALUE hValue) override; | 70 CFXJSE_Value* pValue) override; |
71 #endif // PDF_ENABLE_XFA | 71 #endif // PDF_ENABLE_XFA |
72 | 72 |
73 void AddObserver(Observer* observer); | 73 void AddObserver(Observer* observer); |
74 void RemoveObserver(Observer* observer); | 74 void RemoveObserver(Observer* observer); |
75 | 75 |
76 private: | 76 private: |
77 void DefineJSObjects(); | 77 void DefineJSObjects(); |
78 | 78 |
79 std::vector<std::unique_ptr<CJS_Context>> m_ContextArray; | 79 std::vector<std::unique_ptr<CJS_Context>> m_ContextArray; |
80 CPDFDoc_Environment* const m_pApp; | 80 CPDFDoc_Environment* const m_pApp; |
81 CPDFSDK_Document* m_pDocument; | 81 CPDFSDK_Document* m_pDocument; |
82 FX_BOOL m_bBlocking; | 82 FX_BOOL m_bBlocking; |
83 std::set<FieldEvent> m_FieldEventSet; | 83 std::set<FieldEvent> m_FieldEventSet; |
84 v8::Isolate* m_isolate; | 84 v8::Isolate* m_isolate; |
85 bool m_isolateManaged; | 85 bool m_isolateManaged; |
86 v8::Global<v8::Context> m_context; | 86 v8::Global<v8::Context> m_context; |
87 std::vector<v8::Global<v8::Object>*> m_StaticObjects; | 87 std::vector<v8::Global<v8::Object>*> m_StaticObjects; |
88 std::map<CFX_WideString, v8::Global<v8::Array>> m_ConstArrays; | 88 std::map<CFX_WideString, v8::Global<v8::Array>> m_ConstArrays; |
89 std::set<Observer*> m_observers; | 89 std::set<Observer*> m_observers; |
90 }; | 90 }; |
91 | 91 |
92 #endif // FPDFSDK_JAVASCRIPT_CJS_RUNTIME_H_ | 92 #endif // FPDFSDK_JAVASCRIPT_CJS_RUNTIME_H_ |
OLD | NEW |