• Home
Name Date Size #Lines LOC

..--

gc/03-May-2024-923687

xfa/03-May-2024-19,25515,527

Android.bpD03-May-2024917 3731

BUILD.gnD03-May-20247.7 KiB302294

DEPSD03-May-2024151 1110

READMED03-May-20242 KiB4236

cfx_globaldata.cppD03-May-202411.4 KiB394321

cfx_globaldata.hD03-May-20242.1 KiB7552

cfx_globaldata_unittest.cppD03-May-20245.5 KiB168128

cfx_keyvalue.cppD03-May-2024409 165

cfx_keyvalue.hD03-May-2024843 4630

cfx_v8.cppD03-May-20244 KiB13394

cfx_v8.hD03-May-20242.4 KiB7552

cfx_v8_array_buffer_allocator.cppD03-May-20241.6 KiB5437

cfx_v8_array_buffer_allocator.hD03-May-20241.1 KiB3621

cfx_v8_unittest.cppD03-May-202410.3 KiB273227

cfxjs_engine.cppD03-May-202425 KiB690565

cfxjs_engine.hD03-May-20245.5 KiB155107

cfxjs_engine_embeddertest.cppD03-May-20243.8 KiB11692

cfxjs_engine_unittest.cppD03-May-20243.1 KiB11082

cjs_annot.cppD03-May-20243.4 KiB11279

cjs_annot.hD03-May-20241.3 KiB4628

cjs_app.cppD03-May-202419.7 KiB583453

cjs_app.hD03-May-20246.6 KiB164131

cjs_border.cppD03-May-2024773 2413

cjs_border.hD03-May-2024558 2412

cjs_color.cppD03-May-202410.9 KiB319253

cjs_color.hD03-May-20243.8 KiB11181

cjs_console.cppD03-May-20241.9 KiB6039

cjs_console.hD03-May-20241.3 KiB4429

cjs_delaydata.cppD03-May-2024439 134

cjs_delaydata.hD03-May-2024860 3523

cjs_display.cppD03-May-2024725 2312

cjs_display.hD03-May-2024563 2412

cjs_document.cppD03-May-202447.7 KiB1,4281,135

cjs_document.hD03-May-202414.1 KiB318264

cjs_event.cppD03-May-202410.6 KiB301233

cjs_event.hD03-May-20244.1 KiB10976

cjs_event_context.cppD03-May-202412.1 KiB427370

cjs_event_context.hD03-May-20245.7 KiB176157

cjs_event_context_stub.cppD03-May-2024559 177

cjs_event_context_stub.hD03-May-20243 KiB8067

cjs_field.cppD03-May-202490.2 KiB2,6402,217

cjs_field.hD03-May-202416 KiB375301

cjs_font.cppD03-May-20241.3 KiB3221

cjs_font.hD03-May-2024548 2412

cjs_global.cppD03-May-202418.1 KiB532467

cjs_global.hD03-May-20243.8 KiB10069

cjs_globalarrays.cppD03-May-20244 KiB8758

cjs_globalarrays.hD03-May-2024475 188

cjs_globalconsts.cppD03-May-20241.9 KiB4932

cjs_globalconsts.hD03-May-2024475 188

cjs_highlight.cppD03-May-2024738 2312

cjs_highlight.hD03-May-2024573 2412

cjs_icon.cppD03-May-20241.2 KiB3922

cjs_icon.hD03-May-20241,018 3822

cjs_object.cppD03-May-20241.5 KiB4529

cjs_object.hD03-May-20241.6 KiB6244

cjs_position.cppD03-May-2024874 2615

cjs_position.hD03-May-2024568 2412

cjs_publicmethods.cppD03-May-202445.3 KiB1,4581,224

cjs_publicmethods.hD03-May-20246.2 KiB155136

cjs_publicmethods_embeddertest.cppD03-May-20248.8 KiB264193

cjs_publicmethods_unittest.cppD03-May-20241.3 KiB5335

cjs_result.cppD03-May-2024591 207

cjs_result.hD03-May-20241.8 KiB5832

cjs_runtime.cppD03-May-20247.1 KiB235181

cjs_runtime.hD03-May-20242.3 KiB7146

cjs_runtimestub.cppD03-May-2024996 3621

cjs_runtimestub.hD03-May-20241.1 KiB3923

cjs_scalehow.cppD03-May-2024652 2110

cjs_scalehow.hD03-May-2024568 2412

cjs_scalewhen.cppD03-May-2024734 2312

cjs_scalewhen.hD03-May-2024573 2412

cjs_style.cppD03-May-2024808 2413

cjs_style.hD03-May-2024553 2412

cjs_timerobj.cppD03-May-2024897 3317

cjs_timerobj.hD03-May-2024816 3217

cjs_util.cppD03-May-202414.2 KiB480398

cjs_util.hD03-May-20242.2 KiB6943

cjs_util_unittest.cppD03-May-20243.9 KiB11560

cjs_zoomtype.cppD03-May-2024915 2615

cjs_zoomtype.hD03-May-2024568 2412

fx_date_helpers.cppD03-May-202414.3 KiB553473

fx_date_helpers.hD03-May-20242 KiB6951

fx_date_helpers_unittest.cppD03-May-20245.8 KiB156134

fxv8.cppD03-May-202410.9 KiB338271

fxv8.hD03-May-20245.2 KiB11184

global_timer.cppD03-May-20242.5 KiB9467

global_timer.hD03-May-20241.3 KiB5236

ijs_event_context.hD03-May-20243.5 KiB8869

ijs_runtime.cppD03-May-20241.7 KiB6245

ijs_runtime.hD03-May-20241.8 KiB6743

js_define.cppD03-May-20243 KiB10075

js_define.hD03-May-20245.8 KiB163116

js_resources.cppD03-May-20243.6 KiB114104

js_resources.hD03-May-20241.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