summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript
diff options
context:
space:
mode:
authorJochen Eisinger <jochen@chromium.org>2015-07-15 14:31:29 +0200
committerJochen Eisinger <jochen@chromium.org>2015-07-15 14:31:29 +0200
commit1c79928b4ade95806d0351a21b4d4727d6c8ed38 (patch)
tree379e7f2e8f1ecb15272329ff65f78b3990d66e65 /fpdfsdk/src/javascript
parent304578020122cc4d2a4a8c1598694ef2b9be92b5 (diff)
downloadpdfium-1c79928b4ade95806d0351a21b4d4727d6c8ed38.tar.xz
Plumb in an externally created v8::Isolate
In Chrome, all Isolates must be created by gin R=tsepez@chromium.org, ulan@chromium.org BUG= Review URL: https://codereview.chromium.org/1234053003 .
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index c2c1a51400..6ceb640e58 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -110,13 +110,19 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment * pApp) :
m_pDocument(NULL),
m_bBlocking(FALSE),
m_bRegistered(FALSE),
- m_pFieldEventPath(NULL)
+ m_pFieldEventPath(NULL),
+ m_isolate(NULL)
{
- m_pArrayBufferAllocator.reset(new CJS_ArrayBufferAllocator());
+ if (m_pApp->GetFormFillInfo()->m_pJsPlatform->version >= 2) {
+ m_isolate = m_pApp->GetFormFillInfo()->m_pJsPlatform->m_isolate;
+ }
+ if (!m_isolate) {
+ m_pArrayBufferAllocator.reset(new CJS_ArrayBufferAllocator());
- v8::Isolate::CreateParams params;
- params.array_buffer_allocator = m_pArrayBufferAllocator.get();
- m_isolate = v8::Isolate::New(params);
+ v8::Isolate::CreateParams params;
+ params.array_buffer_allocator = m_pArrayBufferAllocator.get();
+ m_isolate = v8::Isolate::New(params);
+ }
InitJSObjects();