Age | Commit message (Collapse) | Author |
|
PDFium doesn't strip BOMs during parsing, but we should strip BOMs when
retrieving parsed strings in CPDF_NameTree to ensure consistency and
appropriate function behavior. See the bug for more info.
As outlined in Bug=pdfium:593, the solution is to call GetUnicodeText()
instead of GetString(). I added a GetUnicodeTextAt() function in
CPDF_Array, which is symmetrical to GetUnicodeTextFor() in
CPDF_Dictionary.
I then changed the input variable types to CPDF_NameTree functions to
be CFX_WideString instead of CFX_ByteString, and modified all the
calls to them.
I also added a unit test for nametree, which would fail prior to this
change. Nametrees with non-unicode names are already tested by embedder
tests.
Bug=pdfium:820
Change-Id: Id69d7343632f83d1f5180348c0eea290f478183f
Reviewed-on: https://pdfium-review.googlesource.com/8091
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Jane Liu <janeliulwq@google.com>
|
|
Fix some nits and simplify code as well.
Change-Id: I77c88f211b9ce32f38221d04c067f73818e0e970
Reviewed-on: https://pdfium-review.googlesource.com/6674
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
So call it as such. Fix two places where we're invoking it off
of an intance.
Change-Id: I08712fa27dbdf85c9195cedcc62d7d741b0ad091
Reviewed-on: https://pdfium-review.googlesource.com/6110
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Sed + minimal conversions to compile, including moving some
constructors into the .cpp file. Any that caused ASAN issues
during the tests were omitted rather than trying to resolve
the underlying issue.
Change-Id: I00a421f33b253eb4071ffd9af3f2922c7443b335
Reviewed-on: https://pdfium-review.googlesource.com/5891
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Using vector<uint8_t> as a buffer.
Change-Id: I38a8a05e7ec1355980d17533a2c8336e733aa6f6
Reviewed-on: https://pdfium-review.googlesource.com/4791
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I158b7d80b0ec28b742a9f2d5a96f3dde7fb3ab56
Reviewed-on: https://pdfium-review.googlesource.com/3031
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Follow up to https://pdfium-review.googlesource.com/c/2829/
Change-Id: Ic743a5931f743c3e0e3f24246dca768cec09be4f
Reviewed-on: https://pdfium-review.googlesource.com/2843
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
The expected way to create native PDFium objects for JS is via
the NewFxDynamicObject() call in C++, but that doesn't mean that the
corresponding constructors won't be called from JS. In that case,
the internal fields will be uninitialized, and subsequent method
calls may try to use them.
Add a constructor callback for all PDFium objects that nulls out
these fields (shame that v8 doesn't do this by default, but probably
saves some cycles). Then ensure that we check for this possibility
in all the places it might turn up.
Conversely, if we've just gotten a successful return from
NewFxDynamicObject(), we know the CJS_Object/EmbedObj are good,
so avoid checking there.
BUG=695826
Change-Id: Iadad644c4af937def967ddc83daac1dad7544d69
Reviewed-on: https://pdfium-review.googlesource.com/2839
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
It is set, and passed around, but never operated upon. This
removes another unowned ptr from JS back to C++ objects.
Change-Id: I2a7eede050c6d844924e3c74395e7672ebb0213e
Reviewed-on: https://pdfium-review.googlesource.com/2829
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Save some space since none contain non-ascii characters.
Avoid allocating C++ WideStrings just to convert back to
UTF8 when defining properties.
Change-Id: Id94db21b32ee7a96856c35a09f7550b54599ae13
Reviewed-on: https://pdfium-review.googlesource.com/2826
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I4daec9e05a63c55caa01402a594c3553073c439e
Reviewed-on: https://pdfium-review.googlesource.com/2818
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
There are no non-ascii characters, so save space.
Change-Id: Ib9efb9386b6fc83bf3bb1810c791aadeeeebc259
Reviewed-on: https://pdfium-review.googlesource.com/2817
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Attempt at clarity.
Change-Id: Ie37890888e1ec6e07cd10c68066b90f854fe6038
Reviewed-on: https://pdfium-review.googlesource.com/2719
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This is much more convenient, since only a fraction of them
need an IJS_EventContext, which can be obtained from the
CJS_Runtime.
Make GetCurrentEventContext() specific to CJS_Runtime, and
return the concrete type. This saves a lot of casting.
Change-Id: If79a3bcbf44de513f3caace153099234cc313d47
Reviewed-on: https://pdfium-review.googlesource.com/2793
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Prevents confusion with v8::Context, which is wrapped by a
different IJS_ class.
Change-Id: Iff75809e65015c0f810294de1f0d8ecf963150a3
Reviewed-on: https://pdfium-review.googlesource.com/2751
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Modernizing CPDF_TextObject a little bit, in preparation for the addition of
APIs for adding text to PDFs. m_pCharCodes, m_pCharPos are now vectors, this
caused some propagation to other classes. Also m_Pos is now a point. Note that
GetItemInfo is being changed in another CL, so did minimal changes there.
Change-Id: I6e5f19b5d45872e3e714a7cb587c81c92e640ea3
Reviewed-on: https://pdfium-review.googlesource.com/2614
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Move checks performed as part of JS_Value's object and array
handling back into FXJS, to ease removal of JS_Value in the future.
Remove some convenience routines in FXJS for objects, to shrink
API to be covered during testing.
Change some naming (number => double, string => widestring) to
make it clearer when there is a C++ type involved.
BUG=
Review-Url: https://codereview.chromium.org/2637503002
|
|
Rename to CPDFSDK_AnnotIteration, as it is now an ordered set of
annots, and not the iterator itself.
Review-Url: https://codereview.chromium.org/2626073005
|
|
Widgets as returned from GetWidgets() can pop out of existence
unexpectedly, so always return observed pointers. This extends
the same pattern used elsewhere in the file to all occurrences.
BUG=679642
Review-Url: https://codereview.chromium.org/2624933002
|
|
Some changes were required to match underlying ctors
as invoked by the templated methods.
Many release() calls go away, a few WrapUniques() are
introduced to avoid going deeper into other code.
Review-Url: https://codereview.chromium.org/2510223002
|
|
Review-Url: https://codereview.chromium.org/2453683011
|
|
Review-Url: https://codereview.chromium.org/2454263002
|
|
It does not need to be a std::list. This time keep the elements as
unique_ptrs.
Previous attempt: https://codereview.chromium.org/2428743004/
Review-Url: https://chromiumcodereview.appspot.com/2428373004
|
|
id:20001 of https://codereview.chromium.org/2428743004/ )
Reason for revert:
Appears to be blocking the roll due to compile failure https://codereview.chromium.org/2429053002
Attempting to revert to see if the roll will pass.
Original issue's description:
> Make Document::m_IconList a vector of IconElements.
>
> There's no need for std::list<std::unique_ptr<IconElement>>.
>
> Committed: https://pdfium.googlesource.com/pdfium/+/f328d0d378b8df8a3416988d96c34f1d3f9d26d1
TBR=npm@chromium.org,thestig@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review-Url: https://chromiumcodereview.appspot.com/2431913003
|
|
There's no need for std::list<std::unique_ptr<IconElement>>.
Review-Url: https://codereview.chromium.org/2428743004
|
|
This reverts commit 1d023881cd53485303c0fcc0b5878e700dc470fd.
Reason for revert -- fuzzers hit issues.
TBR=thestig@chromium.org
Review-Url: https://codereview.chromium.org/2425783002
|
|
This tweaks the implementation while leaving the API the
same. The API change is more disruptive, so break this
part off first.
Review-Url: https://codereview.chromium.org/2385293002
|
|
This CL cleans up any old m_pEnv variables to
be correctly named m_pFormFillEnv.
Review-Url: https://codereview.chromium.org/2412523002
|
|
This CL merges the CPDFSDK_Document and CPDFSDK_FormFillEnvironment classes
as they always existed and always pointed at each other.
Review-Url: https://codereview.chromium.org/2410893002
|
|
Review-Url: https://codereview.chromium.org/2399213002
|
|
This CL changes the use of CPDFSDK_Document to CPDFSDK_FormFillEnvironment.
Review-Url: https://codereview.chromium.org/2394313002
|
|
This CL converts the IJS_Context and implementations over to use
CPDFSDK_FormFillEnvironment instead of CPDFSDK_Document.
Review-Url: https://codereview.chromium.org/2399943002
|
|
This CL changes Field from using a CPDFSDK_Document to using a
CPDFSDK_FormFillEnvironment.
Review-Url: https://codereview.chromium.org/2400443005
|
|
Rename CPDFSDK_Environment to make it explicit that this is part of the formfill
system.
Review-Url: https://codereview.chromium.org/2391313002
|
|
This Cl cleans up the code regarding CPDFSDK_Annots in CPDFSDK_PageView.
This includes:
* Makes DeleteAnnot XFA only and wraps at the call site.
* Removes unused methods
* Replaces use of CountAnnots and GetAnnot with vector iteration
* Removes {Set|Kill}FocusAnnot from CPDFSDK_PageView
* Renames m_fxAnnotArray to m_SDKAnnotArray
Review-Url: https://codereview.chromium.org/2384323005
|
|
BUG=pdfium:603
Review-Url: https://codereview.chromium.org/2392603004
|
|
BUG=pdfium:603
Review-Url: https://codereview.chromium.org/2386423004
|
|
BUG=pdfium:603
Review-Url: https://codereview.chromium.org/2392773003
|
|
BUG=pdfium:611
Review-Url: https://codereview.chromium.org/2384503003
|
|
BUG=pdfium:611
Review-Url: https://codereview.chromium.org/2374383003
|
|
BUG=pdfium:611
Review-Url: https://codereview.chromium.org/2383543002
|
|
BUG=pdfium:611
Review-Url: https://codereview.chromium.org/2379033002
|
|
BUG=pdfium:611
Review-Url: https://codereview.chromium.org/2375283003
|
|
Remove default arguments.
Review-Url: https://codereview.chromium.org/2380753003
|
|
More instances of CPDFSDK_Environment being called m_pApp in the code. Renamed
to m_pEnv to be clear that it's the environment not an app object.
Review-Url: https://codereview.chromium.org/2354413002
|
|
This Cl makes the Get and Set methods consistenly use {G|S}et<Type>For.
BUG=pdfium:596
Review-Url: https://codereview.chromium.org/2334323005
|
|
The prefix doesn't add anything when used in CPDFSDK_Environment, remove.
Review-Url: https://codereview.chromium.org/2338303002
|
|
CPDFDoc_Environment does not fit with the general naming scheme of the rest of
the files in fpdfsdk. This CL updates the naming to CPDFSDK_Environment to
better fit with the surrounding files.
Review-Url: https://codereview.chromium.org/2333413003
|
|
This CL separates the CPDFDoc_Environment, CPDFSDK_Document and CPDFSDK_PageView
classes into their own h and cpp files.
Review-Url: https://codereview.chromium.org/2335243002
|
|
First of several patches to ensure JS objects don't track
stale C++ objects.
Review-Url: https://codereview.chromium.org/2323903002
|