Age | Commit message (Collapse) | Author |
|
Previously, blur event actions could potentially touch deleted PageViews
as CPDFSDK_Document deletes the PageViews one by one.
This also fixes a related issue: CPDFSDK_Document::SetFocusAnnot no
longer does anything if the document is being destroyed. Otherwise, it
eventually tries to use m_pEnv->GetSDKDocument() at which point has
already been set to NULL by FPDFDOC_ExitFormFillEnvironment.
R=tsepez@chromium.org, thestig@chromium.org
BUG=512445
Review URL: https://codereview.chromium.org/1414353007 .
|
|
The original XFA version was correct, and the master version here is
wrong. The two versions are now in sync, but incorrect.
So we need to fix this here and then merge to XFA again.
Also fix what are now incorrect uses of CountAnnots() and do some
cleanups.
BUG=543049
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1413973011 .
|
|
This reverts commit 9dd9439d23d44d105db0950e33af0cc913a6cece.
BUG=536967
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1421583005 .
|
|
The original XFA version was correct, and the master version here is
wrong. The two versions are now in sync, but incorrect. So we need to
fix this here and then merge to XFA again.
BUG=536967
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1406183007 .
|
|
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1411203007 .
|
|
This method isn't used anywhere and the implementation doesn't really do
anything.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1405163003 .
|
|
- Add new CPDFSDK_Document::GetPDFDocument()
- FPDFDocumentFromCPDFDocument() to match XFA
- rename some JS variables to be consistent with XFA
- remove unused param from CJS_GlobalData().
- kill dead code used XFA only.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1413883005 .
|
|
None of the methods in this file are used and it is not included anywhere. Removing.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1417783004 .
|
|
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1412123004 .
|
|
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1411963002 .
|
|
BUG=pdfium:205
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1409743004 .
|
|
Abstracts the way that pages are passed to the embedder
between XFA and master.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1406543004 .
|
|
Make this a function in the fpdfsdk/ layer, rather than a method
in the core/ layer. Nothing in core should know about public FPDF
types.
BUG=pdfium:217
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1396283006 .
|
|
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1401423004 .
|
|
This reverts commit 633f1e436e1cced874a44a797f02c452eb3cf958.
This restores IPDFSDK_AnnotHandler, which is pointless on master
but useful on XFA. The small gain on master isn't worth the noise
when diffing to XFA.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1408513002 .
|
|
This better separates the two IJS_ classes, with the IJS_Context
taking on its proper role of describing an event. There's no need
for the event details for object creation, so this gets much
cleaner.
Move some JS error reporting code from CJS_Context to CJS_Runtime.
Make InitInstance() and ExitInstance() voids, they always return
TRUE and we never check the result anyways.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1389163007 .
|
|
Original patch from issue 1391843004 at patchset 1
(http://crrev.com/1391843004#ps1)
Introduce a pdf_enable_v8 GYP variable, which controls a
corresponding PDF_ENABLE_V8 #define, and bring in the real
JS library when set. Otherwise, link against a stub JS
runtime.
BUG=pdfium:211
R=dml@google.com, jochen@chromium.org, thestig@chromium.org
Review URL: https://codereview.chromium.org/1395733006 .
|
|
Nothing but sed.
FXJS is a layer that makes it easier to define objects in V8, but has
no knowledge of PDF-specific native objects. It could in theory be used
to implement other sets of native objects.
JS is the layer that implements PDF-specific native objects on top of
FXJS.
Therefore, the classes used to interface to JS should be named using
IJS_. IFXJS_ is reserved for someday adding better API for FXJS iteslf.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1386173002 .
|
|
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1389003003 .
|
|
Avoids doing a lookup via FXJS_V8 for something already
known in CJS layer.
Also:
Consolidate repeated code in JS macros.
Remove knowledge that Document is global from FXJS layer
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1382263002 .
|
|
The fpdfsdk/include/javascript/IJavascript.h is the sole API.
This required moving a creaton method to it from JS_Runtime.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1389783002 .
|
|
It merely includes a bunch of other .h files which are handled
better since we fixed IWYU.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1385983002 .
|
|
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1374723004 .
|
|
BUG=539106
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1386823002 .
|
|
Also remove dead CJS_EmbedObj::{Begin,End}Timer code.
BUG=539107
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1384883002 .
|
|
Move the external isolate and embedder slot from the
IPDF_JSPlatforms struct supplied at the
FPDFDOC_InitFormFillEnvironment() call time to arguments to
the FPDF_InitLibraryWithConfig() call.
This has several benefits:
-- Avoids the crash that could happen if multiple
FPDFDOC_InitFormFillEnvironmen() calls should happen to be
made by an embedder with different slot values.
-- Down the road, for XFA, there may be XFA but no FormFill
environment.
We support both forms for the time being, until the chrome
side catches up, at which point we will deprecate the old
way.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1367033002 .
|
|
BUG=537173
R=jun_fang@foxitsoftware.com, tsepez@chromium.org
Review URL: https://codereview.chromium.org/1376093002 .
|
|
Follow-up from https://codereview.chromium.org/1366053003/
- use kPerIsolateDataIndex rather than magic constant 1.
- make a helper function for common code in JS_Define.h
- remove dead prototypes missed in earlier CL.
- fxjs_v8 can't include generic fpdfsdk includes (layering).
R=jochen@chromium.org
Review URL: https://codereview.chromium.org/1367813003 .
|
|
This reverts commit 3b4382a847b5a7439a3107512dbe54c317108579.
The difference between this CL and the one that failed is
fxjs_v8.cpp:271. In master, we pass the runtime information
as:
v8::isolate -> v8::Context -> FXJS Runtime,
but in XFA:
V8::Isolate -> PerIsolate struct -> FXJS Runtime.
The master way is more correct, in that FXJS_Runtime is 1:1
with v8 contexts and many:1 (in theory) with isolates.
It looks like the XFA branch missed a patch along the way.
I'll do that next.
Having made this change, the only data in the per-isolate
struct will be the ptr array (on master); it will also
include the XFA context (on XFA). I've kept the struct on
master for the sake of similarity.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1365733003 .
|
|
Reason for revert: embeddertests failed.
This reverts commit 70bc04b16646c92f221c5aa56831b01d6ec7c1ca.
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1358263004 .
|
|
Work on this was first performed on the XFA branch, since
it has additional requirements (FXJSE layer) that needed
to be accomodated by the solution.
(cherry picked from commit ed7b2b50aa1744e0bc5a60bef12c61fa91d863b7)
Original Review URL: https://codereview.chromium.org/1351173002 .
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1354593004 .
|
|
This avoids some custom linked-list code. Also note that
we use a local copy to be sure we removed the same thing
that was added no matter how our callees may muck with the
handler.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1352393003 .
|
|
The Factory Design Pattern isn't buying us anything here over just new'ing
the object we want.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1360523004 .
|
|
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1349423006 .
|
|
Kill some now unused functions as a result.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1350703003 .
|
|
Re-arrange things in the header so function overloads are
next to each other, and related things are near each other.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1348693003 .
|
|
Currently, its hard to tell which functions come from the JS_
layer at fpdfsdk/include/javascript vs. which functions come
from the FXJS_V8 layer at fpdfsdk/include/jsapi. Until we
take up the task of using namespaces, at least make the
prefix consistent.
Move objects out of FXJS_V8 that are really part of JS_.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1347833002 .
|
|
This was guarded by an assert, but the path is hit.
BUG=528015
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1345923002 .
|
|
This forces the layer defined by fxjs_v8.h to be (more)
self-contained, so that it can be tested apart from the
CJS_* objects (in fpdfsdk/{src,include}/javascript. This
implies the array buffer allocator must be part of fxjs_v8.
One wrinkle is that we'd like to be able to test an isolate
upon which no native objects have been added, so some
initialization that would have occurred as part of object
definition must be made explicit.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1338073002 .
|
|
First part of getting rid of CJS_RuntimeFactory. The factory design
pattern isn't appropriate here since we only ever make one kind of
object.
CJS_GlobalData is now perfectly capable of managing itself through
internal ref counts. I'm philosophically opposed to keeping ref-counts
outside the object (do you hear me std::shared_ptr, you're bad!)
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1338993005 .
|
|
Replace multiple #defines of the same strings with externs.
Fix strings mangled by interaction of # and clang-format.
Remove macros as possible.
Make more JS_ functions void and simplify.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1342433002 .
|
|
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1335763002 .
|
|
It's too hard to keep mapping between v8 and fx abstractions; the lack
of transparency prevents those skilled in v8 only from working on this
code.
Apparently, the original intention was to confine v8 types to
fpdfsdk/{include,src}/jsapi, but fpdfsdk/{include,src}/javascript
is already well-polluted with v8 types.
Also remove no-op JS_SetThisObj().
Also remove unused ParserParams() [noticed because it was incorrectly
passing handles as pointers].
Also remove cast operator from CJS_Runtime and call GetIsolate()
explicitly.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1332973002 .
|
|
It's pointless to have an abstract interface and its only concrete
implementation defined in the same header. We can de-virtualize along
the way and get a small savings.
Rename CPDFSDK_BFAnnotHandler along the way, since its the only kind
of AnnotHandler, and I can't imagine what BF stands for.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1313733013 .
|
|
It's never instantiated, and any pointers to it are always NULL.
Also kill an unused arg to CPDFSDK_ActionHandler ctor along the way.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1329583004 .
|
|
This, in turn, allows us to get rid of the DoJob method and its clumsy
mode parameter conditional.
Add explicit and consts, and remove pointless asserts along the way.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1318543012 .
|
|
Fixes the remaining issues, except for JBIG2/Skia ...
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1298393003 .
|
|
Part 1. Move to headers so compiler can type check against
the definitions.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1299963002 .
|
|
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1297723002 .
|
|
They look too much like locals; use JSGlobalData and JSGlobalAlternate
instead. Kill some commented out code.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1289903004 .
|