Dan Sinclair | c085835 | 2017-10-30 17:49:52 +0000 | [diff] [blame] | 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 | |
Dan Sinclair | e0345a4 | 2017-10-30 20:20:42 +0000 | [diff] [blame] | 7 | #include "fxjs/cjs_timerobj.h" |
Dan Sinclair | c085835 | 2017-10-30 17:49:52 +0000 | [diff] [blame] | 8 | |
Dan Sinclair | e0345a4 | 2017-10-30 20:20:42 +0000 | [diff] [blame] | 9 | #include "fxjs/global_timer.h" |
Dan Sinclair | c085835 | 2017-10-30 17:49:52 +0000 | [diff] [blame] | 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) { |
Dan Sinclair | 998fee3 | 2018-02-05 21:43:19 +0000 | [diff] [blame] | 20 | ObjDefnID = pEngine->DefineObj("TimerObj", FXJSOBJTYPE_DYNAMIC, |
| 21 | JSConstructor<CJS_TimerObj>, JSDestructor); |
| 22 | } |
| 23 | |
| 24 | CJS_TimerObj::CJS_TimerObj(v8::Local<v8::Object> pObject) |
Dan Sinclair | f743552 | 2018-02-05 22:27:22 +0000 | [diff] [blame] | 25 | : CJS_Object(pObject), m_nTimerID(0) {} |
Dan Sinclair | c085835 | 2017-10-30 17:49:52 +0000 | [diff] [blame] | 26 | |
Dan Sinclair | f743552 | 2018-02-05 22:27:22 +0000 | [diff] [blame] | 27 | CJS_TimerObj::~CJS_TimerObj() = default; |
Dan Sinclair | c085835 | 2017-10-30 17:49:52 +0000 | [diff] [blame] | 28 | |
Dan Sinclair | f743552 | 2018-02-05 22:27:22 +0000 | [diff] [blame] | 29 | void CJS_TimerObj::SetTimer(GlobalTimer* pTimer) { |
Dan Sinclair | c085835 | 2017-10-30 17:49:52 +0000 | [diff] [blame] | 30 | m_nTimerID = pTimer->GetTimerID(); |
| 31 | } |