| 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 FXJSE_RUNTIME_H_ | 7 #ifndef FXJSE_RUNTIME_H_ |
| 8 #define FXJSE_RUNTIME_H_ | 8 #define FXJSE_RUNTIME_H_ |
| 9 class CFXJSE_RuntimeList; | 9 class CFXJSE_RuntimeList; |
| 10 class CFXJSE_RuntimeData : public CFX_Object | 10 class CFXJSE_RuntimeData |
| 11 { | 11 { |
| 12 protected: | 12 protected: |
| 13 CFXJSE_RuntimeData(v8::Isolate* pIsolate) : m_pIsolate(pIsolate) {}; | 13 CFXJSE_RuntimeData(v8::Isolate* pIsolate) : m_pIsolate(pIsolate) {}; |
| 14 public: | 14 public: |
| 15 static CFXJSE_RuntimeData* Create(v8::Isolate* pIsolate); | 15 static CFXJSE_RuntimeData* Create(v8::Isolate* pIsolate); |
| 16 static CFXJSE_RuntimeData* Get(v8::Isolate* pIsolate); | 16 static CFXJSE_RuntimeData* Get(v8::Isolate* pIsolate); |
| 17 public: | 17 public: |
| 18 v8::Isolate* m_pIsola
te; | 18 v8::Isolate* m_pIsola
te; |
| 19 v8::Persistent<v8::FunctionTemplate> m_hRootContextGlobalTemplate; | 19 v8::Persistent<v8::FunctionTemplate> m_hRootContextGlobalTemplate; |
| 20 v8::Persistent<v8::Context> m_hRootContext; | 20 v8::Persistent<v8::Context> m_hRootContext; |
| 21 public: | 21 public: |
| 22 static CFXJSE_RuntimeList* g_RuntimeList; | 22 static CFXJSE_RuntimeList* g_RuntimeList; |
| 23 protected: | 23 protected: |
| 24 CFXJSE_RuntimeData(); | 24 CFXJSE_RuntimeData(); |
| 25 CFXJSE_RuntimeData(const CFXJSE_RuntimeData&); | 25 CFXJSE_RuntimeData(const CFXJSE_RuntimeData&); |
| 26 CFXJSE_RuntimeData& operator = (const CFXJSE_RuntimeData&); | 26 CFXJSE_RuntimeData& operator = (const CFXJSE_RuntimeData&); |
| 27 }; | 27 }; |
| 28 class CFXJSE_RuntimeList : public CFX_Object | 28 class CFXJSE_RuntimeList |
| 29 { | 29 { |
| 30 public: | 30 public: |
| 31 typedef void (*RuntimeDisposeCallback)(v8::Isolate*); | 31 typedef void (*RuntimeDisposeCallback)(v8::Isolate*); |
| 32 public: | 32 public: |
| 33 void AppendRuntime(v8::Isolate* pIsolate); | 33 void AppendRuntime(v8::Isolate* pIsolate); |
| 34 void RemoveRuntime(v8::Isolate* pIsolate, RuntimeDisposeCallback lpfnDispose
Callback); | 34 void RemoveRuntime(v8::Isolate* pIsolate, RuntimeDisposeCallback lpfnDispose
Callback); |
| 35 void RemoveAllRuntimes(RuntimeDisposeCallback lpfnDisposeCallback); | 35 void RemoveAllRuntimes(RuntimeDisposeCallback lpfnDisposeCallback); |
| 36 protected: | 36 protected: |
| 37 CFX_ArrayTemplate<v8::Isolate*> m_RuntimeList; | 37 CFX_ArrayTemplate<v8::Isolate*> m_RuntimeList; |
| 38 }; | 38 }; |
| 39 #endif | 39 #endif |
| OLD | NEW |