diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-11-10 15:07:08 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-11-10 15:07:08 -0800 |
commit | 7d4c74d1b96d82681d49519c129262a1568e87d4 (patch) | |
tree | f1417bd69f8960f072b3fef8309ff092a8380605 /fpdfsdk/include/jsapi | |
parent | 46960a43145ab978ca3c90cb6133bb3d5600ad1d (diff) | |
download | pdfium-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/include/jsapi')
-rw-r--r-- | fpdfsdk/include/jsapi/fxjs_v8.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fpdfsdk/include/jsapi/fxjs_v8.h b/fpdfsdk/include/jsapi/fxjs_v8.h index c5a864026b..b8a63c6c7b 100644 --- a/fpdfsdk/include/jsapi/fxjs_v8.h +++ b/fpdfsdk/include/jsapi/fxjs_v8.h @@ -59,7 +59,6 @@ extern const wchar_t kFXJSValueNameFxobj[]; extern const wchar_t kFXJSValueNameNull[]; extern const wchar_t kFXJSValueNameUndefined[]; - class FXJS_ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { void* Allocate(size_t length) override; void* AllocateUninitialized(size_t length) override; @@ -123,11 +122,14 @@ void FXJS_DefineGlobalConst(v8::Isolate* pIsolate, v8::Local<v8::Value> pDefault); // Called after FXJS_Define* calls made. -void FXJS_InitializeRuntime(v8::Isolate* pIsolate, - IJS_Runtime* pIRuntime, - v8::Global<v8::Context>& v8PersistentContext); +void FXJS_InitializeRuntime( + v8::Isolate* pIsolate, + IJS_Runtime* pIRuntime, + v8::Global<v8::Context>* pV8PersistentContext, + std::vector<v8::Global<v8::Object>*>* pStaticObjects); void FXJS_ReleaseRuntime(v8::Isolate* pIsolate, - v8::Global<v8::Context>& v8PersistentContext); + v8::Global<v8::Context>* pV8PersistentContext, + std::vector<v8::Global<v8::Object>*>* pStaticObjects); IJS_Runtime* FXJS_GetRuntimeFromIsolate(v8::Isolate* pIsolate); // Called after FXJS_InitializeRuntime call made. |