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 24 matching lines...) Expand all Loading... |
35 static CJS_Runtime* FromContext(const IJS_Context* cc); | 35 static CJS_Runtime* FromContext(const IJS_Context* cc); |
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; |
46 int Execute(const CFX_WideString& script, CFX_WideString* info) override; | 46 int Execute(const CFX_WideString& script, CFX_WideString* info) override; |
47 | 47 |
48 CPDFDoc_Environment* GetReaderApp() const { return m_pApp; } | 48 CPDFDoc_Environment* GetReaderApp() const { return m_pApp; } |
49 | 49 |
50 // 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. |
51 bool AddEventToSet(const FieldEvent& event); | 51 bool AddEventToSet(const FieldEvent& event); |
52 void RemoveEventFromSet(const FieldEvent& event); | 52 void RemoveEventFromSet(const FieldEvent& event); |
53 | 53 |
54 void BeginBlock() { m_bBlocking = TRUE; } | 54 void BeginBlock() { m_bBlocking = TRUE; } |
55 void EndBlock() { m_bBlocking = FALSE; } | 55 void EndBlock() { m_bBlocking = FALSE; } |
(...skipping 25 matching lines...) Expand all Loading... |
81 std::set<FieldEvent> m_FieldEventSet; | 81 std::set<FieldEvent> m_FieldEventSet; |
82 v8::Isolate* m_isolate; | 82 v8::Isolate* m_isolate; |
83 bool m_isolateManaged; | 83 bool m_isolateManaged; |
84 v8::Global<v8::Context> m_context; | 84 v8::Global<v8::Context> m_context; |
85 std::vector<v8::Global<v8::Object>*> m_StaticObjects; | 85 std::vector<v8::Global<v8::Object>*> m_StaticObjects; |
86 std::map<CFX_WideString, v8::Global<v8::Array>> m_ConstArrays; | 86 std::map<CFX_WideString, v8::Global<v8::Array>> m_ConstArrays; |
87 std::set<Observer*> m_observers; | 87 std::set<Observer*> m_observers; |
88 }; | 88 }; |
89 | 89 |
90 #endif // FPDFSDK_JAVASCRIPT_CJS_RUNTIME_H_ | 90 #endif // FPDFSDK_JAVASCRIPT_CJS_RUNTIME_H_ |
OLD | NEW |