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

Side by Side Diff: fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.cpp

Issue 2502653002: Cleanup remaining IFWL files for visiblity and usage. (Closed)
Patch Set: Review cleanup Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h ('k') | xfa/fwl/core/cfwl_barcode.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h" 7 #include "fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "fpdfsdk/cpdfsdk_formfillenvironment.h" 11 #include "fpdfsdk/cpdfsdk_formfillenvironment.h"
12 #include "fpdfsdk/fsdk_define.h" 12 #include "fpdfsdk/fsdk_define.h"
13 13
14 std::vector<CFWL_TimerInfo*>* CXFA_FWLAdapterTimerMgr::s_TimerArray = nullptr; 14 std::vector<CFWL_TimerInfo*>* CXFA_FWLAdapterTimerMgr::s_TimerArray = nullptr;
15 15
16 FWL_Error CXFA_FWLAdapterTimerMgr::Start(IFWL_Timer* pTimer, 16 void CXFA_FWLAdapterTimerMgr::Start(IFWL_Timer* pTimer,
17 uint32_t dwElapse, 17 uint32_t dwElapse,
18 bool bImmediately, 18 bool bImmediately,
19 IFWL_TimerInfo** pTimerInfo) { 19 IFWL_TimerInfo** pTimerInfo) {
20 if (!m_pFormFillEnv) 20 if (!m_pFormFillEnv)
21 return FWL_Error::Indefinite; 21 return;
22 22
23 int32_t id_event = m_pFormFillEnv->SetTimer(dwElapse, TimerProc); 23 int32_t id_event = m_pFormFillEnv->SetTimer(dwElapse, TimerProc);
24 if (!s_TimerArray) 24 if (!s_TimerArray)
25 s_TimerArray = new std::vector<CFWL_TimerInfo*>; 25 s_TimerArray = new std::vector<CFWL_TimerInfo*>;
26 26
27 s_TimerArray->push_back(new CFWL_TimerInfo(this, id_event, pTimer)); 27 s_TimerArray->push_back(new CFWL_TimerInfo(this, id_event, pTimer));
28 *pTimerInfo = s_TimerArray->back(); 28 *pTimerInfo = s_TimerArray->back();
29 return FWL_Error::Succeeded;
30 } 29 }
31 30
32 FWL_Error CXFA_FWLAdapterTimerMgr::Stop(IFWL_TimerInfo* pTimerInfo) { 31 void CXFA_FWLAdapterTimerMgr::Stop(IFWL_TimerInfo* pTimerInfo) {
33 if (!pTimerInfo || !m_pFormFillEnv) 32 if (!pTimerInfo || !m_pFormFillEnv)
34 return FWL_Error::Indefinite; 33 return;
35 34
36 CFWL_TimerInfo* pInfo = static_cast<CFWL_TimerInfo*>(pTimerInfo); 35 CFWL_TimerInfo* pInfo = static_cast<CFWL_TimerInfo*>(pTimerInfo);
37 m_pFormFillEnv->KillTimer(pInfo->idEvent); 36 m_pFormFillEnv->KillTimer(pInfo->idEvent);
38 if (s_TimerArray) { 37 if (s_TimerArray) {
39 auto it = std::find(s_TimerArray->begin(), s_TimerArray->end(), pInfo); 38 auto it = std::find(s_TimerArray->begin(), s_TimerArray->end(), pInfo);
40 if (it != s_TimerArray->end()) { 39 if (it != s_TimerArray->end()) {
41 s_TimerArray->erase(it); 40 s_TimerArray->erase(it);
42 delete pInfo; 41 delete pInfo;
43 } 42 }
44 } 43 }
45 return FWL_Error::Succeeded;
46 } 44 }
47 45
48 // static 46 // static
49 void CXFA_FWLAdapterTimerMgr::TimerProc(int32_t idEvent) { 47 void CXFA_FWLAdapterTimerMgr::TimerProc(int32_t idEvent) {
50 if (!s_TimerArray) 48 if (!s_TimerArray)
51 return; 49 return;
52 50
53 for (CFWL_TimerInfo* pInfo : *s_TimerArray) { 51 for (CFWL_TimerInfo* pInfo : *s_TimerArray) {
54 if (pInfo->idEvent == idEvent) { 52 if (pInfo->idEvent == idEvent) {
55 pInfo->pTimer->Run(pInfo); 53 pInfo->pTimer->Run(pInfo);
56 break; 54 break;
57 } 55 }
58 } 56 }
59 } 57 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h ('k') | xfa/fwl/core/cfwl_barcode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698