diff options
author | John Abd-El-Malek <jam@chromium.org> | 2015-02-04 16:04:05 -0800 |
---|---|---|
committer | John Abd-El-Malek <jam@chromium.org> | 2015-02-04 16:04:05 -0800 |
commit | 1be20344622b3da0fa49d511254928c786154f6b (patch) | |
tree | 4067f7559a5b481c090df24e03db31f127222a3c /samples/pdfium_test.cc | |
parent | 62120b79bbaca7430a8fc7ba0846b0a84f40542d (diff) | |
download | pdfium-1be20344622b3da0fa49d511254928c786154f6b.tar.xz |
Initialize V8 outside of PDFium.
This is similar to how we initialize ICU for V8 inside PDFium.
BUG=455399
R=wfh@chromium.org
Review URL: https://codereview.chromium.org/897973002
Diffstat (limited to 'samples/pdfium_test.cc')
-rw-r--r-- | samples/pdfium_test.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc index debe033369..7ba85ef308 100644 --- a/samples/pdfium_test.cc +++ b/samples/pdfium_test.cc @@ -20,6 +20,7 @@ #include "../fpdfsdk/include/fpdfview.h" #include "../core/include/fxcrt/fx_system.h" #include "v8/include/v8.h" +#include "v8/include/libplatform/libplatform.h" #ifdef _WIN32 #define snprintf _snprintf @@ -497,6 +498,9 @@ int main(int argc, const char* argv[]) { } v8::V8::InitializeICU(); + v8::Platform* platform = v8::platform::CreateDefaultPlatform(); + v8::V8::InitializePlatform(platform); + v8::V8::Initialize(); #ifdef V8_USE_EXTERNAL_STARTUP_DATA v8::StartupData natives; @@ -530,6 +534,8 @@ int main(int argc, const char* argv[]) { } FPDF_DestroyLibrary(); + v8::V8::ShutdownPlatform(); + delete platform; return 0; } |