blob: 5fa1ac3329d3ab63c76ee054a77a90023c160192 [file] [log] [blame]
Dan Sinclairc0858352017-10-30 17:49:52 +00001// 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
Dan Sinclaire0345a42017-10-30 20:20:42 +00007#include "fxjs/cjs_timerobj.h"
Dan Sinclairc0858352017-10-30 17:49:52 +00008
Dan Sinclaire0345a42017-10-30 20:20:42 +00009#include "fxjs/global_timer.h"
Lei Zhang4c1ced52018-10-18 21:58:21 +000010#include "fxjs/js_define.h"
Dan Sinclairc0858352017-10-30 17:49:52 +000011
12int CJS_TimerObj::ObjDefnID = -1;
13
14// static
15int CJS_TimerObj::GetObjDefnID() {
16 return ObjDefnID;
17}
18
19// static
20void CJS_TimerObj::DefineJSObjects(CFXJS_Engine* pEngine) {
Dan Sinclair998fee32018-02-05 21:43:19 +000021 ObjDefnID = pEngine->DefineObj("TimerObj", FXJSOBJTYPE_DYNAMIC,
22 JSConstructor<CJS_TimerObj>, JSDestructor);
23}
24
Tom Sepez36aae4f2018-06-04 19:44:37 +000025CJS_TimerObj::CJS_TimerObj(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime)
26 : CJS_Object(pObject, pRuntime) {}
Dan Sinclairc0858352017-10-30 17:49:52 +000027
Dan Sinclairf7435522018-02-05 22:27:22 +000028CJS_TimerObj::~CJS_TimerObj() = default;
Dan Sinclairc0858352017-10-30 17:49:52 +000029
Dan Sinclairf7435522018-02-05 22:27:22 +000030void CJS_TimerObj::SetTimer(GlobalTimer* pTimer) {
Dan Sinclairc0858352017-10-30 17:49:52 +000031 m_nTimerID = pTimer->GetTimerID();
32}