| 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 "JS_Context.h" | 9 #include "JS_Context.h" |
| 10 #include "JS_Define.h" | 10 #include "JS_Define.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 int CJS_Object::MsgBox(CPDFDoc_Environment* pApp, | 80 int CJS_Object::MsgBox(CPDFDoc_Environment* pApp, |
| 81 const FX_WCHAR* swMsg, | 81 const FX_WCHAR* swMsg, |
| 82 const FX_WCHAR* swTitle, | 82 const FX_WCHAR* swTitle, |
| 83 FX_UINT nType, | 83 FX_UINT nType, |
| 84 FX_UINT nIcon) { | 84 FX_UINT nIcon) { |
| 85 return FXJS_MsgBox(pApp, swMsg, swTitle, nType, nIcon); | 85 return FXJS_MsgBox(pApp, swMsg, swTitle, nType, nIcon); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void CJS_Object::Alert(CJS_Context* pContext, const FX_WCHAR* swMsg) { | 88 void CJS_Object::Alert(CJS_Context* pContext, const FX_WCHAR* swMsg) { |
| 89 ASSERT(pContext != NULL); | |
| 90 | |
| 91 if (pContext->IsMsgBoxEnabled()) { | 89 if (pContext->IsMsgBoxEnabled()) { |
| 92 CPDFDoc_Environment* pApp = pContext->GetReaderApp(); | 90 CPDFDoc_Environment* pApp = pContext->GetReaderApp(); |
| 93 if (pApp) | 91 if (pApp) |
| 94 pApp->JS_appAlert(swMsg, NULL, 0, 3); | 92 pApp->JS_appAlert(swMsg, NULL, 0, 3); |
| 95 } | 93 } |
| 96 } | 94 } |
| 97 | 95 |
| 98 CJS_Timer::CJS_Timer(CJS_EmbedObj* pObj, | 96 CJS_Timer::CJS_Timer(CJS_EmbedObj* pObj, |
| 99 CPDFDoc_Environment* pApp, | 97 CPDFDoc_Environment* pApp, |
| 100 CJS_Runtime* pRuntime, | 98 CJS_Runtime* pRuntime, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // static | 150 // static |
| 153 CJS_Timer::TimerMap* CJS_Timer::GetGlobalTimerMap() { | 151 CJS_Timer::TimerMap* CJS_Timer::GetGlobalTimerMap() { |
| 154 // Leak the timer array at shutdown. | 152 // Leak the timer array at shutdown. |
| 155 static auto* s_TimerMap = new TimerMap; | 153 static auto* s_TimerMap = new TimerMap; |
| 156 return s_TimerMap; | 154 return s_TimerMap; |
| 157 } | 155 } |
| 158 | 156 |
| 159 void CJS_Timer::OnDestroyed() { | 157 void CJS_Timer::OnDestroyed() { |
| 160 m_bValid = false; | 158 m_bValid = false; |
| 161 } | 159 } |
| OLD | NEW |