Pass v8::Isolate to PDFium at init time.
authorTom Sepez <tsepez@chromium.org>
Fri, 2 Oct 2015 23:43:15 +0000 (16:43 -0700)
committerTom Sepez <tsepez@chromium.org>
Fri, 2 Oct 2015 23:43:15 +0000 (16:43 -0700)
commit3dedace9623fef6161a8666e53a4ab2b9be61e4c
tree78fba57e1a3edcd064dead99da9a01e8a56055eb
parentac67d4765a8ac36cd00c9fc8b6f2b80a3e1cff72
Pass v8::Isolate to PDFium at init time.

Move the external isolate and embedder slot from the
IPDF_JSPlatforms struct supplied at the
FPDFDOC_InitFormFillEnvironment() call time to arguments to
the FPDF_InitLibraryWithConfig() call.

This has several benefits:
-- Avoids the crash that could happen if multiple
FPDFDOC_InitFormFillEnvironmen() calls should happen to be
made by an embedder with different slot values.
-- Down the road, for XFA, there may be XFA but no FormFill
environment.

We support both forms for the time being, until the chrome
side catches up, at which point we will deprecate the old
way.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1367033002 .
fpdfsdk/include/javascript/JS_Runtime.h
fpdfsdk/include/jsapi/fxjs_v8.h
fpdfsdk/src/fpdfview.cpp
fpdfsdk/src/javascript/JS_Runtime.cpp
fpdfsdk/src/jsapi/fxjs_v8.cpp
fpdfsdk/src/jsapi/fxjs_v8_embeddertest.cpp
public/fpdf_formfill.h
public/fpdfview.h
samples/pdfium_test.cc