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

Unified Diff: fpdfsdk/src/javascript/global.cpp

Issue 1126203010: Replace deprecated with non-deprecated V8 APIs (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/src/javascript/JS_Value.cpp ('k') | fpdfsdk/src/jsapi/fxjs_v8.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/global.cpp
diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp
index 418508f89e02c9765f45c04854d55695e6abc386..99db9e7a71406f9d585b9b203ab385c0c4809c91 100644
--- a/fpdfsdk/src/javascript/global.cpp
+++ b/fpdfsdk/src/javascript/global.cpp
@@ -387,16 +387,15 @@ void global_alternate::CommitGlobalPersisitentVariables()
void global_alternate::ObjectToArray(v8::Handle<v8::Object> pObj, CJS_GlobalVariableArray& array)
{
- v8::Handle<v8::Array> pKeyList = JS_GetObjectElementNames(pObj);
- int nObjElements = pKeyList->Length();
-
v8::Local<v8::Context> context = pObj->CreationContext();
v8::Isolate* isolate = context->GetIsolate();
+ v8::Handle<v8::Array> pKeyList = JS_GetObjectElementNames(isolate, pObj);
+ int nObjElements = pKeyList->Length();
for (int i=0; i<nObjElements; i++)
{
- CFX_WideString ws = JS_ToString(JS_GetArrayElemnet(pKeyList, i));
+ CFX_WideString ws = JS_ToString(isolate, JS_GetArrayElement(isolate, pKeyList, i));
CFX_ByteString sKey = ws.UTF8Encode();
v8::Handle<v8::Value> v = JS_GetObjectElement(isolate, pObj, ws.c_str());
@@ -408,7 +407,7 @@ void global_alternate::ObjectToArray(v8::Handle<v8::Object> pObj, CJS_GlobalVari
CJS_KeyValue* pObjElement = new CJS_KeyValue;
pObjElement->nType = JS_GLOBALDATA_TYPE_NUMBER;
pObjElement->sKey = sKey;
- pObjElement->dData = JS_ToNumber(v);
+ pObjElement->dData = JS_ToNumber(isolate, v);
array.Add(pObjElement);
}
break;
@@ -417,7 +416,7 @@ void global_alternate::ObjectToArray(v8::Handle<v8::Object> pObj, CJS_GlobalVari
CJS_KeyValue* pObjElement = new CJS_KeyValue;
pObjElement->nType = JS_GLOBALDATA_TYPE_BOOLEAN;
pObjElement->sKey = sKey;
- pObjElement->dData = JS_ToBoolean(v);
+ pObjElement->dData = JS_ToBoolean(isolate, v);
array.Add(pObjElement);
}
break;
@@ -436,7 +435,7 @@ void global_alternate::ObjectToArray(v8::Handle<v8::Object> pObj, CJS_GlobalVari
CJS_KeyValue* pObjElement = new CJS_KeyValue;
pObjElement->nType = JS_GLOBALDATA_TYPE_OBJECT;
pObjElement->sKey = sKey;
- ObjectToArray(JS_ToObject(v), pObjElement->objData);
+ ObjectToArray(JS_ToObject(isolate, v), pObjElement->objData);
array.Add(pObjElement);
}
break;
« no previous file with comments | « fpdfsdk/src/javascript/JS_Value.cpp ('k') | fpdfsdk/src/jsapi/fxjs_v8.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698