From 998fee395fc8a543968c7db3db9e3cf81dee57fc Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 5 Feb 2018 21:43:19 +0000 Subject: Remove the CJS_EmbedObj template param from JSConstructor. Each of the CJS_Objects can create their CJS_EmbedObj's internally and we don't need to do it though the JSConstructor. This also removes the need for the SetEmbedObj method in CJS_Object. Change-Id: Ib0535ad922b370634fd1e622a04860a96c4f2825 Reviewed-on: https://pdfium-review.googlesource.com/25370 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- fxjs/cjs_timerobj.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'fxjs/cjs_timerobj.cpp') diff --git a/fxjs/cjs_timerobj.cpp b/fxjs/cjs_timerobj.cpp index d892e0b3ee..172ee5c04e 100644 --- a/fxjs/cjs_timerobj.cpp +++ b/fxjs/cjs_timerobj.cpp @@ -17,15 +17,19 @@ int CJS_TimerObj::GetObjDefnID() { // static void CJS_TimerObj::DefineJSObjects(CFXJS_Engine* pEngine) { - ObjDefnID = - pEngine->DefineObj("TimerObj", FXJSOBJTYPE_DYNAMIC, - JSConstructor, JSDestructor); + ObjDefnID = pEngine->DefineObj("TimerObj", FXJSOBJTYPE_DYNAMIC, + JSConstructor, JSDestructor); +} + +CJS_TimerObj::CJS_TimerObj(v8::Local pObject) + : CJS_Object(pObject) { + m_pEmbedObj = pdfium::MakeUnique(this); } TimerObj::TimerObj(CJS_Object* pJSObject) : CJS_EmbedObj(pJSObject), m_nTimerID(0) {} -TimerObj::~TimerObj() {} +TimerObj::~TimerObj() = default; void TimerObj::SetTimer(GlobalTimer* pTimer) { m_nTimerID = pTimer->GetTimerID(); -- cgit v1.2.3