blob: 292fe26ae335225eb435c29ac62b67eb3a44890c [file] [log] [blame]
dsinclair08fea802016-07-12 10:37:52 -07001// 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
weili54be7be2016-09-21 10:19:50 -070010#include <memory>
11
dsinclair08fea802016-07-12 10:37:52 -070012#include "v8/include/v8.h"
13
14class CFXJSE_RuntimeList;
15
16class 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
weili54be7be2016-09-21 10:19:50 -070029 static std::unique_ptr<CFXJSE_RuntimeData> Create(v8::Isolate* pIsolate);
dsinclair08fea802016-07-12 10:37:52 -070030
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_