summaryrefslogtreecommitdiff
path: root/xfa/fwl/core
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-06-06 13:23:55 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-06 13:23:55 -0700
commit6f4f2335cfd22d26db154fbd51ab553fb9902918 (patch)
tree175379ace9283314d32cf270fcdeba0c1c55cfbe /xfa/fwl/core
parent25dc95a3cb9099550fa4d9d4f1c74b0f996fbc41 (diff)
downloadpdfium-6f4f2335cfd22d26db154fbd51ab553fb9902918.tar.xz
Remove FWL_HTIMER in favor of IWFL_TimerInfo
Review-Url: https://codereview.chromium.org/2037573003
Diffstat (limited to 'xfa/fwl/core')
-rw-r--r--xfa/fwl/core/fwl_timerimp.cpp21
-rw-r--r--xfa/fwl/core/ifwl_timer.h16
-rw-r--r--xfa/fwl/core/include/ifwl_adaptertimermgr.h8
3 files changed, 24 insertions, 21 deletions
diff --git a/xfa/fwl/core/fwl_timerimp.cpp b/xfa/fwl/core/fwl_timerimp.cpp
index ced5adeb9d..22b28c8c67 100644
--- a/xfa/fwl/core/fwl_timerimp.cpp
+++ b/xfa/fwl/core/fwl_timerimp.cpp
@@ -10,21 +10,21 @@
#include "xfa/fwl/core/include/ifwl_adaptertimermgr.h"
#include "xfa/fxfa/include/xfa_ffapp.h"
-FWL_HTIMER FWL_StartTimer(IFWL_Timer* pTimer,
- uint32_t dwElapse,
- FX_BOOL bImmediately) {
+IFWL_TimerInfo* IFWL_Timer::StartTimer(uint32_t dwElapse, bool bImmediately) {
CXFA_FFApp* pAdapterNative = FWL_GetAdapterNative();
if (!pAdapterNative)
- return NULL;
+ return nullptr;
+
IFWL_AdapterTimerMgr* pAdapterTimerMgr = pAdapterNative->GetTimerMgr();
if (!pAdapterTimerMgr)
- return NULL;
- FWL_HTIMER hTimer = NULL;
- pAdapterTimerMgr->Start(pTimer, dwElapse, hTimer, bImmediately);
- return hTimer;
+ return nullptr;
+
+ IFWL_TimerInfo* pTimerInfo = nullptr;
+ pAdapterTimerMgr->Start(this, dwElapse, bImmediately, &pTimerInfo);
+ return pTimerInfo;
}
-FWL_Error FWL_StopTimer(FWL_HTIMER hTimer) {
+FWL_Error IFWL_TimerInfo::StopTimer() {
CXFA_FFApp* pAdapterNative = FWL_GetAdapterNative();
if (!pAdapterNative)
return FWL_Error::Indefinite;
@@ -32,5 +32,6 @@ FWL_Error FWL_StopTimer(FWL_HTIMER hTimer) {
IFWL_AdapterTimerMgr* pAdapterTimerMgr = pAdapterNative->GetTimerMgr();
if (!pAdapterTimerMgr)
return FWL_Error::Indefinite;
- return pAdapterTimerMgr->Stop(hTimer);
+
+ return pAdapterTimerMgr->Stop(this);
}
diff --git a/xfa/fwl/core/ifwl_timer.h b/xfa/fwl/core/ifwl_timer.h
index 0143560410..162fef9692 100644
--- a/xfa/fwl/core/ifwl_timer.h
+++ b/xfa/fwl/core/ifwl_timer.h
@@ -8,17 +8,21 @@
#define XFA_FWL_CORE_IFWL_TIMER_H_
#include "core/fxcrt/include/fx_system.h"
+#include "xfa/fwl/core/fwl_error.h"
-typedef struct FWL_HTIMER_ { void* pData; } * FWL_HTIMER;
+class IFWL_TimerInfo;
class IFWL_Timer {
public:
virtual ~IFWL_Timer() {}
- virtual int32_t Run(FWL_HTIMER hTimer) = 0;
+ virtual void Run(IFWL_TimerInfo* hTimer) = 0;
+ IFWL_TimerInfo* StartTimer(uint32_t dwElapse, bool bImmediately);
+};
+
+class IFWL_TimerInfo {
+ public:
+ virtual ~IFWL_TimerInfo() {}
+ FWL_Error StopTimer();
};
-FWL_HTIMER FWL_StartTimer(IFWL_Timer* pTimer,
- uint32_t dwElapse,
- FX_BOOL bImmediately = TRUE);
-FWL_Error FWL_StopTimer(FWL_HTIMER hTimer);
#endif // XFA_FWL_CORE_IFWL_TIMER_H_
diff --git a/xfa/fwl/core/include/ifwl_adaptertimermgr.h b/xfa/fwl/core/include/ifwl_adaptertimermgr.h
index 7859e31fd8..111c3ebf84 100644
--- a/xfa/fwl/core/include/ifwl_adaptertimermgr.h
+++ b/xfa/fwl/core/include/ifwl_adaptertimermgr.h
@@ -10,16 +10,14 @@
#include "xfa/fwl/core/fwl_error.h"
#include "xfa/fwl/core/ifwl_timer.h"
-class IFWL_Timer;
-
class IFWL_AdapterTimerMgr {
public:
virtual ~IFWL_AdapterTimerMgr() {}
virtual FWL_Error Start(IFWL_Timer* pTimer,
uint32_t dwElapse,
- FWL_HTIMER& hTimer,
- FX_BOOL bImmediately = TRUE) = 0;
- virtual FWL_Error Stop(FWL_HTIMER hTimer) = 0;
+ bool bImmediately,
+ IFWL_TimerInfo** pTimerInfo) = 0;
+ virtual FWL_Error Stop(IFWL_TimerInfo* pTimerInfo) = 0;
};
#endif // XFA_FWL_CORE_INCLUDE_IFWL_ADAPTERTIMERMGR_H_