• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
7 #ifndef FXJS_CJS_TIMEROBJ_H_
8 #define FXJS_CJS_TIMEROBJ_H_
9 
10 #include "fxjs/cjs_object.h"
11 
12 class GlobalTimer;
13 
14 class CJS_TimerObj final : public CJS_Object {
15  public:
16   static int GetObjDefnID();
17   static void DefineJSObjects(CFXJS_Engine* pEngine);
18 
19   CJS_TimerObj(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime);
20   ~CJS_TimerObj() override;
21 
22   void SetTimer(GlobalTimer* pTimer);
GetTimerID()23   int GetTimerID() const { return m_nTimerID; }
24 
25  private:
26   static int ObjDefnID;
27 
28   int m_nTimerID = 0;  // Weak reference to GlobalTimer through global map.
29 };
30 
31 #endif  // FXJS_CJS_TIMEROBJ_H_
32