1 // Copyright 2017 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #include "fxjs/cjs_timerobj.h" 8 9 #include "fxjs/global_timer.h" 10 11 int CJS_TimerObj::ObjDefnID = -1; 12 13 // static GetObjDefnID()14int CJS_TimerObj::GetObjDefnID() { 15 return ObjDefnID; 16 } 17 18 // static DefineJSObjects(CFXJS_Engine * pEngine)19void CJS_TimerObj::DefineJSObjects(CFXJS_Engine* pEngine) { 20 ObjDefnID = pEngine->DefineObj("TimerObj", FXJSOBJTYPE_DYNAMIC, 21 JSConstructor<CJS_TimerObj, TimerObj>, 22 JSDestructor<CJS_TimerObj>); 23 } 24 TimerObj(CJS_Object * pJSObject)25TimerObj::TimerObj(CJS_Object* pJSObject) 26 : CJS_EmbedObj(pJSObject), m_nTimerID(0) {} 27 ~TimerObj()28TimerObj::~TimerObj() {} 29 SetTimer(GlobalTimer * pTimer)30void TimerObj::SetTimer(GlobalTimer* pTimer) { 31 m_nTimerID = pTimer->GetTimerID(); 32 } 33