blob: 69effa638da7b33bb33413930a67ef5b2924ee5a [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#ifndef FXJS_CJS_TIMEROBJ_H_
8#define FXJS_CJS_TIMEROBJ_H_
Dan Sinclairc0858352017-10-30 17:49:52 +00009
Lei Zhang31beedc2018-10-18 21:09:55 +000010#include "fxjs/cjs_object.h"
Dan Sinclairc0858352017-10-30 17:49:52 +000011
12class GlobalTimer;
13
Tom Sepez55865452018-08-27 20:18:04 +000014class CJS_TimerObj final : public CJS_Object {
Dan Sinclairc0858352017-10-30 17:49:52 +000015 public:
16 static int GetObjDefnID();
17 static void DefineJSObjects(CFXJS_Engine* pEngine);
18
Tom Sepez36aae4f2018-06-04 19:44:37 +000019 CJS_TimerObj(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime);
Dan Sinclairf7435522018-02-05 22:27:22 +000020 ~CJS_TimerObj() override;
21
22 void SetTimer(GlobalTimer* pTimer);
23 int GetTimerID() const { return m_nTimerID; }
Dan Sinclairc0858352017-10-30 17:49:52 +000024
25 private:
26 static int ObjDefnID;
Dan Sinclairf7435522018-02-05 22:27:22 +000027
Tom Sepez36aae4f2018-06-04 19:44:37 +000028 int m_nTimerID = 0; // Weak reference to GlobalTimer through global map.
Dan Sinclairc0858352017-10-30 17:49:52 +000029};
30
Dan Sinclaire0345a42017-10-30 20:20:42 +000031#endif // FXJS_CJS_TIMEROBJ_H_