Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: fxjs/include/cfxjse_context.h

Issue 2380713005: Move fxjs/include to fxjs (Closed)
Patch Set: Rebase to master Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fxjs/include/cfxjse_class.h ('k') | fxjs/include/cfxjse_value.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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_INCLUDE_CFXJSE_CONTEXT_H_
8 #define FXJS_INCLUDE_CFXJSE_CONTEXT_H_
9
10 #include <memory>
11 #include <vector>
12
13 #include "core/fxcrt/fx_basic.h"
14 #include "fxjs/include/fxjse.h"
15 #include "v8/include/v8.h"
16
17 class CFXJSE_Class;
18 class CFXJSE_Value;
19 struct FXJSE_CLASS_DESCRIPTOR;
20
21 class CFXJSE_Context {
22 public:
23 static CFXJSE_Context* Create(
24 v8::Isolate* pIsolate,
25 const FXJSE_CLASS_DESCRIPTOR* lpGlobalClass = nullptr,
26 CFXJSE_HostObject* lpGlobalObject = nullptr);
27
28 ~CFXJSE_Context();
29
30 v8::Isolate* GetRuntime() { return m_pIsolate; }
31 std::unique_ptr<CFXJSE_Value> GetGlobalObject();
32 void EnableCompatibleMode();
33 FX_BOOL ExecuteScript(const FX_CHAR* szScript,
34 CFXJSE_Value* lpRetValue,
35 CFXJSE_Value* lpNewThisObject = nullptr);
36
37 protected:
38 friend class CFXJSE_Class;
39 friend class CFXJSE_ScopeUtil_IsolateHandleContext;
40
41 CFXJSE_Context();
42 CFXJSE_Context(const CFXJSE_Context&);
43 explicit CFXJSE_Context(v8::Isolate* pIsolate);
44
45 CFXJSE_Context& operator=(const CFXJSE_Context&);
46
47 v8::Global<v8::Context> m_hContext;
48 v8::Isolate* m_pIsolate;
49 std::vector<std::unique_ptr<CFXJSE_Class>> m_rgClasses;
50 };
51
52 v8::Local<v8::Object> FXJSE_CreateReturnValue(v8::Isolate* pIsolate,
53 v8::TryCatch& trycatch);
54
55 v8::Local<v8::Object> FXJSE_GetGlobalObjectFromContext(
56 const v8::Local<v8::Context>& hContext);
57
58 void FXJSE_UpdateObjectBinding(v8::Local<v8::Object>& hObject,
59 CFXJSE_HostObject* lpNewBinding = nullptr);
60
61 CFXJSE_HostObject* FXJSE_RetrieveObjectBinding(
62 const v8::Local<v8::Object>& hJSObject,
63 CFXJSE_Class* lpClass = nullptr);
64
65 #endif // FXJS_INCLUDE_CFXJSE_CONTEXT_H_
OLDNEW
« no previous file with comments | « fxjs/include/cfxjse_class.h ('k') | fxjs/include/cfxjse_value.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698