| 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/fpdfxfa/include/fpdfxfa_app.h" | 7 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_app.h" |
| 8 | 8 |
| 9 #include <memory> |
| 10 |
| 9 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_util.h" | 11 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_util.h" |
| 10 #include "fpdfsdk/include/cpdfsdk_environment.h" | 12 #include "fpdfsdk/include/cpdfsdk_environment.h" |
| 11 #include "fpdfsdk/include/fsdk_define.h" | 13 #include "fpdfsdk/include/fsdk_define.h" |
| 12 #include "xfa/fxbarcode/include/BC_Library.h" | 14 #include "xfa/fxbarcode/include/BC_Library.h" |
| 13 #include "xfa/fxfa/include/xfa_ffapp.h" | 15 #include "xfa/fxfa/include/xfa_ffapp.h" |
| 14 #include "xfa/fxfa/include/xfa_fontmgr.h" | 16 #include "xfa/fxfa/include/xfa_fontmgr.h" |
| 15 | 17 |
| 16 namespace { | 18 namespace { |
| 17 | 19 |
| 18 CPDFXFA_App* g_pApp = nullptr; | 20 CPDFXFA_App* g_pApp = nullptr; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 47 } | 49 } |
| 48 | 50 |
| 49 FX_BOOL CPDFXFA_App::Initialize(v8::Isolate* pIsolate) { | 51 FX_BOOL CPDFXFA_App::Initialize(v8::Isolate* pIsolate) { |
| 50 BC_Library_Init(); | 52 BC_Library_Init(); |
| 51 FXJSE_Initialize(); | 53 FXJSE_Initialize(); |
| 52 | 54 |
| 53 m_pIsolate = pIsolate ? pIsolate : FXJSE_Runtime_Create_Own(); | 55 m_pIsolate = pIsolate ? pIsolate : FXJSE_Runtime_Create_Own(); |
| 54 if (!m_pIsolate) | 56 if (!m_pIsolate) |
| 55 return FALSE; | 57 return FALSE; |
| 56 | 58 |
| 57 m_pXFAApp.reset(new CXFA_FFApp(this)); | 59 m_pXFAApp = WrapUnique(new CXFA_FFApp(this)); |
| 58 m_pXFAApp->SetDefaultFontMgr( | 60 m_pXFAApp->SetDefaultFontMgr( |
| 59 std::unique_ptr<CXFA_DefFontMgr>(new CXFA_DefFontMgr)); | 61 std::unique_ptr<CXFA_DefFontMgr>(new CXFA_DefFontMgr)); |
| 60 | 62 |
| 61 return TRUE; | 63 return TRUE; |
| 62 } | 64 } |
| 63 | 65 |
| 64 FX_BOOL CPDFXFA_App::AddFormFillEnv(CPDFSDK_Environment* pEnv) { | 66 FX_BOOL CPDFXFA_App::AddFormFillEnv(CPDFSDK_Environment* pEnv) { |
| 65 if (!pEnv) | 67 if (!pEnv) |
| 66 return FALSE; | 68 return FALSE; |
| 67 | 69 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 } | 331 } |
| 330 } | 332 } |
| 331 | 333 |
| 332 IFWL_AdapterTimerMgr* CPDFXFA_App::GetTimerMgr() { | 334 IFWL_AdapterTimerMgr* CPDFXFA_App::GetTimerMgr() { |
| 333 CXFA_FWLAdapterTimerMgr* pAdapter = nullptr; | 335 CXFA_FWLAdapterTimerMgr* pAdapter = nullptr; |
| 334 CPDFSDK_Environment* pEnv = m_pEnvList.GetAt(0); | 336 CPDFSDK_Environment* pEnv = m_pEnvList.GetAt(0); |
| 335 if (pEnv) | 337 if (pEnv) |
| 336 pAdapter = new CXFA_FWLAdapterTimerMgr(pEnv); | 338 pAdapter = new CXFA_FWLAdapterTimerMgr(pEnv); |
| 337 return pAdapter; | 339 return pAdapter; |
| 338 } | 340 } |
| OLD | NEW |