| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 using FXJS_DESTRUCTOR = void (*)(v8::Local<v8::Object> obj); | 67 using FXJS_DESTRUCTOR = void (*)(v8::Local<v8::Object> obj); |
| 68 | 68 |
| 69 // Call before making FXJS_PrepareIsolate call. | 69 // Call before making FXJS_PrepareIsolate call. |
| 70 void FXJS_Initialize(unsigned int embedderDataSlot); | 70 void FXJS_Initialize(unsigned int embedderDataSlot); |
| 71 void FXJS_Release(); | 71 void FXJS_Release(); |
| 72 | 72 |
| 73 // Call before making FXJS_Define* calls. Resources allocated here are cleared | 73 // Call before making FXJS_Define* calls. Resources allocated here are cleared |
| 74 // as part of FXJS_ReleaseRuntime(). | 74 // as part of FXJS_ReleaseRuntime(). |
| 75 void FXJS_PrepareIsolate(v8::Isolate* pIsolate); | 75 void FXJS_PrepareIsolate(v8::Isolate* pIsolate); |
| 76 | 76 |
| 77 // Call before making JS_PrepareIsolate call. | |
| 78 void JS_Initialize(unsigned int embedderDataSlot); | |
| 79 void JS_Release(); | |
| 80 | |
| 81 // Call before making JS_Define* calls. Resources allocated here are cleared | 77 // Call before making JS_Define* calls. Resources allocated here are cleared |
| 82 // as part of JS_ReleaseRuntime(). | 78 // as part of JS_ReleaseRuntime(). |
| 83 void JS_PrepareIsolate(v8::Isolate* pIsolate); | 79 void JS_PrepareIsolate(v8::Isolate* pIsolate); |
| 84 | 80 |
| 85 // Always returns a valid, newly-created objDefnID. | 81 // Always returns a valid, newly-created objDefnID. |
| 86 int FXJS_DefineObj(v8::Isolate* pIsolate, | 82 int FXJS_DefineObj(v8::Isolate* pIsolate, |
| 87 const wchar_t* sObjName, | 83 const wchar_t* sObjName, |
| 88 FXJSOBJTYPE eObjType, | 84 FXJSOBJTYPE eObjType, |
| 89 FXJS_CONSTRUCTOR pConstructor, | 85 FXJS_CONSTRUCTOR pConstructor, |
| 90 FXJS_DESTRUCTOR pDestructor); | 86 FXJS_DESTRUCTOR pDestructor); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 115 const wchar_t* sConstName, | 111 const wchar_t* sConstName, |
| 116 v8::Local<v8::Value> pDefault); | 112 v8::Local<v8::Value> pDefault); |
| 117 | 113 |
| 118 // Called after FXJS_Define* calls made. | 114 // Called after FXJS_Define* calls made. |
| 119 void FXJS_InitializeRuntime(v8::Isolate* pIsolate, | 115 void FXJS_InitializeRuntime(v8::Isolate* pIsolate, |
| 120 IFXJS_Runtime* pFXRuntime, | 116 IFXJS_Runtime* pFXRuntime, |
| 121 IFXJS_Context* context, | 117 IFXJS_Context* context, |
| 122 v8::Global<v8::Context>& v8PersistentContext); | 118 v8::Global<v8::Context>& v8PersistentContext); |
| 123 void FXJS_ReleaseRuntime(v8::Isolate* pIsolate, | 119 void FXJS_ReleaseRuntime(v8::Isolate* pIsolate, |
| 124 v8::Global<v8::Context>& v8PersistentContext); | 120 v8::Global<v8::Context>& v8PersistentContext); |
| 121 IFXJS_Runtime* FXJS_GetRuntimeFromIsolate(v8::Isolate* pIsolate); |
| 125 | 122 |
| 126 // Called after FXJS_InitializeRuntime call made. | 123 // Called after FXJS_InitializeRuntime call made. |
| 127 int FXJS_Execute(v8::Isolate* pIsolate, | 124 int FXJS_Execute(v8::Isolate* pIsolate, |
| 128 IFXJS_Context* pJSContext, | 125 IFXJS_Context* pJSContext, |
| 129 const wchar_t* script, | 126 const wchar_t* script, |
| 130 long length, | 127 long length, |
| 131 FXJSErr* perror); | 128 FXJSErr* perror); |
| 132 | 129 |
| 133 v8::Local<v8::Object> FXJS_NewFxDynamicObj(v8::Isolate* pIsolate, | 130 v8::Local<v8::Object> FXJS_NewFxDynamicObj(v8::Isolate* pIsolate, |
| 134 IFXJS_Context* pJSContext, | 131 IFXJS_Context* pJSContext, |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 double FXJS_ToNumber(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue); | 210 double FXJS_ToNumber(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue); |
| 214 v8::Local<v8::Object> FXJS_ToObject(v8::Isolate* pIsolate, | 211 v8::Local<v8::Object> FXJS_ToObject(v8::Isolate* pIsolate, |
| 215 v8::Local<v8::Value> pValue); | 212 v8::Local<v8::Value> pValue); |
| 216 CFX_WideString FXJS_ToString(v8::Isolate* pIsolate, | 213 CFX_WideString FXJS_ToString(v8::Isolate* pIsolate, |
| 217 v8::Local<v8::Value> pValue); | 214 v8::Local<v8::Value> pValue); |
| 218 v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate, | 215 v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate, |
| 219 v8::Local<v8::Value> pValue); | 216 v8::Local<v8::Value> pValue); |
| 220 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom); | 217 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom); |
| 221 | 218 |
| 222 #endif // FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ | 219 #endif // FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ |
| OLD | NEW |