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

Unified Diff: xfa/fwl/core/ifwl_timer.cpp

Issue 2436103002: Remove FWL globals. (Closed)
Patch Set: fix mac Created 4 years, 2 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
Index: xfa/fwl/core/ifwl_timer.cpp
diff --git a/xfa/fwl/core/ifwl_timer.cpp b/xfa/fwl/core/ifwl_timer.cpp
index 941113e7ca0af48894dd12ab81f1138d73c58a85..3f81eec476829096077cbf845f4361f9d4b66352 100644
--- a/xfa/fwl/core/ifwl_timer.cpp
+++ b/xfa/fwl/core/ifwl_timer.cpp
@@ -7,10 +7,15 @@
#include "xfa/fwl/core/ifwl_adaptertimermgr.h"
#include "xfa/fwl/core/ifwl_app.h"
#include "xfa/fwl/core/ifwl_timer.h"
+#include "xfa/fwl/core/ifwl_widget.h"
#include "xfa/fxfa/xfa_ffapp.h"
IFWL_TimerInfo* IFWL_Timer::StartTimer(uint32_t dwElapse, bool bImmediately) {
- CXFA_FFApp* pAdapterNative = FWL_GetAdapterNative();
+ const IFWL_App* pApp = m_pWidget->GetOwnerApp();
+ if (!pApp)
+ return nullptr;
+
+ CXFA_FFApp* pAdapterNative = pApp->GetAdapterNative();
if (!pAdapterNative)
return nullptr;
@@ -24,13 +29,5 @@ IFWL_TimerInfo* IFWL_Timer::StartTimer(uint32_t dwElapse, bool bImmediately) {
}
FWL_Error IFWL_TimerInfo::StopTimer() {
- CXFA_FFApp* pAdapterNative = FWL_GetAdapterNative();
- if (!pAdapterNative)
- return FWL_Error::Indefinite;
-
- IFWL_AdapterTimerMgr* pAdapterTimerMgr = pAdapterNative->GetTimerMgr();
- if (!pAdapterTimerMgr)
- return FWL_Error::Indefinite;
-
- return pAdapterTimerMgr->Stop(this);
+ return m_pMgr->Stop(this);
}

Powered by Google App Engine
This is Rietveld 408576698