| 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 "fpdfsdk/javascript/app.h" | 7 #include "fpdfsdk/javascript/app.h" |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 : m_nTimerID(0), | 68 : m_nTimerID(0), |
| 69 m_pEmbedObj(pObj), | 69 m_pEmbedObj(pObj), |
| 70 m_bProcessing(false), | 70 m_bProcessing(false), |
| 71 m_nType(nType), | 71 m_nType(nType), |
| 72 m_dwTimeOut(dwTimeOut), | 72 m_dwTimeOut(dwTimeOut), |
| 73 m_swJScript(script), | 73 m_swJScript(script), |
| 74 m_pRuntime(pRuntime), | 74 m_pRuntime(pRuntime), |
| 75 m_pFormFillEnv(pFormFillEnv) { | 75 m_pFormFillEnv(pFormFillEnv) { |
| 76 CFX_SystemHandler* pHandler = m_pFormFillEnv->GetSysHandler(); | 76 CFX_SystemHandler* pHandler = m_pFormFillEnv->GetSysHandler(); |
| 77 m_nTimerID = pHandler->SetTimer(dwElapse, Trigger); | 77 m_nTimerID = pHandler->SetTimer(dwElapse, Trigger); |
| 78 (*GetGlobalTimerMap())[m_nTimerID] = this; | 78 if (m_nTimerID) |
| 79 (*GetGlobalTimerMap())[m_nTimerID] = this; |
| 79 } | 80 } |
| 80 | 81 |
| 81 GlobalTimer::~GlobalTimer() { | 82 GlobalTimer::~GlobalTimer() { |
| 82 if (!m_nTimerID) | 83 if (!m_nTimerID) |
| 83 return; | 84 return; |
| 84 | 85 |
| 85 if (GetRuntime()) | 86 if (GetRuntime()) |
| 86 m_pFormFillEnv->GetSysHandler()->KillTimer(m_nTimerID); | 87 m_pFormFillEnv->GetSysHandler()->KillTimer(m_nTimerID); |
| 87 | 88 |
| 88 GetGlobalTimerMap()->erase(m_nTimerID); | 89 GetGlobalTimerMap()->erase(m_nTimerID); |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 bool app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { | 793 bool app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { |
| 793 return false; | 794 return false; |
| 794 } | 795 } |
| 795 | 796 |
| 796 bool app::execDialog(IJS_Context* cc, | 797 bool app::execDialog(IJS_Context* cc, |
| 797 const std::vector<CJS_Value>& params, | 798 const std::vector<CJS_Value>& params, |
| 798 CJS_Value& vRet, | 799 CJS_Value& vRet, |
| 799 CFX_WideString& sError) { | 800 CFX_WideString& sError) { |
| 800 return true; | 801 return true; |
| 801 } | 802 } |
| OLD | NEW |