OLD | NEW |
| (Empty) |
1 // Copyright 2014 PDFium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
6 | |
7 #ifndef XFA_SRC_FXJSE_RUNTIME_H_ | |
8 #define XFA_SRC_FXJSE_RUNTIME_H_ | |
9 | |
10 #include "core/include/fxcrt/fx_basic.h" | |
11 #include "v8/include/v8.h" | |
12 | |
13 class CFXJSE_RuntimeList; | |
14 | |
15 class CFXJSE_RuntimeData { | |
16 protected: | |
17 CFXJSE_RuntimeData(v8::Isolate* pIsolate) : m_pIsolate(pIsolate) {} | |
18 | |
19 public: | |
20 static CFXJSE_RuntimeData* Create(v8::Isolate* pIsolate); | |
21 static CFXJSE_RuntimeData* Get(v8::Isolate* pIsolate); | |
22 | |
23 public: | |
24 v8::Isolate* m_pIsolate; | |
25 v8::Global<v8::FunctionTemplate> m_hRootContextGlobalTemplate; | |
26 v8::Global<v8::Context> m_hRootContext; | |
27 | |
28 public: | |
29 static CFXJSE_RuntimeList* g_RuntimeList; | |
30 | |
31 protected: | |
32 CFXJSE_RuntimeData(); | |
33 CFXJSE_RuntimeData(const CFXJSE_RuntimeData&); | |
34 CFXJSE_RuntimeData& operator=(const CFXJSE_RuntimeData&); | |
35 }; | |
36 | |
37 class CFXJSE_RuntimeList { | |
38 public: | |
39 typedef void (*RuntimeDisposeCallback)(v8::Isolate*); | |
40 | |
41 public: | |
42 void AppendRuntime(v8::Isolate* pIsolate); | |
43 void RemoveRuntime(v8::Isolate* pIsolate, | |
44 RuntimeDisposeCallback lpfnDisposeCallback); | |
45 void RemoveAllRuntimes(RuntimeDisposeCallback lpfnDisposeCallback); | |
46 | |
47 protected: | |
48 CFX_ArrayTemplate<v8::Isolate*> m_RuntimeList; | |
49 }; | |
50 | |
51 #endif // XFA_SRC_FXJSE_RUNTIME_H_ | |
OLD | NEW |