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 .
diff --git a/fpdfsdk/include/jsapi/fxjs_v8.h b/fpdfsdk/include/jsapi/fxjs_v8.h
index f51340a..6e8d2fa 100644
--- a/fpdfsdk/include/jsapi/fxjs_v8.h
+++ b/fpdfsdk/include/jsapi/fxjs_v8.h
@@ -68,9 +68,14 @@
 using FXJS_DESTRUCTOR = void (*)(v8::Local<v8::Object> 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);