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
10#include <memory>
11
12#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
29  static std::unique_ptr<CFXJSE_RuntimeData> Create(v8::Isolate* pIsolate);
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_
37