Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(462)

Side by Side Diff: fpdfsdk/src/fpdfview.cpp

Issue 1393833006: Merge to XFA: Allow compiling PDFium without V8. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Rebase, fix build, stray include. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/include/javascript/IJavaScript.h ('k') | fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "../../core/include/fpdfapi/fpdf_module.h" 7 #include "../../core/include/fpdfapi/fpdf_module.h"
8 #include "../../core/include/fxcodec/fx_codec.h" 8 #include "../../core/include/fxcodec/fx_codec.h"
9 #include "../../core/include/fxcrt/fx_safe_types.h" 9 #include "../../core/include/fxcrt/fx_safe_types.h"
10 #include "../../public/fpdf_ext.h" 10 #include "../../public/fpdf_ext.h"
11 #include "../../public/fpdf_formfill.h" 11 #include "../../public/fpdf_formfill.h"
12 #include "../../public/fpdf_progressive.h" 12 #include "../../public/fpdf_progressive.h"
13 #include "../../public/fpdfview.h" 13 #include "../../public/fpdfview.h"
14 #include "../../third_party/base/nonstd_unique_ptr.h" 14 #include "../../third_party/base/nonstd_unique_ptr.h"
15 #include "../../third_party/base/numerics/safe_conversions_impl.h" 15 #include "../../third_party/base/numerics/safe_conversions_impl.h"
16 #include "../include/fsdk_define.h" 16 #include "../include/fsdk_define.h"
17 #include "../include/fsdk_mgr.h" 17 #include "../include/fsdk_mgr.h"
18 #include "../include/fsdk_rendercontext.h" 18 #include "../include/fsdk_rendercontext.h"
19 #include "../include/fpdfxfa/fpdfxfa_doc.h" 19 #include "../include/fpdfxfa/fpdfxfa_doc.h"
20 #include "../include/fpdfxfa/fpdfxfa_app.h" 20 #include "../include/fpdfxfa/fpdfxfa_app.h"
21 #include "../include/fpdfxfa/fpdfxfa_page.h" 21 #include "../include/fpdfxfa/fpdfxfa_page.h"
22 #include "../include/fpdfxfa/fpdfxfa_util.h" 22 #include "../include/fpdfxfa/fpdfxfa_util.h"
23 #include "../include/jsapi/fxjs_v8.h" 23 #include "../include/javascript/IJavaScript.h"
24 24
25 CFPDF_FileStream::CFPDF_FileStream(FPDF_FILEHANDLER* pFS) { 25 CFPDF_FileStream::CFPDF_FileStream(FPDF_FILEHANDLER* pFS) {
26 m_pFS = pFS; 26 m_pFS = pFS;
27 m_nCurPos = 0; 27 m_nCurPos = 0;
28 } 28 }
29 29
30 IFX_FileStream* CFPDF_FileStream::Retain() { 30 IFX_FileStream* CFPDF_FileStream::Retain() {
31 return this; 31 return this;
32 } 32 }
33 33
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 g_pCodecModule = new CCodec_ModuleMgr(); 189 g_pCodecModule = new CCodec_ModuleMgr();
190 190
191 CFX_GEModule::Create(cfg ? cfg->m_pUserFontPaths : nullptr); 191 CFX_GEModule::Create(cfg ? cfg->m_pUserFontPaths : nullptr);
192 CFX_GEModule::Get()->SetCodecModule(g_pCodecModule); 192 CFX_GEModule::Get()->SetCodecModule(g_pCodecModule);
193 193
194 CPDF_ModuleMgr::Create(); 194 CPDF_ModuleMgr::Create();
195 CPDF_ModuleMgr::Get()->SetCodecModule(g_pCodecModule); 195 CPDF_ModuleMgr::Get()->SetCodecModule(g_pCodecModule);
196 CPDF_ModuleMgr::Get()->InitPageModule(); 196 CPDF_ModuleMgr::Get()->InitPageModule();
197 CPDF_ModuleMgr::Get()->InitRenderModule(); 197 CPDF_ModuleMgr::Get()->InitRenderModule();
198 CPDFXFA_App::GetInstance()->Initialize(); 198 CPDFXFA_App::GetInstance()->Initialize();
199 if (cfg && cfg->version >= 2) { 199 if (cfg && cfg->version >= 2)
200 FXJS_Initialize(cfg->m_v8EmbedderSlot, 200 IJS_Runtime::Initialize(cfg->m_v8EmbedderSlot, cfg->m_pIsolate);
201 reinterpret_cast<v8::Isolate*>(cfg->m_pIsolate));
202 }
203 } 201 }
204 202
205 DLLEXPORT void STDCALL FPDF_DestroyLibrary() { 203 DLLEXPORT void STDCALL FPDF_DestroyLibrary() {
206 CPDFXFA_App::ReleaseInstance(); 204 CPDFXFA_App::ReleaseInstance();
207 CPDF_ModuleMgr::Destroy(); 205 CPDF_ModuleMgr::Destroy();
208 CFX_GEModule::Destroy(); 206 CFX_GEModule::Destroy();
209 207
210 delete g_pCodecModule; 208 delete g_pCodecModule;
211 g_pCodecModule = nullptr; 209 g_pCodecModule = nullptr;
212 } 210 }
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 if (!buffer) { 1084 if (!buffer) {
1087 *buflen = len; 1085 *buflen = len;
1088 } else if (*buflen >= len) { 1086 } else if (*buflen >= len) {
1089 memcpy(buffer, utf16Name.c_str(), len); 1087 memcpy(buffer, utf16Name.c_str(), len);
1090 *buflen = len; 1088 *buflen = len;
1091 } else { 1089 } else {
1092 *buflen = -1; 1090 *buflen = -1;
1093 } 1091 }
1094 return (FPDF_DEST)pDestObj; 1092 return (FPDF_DEST)pDestObj;
1095 } 1093 }
OLDNEW
« no previous file with comments | « fpdfsdk/include/javascript/IJavaScript.h ('k') | fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698