summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-10-07 10:17:53 -0700
committerTom Sepez <tsepez@chromium.org>2015-10-07 10:17:53 -0700
commita72e8e2c4392df725c7e35ed1ae3f891e79e49ec (patch)
tree99eb91f764c428cd34a3b84e8b9e9bfb239d9e5a /samples
parentcd56a7d6fb05bd0babf316a84280a26ecc649d45 (diff)
downloadpdfium-a72e8e2c4392df725c7e35ed1ae3f891e79e49ec.tar.xz
Merge to XFA: Pass v8::Isolate to PDFium at init time.
New code changes in JS_Runtime.cpp. (cherry picked from commit 3dedace9623fef6161a8666e53a4ab2b9be61e4c) Original Review URL: https://codereview.chromium.org/1367033002 . Also merge to XFA: Run FXJS_V8 embedder tests against a shared isolate, since the two go together. (cherry picked from commit 4ea721cb7954898a9722c389dae86c62957352d0) Original Review URL: https://codereview.chromium.org/1377293004 . R=thestig@chromium.org Review URL: https://codereview.chromium.org/1381633008 .
Diffstat (limited to 'samples')
-rw-r--r--samples/pdfium_test.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index 056ba0b6db..a17a85390d 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));