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

Unified Diff: fpdfsdk/include/jsapi/fxjs_v8.h

Issue 1138823004: Replace v8::Handle with v8::Local and v8::Persistent with v8::Global (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/include/javascript/global.h ('k') | fpdfsdk/src/javascript/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/include/jsapi/fxjs_v8.h
diff --git a/fpdfsdk/include/jsapi/fxjs_v8.h b/fpdfsdk/include/jsapi/fxjs_v8.h
index d84b2161175b0363fc5759fb409f559c9da03037..cc1eb6b2c19fea47e9247ca242358d8483ff151b 100644
--- a/fpdfsdk/include/jsapi/fxjs_v8.h
+++ b/fpdfsdk/include/jsapi/fxjs_v8.h
@@ -14,8 +14,8 @@
#include "../../../core/include/fxcrt/fx_string.h" // For CFX_WideString
typedef v8::Value JSValue;
-typedef v8::Handle<v8::Object> JSObject;
-typedef v8::Handle<v8::Object> JSFXObject;
+typedef v8::Local<v8::Object> JSObject;
+typedef v8::Local<v8::Object> JSFXObject;
enum FXJSOBJTYPE
{
@@ -49,78 +49,78 @@ typedef v8::Isolate IJS_Runtime;
class IFXJS_Context;
class IFXJS_Runtime;
-typedef void (*LP_CONSTRUCTOR)(IFXJS_Context* cc, v8::Handle<v8::Object> obj, v8::Handle<v8::Object> global);
-typedef void (*LP_DESTRUCTOR)(v8::Handle<v8::Object> obj);
+typedef void (*LP_CONSTRUCTOR)(IFXJS_Context* cc, v8::Local<v8::Object> obj, v8::Local<v8::Object> global);
+typedef void (*LP_DESTRUCTOR)(v8::Local<v8::Object> obj);
int JS_DefineObj(IJS_Runtime* pJSRuntime, const wchar_t* sObjName, FXJSOBJTYPE eObjType, LP_CONSTRUCTOR pConstructor, LP_DESTRUCTOR pDestructor, unsigned bApplyNew);
int JS_DefineObjMethod(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sMethodName, v8::FunctionCallback pMethodCall);
int JS_DefineObjProperty(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sPropName, v8::AccessorGetterCallback pPropGet, v8::AccessorSetterCallback pPropPut);
int JS_DefineObjAllProperties(IJS_Runtime* pJSRuntime, int nObjDefnID, v8::NamedPropertyQueryCallback pPropQurey, v8::NamedPropertyGetterCallback pPropGet, v8::NamedPropertySetterCallback pPropPut, v8::NamedPropertyDeleterCallback pPropDel);
-int JS_DefineObjConst(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sConstName, v8::Handle<v8::Value> pDefault);
+int JS_DefineObjConst(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sConstName, v8::Local<v8::Value> pDefault);
int JS_DefineGlobalMethod(IJS_Runtime* pJSRuntime, const wchar_t* sMethodName, v8::FunctionCallback pMethodCall);
-int JS_DefineGlobalConst(IJS_Runtime* pJSRuntime, const wchar_t* sConstName, v8::Handle<v8::Value> pDefault);
+int JS_DefineGlobalConst(IJS_Runtime* pJSRuntime, const wchar_t* sConstName, v8::Local<v8::Value> pDefault);
-void JS_InitialRuntime(IJS_Runtime* pJSRuntime,IFXJS_Runtime* pFXRuntime, IFXJS_Context* context, v8::Persistent<v8::Context>& v8PersistentContext);
-void JS_ReleaseRuntime(IJS_Runtime* pJSRuntime, v8::Persistent<v8::Context>& v8PersistentContext);
+void JS_InitialRuntime(IJS_Runtime* pJSRuntime,IFXJS_Runtime* pFXRuntime, IFXJS_Context* context, v8::Global<v8::Context>& v8PersistentContext);
+void JS_ReleaseRuntime(IJS_Runtime* pJSRuntime, v8::Global<v8::Context>& v8PersistentContext);
void JS_Initial();
void JS_Release();
int JS_Parse(IJS_Runtime* pJSRuntime, IFXJS_Context* pJSContext, const wchar_t* script, long length, FXJSErr* perror);
int JS_Execute(IJS_Runtime* pJSRuntime, IFXJS_Context* pJSContext, const wchar_t* script, long length, FXJSErr* perror);
-v8::Handle<v8::Object> JS_NewFxDynamicObj(IJS_Runtime* pJSRuntime, IFXJS_Context* pJSContext, int nObjDefnID);
-v8::Handle<v8::Object> JS_GetStaticObj(IJS_Runtime* pJSRuntime, int nObjDefnID);
+v8::Local<v8::Object> JS_NewFxDynamicObj(IJS_Runtime* pJSRuntime, IFXJS_Context* pJSContext, int nObjDefnID);
+v8::Local<v8::Object> JS_GetStaticObj(IJS_Runtime* pJSRuntime, int nObjDefnID);
void JS_SetThisObj(IJS_Runtime* pJSRuntime, int nThisObjID);
-v8::Handle<v8::Object> JS_GetThisObj(IJS_Runtime * pJSRuntime);
-int JS_GetObjDefnID(v8::Handle<v8::Object> pObj);
-IJS_Runtime* JS_GetRuntime(v8::Handle<v8::Object> pObj);
+v8::Local<v8::Object> JS_GetThisObj(IJS_Runtime * pJSRuntime);
+int JS_GetObjDefnID(v8::Local<v8::Object> pObj);
+IJS_Runtime* JS_GetRuntime(v8::Local<v8::Object> pObj);
int JS_GetObjDefnID(IJS_Runtime * pJSRuntime, const wchar_t* pObjName);
void JS_Error(v8::Isolate* isolate, const CFX_WideString& message);
unsigned JS_CalcHash(const wchar_t* main, unsigned nLen);
unsigned JS_CalcHash(const wchar_t* main);
-const wchar_t* JS_GetTypeof(v8::Handle<v8::Value> pObj);
-void JS_SetPrivate(IJS_Runtime* pJSRuntime, v8::Handle<v8::Object> pObj, void* p);
-void* JS_GetPrivate(IJS_Runtime* pJSRuntime, v8::Handle<v8::Object> pObj);
-void JS_SetPrivate(v8::Handle<v8::Object> pObj, void* p);
-void* JS_GetPrivate(v8::Handle<v8::Object> pObj);
+const wchar_t* JS_GetTypeof(v8::Local<v8::Value> pObj);
+void JS_SetPrivate(IJS_Runtime* pJSRuntime, v8::Local<v8::Object> pObj, void* p);
+void* JS_GetPrivate(IJS_Runtime* pJSRuntime, v8::Local<v8::Object> pObj);
+void JS_SetPrivate(v8::Local<v8::Object> pObj, void* p);
+void* JS_GetPrivate(v8::Local<v8::Object> pObj);
void JS_FreePrivate(void* p);
-void JS_FreePrivate(v8::Handle<v8::Object> pObj);
-v8::Handle<v8::Value> JS_GetObjectValue(v8::Handle<v8::Object> pObj);
-v8::Handle<v8::Value> JS_GetObjectElement(IJS_Runtime* pJSRuntime, v8::Handle<v8::Object> pObj,const wchar_t* PropertyName);
-v8::Handle<v8::Array> JS_GetObjectElementNames(IJS_Runtime* pJSRuntime, v8::Handle<v8::Object> pObj);
-void JS_PutObjectString(IJS_Runtime* pJSRuntime,v8::Handle<v8::Object> pObj, const wchar_t* PropertyName, const wchar_t* sValue);
-void JS_PutObjectNumber(IJS_Runtime* pJSRuntime,v8::Handle<v8::Object> pObj, const wchar_t* PropertyName, int nValue);
-void JS_PutObjectNumber(IJS_Runtime* pJSRuntime,v8::Handle<v8::Object> pObj, const wchar_t* PropertyName, float fValue);
-void JS_PutObjectNumber(IJS_Runtime* pJSRuntime,v8::Handle<v8::Object> pObj, const wchar_t* PropertyName, double dValue);
-void JS_PutObjectBoolean(IJS_Runtime* pJSRuntime,v8::Handle<v8::Object> pObj, const wchar_t* PropertyName, bool bValue);
-void JS_PutObjectObject(IJS_Runtime* pJSRuntime,v8::Handle<v8::Object> pObj, const wchar_t* PropertyName, v8::Handle<v8::Object> pPut);
-void JS_PutObjectNull(IJS_Runtime* pJSRuntime,v8::Handle<v8::Object> pObj, const wchar_t* PropertyName);
-unsigned JS_PutArrayElement(IJS_Runtime* pJSRuntime, v8::Handle<v8::Array> pArray,unsigned index,v8::Handle<v8::Value> pValue,FXJSVALUETYPE eType);
-v8::Handle<v8::Value> JS_GetArrayElement(IJS_Runtime* pJSRuntime, v8::Handle<v8::Array> pArray,unsigned index);
-unsigned JS_GetArrayLength(v8::Handle<v8::Array> pArray);
-v8::Handle<v8::Value> JS_GetListValue(IJS_Runtime* pJSRuntime, v8::Handle<v8::Value> pList, int index);
-
-
-v8::Handle<v8::Array> JS_NewArray(IJS_Runtime* pJSRuntime);
-v8::Handle<v8::Value> JS_NewNumber(IJS_Runtime* pJSRuntime,int number);
-v8::Handle<v8::Value> JS_NewNumber(IJS_Runtime* pJSRuntime,double number);
-v8::Handle<v8::Value> JS_NewNumber(IJS_Runtime* pJSRuntime,float number);
-v8::Handle<v8::Value> JS_NewBoolean(IJS_Runtime* pJSRuntime,bool b);
-v8::Handle<v8::Value> JS_NewObject(IJS_Runtime* pJSRuntime,v8::Handle<v8::Object> pObj);
-v8::Handle<v8::Value> JS_NewObject2(IJS_Runtime* pJSRuntime,v8::Handle<v8::Array> pObj);
-v8::Handle<v8::Value> JS_NewString(IJS_Runtime* pJSRuntime,const wchar_t* string);
-v8::Handle<v8::Value> JS_NewString(IJS_Runtime* pJSRuntime,const wchar_t* string, unsigned nLen);
-v8::Handle<v8::Value> JS_NewNull();
-v8::Handle<v8::Value> JS_NewDate(IJS_Runtime* pJSRuntime,double d);
-v8::Handle<v8::Value> JS_NewValue(IJS_Runtime* pJSRuntime);
-
-
-int JS_ToInt32(IJS_Runtime* pJSRuntime, v8::Handle<v8::Value> pValue);
-bool JS_ToBoolean(IJS_Runtime* pJSRuntime, v8::Handle<v8::Value> pValue);
-double JS_ToNumber(IJS_Runtime* pJSRuntime, v8::Handle<v8::Value> pValue);
-v8::Handle<v8::Object> JS_ToObject(IJS_Runtime* pJSRuntime, v8::Handle<v8::Value> pValue);
-CFX_WideString JS_ToString(IJS_Runtime* pJSRuntime, v8::Handle<v8::Value> pValue);
-v8::Handle<v8::Array> JS_ToArray(IJS_Runtime* pJSRuntime, v8::Handle<v8::Value> pValue);
-void JS_ValueCopy(v8::Handle<v8::Value>& pTo, v8::Handle<v8::Value> pFrom);
+void JS_FreePrivate(v8::Local<v8::Object> pObj);
+v8::Local<v8::Value> JS_GetObjectValue(v8::Local<v8::Object> pObj);
+v8::Local<v8::Value> JS_GetObjectElement(IJS_Runtime* pJSRuntime, v8::Local<v8::Object> pObj,const wchar_t* PropertyName);
+v8::Local<v8::Array> JS_GetObjectElementNames(IJS_Runtime* pJSRuntime, v8::Local<v8::Object> pObj);
+void JS_PutObjectString(IJS_Runtime* pJSRuntime,v8::Local<v8::Object> pObj, const wchar_t* PropertyName, const wchar_t* sValue);
+void JS_PutObjectNumber(IJS_Runtime* pJSRuntime,v8::Local<v8::Object> pObj, const wchar_t* PropertyName, int nValue);
+void JS_PutObjectNumber(IJS_Runtime* pJSRuntime,v8::Local<v8::Object> pObj, const wchar_t* PropertyName, float fValue);
+void JS_PutObjectNumber(IJS_Runtime* pJSRuntime,v8::Local<v8::Object> pObj, const wchar_t* PropertyName, double dValue);
+void JS_PutObjectBoolean(IJS_Runtime* pJSRuntime,v8::Local<v8::Object> pObj, const wchar_t* PropertyName, bool bValue);
+void JS_PutObjectObject(IJS_Runtime* pJSRuntime,v8::Local<v8::Object> pObj, const wchar_t* PropertyName, v8::Local<v8::Object> pPut);
+void JS_PutObjectNull(IJS_Runtime* pJSRuntime,v8::Local<v8::Object> pObj, const wchar_t* PropertyName);
+unsigned JS_PutArrayElement(IJS_Runtime* pJSRuntime, v8::Local<v8::Array> pArray,unsigned index,v8::Local<v8::Value> pValue,FXJSVALUETYPE eType);
+v8::Local<v8::Value> JS_GetArrayElement(IJS_Runtime* pJSRuntime, v8::Local<v8::Array> pArray,unsigned index);
+unsigned JS_GetArrayLength(v8::Local<v8::Array> pArray);
+v8::Local<v8::Value> JS_GetListValue(IJS_Runtime* pJSRuntime, v8::Local<v8::Value> pList, int index);
+
+
+v8::Local<v8::Array> JS_NewArray(IJS_Runtime* pJSRuntime);
+v8::Local<v8::Value> JS_NewNumber(IJS_Runtime* pJSRuntime,int number);
+v8::Local<v8::Value> JS_NewNumber(IJS_Runtime* pJSRuntime,double number);
+v8::Local<v8::Value> JS_NewNumber(IJS_Runtime* pJSRuntime,float number);
+v8::Local<v8::Value> JS_NewBoolean(IJS_Runtime* pJSRuntime,bool b);
+v8::Local<v8::Value> JS_NewObject(IJS_Runtime* pJSRuntime,v8::Local<v8::Object> pObj);
+v8::Local<v8::Value> JS_NewObject2(IJS_Runtime* pJSRuntime,v8::Local<v8::Array> pObj);
+v8::Local<v8::Value> JS_NewString(IJS_Runtime* pJSRuntime,const wchar_t* string);
+v8::Local<v8::Value> JS_NewString(IJS_Runtime* pJSRuntime,const wchar_t* string, unsigned nLen);
+v8::Local<v8::Value> JS_NewNull();
+v8::Local<v8::Value> JS_NewDate(IJS_Runtime* pJSRuntime,double d);
+v8::Local<v8::Value> JS_NewValue(IJS_Runtime* pJSRuntime);
+
+
+int JS_ToInt32(IJS_Runtime* pJSRuntime, v8::Local<v8::Value> pValue);
+bool JS_ToBoolean(IJS_Runtime* pJSRuntime, v8::Local<v8::Value> pValue);
+double JS_ToNumber(IJS_Runtime* pJSRuntime, v8::Local<v8::Value> pValue);
+v8::Local<v8::Object> JS_ToObject(IJS_Runtime* pJSRuntime, v8::Local<v8::Value> pValue);
+CFX_WideString JS_ToString(IJS_Runtime* pJSRuntime, v8::Local<v8::Value> pValue);
+v8::Local<v8::Array> JS_ToArray(IJS_Runtime* pJSRuntime, v8::Local<v8::Value> pValue);
+void JS_ValueCopy(v8::Local<v8::Value>& pTo, v8::Local<v8::Value> pFrom);
double JS_GetDateTime();
int JS_GetYearFromTime(double dt);
« no previous file with comments | « fpdfsdk/include/javascript/global.h ('k') | fpdfsdk/src/javascript/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698