• Home
Name Date Size #Lines LOC

..--

xfa/03-May-2024-19,54115,832

Android.bpD03-May-2024944 4033

BUILD.gnD03-May-20246.6 KiB253245

DEPSD03-May-2024151 1110

READMED03-May-20242 KiB4236

cfx_globaldata.cppD03-May-202411.6 KiB400325

cfx_globaldata.hD03-May-20242.4 KiB8559

cfx_globaldata_unittest.cppD03-May-20245.5 KiB164126

cfx_keyvalue.cppD03-May-2024427 165

cfx_keyvalue.hD03-May-2024846 4630

cfx_v8.cppD03-May-20246.9 KiB218173

cfx_v8.hD03-May-20242.7 KiB8057

cfx_v8_unittest.cppD03-May-202410.4 KiB270224

cfx_v8_unittest.hD03-May-2024924 4025

cfxjs_engine.cppD03-May-202424.1 KiB668550

cfxjs_engine.hD03-May-20245 KiB14493

cfxjs_engine_embeddertest.cppD03-May-20243.5 KiB10783

cfxjs_engine_unittest.cppD03-May-20242.8 KiB10175

cjs_annot.cppD03-May-20243.6 KiB11582

cjs_annot.hD03-May-20241.3 KiB4728

cjs_app.cppD03-May-202419.3 KiB572444

cjs_app.hD03-May-20246.7 KiB164131

cjs_border.cppD03-May-2024787 2413

cjs_border.hD03-May-2024571 2412

cjs_color.cppD03-May-202410.8 KiB320254

cjs_color.hD03-May-20243.8 KiB11080

cjs_console.cppD03-May-20241.9 KiB6140

cjs_console.hD03-May-20241.3 KiB4429

cjs_delaydata.cppD03-May-2024449 134

cjs_delaydata.hD03-May-2024866 3523

cjs_display.cppD03-May-2024739 2312

cjs_display.hD03-May-2024576 2412

cjs_document.cppD03-May-202448.2 KiB1,4221,141

cjs_document.hD03-May-202414.3 KiB322268

cjs_event.cppD03-May-202411.2 KiB324255

cjs_event.hD03-May-20244.1 KiB10976

cjs_event_context.cppD03-May-202411.6 KiB327263

cjs_event_context.hD03-May-20245.7 KiB137121

cjs_event_context_stub.cppD03-May-2024456 135

cjs_event_context_stub.hD03-May-20245.2 KiB117104

cjs_eventrecorder.cppD03-May-202415.4 KiB559479

cjs_eventrecorder.hD03-May-20247 KiB202178

cjs_field.cppD03-May-202491.1 KiB2,6642,234

cjs_field.hD03-May-202416 KiB376301

cjs_font.cppD03-May-20241.3 KiB3221

cjs_font.hD03-May-2024561 2412

cjs_global.cppD03-May-202420 KiB579505

cjs_global.hD03-May-20243.1 KiB8967

cjs_globalarrays.cppD03-May-20243.5 KiB7649

cjs_globalarrays.hD03-May-2024493 188

cjs_globalconsts.cppD03-May-20242.2 KiB5034

cjs_globalconsts.hD03-May-2024493 188

cjs_highlight.cppD03-May-2024752 2312

cjs_highlight.hD03-May-2024586 2412

cjs_icon.cppD03-May-20241.2 KiB3922

cjs_icon.hD03-May-20241 KiB3822

cjs_object.cppD03-May-20241.5 KiB4630

cjs_object.hD03-May-20241.7 KiB6244

cjs_position.cppD03-May-2024888 2615

cjs_position.hD03-May-2024581 2412

cjs_publicmethods.cppD03-May-202445.2 KiB1,4541,220

cjs_publicmethods.hD03-May-20246.1 KiB152133

cjs_publicmethods_embeddertest.cppD03-May-20248.6 KiB260190

cjs_publicmethods_unittest.cppD03-May-20241.3 KiB5134

cjs_result.cppD03-May-2024601 207

cjs_result.hD03-May-20241.8 KiB5832

cjs_runtime.cppD03-May-20247.2 KiB238186

cjs_runtime.hD03-May-20242.4 KiB7348

cjs_runtimestub.cppD03-May-20241 KiB3722

cjs_runtimestub.hD03-May-20241.1 KiB3923

cjs_scalehow.cppD03-May-2024666 2110

cjs_scalehow.hD03-May-2024581 2412

cjs_scalewhen.cppD03-May-2024748 2312

cjs_scalewhen.hD03-May-2024586 2412

cjs_style.cppD03-May-2024822 2413

cjs_style.hD03-May-2024566 2412

cjs_timerobj.cppD03-May-2024906 3317

cjs_timerobj.hD03-May-2024824 3217

cjs_util.cppD03-May-202414 KiB475395

cjs_util.hD03-May-20242.1 KiB6639

cjs_util_unittest.cppD03-May-20242.8 KiB11359

cjs_zoomtype.cppD03-May-2024929 2615

cjs_zoomtype.hD03-May-2024581 2412

fx_date_helpers.cppD03-May-202414.3 KiB552471

fx_date_helpers.hD03-May-20242 KiB6951

fx_date_helpers_unittest.cppD03-May-20243.8 KiB10992

global_timer.cppD03-May-20242.3 KiB8962

global_timer.hD03-May-20241.3 KiB5135

ijs_event_context.hD03-May-20246 KiB133111

ijs_runtime.cppD03-May-20241.4 KiB5235

ijs_runtime.hD03-May-20241.8 KiB6643

js_define.cppD03-May-20243.3 KiB10282

js_define.hD03-May-20245.6 KiB161114

js_resources.cppD03-May-20243.5 KiB109100

js_resources.hD03-May-20241.1 KiB4635

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  g_FXJSEHostObjectTag for FXJSE Host objects, or
24  g_FXJSEProxyObjectTag for a global proxy object under FXJSE, or
25  One of 4 specific FXJSE_CLASS_DESCRIPTOR globals for FXJSE classes:
26    GlobalClassDescriptor
27    NormalClassDescriptor
28    VariablesClassDescriptor
29    formcalc_fm2js_descriptor
30
31Slot 1's contents are determined by these tags:
32  kPerObjectDataTag means an aligned pointer to CFXJS_PerObjectData.
33  g_FXJSEHostObjectTag means an aligned pointer to CFXJSE_HostObject.
34  g_FXJSEProxyObjectTag 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