summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/JS_Runtime.cpp
diff options
context:
space:
mode:
authorJochen Eisinger <jochen@chromium.org>2015-07-16 09:37:48 +0200
committerJochen Eisinger <jochen@chromium.org>2015-07-16 09:37:48 +0200
commitcc8b4d8763151f51c9fe71ce9b64b2a0d7ddcc88 (patch)
treefbb16c6ff6d7386dd4c532956d54232a9851a75a /fpdfsdk/src/javascript/JS_Runtime.cpp
parent281d1d293dab54cadd214e5a1c098583fbbe0788 (diff)
downloadpdfium-cc8b4d8763151f51c9fe71ce9b64b2a0d7ddcc88.tar.xz
Make v8 embedder data slot configurablechromium/2460chromium/2459chromium/2458
Chrome already uses 0 and 1. BUG=none R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1235303003 .
Diffstat (limited to 'fpdfsdk/src/javascript/JS_Runtime.cpp')
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index b26f5a2e62..f21819ac17 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -35,7 +35,11 @@ IFXJS_Runtime* CJS_RuntimeFactory::NewJSRuntime(CPDFDoc_Environment* pApp)
{
if (!m_bInit)
{
- JS_Initial();
+ unsigned int embedderDataSlot = 0;
+ if (pApp->GetFormFillInfo()->m_pJsPlatform->version >= 2) {
+ embedderDataSlot = pApp->GetFormFillInfo()->m_pJsPlatform->m_v8EmbedderSlot;
+ }
+ JS_Initial(embedderDataSlot);
m_bInit = TRUE;
}
return new CJS_Runtime(pApp);