Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: fpdfsdk/fpdfxfa/fpdfxfa_util.cpp

Issue 2037573003: Remove FWL_HTIMER in favor of IWFL_TimerInfo (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Nits. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | fpdfsdk/fpdfxfa/include/fpdfxfa_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfxfa/fpdfxfa_util.cpp
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_util.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_util.cpp
index b6deaef17b73a79ab000895ee2cfa3d35c5f9213..9971f5d165faeba4cf8ea2b55e11b4277b20541c 100644
--- a/fpdfsdk/fpdfxfa/fpdfxfa_util.cpp
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_util.cpp
@@ -15,24 +15,25 @@ std::vector<CFWL_TimerInfo*>* CXFA_FWLAdapterTimerMgr::s_TimerArray = nullptr;
FWL_Error CXFA_FWLAdapterTimerMgr::Start(IFWL_Timer* pTimer,
uint32_t dwElapse,
- FWL_HTIMER& hTimer,
- FX_BOOL bImmediately) {
+ bool bImmediately,
+ IFWL_TimerInfo** pTimerInfo) {
if (!m_pEnv)
return FWL_Error::Indefinite;
int32_t id_event = m_pEnv->FFI_SetTimer(dwElapse, TimerProc);
if (!s_TimerArray)
s_TimerArray = new std::vector<CFWL_TimerInfo*>;
+
s_TimerArray->push_back(new CFWL_TimerInfo(id_event, pTimer));
- hTimer = reinterpret_cast<FWL_HTIMER>(s_TimerArray->back());
+ *pTimerInfo = s_TimerArray->back();
return FWL_Error::Succeeded;
}
-FWL_Error CXFA_FWLAdapterTimerMgr::Stop(FWL_HTIMER hTimer) {
- if (!hTimer || !m_pEnv)
+FWL_Error CXFA_FWLAdapterTimerMgr::Stop(IFWL_TimerInfo* pTimerInfo) {
+ if (!pTimerInfo || !m_pEnv)
return FWL_Error::Indefinite;
- CFWL_TimerInfo* pInfo = reinterpret_cast<CFWL_TimerInfo*>(hTimer);
+ CFWL_TimerInfo* pInfo = static_cast<CFWL_TimerInfo*>(pTimerInfo);
m_pEnv->FFI_KillTimer(pInfo->idEvent);
if (s_TimerArray) {
auto it = std::find(s_TimerArray->begin(), s_TimerArray->end(), pInfo);
@@ -51,7 +52,7 @@ void CXFA_FWLAdapterTimerMgr::TimerProc(int32_t idEvent) {
for (CFWL_TimerInfo* pInfo : *s_TimerArray) {
if (pInfo->idEvent == idEvent) {
- pInfo->pTimer->Run(reinterpret_cast<FWL_HTIMER>(pInfo));
+ pInfo->pTimer->Run(pInfo);
break;
}
}
« no previous file with comments | « no previous file | fpdfsdk/fpdfxfa/include/fpdfxfa_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698