• Home
Name Date Size #Lines LOC

..--

gc/04-Jul-2025-923687

xfa/04-Jul-2025-19,25115,517

Android.bpD04-Jul-2025917 3731

BUILD.gnD04-Jul-20257.7 KiB303295

DEPSD04-Jul-2025151 1110

READMED04-Jul-20252 KiB4236

cfx_globaldata.cppD04-Jul-202511.9 KiB408335

cfx_globaldata.hD04-Jul-20252.1 KiB7552

cfx_globaldata_unittest.cppD04-Jul-20255.5 KiB168128

cfx_keyvalue.cppD04-Jul-2025409 165

cfx_keyvalue.hD04-Jul-2025843 4630

cfx_v8.cppD04-Jul-20254 KiB13394

cfx_v8.hD04-Jul-20252.4 KiB7552

cfx_v8_array_buffer_allocator.cppD04-Jul-20251.6 KiB5437

cfx_v8_array_buffer_allocator.hD04-Jul-20251.1 KiB3621

cfx_v8_unittest.cppD04-Jul-202510.2 KiB274228

cfxjs_engine.cppD04-Jul-202525.1 KiB686560

cfxjs_engine.hD04-Jul-20256.5 KiB183127

cfxjs_engine_embeddertest.cppD04-Jul-20253.8 KiB11692

cfxjs_engine_unittest.cppD04-Jul-20253 KiB10880

cjs_annot.cppD04-Jul-20253.4 KiB11279

cjs_annot.hD04-Jul-20251.3 KiB4628

cjs_app.cppD04-Jul-202519.6 KiB572441

cjs_app.hD04-Jul-20256.5 KiB164131

cjs_border.cppD04-Jul-2025773 2413

cjs_border.hD04-Jul-2025558 2412

cjs_color.cppD04-Jul-202510.9 KiB319253

cjs_color.hD04-Jul-20253.8 KiB11081

cjs_console.cppD04-Jul-20251.9 KiB5838

cjs_console.hD04-Jul-20251.3 KiB4329

cjs_delaydata.cppD04-Jul-2025439 134

cjs_delaydata.hD04-Jul-2025860 3523

cjs_display.cppD04-Jul-2025749 2312

cjs_display.hD04-Jul-2025563 2412

cjs_document.cppD04-Jul-202548 KiB1,4101,117

cjs_document.hD04-Jul-202513.9 KiB317263

cjs_event.cppD04-Jul-202510.7 KiB301240

cjs_event.hD04-Jul-20254.1 KiB10976

cjs_event_context.cppD04-Jul-202512.1 KiB427370

cjs_event_context.hD04-Jul-20255.7 KiB176157

cjs_event_context_stub.cppD04-Jul-2025558 177

cjs_event_context_stub.hD04-Jul-20253 KiB8067

cjs_field.cppD04-Jul-202590.3 KiB2,6242,201

cjs_field.hD04-Jul-202515.9 KiB373299

cjs_font.cppD04-Jul-20251.3 KiB3221

cjs_font.hD04-Jul-2025548 2412

cjs_global.cppD04-Jul-202518.4 KiB544476

cjs_global.hD04-Jul-20253.8 KiB10473

cjs_globalarrays.cppD04-Jul-20254.2 KiB9162

cjs_globalarrays.hD04-Jul-2025475 188

cjs_globalconsts.cppD04-Jul-20251.9 KiB4932

cjs_globalconsts.hD04-Jul-2025475 188

cjs_highlight.cppD04-Jul-2025738 2312

cjs_highlight.hD04-Jul-2025573 2412

cjs_icon.cppD04-Jul-20251.2 KiB3922

cjs_icon.hD04-Jul-20251,018 3822

cjs_object.cppD04-Jul-20251.5 KiB4529

cjs_object.hD04-Jul-20251.7 KiB6144

cjs_position.cppD04-Jul-2025916 2615

cjs_position.hD04-Jul-2025568 2412

cjs_publicmethods.cppD04-Jul-202545.4 KiB1,4591,227

cjs_publicmethods.hD04-Jul-20256.4 KiB140122

cjs_publicmethods_embeddertest.cppD04-Jul-20258.6 KiB260190

cjs_publicmethods_unittest.cppD04-Jul-20251.3 KiB5133

cjs_result.cppD04-Jul-2025591 207

cjs_result.hD04-Jul-20251.7 KiB5932

cjs_runtime.cppD04-Jul-20257.1 KiB235181

cjs_runtime.hD04-Jul-20252.3 KiB7146

cjs_runtimestub.cppD04-Jul-2025994 3621

cjs_runtimestub.hD04-Jul-20251.1 KiB3923

cjs_scalehow.cppD04-Jul-2025652 2110

cjs_scalehow.hD04-Jul-2025568 2412

cjs_scalewhen.cppD04-Jul-2025758 2312

cjs_scalewhen.hD04-Jul-2025573 2412

cjs_style.cppD04-Jul-2025808 2413

cjs_style.hD04-Jul-2025553 2412

cjs_timerobj.cppD04-Jul-2025897 3317

cjs_timerobj.hD04-Jul-2025816 3217

cjs_util.cppD04-Jul-202514.3 KiB481401

cjs_util.hD04-Jul-20252.1 KiB6843

cjs_util_unittest.cppD04-Jul-20253.9 KiB11560

cjs_zoomtype.cppD04-Jul-2025915 2615

cjs_zoomtype.hD04-Jul-2025568 2412

fx_date_helpers.cppD04-Jul-202514.2 KiB554473

fx_date_helpers.hD04-Jul-20252 KiB7152

fx_date_helpers_unittest.cppD04-Jul-20255.8 KiB156134

fxv8.cppD04-Jul-202511 KiB341272

fxv8.hD04-Jul-20255.2 KiB11184

global_timer.cppD04-Jul-20252.6 KiB10574

global_timer.hD04-Jul-20251.4 KiB5538

ijs_event_context.hD04-Jul-20253.5 KiB8969

ijs_runtime.cppD04-Jul-20251.8 KiB6548

ijs_runtime.hD04-Jul-20251.8 KiB6743

js_define.cppD04-Jul-20253 KiB10075

js_define.hD04-Jul-20255.8 KiB167122

js_resources.cppD04-Jul-20253.5 KiB109100

js_resources.hD04-Jul-20251.1 KiB4736

README

1There are two separate wrappers for V8 here.  One is called FXJS, and
2it is used by the non-XFA code.  The other is called FXJSE, and it is
3used only by the XFA code.  Additionally FXJSE may request services
4from FXJS to bridge the two.
5
6Both the FXJS and FXJSE binding code needs to be replaced by something
7saner, perhaps Gin or perhaps some IDL. See
8  https://bugs.chromium.org/p/pdfium/issues/detail?id=716
9for progress on the issue.
10
11FXJS binds objects by sticking a pointer to a CFXJS_PerObjectData in
12the V8 object's internal slot.  FXJSE binds objects by sticking a
13pointer to either an actual v8 function object or a CFXJSE_HostObject
14in the V8 object's internal slot, depending upon whether the object
15represents (in some notion) a "class" or an "instance". Also, V8 objects
16bound in one library may unexpectedly arrive at the other given a script
17that's trying to mess with us.
18
19To distinguish these cases, we use two internal slots for all bound
20objects, regardless of the FXJS/FXJSE distinction.  Slot 0 is the
21tag and contains either:
22  kPerObjectDataTag for FXJS objects, or
23  kFXJSEHostObjectTag for FXJSE Host objects, or
24  kFXJSEProxyObjectTag for a global proxy object under FXJSE, or
25  One of 4 specific FXJSE_CLASS_DESCRIPTOR globals for FXJSE classes:
26    kGlobalClassDescriptor
27    kNormalClassDescriptor
28    kVariablesClassDescriptor
29    kFormCalcDescriptor
30
31Slot 1's contents are determined by these tags:
32  kPerObjectDataTag means an aligned pointer to CFXJS_PerObjectData.
33  kFXJSEHostObjectTag means an aligned pointer to CFXJSE_HostObject.
34  kFXJSEProxyObjectTag means nullptr, and to check the prototype instead.
35  A FXJSE_CLASS_DESCRIPTOR pointer means to expect an actual v8 function
36  object (or a string naming that function), and not an aligned pointer.
37
38Because PDFium uses V8 for various unrelated purposes, there may be up to
39four v8::Contexts (JS Global Objects) associated with each document. One is
40used by FXJS and holds objects as described by the js_api_reference.pdf
41specification. The others are used by FXJSE.
42