summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/cjs_timerobj.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-30 17:49:52 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-10-30 17:49:52 +0000
commitc0858354f1e9ce1246b8af9ef2cd11623a1132dd (patch)
tree13db2ec010cdc05a8dd6f91cd06bbb0ccc6613f2 /fpdfsdk/javascript/cjs_timerobj.cpp
parenta5c874c1240a0be86d6db0536940c1d0942b4c6d (diff)
downloadpdfium-c0858354f1e9ce1246b8af9ef2cd11623a1132dd.tar.xz
Rename app to cjs_app
This CL renames the app.{cpp|h} files to cjs_app.{cpp|h}. The CJS_TimerObj and GlobalTimer objects have been moved to their own files. Change-Id: I7a4063b212f1051b1517ec8902a0ee215854feaf Reviewed-on: https://pdfium-review.googlesource.com/17040 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/cjs_timerobj.cpp')
-rw-r--r--fpdfsdk/javascript/cjs_timerobj.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/fpdfsdk/javascript/cjs_timerobj.cpp b/fpdfsdk/javascript/cjs_timerobj.cpp
new file mode 100644
index 0000000000..f0b90292c6
--- /dev/null
+++ b/fpdfsdk/javascript/cjs_timerobj.cpp
@@ -0,0 +1,32 @@
+// Copyright 2017 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "fpdfsdk/javascript/cjs_timerobj.h"
+
+#include "fpdfsdk/javascript/global_timer.h"
+
+int CJS_TimerObj::ObjDefnID = -1;
+
+// static
+int CJS_TimerObj::GetObjDefnID() {
+ return ObjDefnID;
+}
+
+// static
+void CJS_TimerObj::DefineJSObjects(CFXJS_Engine* pEngine) {
+ ObjDefnID = pEngine->DefineObj("TimerObj", FXJSOBJTYPE_DYNAMIC,
+ JSConstructor<CJS_TimerObj, TimerObj>,
+ JSDestructor<CJS_TimerObj>);
+}
+
+TimerObj::TimerObj(CJS_Object* pJSObject)
+ : CJS_EmbedObj(pJSObject), m_nTimerID(0) {}
+
+TimerObj::~TimerObj() {}
+
+void TimerObj::SetTimer(GlobalTimer* pTimer) {
+ m_nTimerID = pTimer->GetTimerID();
+}