Age | Commit message (Collapse) | Author |
|
Clean up another ten bare |new|s or so.
Change-Id: If32b307e5edd844488dfb2020e710214bb6f75a0
Reviewed-on: https://pdfium-review.googlesource.com/42550
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Also merge Initial() into the ctor.
Change-Id: Ib3cb9619a65a5c33d7c739051c13dfcd7f2324d7
Reviewed-on: https://pdfium-review.googlesource.com/41356
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
"Return" is a verb, and "return" is a reserved-word at that,
so avoid using it as part of a class name.
Fully mechanical change apart from rename.
Change-Id: I120e453e8ba001c4ab74a39e2da6aa6eb590835f
Reviewed-on: https://pdfium-review.googlesource.com/40532
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Avoid the possibility of ever re-introducing the issue noticed
last week.
Remove some redundant JSGetStringFromID() calls.
Change-Id: I56687c2191bd72e378f747083f34080e50cbe490
Reviewed-on: https://pdfium-review.googlesource.com/40490
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Turns out that "FromUnicode" is misleading in that, on linux, it simply
removes any characters beyond 0xFF and passes the rest unchanged, so
no unicode decoding actually takes place. On Windows, it passes it into
the system function specifying FX_CODEPAGE_DefANSI, converting it into
the so-called "default ANSI code plane", passing some characters,
converting others to '?' and still others to 'A'. Either way, nothing
resembling UTF8 comes out of this, so pick a better name.
These now immediately look suspicious, so a follow-up CL will see
which ones should really be WideString::UTF8Encode() instead.
Making this a normal method on a widestring rather than a static
method on a bytestring feels more natural; this is parallel to
the UTF8Encode and UTF16LE_Encode functions.
Add a test that shows these conversions.
Change-Id: Ia7551b47199eba61b5c328a97bfe9176ac8e583c
Reviewed-on: https://pdfium-review.googlesource.com/39690
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Value::ToString is deprecated since the Isolate is inferred from the
memory address of the object being converted to a string which will soon
not be reliable. As such this method will be removed in the very near
future.
Change-Id: I1e5a1a0464f2052cc3aa5eeb1ddbdb7b0a9222d3
Reviewed-on: https://pdfium-review.googlesource.com/38914
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
|
|
This a convenient place to assert that the callback that is about
to be invoked on the object doesn't destroy the object at any point
during its execution.
Change-Id: Iacb9d4e01603cc6bf316b00fdd062955c903ca5c
Reviewed-on: https://pdfium-review.googlesource.com/37970
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
BUG=chromium:862059
Change-Id: Id354a5e6dbc037dbb76f901de8311a4f4a4d8940
Reviewed-on: https://pdfium-review.googlesource.com/37670
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Consolidate all the checks into JSGetObject(), and add GetObjDefnID()
methods for classes that are missing it.
BUG=chromium:862059
Change-Id: I2c2b725a01dcd259ef712d2513fcf740cc410b15
Reviewed-on: https://pdfium-review.googlesource.com/37510
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I533a702947ba371cbc7971d88a3b7dabbc81a298
Reviewed-on: https://pdfium-review.googlesource.com/37511
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I0f2bf1cb44b4cba872a719f0a75d8776f413812c
Reviewed-on: https://pdfium-review.googlesource.com/36250
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Many of these are converting ByteString => c_str => ByteStringView, since
the ByteStringView ctor is implicit. This is unfortunate, since that
involves a strlen() which the ByteString already knows if we use
AsStringView() instead.
This changed one test result where we can now return the string
"\0" instead of "" -- since strlen no longer eats the NUL. This
seems consistent, say, with String.fromCharCode().
Change-Id: I17f68d1a1f4b352960208f9148e68ab4c4d78bd2
Reviewed-on: https://pdfium-review.googlesource.com/35590
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Avoid explicitly having to count items in arrays.
Change-Id: I24a91db45e8a8530f38afcc273e824ffb70a6cb9
Reviewed-on: https://pdfium-review.googlesource.com/34710
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Because constructors can do all this.
Change-Id: I4f7ff6c26b17d9bddd326333a66e1bd38b2ea377
Reviewed-on: https://pdfium-review.googlesource.com/34693
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change the signature of the constructors to make it impossible to
do this otherwise.
Change-Id: I14e88d98a1128f2d599459ce9337cd6d079469fe
Reviewed-on: https://pdfium-review.googlesource.com/34531
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Removes CJS_Runtime::RuntimeFromIsolateCurrentContext()
Change-Id: I51abcf32aaafac522e1595edf663507c26781357
Reviewed-on: https://pdfium-review.googlesource.com/34230
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Instead, use the object binding's pointer. Puts the cart back
behind the horse.
Change-Id: I4c06ae991b871c6e90b0e6c70b69886addca2354
Reviewed-on: https://pdfium-review.googlesource.com/33630
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Consistency with file naming conventions.
No functional change.
Change-Id: I596c4be5bbf0510950c44a7d9d80f59537739c3b
Reviewed-on: https://pdfium-review.googlesource.com/33593
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Precursor to removing some more v8::Context slot dependency.
There's a cost to maintaining the set of observers, but since these
objects are tied to V8 lifetimes, not C++ lifetimes, we want to be
very wary of the document going away unexpectedly.
Change-Id: I579f58a460aa50b88cb861227c9aca9a8a83ce12
Reviewed-on: https://pdfium-review.googlesource.com/33471
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Allows run-time selection of whether to permit JS inside PDF. Previously,
this was a link-time decision only. This requires a little more caution
before we decide that we have the CJS_Runtime, and not the CJS_RuntimeStub
in a few casts.
Adds a kDisableJavaScript option to the form fill embeddertests.
Adds a --disable-javascript flag to the pdfium_test executable.
Also adds a --disable-xfa flag while we're at it.
Change-Id: I8d8ac95f6474459cadba9a60572fbb342e984646
Reviewed-on: https://pdfium-review.googlesource.com/31090
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Replace v8::SetNamedPropertyHandler() with SetHandler() and
the appropriate flag set.
Change-Id: Ia06311cbea4ab21903d4ac4fe115eab6f0983c0d
Reviewed-on: https://pdfium-review.googlesource.com/28930
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
|
|
One can be performed by the CJS_V8 layer, the other requires the
full FXJS mechanism. Avoids using -1 as a special case.
Change-Id: I4a14ccb6a7fea393f84b70a07ada03b1a83c7d36
Reviewed-on: https://pdfium-review.googlesource.com/25830
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This CL removes the CJS_EmbedObj class and various subclasses and folds
the subclasses into their CJS_Object counterparts.
Change-Id: If6b882a4995c0b1bf83ac783f5c27ba9216c2d5c
Reviewed-on: https://pdfium-review.googlesource.com/25410
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Each of the CJS_Objects can create their CJS_EmbedObj's internally and
we don't need to do it though the JSConstructor. This also removes the
need for the SetEmbedObj method in CJS_Object.
Change-Id: Ib0535ad922b370634fd1e622a04860a96c4f2825
Reviewed-on: https://pdfium-review.googlesource.com/25370
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Also use the actual type information, not void* and remove casts.
Template function not required to wrap virtual dtors.
Change-Id: I9397cae136c3c395a368a1ef0ce8162d9b586076
Reviewed-on: https://pdfium-review.googlesource.com/25290
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
No functional change, but expose helpers likely to be needed by
next steps. Rename CXFJS_Engine::CurrentEngineFromIsolate to be more
accurately named along the way.
Change-Id: Iaf2d15a09cfed85705d24ee056e78edf0660ce59
Reviewed-on: https://pdfium-review.googlesource.com/25090
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
The non-Isolate version will soon be deprecated.
Bug: v8:7269, v8:7282
Change-Id: I204e45bd73f5b809d6c44b77bbcf62d32e7ccbec
Reviewed-on: https://pdfium-review.googlesource.com/23058
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
|
|
This CL changes the DefineMethod, DefineProps and DefineConsts methods
to pass a size instead of depending on a sentinel value in the
definition arrays.
Change-Id: Ie054544124290c0833a8b21af175a203ca99591a
Reviewed-on: https://pdfium-review.googlesource.com/20551
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Also fix other occurrences that were missed.
Bug:pdfium:947
Change-Id: Ic7e909ff9ce3abdf91e8e9ba108c84ad28b2fd65
Reviewed-on: https://pdfium-review.googlesource.com/20472
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Or change them to clear().
Change-Id: Ia9e3e1f0d74b948cec3f8df85d205f830ac9216c
Reviewed-on: https://pdfium-review.googlesource.com/19172
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This CL converts the #defines into an enum class.
Change-Id: I895e29e1d46a7a82d7be896f5776eb00d28559f5
Reviewed-on: https://pdfium-review.googlesource.com/17091
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL renames the files related to Javascript global data to match
their file contents.
Change-Id: I65a6191968656b5e89c9eb6edb2ea9f9db92875a
Reviewed-on: https://pdfium-review.googlesource.com/17090
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL moves all of the CJS files into fxjs. The :javascript build rule
is removed and :fxjs is used instead.
Change-Id: I1701b308f51317d0346c7401b43812c3f43a27bf
Reviewed-on: https://pdfium-review.googlesource.com/17047
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|