blob: 59d38423af61f886ab6c3a3953bfde8f0b1853a9 [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"
Dan Sinclairc0858352017-10-30 17:49:52 +000010
11int CJS_TimerObj::ObjDefnID = -1;
12
13// static
14int CJS_TimerObj::GetObjDefnID() {
15 return ObjDefnID;
16}
17
18// static
19void CJS_TimerObj::DefineJSObjects(CFXJS_Engine* pEngine) {
Dan Sinclair998fee32018-02-05 21:43:19 +000020 ObjDefnID = pEngine->DefineObj("TimerObj", FXJSOBJTYPE_DYNAMIC,
21 JSConstructor<CJS_TimerObj>, JSDestructor);
22}
23
24CJS_TimerObj::CJS_TimerObj(v8::Local<v8::Object> pObject)
Dan Sinclairf7435522018-02-05 22:27:22 +000025 : CJS_Object(pObject), m_nTimerID(0) {}
Dan Sinclairc0858352017-10-30 17:49:52 +000026
Dan Sinclairf7435522018-02-05 22:27:22 +000027CJS_TimerObj::~CJS_TimerObj() = default;
Dan Sinclairc0858352017-10-30 17:49:52 +000028
Dan Sinclairf7435522018-02-05 22:27:22 +000029void CJS_TimerObj::SetTimer(GlobalTimer* pTimer) {
Dan Sinclairc0858352017-10-30 17:49:52 +000030 m_nTimerID = pTimer->GetTimerID();
31}