summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/JS_Object.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-08-08 11:58:47 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-08 11:58:47 -0700
commite3ff76b11ac6fcd0d0196ef83946d2321ab8e9bf (patch)
tree0665080bf665e3a1131107d242b01e137cd52c52 /fpdfsdk/javascript/JS_Object.h
parentb1b8668ef12ae4e7fcb5fbf3f01fa623a319a092 (diff)
downloadpdfium-e3ff76b11ac6fcd0d0196ef83946d2321ab8e9bf.tar.xz
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
Diffstat (limited to 'fpdfsdk/javascript/JS_Object.h')
-rw-r--r--fpdfsdk/javascript/JS_Object.h43
1 files changed, 0 insertions, 43 deletions
diff --git a/fpdfsdk/javascript/JS_Object.h b/fpdfsdk/javascript/JS_Object.h
index aec94c0362..3f0db0ea71 100644
--- a/fpdfsdk/javascript/JS_Object.h
+++ b/fpdfsdk/javascript/JS_Object.h
@@ -16,7 +16,6 @@
class CJS_Context;
class CJS_Object;
-class CJS_Timer;
class CPDFDoc_Environment;
class CJS_EmbedObj {
@@ -24,9 +23,6 @@ class CJS_EmbedObj {
explicit CJS_EmbedObj(CJS_Object* pJSObject);
virtual ~CJS_EmbedObj();
- virtual void TimerProc(CJS_Timer* pTimer) {}
- virtual void CancelProc(CJS_Timer* pTimer) {}
-
CJS_Object* GetJSObject() const { return m_pJSObject; }
int MsgBox(CPDFDoc_Environment* pApp,
@@ -67,44 +63,5 @@ class CJS_Object {
v8::Isolate* m_pIsolate;
};
-class CJS_Timer : public CJS_Runtime::Observer {
- public:
- CJS_Timer(CJS_EmbedObj* pObj,
- CPDFDoc_Environment* pApp,
- CJS_Runtime* pRuntime,
- int nType,
- const CFX_WideString& script,
- uint32_t dwElapse,
- uint32_t dwTimeOut);
- ~CJS_Timer() override;
-
- static void Trigger(int nTimerID);
- static void Cancel(int nTimerID);
-
- bool IsOneShot() const { return m_nType == 1; }
- uint32_t GetTimeOut() const { return m_dwTimeOut; }
- int GetTimerID() const { return m_nTimerID; }
- CJS_Runtime* GetRuntime() const { return m_bValid ? m_pRuntime : nullptr; }
- CFX_WideString GetJScript() const { return m_swJScript; }
-
- private:
- using TimerMap = std::map<FX_UINT, CJS_Timer*>;
- static TimerMap* GetGlobalTimerMap();
-
- // CJS_Runtime::Observer
- void OnDestroyed() override;
-
- uint32_t m_nTimerID;
- CJS_EmbedObj* const m_pEmbedObj;
- bool m_bProcessing;
- bool m_bValid;
-
- // data
- const int m_nType; // 0:Interval; 1:TimeOut
- const uint32_t m_dwTimeOut;
- const CFX_WideString m_swJScript;
- CJS_Runtime* const m_pRuntime;
- CPDFDoc_Environment* const m_pApp;
-};
#endif // FPDFSDK_JAVASCRIPT_JS_OBJECT_H_