summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-10-02 16:43:15 -0700
committerTom Sepez <tsepez@chromium.org>2015-10-02 16:43:15 -0700
commit3dedace9623fef6161a8666e53a4ab2b9be61e4c (patch)
tree78fba57e1a3edcd064dead99da9a01e8a56055eb /public
parentac67d4765a8ac36cd00c9fc8b6f2b80a3e1cff72 (diff)
downloadpdfium-3dedace9623fef6161a8666e53a4ab2b9be61e4c.tar.xz
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 .
Diffstat (limited to 'public')
-rw-r--r--public/fpdf_formfill.h15
-rw-r--r--public/fpdfview.h13
2 files changed, 17 insertions, 11 deletions
diff --git a/public/fpdf_formfill.h b/public/fpdf_formfill.h
index 128c7ec818..baab18ab92 100644
--- a/public/fpdf_formfill.h
+++ b/public/fpdf_formfill.h
@@ -293,17 +293,12 @@ typedef struct _IPDF_JsPlatform {
/* Version 2. */
- /**
- * pointer to the v8::Isolate to use, or NULL to force PDFium to create one.
- **/
- void* m_isolate;
+ void* m_isolate; /* Unused in v3, retain for compatibility. */
+ unsigned int m_v8EmbedderSlot; /* Unused in v3, retain for compatibility. */
+
+ /* Version 3. */
+ /* Version 3 moves m_Isolate and m_v8EmbedderSlot to FPDF_LIBRARY_CONFIG. */
- /**
- * The embedder data slot to use in the v8::Isolate to store PDFium's
- * per-isolate data. The value needs to be between 0 and
- * v8::Internals::kNumIsolateDataLots (exclusive).
- */
- unsigned int m_v8EmbedderSlot;
} IPDF_JSPLATFORM;
// Flags for Cursor type
diff --git a/public/fpdfview.h b/public/fpdfview.h
index 9d199a1d2e..ea45c2912c 100644
--- a/public/fpdfview.h
+++ b/public/fpdfview.h
@@ -130,7 +130,7 @@ DLLEXPORT void STDCALL FPDF_InitLibrary();
// Process-wide options for initializing library.
typedef struct FPDF_LIBRARY_CONFIG_ {
- // Version number of the interface. Currently must be 1.
+ // Version number of the interface. Currently must be 2.
int version;
// Array of paths to scan in place of the defaults when using built-in
@@ -138,6 +138,17 @@ typedef struct FPDF_LIBRARY_CONFIG_ {
// The Array may be NULL itself to use the default paths. May be ignored
// entirely depending upon the platform.
const char** m_pUserFontPaths;
+
+ // Version 2.
+
+ // pointer to the v8::Isolate to use, or NULL to force PDFium to create one.
+ void* m_pIsolate;
+
+ // The embedder data slot to use in the v8::Isolate to store PDFium's
+ // per-isolate data. The value needs to be between 0 and
+ // v8::Internals::kNumIsolateDataLots (exclusive). Note that 0 is fine
+ // for most embedders.
+ unsigned int m_v8EmbedderSlot;
} FPDF_LIBRARY_CONFIG;
// Function: FPDF_InitLibraryWithConfig