blob: be095558e231dd52def8da2945965e809026af43 [file] [log] [blame]
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -07001// 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
7#ifndef FXJS_CJS_TIMEROBJ_H_
8#define FXJS_CJS_TIMEROBJ_H_
9
10#include "fxjs/JS_Define.h"
11
12class GlobalTimer;
13
14class TimerObj : public CJS_EmbedObj {
15 public:
16 explicit TimerObj(CJS_Object* pJSObject);
17 ~TimerObj() override;
18
19 void SetTimer(GlobalTimer* pTimer);
20 int GetTimerID() const { return m_nTimerID; }
21
22 private:
23 int m_nTimerID; // Weak reference to GlobalTimer through global map.
24};
25
26class CJS_TimerObj : public CJS_Object {
27 public:
28 static int GetObjDefnID();
29 static void DefineJSObjects(CFXJS_Engine* pEngine);
30
31 explicit CJS_TimerObj(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {}
32 ~CJS_TimerObj() override {}
33
34 private:
35 static int ObjDefnID;
36};
37
38#endif // FXJS_CJS_TIMEROBJ_H_