summaryrefslogtreecommitdiff
path: root/fxjs/cjs_document.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-02-05 18:52:09 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-05 18:52:09 +0000
commit57e097750846bf3ffc3e4e2ef9e78be8a82c69de (patch)
tree080a0d644b816cc6d2cb0b00f4c9629020894316 /fxjs/cjs_document.cpp
parent13c4d1b46641fb3041800cad3032e7e60026e3f4 (diff)
downloadpdfium-57e097750846bf3ffc3e4e2ef9e78be8a82c69de.tar.xz
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 <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjs_document.cpp')
-rw-r--r--fxjs/cjs_document.cpp11
1 files changed, 5 insertions, 6 deletions
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<CJS_Document, Document>,
- JSDestructor<CJS_Document>);
+ ObjDefnID =
+ pEngine->DefineObj("Document", FXJSOBJTYPE_GLOBAL,
+ JSConstructor<CJS_Document, Document>, 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<v8::Object> pObj = pRuntime->ToObject(params[8]);
- CJS_Object* pJSObj =
- static_cast<CJS_Object*>(pRuntime->GetObjectPrivate(pObj));
+ CJS_Object* pJSObj = pRuntime->GetObjectPrivate(pObj);
if (pJSObj) {
if (PrintParamsObj* pprintparamsObj =
static_cast<PrintParamsObj*>(pJSObj->GetEmbedObject())) {
@@ -1113,7 +1112,7 @@ CJS_Return Document::addIcon(CJS_Runtime* pRuntime,
return CJS_Return(JSGetStringFromID(JSMessage::kTypeError));
v8::Local<v8::Object> pObj = pRuntime->ToObject(params[1]);
- CJS_Object* obj = static_cast<CJS_Object*>(pRuntime->GetObjectPrivate(pObj));
+ CJS_Object* obj = pRuntime->GetObjectPrivate(pObj);
if (!obj->GetEmbedObject())
return CJS_Return(JSGetStringFromID(JSMessage::kTypeError));