• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "fxjs/js_define.h"
11 
12 int CJS_TimerObj::ObjDefnID = -1;
13 
14 // static
GetObjDefnID()15 int CJS_TimerObj::GetObjDefnID() {
16   return ObjDefnID;
17 }
18 
19 // static
DefineJSObjects(CFXJS_Engine * pEngine)20 void CJS_TimerObj::DefineJSObjects(CFXJS_Engine* pEngine) {
21   ObjDefnID = pEngine->DefineObj("TimerObj", FXJSOBJTYPE_DYNAMIC,
22                                  JSConstructor<CJS_TimerObj>, JSDestructor);
23 }
24 
CJS_TimerObj(v8::Local<v8::Object> pObject,CJS_Runtime * pRuntime)25 CJS_TimerObj::CJS_TimerObj(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime)
26     : CJS_Object(pObject, pRuntime) {}
27 
28 CJS_TimerObj::~CJS_TimerObj() = default;
29 
SetTimer(GlobalTimer * pTimer)30 void CJS_TimerObj::SetTimer(GlobalTimer* pTimer) {
31   m_nTimerID = pTimer->GetTimerID();
32 }
33