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

Side by Side Diff: fpdfsdk/include/jsapi/fxjs_v8.h

Issue 1382263002: Store object definition ID in each js_class. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Use size_t vars with FX_ArraySize. Created 5 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 | « no previous file | fpdfsdk/src/javascript/Document.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | fpdfsdk/src/javascript/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698