summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/JS_Runtime.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-11-10 15:07:08 -0800
committerTom Sepez <tsepez@chromium.org>2015-11-10 15:07:08 -0800
commit7d4c74d1b96d82681d49519c129262a1568e87d4 (patch)
treef1417bd69f8960f072b3fef8309ff092a8380605 /fpdfsdk/src/javascript/JS_Runtime.cpp
parent46960a43145ab978ca3c90cb6133bb3d5600ad1d (diff)
downloadpdfium-7d4c74d1b96d82681d49519c129262a1568e87d4.tar.xz
Keep "static" objects per-context rather than per isolate.
Every time we initialize a new v8::Context, we make a new set of pre-existing native objects, and overwrite the v8::Global handles to those in the previous set. Thus, we may be theoretically releasing some v8::Globals early. R=jochen@chromium.org Review URL: https://codereview.chromium.org/1424933013 .
Diffstat (limited to 'fpdfsdk/src/javascript/JS_Runtime.cpp')
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index 34a18dc385..74d9a44a1c 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -64,7 +64,7 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp)
DefineJSObjects();
CJS_Context* pContext = (CJS_Context*)NewContext();
- FXJS_InitializeRuntime(GetIsolate(), this, m_context);
+ FXJS_InitializeRuntime(GetIsolate(), this, &m_context, &m_StaticObjects);
ReleaseContext(pContext);
}
@@ -76,7 +76,7 @@ CJS_Runtime::~CJS_Runtime() {
delete m_ContextArray.GetAt(i);
m_ContextArray.RemoveAll();
- FXJS_ReleaseRuntime(GetIsolate(), m_context);
+ FXJS_ReleaseRuntime(GetIsolate(), &m_context, &m_StaticObjects);
m_pApp = NULL;
m_pDocument = NULL;