From 57e097750846bf3ffc3e4e2ef9e78be8a82c69de Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 5 Feb 2018 18:52:09 +0000 Subject: Use unique pointer in CFXJS_PerObjectData. Also use the actual type information, not void* and remove casts. Template function not required to wrap virtual dtors. Change-Id: I9397cae136c3c395a368a1ef0ce8162d9b586076 Reviewed-on: https://pdfium-review.googlesource.com/25290 Reviewed-by: dsinclair Commit-Queue: Tom Sepez --- fxjs/cjs_document.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'fxjs/cjs_document.cpp') diff --git a/fxjs/cjs_document.cpp b/fxjs/cjs_document.cpp index 980edd990a..e513ba0159 100644 --- a/fxjs/cjs_document.cpp +++ b/fxjs/cjs_document.cpp @@ -116,9 +116,9 @@ int CJS_Document::GetObjDefnID() { // static void CJS_Document::DefineJSObjects(CFXJS_Engine* pEngine) { - ObjDefnID = pEngine->DefineObj("Document", FXJSOBJTYPE_GLOBAL, - JSConstructor, - JSDestructor); + ObjDefnID = + pEngine->DefineObj("Document", FXJSOBJTYPE_GLOBAL, + JSConstructor, JSDestructor); DefineProps(pEngine, ObjDefnID, PropertySpecs, FX_ArraySize(PropertySpecs)); DefineMethods(pEngine, ObjDefnID, MethodSpecs, FX_ArraySize(MethodSpecs)); } @@ -362,8 +362,7 @@ CJS_Return Document::print(CJS_Runtime* pRuntime, if (CFXJS_Engine::GetObjDefnID(pObj) == CJS_PrintParamsObj::GetObjDefnID()) { v8::Local pObj = pRuntime->ToObject(params[8]); - CJS_Object* pJSObj = - static_cast(pRuntime->GetObjectPrivate(pObj)); + CJS_Object* pJSObj = pRuntime->GetObjectPrivate(pObj); if (pJSObj) { if (PrintParamsObj* pprintparamsObj = static_cast(pJSObj->GetEmbedObject())) { @@ -1113,7 +1112,7 @@ CJS_Return Document::addIcon(CJS_Runtime* pRuntime, return CJS_Return(JSGetStringFromID(JSMessage::kTypeError)); v8::Local pObj = pRuntime->ToObject(params[1]); - CJS_Object* obj = static_cast(pRuntime->GetObjectPrivate(pObj)); + CJS_Object* obj = pRuntime->GetObjectPrivate(pObj); if (!obj->GetEmbedObject()) return CJS_Return(JSGetStringFromID(JSMessage::kTypeError)); -- cgit v1.2.3