1
0
Fork 0
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.
..
xfa
Android.bp
BUILD.gn
DEPS
README
cfx_globaldata.cpp
cfx_globaldata.h
cfx_globaldata_unittest.cpp
cfx_keyvalue.cpp
cfx_keyvalue.h
cfx_v8.cpp
cfx_v8.h
cfx_v8_unittest.cpp
cfx_v8_unittest.h
cfxjs_engine.cpp
cfxjs_engine.h
cfxjs_engine_embeddertest.cpp
cfxjs_engine_unittest.cpp
cjs_annot.cpp
cjs_annot.h
cjs_app.cpp
cjs_app.h
cjs_border.cpp
cjs_border.h
cjs_color.cpp
cjs_color.h
cjs_console.cpp
cjs_console.h
cjs_delaydata.cpp
cjs_delaydata.h
cjs_display.cpp
cjs_display.h
cjs_document.cpp
cjs_document.h
cjs_event.cpp
cjs_event.h
cjs_event_context.cpp
cjs_event_context.h
cjs_event_context_stub.cpp
cjs_event_context_stub.h
cjs_eventrecorder.cpp
cjs_eventrecorder.h
cjs_field.cpp
cjs_field.h
cjs_font.cpp
cjs_font.h
cjs_global.cpp
cjs_global.h
cjs_globalarrays.cpp
cjs_globalarrays.h
cjs_globalconsts.cpp
cjs_globalconsts.h
cjs_highlight.cpp
cjs_highlight.h
cjs_icon.cpp
cjs_icon.h
cjs_object.cpp
cjs_object.h
cjs_position.cpp
cjs_position.h
cjs_publicmethods.cpp
cjs_publicmethods.h
cjs_publicmethods_embeddertest.cpp
cjs_publicmethods_unittest.cpp
cjs_result.cpp
cjs_result.h
cjs_runtime.cpp
cjs_runtime.h
cjs_runtimestub.cpp
cjs_runtimestub.h
cjs_scalehow.cpp
cjs_scalehow.h
cjs_scalewhen.cpp
cjs_scalewhen.h
cjs_style.cpp
cjs_style.h
cjs_timerobj.cpp
cjs_timerobj.h
cjs_util.cpp
cjs_util.h
cjs_util_unittest.cpp
cjs_zoomtype.cpp
cjs_zoomtype.h
fx_date_helpers.cpp
fx_date_helpers.h
fx_date_helpers_unittest.cpp
global_timer.cpp
global_timer.h
ijs_event_context.h
ijs_runtime.cpp
ijs_runtime.h
js_define.cpp
js_define.h
js_resources.cpp
js_resources.h

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.