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 25 matching lines...) Expand all Loading... |
36 | 36 |
37 explicit CJS_Runtime(CPDFDoc_Environment* pApp); | 37 explicit CJS_Runtime(CPDFDoc_Environment* pApp); |
38 ~CJS_Runtime() override; | 38 ~CJS_Runtime() override; |
39 | 39 |
40 // IJS_Runtime | 40 // IJS_Runtime |
41 IJS_Context* NewContext() override; | 41 IJS_Context* NewContext() override; |
42 void ReleaseContext(IJS_Context* pContext) override; | 42 void ReleaseContext(IJS_Context* pContext) override; |
43 IJS_Context* GetCurrentContext() override; | 43 IJS_Context* GetCurrentContext() override; |
44 void SetReaderDocument(CPDFSDK_Document* pReaderDoc) override; | 44 void SetReaderDocument(CPDFSDK_Document* pReaderDoc) override; |
45 CPDFSDK_Document* GetReaderDocument() override { return m_pDocument; } | 45 CPDFSDK_Document* GetReaderDocument() override { return m_pDocument; } |
46 int Execute(IJS_Context* cc, | 46 int Execute(const CFX_WideString& script, CFX_WideString* info) override; |
47 const wchar_t* script, | |
48 CFX_WideString* info) override; | |
49 | 47 |
50 CPDFDoc_Environment* GetReaderApp() const { return m_pApp; } | 48 CPDFDoc_Environment* GetReaderApp() const { return m_pApp; } |
51 | 49 |
52 // Returns true if the event isn't already found in the set. | 50 // Returns true if the event isn't already found in the set. |
53 bool AddEventToSet(const FieldEvent& event); | 51 bool AddEventToSet(const FieldEvent& event); |
54 void RemoveEventFromSet(const FieldEvent& event); | 52 void RemoveEventFromSet(const FieldEvent& event); |
55 | 53 |
56 void BeginBlock() { m_bBlocking = TRUE; } | 54 void BeginBlock() { m_bBlocking = TRUE; } |
57 void EndBlock() { m_bBlocking = FALSE; } | 55 void EndBlock() { m_bBlocking = FALSE; } |
58 FX_BOOL IsBlocking() const { return m_bBlocking; } | 56 FX_BOOL IsBlocking() const { return m_bBlocking; } |
(...skipping 24 matching lines...) Expand all Loading... |
83 std::set<FieldEvent> m_FieldEventSet; | 81 std::set<FieldEvent> m_FieldEventSet; |
84 v8::Isolate* m_isolate; | 82 v8::Isolate* m_isolate; |
85 bool m_isolateManaged; | 83 bool m_isolateManaged; |
86 v8::Global<v8::Context> m_context; | 84 v8::Global<v8::Context> m_context; |
87 std::vector<v8::Global<v8::Object>*> m_StaticObjects; | 85 std::vector<v8::Global<v8::Object>*> m_StaticObjects; |
88 std::map<CFX_WideString, v8::Global<v8::Array>> m_ConstArrays; | 86 std::map<CFX_WideString, v8::Global<v8::Array>> m_ConstArrays; |
89 std::set<Observer*> m_observers; | 87 std::set<Observer*> m_observers; |
90 }; | 88 }; |
91 | 89 |
92 #endif // FPDFSDK_JAVASCRIPT_CJS_RUNTIME_H_ | 90 #endif // FPDFSDK_JAVASCRIPT_CJS_RUNTIME_H_ |
OLD | NEW |