| 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_ |
| 11 #define FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ | 11 #define FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ |
| 12 | 12 |
| 13 #include <v8.h> | 13 #include <v8.h> |
| 14 #include "../../../core/include/fxcrt/fx_basic.h" | 14 #include "../../../core/include/fxcrt/fx_basic.h" |
| 15 | 15 |
| 16 // FXJS_V8 places no interpretation on these two classes; it merely | 16 // FXJS_V8 places no interpretation on these two classes; it merely |
| 17 // passes them on to the caller-provided FXJS_CONSTRUCTORs. | 17 // passes them on to the caller-provided FXJS_CONSTRUCTORs. |
| 18 class IFXJS_Context; | 18 class IFXJS_Context; |
| 19 class IFXJS_Runtime; | 19 class IFXJS_Runtime; |
| 20 | 20 |
| 21 enum FXJSOBJTYPE { | 21 enum FXJSOBJTYPE { |
| 22 FXJS_DYNAMIC = 0, | 22 FXJSOBJTYPE_DYNAMIC = 0, // Created by native method and returned to JS. |
| 23 FXJS_STATIC = 1, | 23 FXJSOBJTYPE_STATIC, // Created by init and hung off of global object. |
| 24 FXJSOBJTYPE_GLOBAL, // The global object itself (may only appear once). |
| 24 }; | 25 }; |
| 25 | 26 |
| 26 struct FXJSErr { | 27 struct FXJSErr { |
| 27 const wchar_t* message; | 28 const wchar_t* message; |
| 28 const wchar_t* srcline; | 29 const wchar_t* srcline; |
| 29 unsigned linnum; | 30 unsigned linnum; |
| 30 }; | 31 }; |
| 31 | 32 |
| 32 class FXJS_PerIsolateData { | 33 class FXJS_PerIsolateData { |
| 33 public: | 34 public: |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 IFXJS_Context* pJSContext, | 129 IFXJS_Context* pJSContext, |
| 129 const wchar_t* script, | 130 const wchar_t* script, |
| 130 long length, | 131 long length, |
| 131 FXJSErr* perror); | 132 FXJSErr* perror); |
| 132 | 133 |
| 133 v8::Local<v8::Object> FXJS_NewFxDynamicObj(v8::Isolate* pIsolate, | 134 v8::Local<v8::Object> FXJS_NewFxDynamicObj(v8::Isolate* pIsolate, |
| 134 IFXJS_Context* pJSContext, | 135 IFXJS_Context* pJSContext, |
| 135 int nObjDefnID); | 136 int nObjDefnID); |
| 136 v8::Local<v8::Object> FXJS_GetThisObj(v8::Isolate* pIsolate); | 137 v8::Local<v8::Object> FXJS_GetThisObj(v8::Isolate* pIsolate); |
| 137 int FXJS_GetObjDefnID(v8::Local<v8::Object> pObj); | 138 int FXJS_GetObjDefnID(v8::Local<v8::Object> pObj); |
| 138 int FXJS_GetObjDefnID(v8::Isolate* pIsolate, const wchar_t* pObjName); | |
| 139 v8::Isolate* FXJS_GetRuntime(v8::Local<v8::Object> pObj); | 139 v8::Isolate* FXJS_GetRuntime(v8::Local<v8::Object> pObj); |
| 140 const wchar_t* FXJS_GetTypeof(v8::Local<v8::Value> pObj); | 140 const wchar_t* FXJS_GetTypeof(v8::Local<v8::Value> pObj); |
| 141 | 141 |
| 142 void FXJS_SetPrivate(v8::Isolate* pIsolate, | 142 void FXJS_SetPrivate(v8::Isolate* pIsolate, |
| 143 v8::Local<v8::Object> pObj, | 143 v8::Local<v8::Object> pObj, |
| 144 void* p); | 144 void* p); |
| 145 void* FXJS_GetPrivate(v8::Isolate* pIsolate, v8::Local<v8::Object> pObj); | 145 void* FXJS_GetPrivate(v8::Isolate* pIsolate, v8::Local<v8::Object> pObj); |
| 146 void FXJS_FreePrivate(void* p); | 146 void FXJS_FreePrivate(void* p); |
| 147 void FXJS_FreePrivate(v8::Local<v8::Object> pObj); | 147 void FXJS_FreePrivate(v8::Local<v8::Object> pObj); |
| 148 | 148 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 double FXJS_ToNumber(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue); | 213 double FXJS_ToNumber(v8::Isolate* pIsolate, v8::Local<v8::Value> pValue); |
| 214 v8::Local<v8::Object> FXJS_ToObject(v8::Isolate* pIsolate, | 214 v8::Local<v8::Object> FXJS_ToObject(v8::Isolate* pIsolate, |
| 215 v8::Local<v8::Value> pValue); | 215 v8::Local<v8::Value> pValue); |
| 216 CFX_WideString FXJS_ToString(v8::Isolate* pIsolate, | 216 CFX_WideString FXJS_ToString(v8::Isolate* pIsolate, |
| 217 v8::Local<v8::Value> pValue); | 217 v8::Local<v8::Value> pValue); |
| 218 v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate, | 218 v8::Local<v8::Array> FXJS_ToArray(v8::Isolate* pIsolate, |
| 219 v8::Local<v8::Value> pValue); | 219 v8::Local<v8::Value> pValue); |
| 220 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom); | 220 void FXJS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom); |
| 221 | 221 |
| 222 #endif // FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ | 222 #endif // FPDFSDK_INCLUDE_JSAPI_FXJS_V8_H_ |
| OLD | NEW |