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" |
Lei Zhang | 4c1ced5 | 2018-10-18 21:58:21 +0000 | [diff] [blame] | 10 | #include "fxjs/js_define.h" |
Dan Sinclair | c085835 | 2017-10-30 17:49:52 +0000 | [diff] [blame] | 11 | |
| 12 | int CJS_TimerObj::ObjDefnID = -1; |
| 13 | |
| 14 | // static |
| 15 | int CJS_TimerObj::GetObjDefnID() { |
| 16 | return ObjDefnID; |
| 17 | } |
| 18 | |
| 19 | // static |
| 20 | void CJS_TimerObj::DefineJSObjects(CFXJS_Engine* pEngine) { |
Dan Sinclair | 998fee3 | 2018-02-05 21:43:19 +0000 | [diff] [blame] | 21 | ObjDefnID = pEngine->DefineObj("TimerObj", FXJSOBJTYPE_DYNAMIC, |
| 22 | JSConstructor<CJS_TimerObj>, JSDestructor); |
| 23 | } |
| 24 | |
Tom Sepez | 36aae4f | 2018-06-04 19:44:37 +0000 | [diff] [blame] | 25 | CJS_TimerObj::CJS_TimerObj(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime) |
| 26 | : CJS_Object(pObject, pRuntime) {} |
Dan Sinclair | c085835 | 2017-10-30 17:49:52 +0000 | [diff] [blame] | 27 | |
Dan Sinclair | f743552 | 2018-02-05 22:27:22 +0000 | [diff] [blame] | 28 | CJS_TimerObj::~CJS_TimerObj() = default; |
Dan Sinclair | c085835 | 2017-10-30 17:49:52 +0000 | [diff] [blame] | 29 | |
Dan Sinclair | f743552 | 2018-02-05 22:27:22 +0000 | [diff] [blame] | 30 | void CJS_TimerObj::SetTimer(GlobalTimer* pTimer) { |
Dan Sinclair | c085835 | 2017-10-30 17:49:52 +0000 | [diff] [blame] | 31 | m_nTimerID = pTimer->GetTimerID(); |
| 32 | } |