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

Unified Diff: fpdfsdk/fpdfview.cpp

Issue 2421603002: Reland: Make the CPDFXFA_App non-global (Closed)
Patch Set: Rebase to master Created 4 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 side-by-side diff with in-line comments
Download patch
Index: fpdfsdk/fpdfview.cpp
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index 7f2faa09473513ce67e3f4c0242e6ebb598491c1..1ce8e2f5f67797b903dfe07f3222c8ccb8f775e5 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -42,6 +42,7 @@
#include "fpdfsdk/fpdfxfa/cpdfxfa_page.h"
#include "fpdfsdk/fpdfxfa/cxfa_fwladaptertimermgr.h"
#include "public/fpdf_formfill.h"
+#include "xfa/fxbarcode/BC_Library.h"
#endif // PDF_ENABLE_XFA
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
@@ -70,8 +71,8 @@ CPDF_Document* CPDFDocumentFromFPDFDocument(FPDF_DOCUMENT doc) {
FPDF_DOCUMENT FPDFDocumentFromCPDFDocument(CPDF_Document* doc) {
#ifdef PDF_ENABLE_XFA
- return doc ? FPDFDocumentFromUnderlying(new CPDFXFA_Document(
- pdfium::WrapUnique(doc), CPDFXFA_App::GetInstance()))
+ return doc ? FPDFDocumentFromUnderlying(
+ new CPDFXFA_Document(pdfium::WrapUnique(doc)))
: nullptr;
#else // PDF_ENABLE_XFA
return FPDFDocumentFromUnderlying(doc);
@@ -285,19 +286,19 @@ FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* cfg) {
pModuleMgr->LoadEmbeddedKorea1CMaps();
#ifdef PDF_ENABLE_XFA
- CPDFXFA_App::GetInstance()->Initialize(
- (cfg && cfg->version >= 2) ? static_cast<v8::Isolate*>(cfg->m_pIsolate)
- : nullptr);
+ FXJSE_Initialize();
Tom Sepez 2016/10/20 17:05:59 Isn't this going to bring v8 into existence on eve
dsinclair 2016/10/31 15:07:57 Currently, the call to Initialize() will do FXJSE_
+ BC_Library_Init();
#endif // PDF_ENABLE_XFA
-
if (cfg && cfg->version >= 2)
IJS_Runtime::Initialize(cfg->m_v8EmbedderSlot, cfg->m_pIsolate);
}
DLLEXPORT void STDCALL FPDF_DestroyLibrary() {
#ifdef PDF_ENABLE_XFA
- CPDFXFA_App::ReleaseInstance();
+ BC_Library_Destory();
+ FXJSE_Finalize();
#endif // PDF_ENABLE_XFA
+
CPDF_ModuleMgr::Destroy();
CFX_GEModule::Destroy();
@@ -377,11 +378,7 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path,
ProcessParseError(error);
return nullptr;
}
-#ifdef PDF_ENABLE_XFA
- return new CPDFXFA_Document(std::move(pDocument), CPDFXFA_App::GetInstance());
-#else // PDF_ENABLE_XFA
- return pDocument.release();
-#endif // PDF_ENABLE_XFA
+ return FPDFDocumentFromCPDFDocument(pDocument.release());
}
#ifdef PDF_ENABLE_XFA
« no previous file with comments | « fpdfsdk/fpdfsave.cpp ('k') | fpdfsdk/fpdfxfa/DEPS » ('j') | fpdfsdk/fpdfxfa/cpdfxfa_app.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698