| 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_Runtime.h" |
| 8 |
| 9 #include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment. |
| 7 #include "../../include/javascript/IJavaScript.h" | 10 #include "../../include/javascript/IJavaScript.h" |
| 8 #include "../../include/javascript/JS_EventHandler.h" | 11 #include "Consts.h" |
| 9 #include "../../include/javascript/JS_Runtime.h" | 12 #include "Document.h" |
| 10 #include "../../include/javascript/JS_Context.h" | 13 #include "Field.h" |
| 11 #include "../../include/javascript/JS_Define.h" | 14 #include "Icon.h" |
| 12 #include "../../include/javascript/JS_Object.h" | 15 #include "JS_Context.h" |
| 13 #include "../../include/javascript/JS_Value.h" | 16 #include "JS_Define.h" |
| 14 #include "../../include/javascript/app.h" | 17 #include "JS_EventHandler.h" |
| 15 #include "../../include/javascript/color.h" | 18 #include "JS_GlobalData.h" |
| 16 #include "../../include/javascript/Consts.h" | 19 #include "JS_Object.h" |
| 17 #include "../../include/javascript/Document.h" | 20 #include "JS_Value.h" |
| 18 #include "../../include/javascript/event.h" | 21 #include "PublicMethods.h" |
| 19 #include "../../include/javascript/Field.h" | 22 #include "app.h" |
| 20 #include "../../include/javascript/Icon.h" | 23 #include "color.h" |
| 21 #include "../../include/javascript/PublicMethods.h" | 24 #include "console.h" |
| 22 #include "../../include/javascript/report.h" | 25 #include "event.h" |
| 23 #include "../../include/javascript/util.h" | 26 #include "global.h" |
| 24 #include "../../include/javascript/JS_GlobalData.h" | 27 #include "report.h" |
| 25 #include "../../include/javascript/global.h" | 28 #include "util.h" |
| 26 #include "../../include/javascript/console.h" | |
| 27 | 29 |
| 28 /* ------------------------------ CJS_Runtime ------------------------------ */ | 30 /* ------------------------------ CJS_Runtime ------------------------------ */ |
| 29 | 31 |
| 32 IFXJS_Runtime* IFXJS_Runtime::Create(CPDFDoc_Environment* pEnv) { |
| 33 return new CJS_Runtime(pEnv); |
| 34 } |
| 35 |
| 30 CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp) | 36 CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp) |
| 31 : m_pApp(pApp), | 37 : m_pApp(pApp), |
| 32 m_pDocument(NULL), | 38 m_pDocument(NULL), |
| 33 m_bBlocking(FALSE), | 39 m_bBlocking(FALSE), |
| 34 m_isolate(NULL), | 40 m_isolate(NULL), |
| 35 m_isolateManaged(false) { | 41 m_isolateManaged(false) { |
| 36 IPDF_JSPLATFORM* pPlatform = m_pApp->GetFormFillInfo()->m_pJsPlatform; | 42 IPDF_JSPLATFORM* pPlatform = m_pApp->GetFormFillInfo()->m_pJsPlatform; |
| 37 if (pPlatform->version <= 2) { | 43 if (pPlatform->version <= 2) { |
| 38 unsigned int embedderDataSlot = 0; | 44 unsigned int embedderDataSlot = 0; |
| 39 v8::Isolate* pExternalIsolate = nullptr; | 45 v8::Isolate* pExternalIsolate = nullptr; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 void CJS_Runtime::RemoveObserver(Observer* observer) { | 192 void CJS_Runtime::RemoveObserver(Observer* observer) { |
| 187 ASSERT(m_observers.find(observer) != m_observers.end()); | 193 ASSERT(m_observers.find(observer) != m_observers.end()); |
| 188 m_observers.erase(observer); | 194 m_observers.erase(observer); |
| 189 } | 195 } |
| 190 | 196 |
| 191 CFX_WideString ChangeObjName(const CFX_WideString& str) { | 197 CFX_WideString ChangeObjName(const CFX_WideString& str) { |
| 192 CFX_WideString sRet = str; | 198 CFX_WideString sRet = str; |
| 193 sRet.Replace(L"_", L"."); | 199 sRet.Replace(L"_", L"."); |
| 194 return sRet; | 200 return sRet; |
| 195 } | 201 } |
| OLD | NEW |