You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jianglk.darker 7ee447c011
v811_spc009_project
4 months ago
..
xfa v811_spc009_project 4 months ago
Android.bp v811_spc009_project 4 months ago
BUILD.gn v811_spc009_project 4 months ago
DEPS v811_spc009_project 4 months ago
README v811_spc009_project 4 months ago
cfx_globaldata.cpp v811_spc009_project 4 months ago
cfx_globaldata.h v811_spc009_project 4 months ago
cfx_globaldata_unittest.cpp v811_spc009_project 4 months ago
cfx_keyvalue.cpp v811_spc009_project 4 months ago
cfx_keyvalue.h v811_spc009_project 4 months ago
cfx_v8.cpp v811_spc009_project 4 months ago
cfx_v8.h v811_spc009_project 4 months ago
cfx_v8_unittest.cpp v811_spc009_project 4 months ago
cfx_v8_unittest.h v811_spc009_project 4 months ago
cfxjs_engine.cpp v811_spc009_project 4 months ago
cfxjs_engine.h v811_spc009_project 4 months ago
cfxjs_engine_embeddertest.cpp v811_spc009_project 4 months ago
cfxjs_engine_unittest.cpp v811_spc009_project 4 months ago
cjs_annot.cpp v811_spc009_project 4 months ago
cjs_annot.h v811_spc009_project 4 months ago
cjs_app.cpp v811_spc009_project 4 months ago
cjs_app.h v811_spc009_project 4 months ago
cjs_border.cpp v811_spc009_project 4 months ago
cjs_border.h v811_spc009_project 4 months ago
cjs_color.cpp v811_spc009_project 4 months ago
cjs_color.h v811_spc009_project 4 months ago
cjs_console.cpp v811_spc009_project 4 months ago
cjs_console.h v811_spc009_project 4 months ago
cjs_delaydata.cpp v811_spc009_project 4 months ago
cjs_delaydata.h v811_spc009_project 4 months ago
cjs_display.cpp v811_spc009_project 4 months ago
cjs_display.h v811_spc009_project 4 months ago
cjs_document.cpp v811_spc009_project 4 months ago
cjs_document.h v811_spc009_project 4 months ago
cjs_event.cpp v811_spc009_project 4 months ago
cjs_event.h v811_spc009_project 4 months ago
cjs_event_context.cpp v811_spc009_project 4 months ago
cjs_event_context.h v811_spc009_project 4 months ago
cjs_event_context_stub.cpp v811_spc009_project 4 months ago
cjs_event_context_stub.h v811_spc009_project 4 months ago
cjs_eventrecorder.cpp v811_spc009_project 4 months ago
cjs_eventrecorder.h v811_spc009_project 4 months ago
cjs_field.cpp v811_spc009_project 4 months ago
cjs_field.h v811_spc009_project 4 months ago
cjs_font.cpp v811_spc009_project 4 months ago
cjs_font.h v811_spc009_project 4 months ago
cjs_global.cpp v811_spc009_project 4 months ago
cjs_global.h v811_spc009_project 4 months ago
cjs_globalarrays.cpp v811_spc009_project 4 months ago
cjs_globalarrays.h v811_spc009_project 4 months ago
cjs_globalconsts.cpp v811_spc009_project 4 months ago
cjs_globalconsts.h v811_spc009_project 4 months ago
cjs_highlight.cpp v811_spc009_project 4 months ago
cjs_highlight.h v811_spc009_project 4 months ago
cjs_icon.cpp v811_spc009_project 4 months ago
cjs_icon.h v811_spc009_project 4 months ago
cjs_object.cpp v811_spc009_project 4 months ago
cjs_object.h v811_spc009_project 4 months ago
cjs_position.cpp v811_spc009_project 4 months ago
cjs_position.h v811_spc009_project 4 months ago
cjs_publicmethods.cpp v811_spc009_project 4 months ago
cjs_publicmethods.h v811_spc009_project 4 months ago
cjs_publicmethods_embeddertest.cpp v811_spc009_project 4 months ago
cjs_publicmethods_unittest.cpp v811_spc009_project 4 months ago
cjs_result.cpp v811_spc009_project 4 months ago
cjs_result.h v811_spc009_project 4 months ago
cjs_runtime.cpp v811_spc009_project 4 months ago
cjs_runtime.h v811_spc009_project 4 months ago
cjs_runtimestub.cpp v811_spc009_project 4 months ago
cjs_runtimestub.h v811_spc009_project 4 months ago
cjs_scalehow.cpp v811_spc009_project 4 months ago
cjs_scalehow.h v811_spc009_project 4 months ago
cjs_scalewhen.cpp v811_spc009_project 4 months ago
cjs_scalewhen.h v811_spc009_project 4 months ago
cjs_style.cpp v811_spc009_project 4 months ago
cjs_style.h v811_spc009_project 4 months ago
cjs_timerobj.cpp v811_spc009_project 4 months ago
cjs_timerobj.h v811_spc009_project 4 months ago
cjs_util.cpp v811_spc009_project 4 months ago
cjs_util.h v811_spc009_project 4 months ago
cjs_util_unittest.cpp v811_spc009_project 4 months ago
cjs_zoomtype.cpp v811_spc009_project 4 months ago
cjs_zoomtype.h v811_spc009_project 4 months ago
fx_date_helpers.cpp v811_spc009_project 4 months ago
fx_date_helpers.h v811_spc009_project 4 months ago
fx_date_helpers_unittest.cpp v811_spc009_project 4 months ago
global_timer.cpp v811_spc009_project 4 months ago
global_timer.h v811_spc009_project 4 months ago
ijs_event_context.h v811_spc009_project 4 months ago
ijs_runtime.cpp v811_spc009_project 4 months ago
ijs_runtime.h v811_spc009_project 4 months ago
js_define.cpp v811_spc009_project 4 months ago
js_define.h v811_spc009_project 4 months ago
js_resources.cpp v811_spc009_project 4 months ago
js_resources.h v811_spc009_project 4 months ago

README

There are two separate wrappers for V8 here.  One is called FXJS, and
it is used by the non-XFA code.  The other is called FXJSE, and it is
used only by the XFA code.  Additionally FXJSE may request services
from FXJS to bridge the two.

Both the FXJS and FXJSE binding code needs to be replaced by something
saner, perhaps Gin or perhaps some IDL. See
  https://bugs.chromium.org/p/pdfium/issues/detail?id=716
for progress on the issue.

FXJS binds objects by sticking a pointer to a CFXJS_PerObjectData in
the V8 object's internal slot.  FXJSE binds objects by sticking a
pointer to either an actual v8 function object or a CFXJSE_HostObject
in the V8 object's internal slot, depending upon whether the object
represents (in some notion) a "class" or an "instance". Also, V8 objects
bound in one library may unexpectedly arrive at the other given a script
that's trying to mess with us.

To distinguish these cases, we use two internal slots for all bound
objects, regardless of the FXJS/FXJSE distinction.  Slot 0 is the
tag and contains either:
  kPerObjectDataTag for FXJS objects, or
  g_FXJSEHostObjectTag for FXJSE Host objects, or
  g_FXJSEProxyObjectTag for a global proxy object under FXJSE, or
  One of 4 specific FXJSE_CLASS_DESCRIPTOR globals for FXJSE classes:
    GlobalClassDescriptor
    NormalClassDescriptor
    VariablesClassDescriptor
    formcalc_fm2js_descriptor

Slot 1's contents are determined by these tags:
  kPerObjectDataTag means an aligned pointer to CFXJS_PerObjectData.
  g_FXJSEHostObjectTag means an aligned pointer to CFXJSE_HostObject.
  g_FXJSEProxyObjectTag means nullptr, and to check the prototype instead.
  A FXJSE_CLASS_DESCRIPTOR pointer means to expect an actual v8 function
  object (or a string naming that function),  and not an aligned pointer.

Because PDFium uses V8 for various unrelated purposes, there may be up to
four v8::Contexts (JS Global Objects) associated with each document. One is
used by FXJS and holds objects as described by the js_api_reference.pdf
specification. The others are used by FXJSE.