summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/JS_Runtime.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-03-04 12:25:33 -0800
committerTom Sepez <tsepez@chromium.org>2016-03-04 12:25:33 -0800
commit3e44a7bd2b60ace1ee8bc8f48c709056f65c3dc1 (patch)
treeda619820b9c96ebca7551fd2135a3dff8925c3e6 /fpdfsdk/src/javascript/JS_Runtime.cpp
parentdca24838ce9799bd878477f36014525c9d6b645d (diff)
downloadpdfium-3e44a7bd2b60ace1ee8bc8f48c709056f65c3dc1.tar.xz
Only place primitive objects on the V8 global template.
Kill some crummy comments along the way. BUG=pdfium:419 R=jochen@chromium.org Review URL: https://codereview.chromium.org/1759893002 .
Diffstat (limited to 'fpdfsdk/src/javascript/JS_Runtime.cpp')
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index 76221db3f2..342b43e267 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -256,6 +256,15 @@ v8::Local<v8::Context> CJS_Runtime::NewJSContext() {
return v8::Local<v8::Context>::New(m_isolate, m_context);
}
+void CJS_Runtime::SetConstArray(const CFX_WideString& name,
+ v8::Local<v8::Array> array) {
+ m_ConstArrays[name] = v8::Global<v8::Array>(m_isolate, array);
+}
+
+v8::Local<v8::Array> CJS_Runtime::GetConstArray(const CFX_WideString& name) {
+ return v8::Local<v8::Array>::New(m_isolate, m_ConstArrays[name]);
+}
+
#ifdef PDF_ENABLE_XFA
CFX_WideString ChangeObjName(const CFX_WideString& str) {
CFX_WideString sRet = str;