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

Unified Diff: samples/pdfium_test.cc

Issue 1381633008: Merge to XFA: Pass v8::Isolate to PDFium at init time. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
Index: samples/pdfium_test.cc
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index 056ba0b6db23a9940f522ef582420d903bb2c1ef..a17a85390da10e145ed7dafe38943aa00b2de8be 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -437,7 +437,7 @@ void RenderPdf(const std::string& name, const char* pBuf, size_t len,
IPDF_JSPLATFORM platform_callbacks;
memset(&platform_callbacks, '\0', sizeof(platform_callbacks));
- platform_callbacks.version = 2;
+ platform_callbacks.version = 3;
platform_callbacks.app_alert = ExampleAppAlert;
platform_callbacks.Doc_gotoPage = ExampleDocGotoPage;
@@ -621,17 +621,19 @@ int main(int argc, const char* argv[]) {
v8::V8::SetSnapshotDataBlob(&snapshot);
#endif // V8_USE_EXTERNAL_STARTUP_DATA
- if (options.font_directory.empty()) {
- FPDF_InitLibrary();
- } else {
- const char* path_array[2];
+ FPDF_LIBRARY_CONFIG config;
+ config.version = 2;
+ config.m_pUserFontPaths = nullptr;
+ config.m_pIsolate = nullptr;
+ config.m_v8EmbedderSlot = 0;
+
+ const char* path_array[2];
+ if (!options.font_directory.empty()) {
path_array[0] = options.font_directory.c_str();
path_array[1] = nullptr;
- FPDF_LIBRARY_CONFIG config;
- config.version = 1;
config.m_pUserFontPaths = path_array;
- FPDF_InitLibraryWithConfig(&config);
}
+ FPDF_InitLibraryWithConfig(&config);
UNSUPPORT_INFO unsuppored_info;
memset(&unsuppored_info, '\0', sizeof(unsuppored_info));

Powered by Google App Engine
This is Rietveld 408576698