dsinclair | 08fea80 | 2016-07-12 10:37:52 -0700 | [diff] [blame] | 1 | // Copyright 2016 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 FXJS_CFXJSE_RUNTIMEDATA_H_ |
| 8 | #define FXJS_CFXJSE_RUNTIMEDATA_H_ |
| 9 | |
weili | 54be7be | 2016-09-21 10:19:50 -0700 | [diff] [blame] | 10 | #include <memory> |
| 11 | |
dsinclair | 08fea80 | 2016-07-12 10:37:52 -0700 | [diff] [blame] | 12 | #include "v8/include/v8.h" |
| 13 | |
| 14 | class CFXJSE_RuntimeList; |
| 15 | |
| 16 | class CFXJSE_RuntimeData { |
| 17 | public: |
| 18 | ~CFXJSE_RuntimeData(); |
| 19 | |
| 20 | static CFXJSE_RuntimeData* Get(v8::Isolate* pIsolate); |
| 21 | |
| 22 | v8::Isolate* m_pIsolate; |
| 23 | v8::Global<v8::FunctionTemplate> m_hRootContextGlobalTemplate; |
| 24 | v8::Global<v8::Context> m_hRootContext; |
| 25 | |
| 26 | protected: |
| 27 | explicit CFXJSE_RuntimeData(v8::Isolate* pIsolate); |
| 28 | |
weili | 54be7be | 2016-09-21 10:19:50 -0700 | [diff] [blame] | 29 | static std::unique_ptr<CFXJSE_RuntimeData> Create(v8::Isolate* pIsolate); |
dsinclair | 08fea80 | 2016-07-12 10:37:52 -0700 | [diff] [blame] | 30 | |
| 31 | private: |
| 32 | CFXJSE_RuntimeData(const CFXJSE_RuntimeData&) = delete; |
| 33 | CFXJSE_RuntimeData& operator=(const CFXJSE_RuntimeData&) = delete; |
| 34 | }; |
| 35 | |
| 36 | #endif // FXJS_CFXJSE_RUNTIMEDATA_H_ |