From a72e8e2c4392df725c7e35ed1ae3f891e79e49ec Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 7 Oct 2015 10:17:53 -0700 Subject: Merge to XFA: Pass v8::Isolate to PDFium at init time. New code changes in JS_Runtime.cpp. (cherry picked from commit 3dedace9623fef6161a8666e53a4ab2b9be61e4c) Original Review URL: https://codereview.chromium.org/1367033002 . Also merge to XFA: Run FXJS_V8 embedder tests against a shared isolate, since the two go together. (cherry picked from commit 4ea721cb7954898a9722c389dae86c62957352d0) Original Review URL: https://codereview.chromium.org/1377293004 . R=thestig@chromium.org Review URL: https://codereview.chromium.org/1381633008 . --- fpdfsdk/include/jsapi/fxjs_v8.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'fpdfsdk/include/jsapi') diff --git a/fpdfsdk/include/jsapi/fxjs_v8.h b/fpdfsdk/include/jsapi/fxjs_v8.h index f51340acd3..6e8d2fa478 100644 --- a/fpdfsdk/include/jsapi/fxjs_v8.h +++ b/fpdfsdk/include/jsapi/fxjs_v8.h @@ -68,9 +68,14 @@ using FXJS_CONSTRUCTOR = void (*)(IFXJS_Context* cc, using FXJS_DESTRUCTOR = void (*)(v8::Local obj); // Call before making FXJS_PrepareIsolate call. -void FXJS_Initialize(unsigned int embedderDataSlot); +void FXJS_Initialize(unsigned int embedderDataSlot, v8::Isolate* pIsolate); void FXJS_Release(); +// Gets the global isolate set by FXJS_Initialize(), or makes a new one each +// time if there is no such isolate. Returns true if a new isolate had to be +// created. +bool FXJS_GetIsolate(v8::Isolate** pResultIsolate); + // Call before making FXJS_Define* calls. Resources allocated here are cleared // as part of FXJS_ReleaseRuntime(). void FXJS_PrepareIsolate(v8::Isolate* pIsolate); -- cgit v1.2.3