From e3ff76b11ac6fcd0d0196ef83946d2321ab8e9bf Mon Sep 17 00:00:00 2001 From: tsepez Date: Mon, 8 Aug 2016 11:58:47 -0700 Subject: Rename CJS_Timer to GlobalTimer and make private to app.cpp The CJS_Timer is fairly far removed from JS itself, the wrapper objects are CJS_TimerObj and TimerObj. Make it sound less like them. Having moved the code to app.cpp, the GlobalTimer can now refer directly to the app, rather than its superclass of CJS_EmbedObj. Hence we can pull some app-only timer related methods out of the superclass. Review-Url: https://codereview.chromium.org/2222043002 --- fpdfsdk/javascript/app.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'fpdfsdk/javascript/app.h') diff --git a/fpdfsdk/javascript/app.h b/fpdfsdk/javascript/app.h index bb083cedb4..52dfd2f9ca 100644 --- a/fpdfsdk/javascript/app.h +++ b/fpdfsdk/javascript/app.h @@ -13,18 +13,18 @@ #include "fpdfsdk/javascript/JS_Define.h" class CJS_Runtime; -class CJS_Timer; +class GlobalTimer; class TimerObj : public CJS_EmbedObj { public: TimerObj(CJS_Object* pJSObject); ~TimerObj() override; - void SetTimer(CJS_Timer* pTimer); + void SetTimer(GlobalTimer* pTimer); int GetTimerID() const { return m_nTimerID; } private: - int m_nTimerID; // Weak reference to timer through global map. + int m_nTimerID; // Weak reference to GlobalTimer through global map. }; class CJS_TimerObj : public CJS_Object { @@ -152,19 +152,20 @@ class app : public CJS_EmbedObj { CJS_Value& vRet, CFX_WideString& sError); + void TimerProc(GlobalTimer* pTimer); + void CancelProc(GlobalTimer* pTimer); + static CFX_WideString SysPathToPDFPath(const CFX_WideString& sOldPath); private: // CJS_EmbedObj - void TimerProc(CJS_Timer* pTimer) override; - void CancelProc(CJS_Timer* pTimer) override; void RunJsScript(CJS_Runtime* pRuntime, const CFX_WideString& wsScript); void ClearTimerCommon(const CJS_Value& param); bool m_bCalculate; bool m_bRuntimeHighLight; - std::vector> m_Timers; + std::vector> m_Timers; }; class CJS_App : public CJS_Object { -- cgit v1.2.3