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 // PDFium wrapper around V8 APIs. PDFium code should include this file rather | 7 // PDFium wrapper around V8 APIs. PDFium code should include this file rather |
8 // than including V8 headers directly. | 8 // than including V8 headers directly. |
9 | 9 |
10 #ifndef FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ | 10 #ifndef FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 using FXJS_DESTRUCTOR = void (*)(v8::Local<v8::Object> obj); | 62 using FXJS_DESTRUCTOR = void (*)(v8::Local<v8::Object> obj); |
63 | 63 |
64 // Call before making FXJS_PrepareIsolate call. | 64 // Call before making FXJS_PrepareIsolate call. |
65 void FXJS_Initialize(unsigned int embedderDataSlot); | 65 void FXJS_Initialize(unsigned int embedderDataSlot); |
66 void FXJS_Release(); | 66 void FXJS_Release(); |
67 | 67 |
68 // Call before making FXJS_Define* calls. Resources allocated here are cleared | 68 // Call before making FXJS_Define* calls. Resources allocated here are cleared |
69 // as part of FXJS_ReleaseRuntime(). | 69 // as part of FXJS_ReleaseRuntime(). |
70 void FXJS_PrepareIsolate(v8::Isolate* pIsolate); | 70 void FXJS_PrepareIsolate(v8::Isolate* pIsolate); |
71 | 71 |
72 // Call before making JS_PrepareIsolate call. | |
73 void JS_Initialize(unsigned int embedderDataSlot); | |
74 void JS_Release(); | |
75 | |
76 // Call before making JS_Define* calls. Resources allocated here are cleared | 72 // Call before making JS_Define* calls. Resources allocated here are cleared |
77 // as part of JS_ReleaseRuntime(). | 73 // as part of JS_ReleaseRuntime(). |
78 void JS_PrepareIsolate(v8::Isolate* pIsolate); | 74 void JS_PrepareIsolate(v8::Isolate* pIsolate); |
79 | 75 |
80 // Always returns a valid, newly-created objDefnID. | 76 // Always returns a valid, newly-created objDefnID. |
81 int FXJS_DefineObj(v8::Isolate* pIsolate, | 77 int FXJS_DefineObj(v8::Isolate* pIsolate, |
82 const wchar_t* sObjName, | 78 const wchar_t* sObjName, |
83 FXJSOBJTYPE eObjType, | 79 FXJSOBJTYPE eObjType, |
84 FXJS_CONSTRUCTOR pConstructor, | 80 FXJS_CONSTRUCTOR pConstructor, |
85 FXJS_DESTRUCTOR pDestructor); | 81 FXJS_DESTRUCTOR pDestructor); |
(...skipping 24 matching lines...) Expand all Loading... |
110 const wchar_t* sConstName, | 106 const wchar_t* sConstName, |
111 v8::Local<v8::Value> pDefault); | 107 v8::Local<v8::Value> pDefault); |
112 | 108 |
113 // Called after FXJS_Define* calls made. | 109 // Called after FXJS_Define* calls made. |
114 void FXJS_InitializeRuntime(v8::Isolate* pIsolate, | 110 void FXJS_InitializeRuntime(v8::Isolate* pIsolate, |
115 IFXJS_Runtime* pFXRuntime, | 111 IFXJS_Runtime* pFXRuntime, |
116 IFXJS_Context* context, | 112 IFXJS_Context* context, |
117 v8::Global<v8::Context>& v8PersistentContext); | 113 v8::Global<v8::Context>& v8PersistentContext); |
118 void FXJS_ReleaseRuntime(v8::Isolate* pIsolate, | 114 void FXJS_ReleaseRuntime(v8::Isolate* pIsolate, |
119 v8::Global<v8::Context>& v8PersistentContext); | 115 v8::Global<v8::Context>& v8PersistentContext); |
| 116 IFXJS_Runtime* FXJS_GetRuntimeFromIsolate(v8::Isolate* pIsolate); |
120 | 117 |
121 // Called after FXJS_InitializeRuntime call made. | 118 // Called after FXJS_InitializeRuntime call made. |
122 int FXJS_Execute(v8::Isolate* pIsolate, | 119 int FXJS_Execute(v8::Isolate* pIsolate, |
123 IFXJS_Context* pJSContext, | 120 IFXJS_Context* pJSContext, |
124 const wchar_t* script, | 121 const wchar_t* script, |
125 long length, | 122 long length, |
126 FXJSErr* perror); | 123 FXJSErr* perror); |
127 | 124 |
128 v8::Local<v8::Object> FXJS_NewFxDynamicObj(v8::Isolate* pIsolate, | 125 v8::Local<v8::Object> FXJS_NewFxDynamicObj(v8::Isolate* pIsolate, |
129 IFXJS_Context* pJSContext, | 126 IFXJS_Context* pJSContext, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 double FXJS_ToNumber(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue); | 205 double FXJS_ToNumber(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue); |
209 v8::Local<v8::Object> FXJS_ToObject(v8::Isolate* pIsolate, | 206 v8::Local<v8::Object> FXJS_ToObject(v8::Isolate* pIsolate, |
210 v8::Local<v8::Value> pValue); | 207 v8::Local<v8::Value> pValue); |
211 CFX_WideString FXJS_ToString(v8::Isolate* pIsolate, | 208 CFX_WideString FXJS_ToString(v8::Isolate* pIsolate, |
212 v8::Local<v8::Value> pValue); | 209 v8::Local<v8::Value> pValue); |
213 v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate, | 210 v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate, |
214 v8::Local<v8::Value> pValue); | 211 v8::Local<v8::Value> pValue); |
215 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom); | 212 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom); |
216 | 213 |
217 #endif // FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ | 214 #endif // FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ |
OLD | NEW |