From fbf266fc0ea4be2523cbb901a641aa33f0035662 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 10 Jun 2015 11:09:44 -0700 Subject: Remove typdefs for pointer types in fx_system.h. This involves fixing some multiple variable per line declarations, as the textually-substituted "*" applies only to the first one. This involves moving some consts around following the substitution. This involves replacing some typedefs used as constructors with better code. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1171733003 --- fpdfsdk/src/jsapi/fxjs_v8.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'fpdfsdk/src/jsapi') diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp index 0c0d8b5b1b..5ffbc9d86b 100644 --- a/fpdfsdk/src/jsapi/fxjs_v8.cpp +++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp @@ -33,7 +33,7 @@ class CJS_PrivateData public: CJS_PrivateData():ObjDefID(-1), pPrivate(NULL) {} int ObjDefID; - FX_LPVOID pPrivate; + void* pPrivate; }; @@ -105,7 +105,7 @@ int JS_DefineObjMethod(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* s if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return 0; CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID); v8::Local objTemp = v8::Local::New(isolate, pObjDef->m_objTemplate); - objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsMethodName), v8::NewStringType::kNormal).ToLocalChecked(), v8::FunctionTemplate::New(isolate, pMethodCall), v8::ReadOnly); + objTemp->Set(v8::String::NewFromUtf8(isolate, bsMethodName.c_str(), v8::NewStringType::kNormal).ToLocalChecked(), v8::FunctionTemplate::New(isolate, pMethodCall), v8::ReadOnly); pObjDef->m_objTemplate.Reset(isolate,objTemp); return 0; } @@ -125,7 +125,7 @@ int JS_DefineObjProperty(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return 0; CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID); v8::Local objTemp = v8::Local::New(isolate, pObjDef->m_objTemplate); - objTemp->SetAccessor(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsPropertyName), v8::NewStringType::kNormal).ToLocalChecked(), pPropGet, pPropPut); + objTemp->SetAccessor(v8::String::NewFromUtf8(isolate, bsPropertyName.c_str(), v8::NewStringType::kNormal).ToLocalChecked(), pPropGet, pPropPut); pObjDef->m_objTemplate.Reset(isolate,objTemp); return 0; } @@ -162,7 +162,7 @@ int JS_DefineObjConst(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sC if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return 0; CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID); v8::Local objTemp = v8::Local::New(isolate, pObjDef->m_objTemplate); - objTemp->Set(isolate, FX_LPCSTR(bsConstName), pDefault); + objTemp->Set(isolate, bsConstName.c_str(), pDefault); pObjDef->m_objTemplate.Reset(isolate,objTemp); return 0; } @@ -202,7 +202,7 @@ int JS_DefineGlobalMethod(IJS_Runtime* pJSRuntime, const wchar_t* sMethodName, v objTemp = v8::ObjectTemplate::New(isolate); else objTemp = v8::Local::New(isolate, globalObjTemp); - objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsMethodName), v8::NewStringType::kNormal).ToLocalChecked(), funTempl, v8::ReadOnly); + objTemp->Set(v8::String::NewFromUtf8(isolate, bsMethodName.c_str(), v8::NewStringType::kNormal).ToLocalChecked(), funTempl, v8::ReadOnly); globalObjTemp.Reset(isolate,objTemp); @@ -225,7 +225,7 @@ int JS_DefineGlobalConst(IJS_Runtime* pJSRuntime, const wchar_t* sConstName, v8: objTemp = v8::ObjectTemplate::New(isolate); else objTemp = v8::Local::New(isolate, globalObjTemp); - objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsConst), v8::NewStringType::kNormal).ToLocalChecked(), pDefault, v8::ReadOnly); + objTemp->Set(v8::String::NewFromUtf8(isolate, bsConst.c_str(), v8::NewStringType::kNormal).ToLocalChecked(), pDefault, v8::ReadOnly); globalObjTemp.Reset(isolate,objTemp); -- cgit v1.2.3