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 14 int CJS_TimerObj::GetObjDefnID() { 15 return ObjDefnID; 16 } 17 18 // static 19 void CJS_TimerObj::DefineJSObjects(CFXJS_Engine* pEngine) { 20 ObjDefnID = pEngine->DefineObj("TimerObj", FXJSOBJTYPE_DYNAMIC, 21 JSConstructor<CJS_TimerObj, TimerObj>, 22 JSDestructor<CJS_TimerObj>); 23 } 24 25 TimerObj::TimerObj(CJS_Object* pJSObject) 26 : CJS_EmbedObj(pJSObject), m_nTimerID(0) {} 27 28 TimerObj::~TimerObj() {} 29 30 void TimerObj::SetTimer(GlobalTimer* pTimer) { 31 m_nTimerID = pTimer->GetTimerID(); 32 } 33