OLD | NEW |
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 "JS_Object.h" | 7 #include "JS_Object.h" |
8 | 8 |
9 #include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment. | 9 #include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment. |
10 #include "../../include/javascript/IJavaScript.h" | 10 #include "../../include/javascript/IJavaScript.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 int nType, | 101 int nType, |
102 const CFX_WideString& script, | 102 const CFX_WideString& script, |
103 FX_DWORD dwElapse, | 103 FX_DWORD dwElapse, |
104 FX_DWORD dwTimeOut) | 104 FX_DWORD dwTimeOut) |
105 : m_nTimerID(0), | 105 : m_nTimerID(0), |
106 m_pEmbedObj(pObj), | 106 m_pEmbedObj(pObj), |
107 m_bProcessing(false), | 107 m_bProcessing(false), |
108 m_bValid(true), | 108 m_bValid(true), |
109 m_nType(nType), | 109 m_nType(nType), |
110 m_dwTimeOut(dwTimeOut), | 110 m_dwTimeOut(dwTimeOut), |
| 111 m_swJScript(script), |
111 m_pRuntime(pRuntime), | 112 m_pRuntime(pRuntime), |
112 m_pApp(pApp) { | 113 m_pApp(pApp) { |
113 IFX_SystemHandler* pHandler = m_pApp->GetSysHandler(); | 114 IFX_SystemHandler* pHandler = m_pApp->GetSysHandler(); |
114 m_nTimerID = pHandler->SetTimer(dwElapse, TimerProc); | 115 m_nTimerID = pHandler->SetTimer(dwElapse, TimerProc); |
115 (*GetGlobalTimerMap())[m_nTimerID] = this; | 116 (*GetGlobalTimerMap())[m_nTimerID] = this; |
116 m_pRuntime->AddObserver(this); | 117 m_pRuntime->AddObserver(this); |
117 } | 118 } |
118 | 119 |
119 CJS_Timer::~CJS_Timer() { | 120 CJS_Timer::~CJS_Timer() { |
120 CJS_Runtime* pRuntime = GetRuntime(); | 121 CJS_Runtime* pRuntime = GetRuntime(); |
(...skipping 30 matching lines...) Expand all Loading... |
151 // static | 152 // static |
152 CJS_Timer::TimerMap* CJS_Timer::GetGlobalTimerMap() { | 153 CJS_Timer::TimerMap* CJS_Timer::GetGlobalTimerMap() { |
153 // Leak the timer array at shutdown. | 154 // Leak the timer array at shutdown. |
154 static auto* s_TimerMap = new TimerMap; | 155 static auto* s_TimerMap = new TimerMap; |
155 return s_TimerMap; | 156 return s_TimerMap; |
156 } | 157 } |
157 | 158 |
158 void CJS_Timer::OnDestroyed() { | 159 void CJS_Timer::OnDestroyed() { |
159 m_bValid = false; | 160 m_bValid = false; |
160 } | 161 } |
OLD | NEW |