| 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 #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_ | 7 #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_ |
| 8 #define FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_ | 8 #define FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_ |
| 9 | 9 |
| 10 #include "../fsdk_define.h" // For FX_UINT | 10 #include "../fsdk_define.h" // For FX_UINT |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 m_Array.RemoveAll(); | 102 m_Array.RemoveAll(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void SetAt(FX_UINT nIndex, CJS_Timer* pTimer) { | 105 void SetAt(FX_UINT nIndex, CJS_Timer* pTimer) { |
| 106 int i = Find(nIndex); | 106 int i = Find(nIndex); |
| 107 | 107 |
| 108 if (i >= 0) { | 108 if (i >= 0) { |
| 109 if (JS_TIMER_MAP* pMap = m_Array.GetAt(i)) | 109 if (JS_TIMER_MAP* pMap = m_Array.GetAt(i)) |
| 110 pMap->pTimer = pTimer; | 110 pMap->pTimer = pTimer; |
| 111 } else { | 111 } else { |
| 112 if (JS_TIMER_MAP* pMap = new JS_TIMER_MAP) { | 112 JS_TIMER_MAP* pMap = new JS_TIMER_MAP; |
| 113 pMap->nID = nIndex; | 113 pMap->nID = nIndex; |
| 114 pMap->pTimer = pTimer; | 114 pMap->pTimer = pTimer; |
| 115 m_Array.Add(pMap); | 115 m_Array.Add(pMap); |
| 116 } | |
| 117 } | 116 } |
| 118 } | 117 } |
| 119 | 118 |
| 120 CJS_Timer* GetAt(FX_UINT nIndex) { | 119 CJS_Timer* GetAt(FX_UINT nIndex) { |
| 121 int i = Find(nIndex); | 120 int i = Find(nIndex); |
| 122 | 121 |
| 123 if (i >= 0) { | 122 if (i >= 0) { |
| 124 if (JS_TIMER_MAP* pMap = m_Array.GetAt(i)) | 123 if (JS_TIMER_MAP* pMap = m_Array.GetAt(i)) |
| 125 return pMap->pTimer; | 124 return pMap->pTimer; |
| 126 } | 125 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 FX_DWORD m_dwTimeOut; | 234 FX_DWORD m_dwTimeOut; |
| 236 FX_DWORD m_dwElapse; | 235 FX_DWORD m_dwElapse; |
| 237 CJS_Runtime* m_pRuntime; | 236 CJS_Runtime* m_pRuntime; |
| 238 CFX_WideString m_swJScript; | 237 CFX_WideString m_swJScript; |
| 239 int m_nType; // 0:Interval; 1:TimeOut | 238 int m_nType; // 0:Interval; 1:TimeOut |
| 240 | 239 |
| 241 CPDFDoc_Environment* m_pApp; | 240 CPDFDoc_Environment* m_pApp; |
| 242 }; | 241 }; |
| 243 | 242 |
| 244 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_ | 243 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_OBJECT_H_ |
| OLD | NEW |