Age | Commit message (Collapse) | Author |
|
(patchset #1 id:1 of https://codereview.chromium.org/1926823002/ )
Reason for revert:
Speculatively revert due to high volume of crashes on Chromium.
Original issue's description:
> Relax a couple checks to allow certain non-standard PDF files.
>
> Some non-standard PDF files misuse the size of cross reference table,
> and reuse some object number which the old one is still in use. PDFium
> can relax the reusing of xref objects only since it is not referred in
> the pdf document. When the size of cross reference table is larger
> than defined, PDFium will try to continue other than abort.
>
> BUG=chromium:596947
>
> Committed: https://pdfium.googlesource.com/pdfium/+/cd1e9ff4f432cbc29ed279e6891fb7ddc2ea3734
TBR=thestig@chromium.org,dsinclair@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=chromium:596947
Review-Url: https://codereview.chromium.org/1946693002
|
|
Last part. Remove CFX_PtrArray typedef.
Review-Url: https://codereview.chromium.org/1941863002
|
|
- CPVT_Size is the same as CFX_PointF
- CPVT_FloatRange is unused.
- CPVT_ArrayTemplate is just a wrapper for CFX_ArrayTemplate.
Review-Url: https://codereview.chromium.org/1919283008
|
|
Do more cleanup in modified files.
Review-Url: https://codereview.chromium.org/1938613003
|
|
Some non-standard PDF files misuse the size of cross reference table,
and reuse some object number which the old one is still in use. PDFium
can relax the reusing of xref objects only since it is not referred in
the pdf document. When the size of cross reference table is larger
than defined, PDFium will try to continue other than abort.
BUG=chromium:596947
Review-Url: https://codereview.chromium.org/1926823002
|
|
BUG=607739
Review-Url: https://codereview.chromium.org/1934483002
|
|
BUG=pdfium:422
Review-Url: https://codereview.chromium.org/1930743003
|
|
Remove IFX_FontProvider, IFX_FontSourceEnum, IFX_SAXReader and
IFX_SAXReaderHandler.
Review-Url: https://codereview.chromium.org/1930533002
|
|
There are currently three ways to assert in the code (ASSERT, FXSYS_assert and
assert). This CL standardizes on ASSERT. The benefit of ASSERT is that it can
be overridden if the platform requies and we can pickup the Chromium version
if it has already been defined in the build.
This does change behaviour. Currently FXSYS_assert is always defined but ASSERT
is only defined in debug builds. So, the FXSYS_assert's would fire in Release
builds. That will no longer happen.
BUG=pdfium:219
Review-Url: https://codereview.chromium.org/1914303003
|
|
So pass by const-ref instead of by pointer.
Review URL: https://codereview.chromium.org/1923153002
|
|
Review URL: https://codereview.chromium.org/1925453002
|
|
This CL removes the interfaces:
* IPDF_ObjectRenderer
* IPDF_OCContext
* IPDF_RenderModule
* IPDF_PageModule
The CPDF_RenderModule was just wrapping new and delete calls. This Cl moves
those up to the callers and removes the CPDF_RenderModule class.
Review URL: https://codereview.chromium.org/1918323003
|
|
Also identical fixes for CFX_WideString.
Reserve() on an empty string would not actually reserve a
buffer. Currently unused, but there are places where this
would really help.
ReleaseBuffer() would rarely return memory to the system, since
it would short-circuit thinking it could operate in place. Tune
the algorithm slightly so that we hold on when the savings is
small.
Bounds check release buffer args rather than just asserting.
Add tests for all of these.
Review URL: https://codereview.chromium.org/1916303004
|
|
- Merge CPDF_Page::Load() into ctor.
- Remove always nullptr param for CPDF_Page::ParseContent().
- Remove unneeded indirection in IPDF_RenderModule.
- Delete CPDF_ParseOptions.
- Fix up CPDF_Pattern.
Review URL: https://codereview.chromium.org/1918113002
|
|
This issue was found by clang-tidy linter.
BUG=589955
Review URL: https://codereview.chromium.org/1921713003
|
|
Too many calls were of the form fn(x.c_str(), x.GetLength())
which is an anti-pattern given the StringC classes which tie
these together.
There are a few places where explicit CFX_*StringCs are
constructed, but this can be avoided by changing the args
to these functions in the same manner.
Removed String_ from name of functions since it added
little value. Also removed default argument.
Review URL: https://codereview.chromium.org/1919563002
|
|
We have three failed unit tests -- FX_AllocOverflow(),
FX_AllocOverflow2D(), and FX_TryAllocOverflow() on Linux and Mac
release builds, because Clang aggressively optimizes the code.
Adding some usage of the return value of a function can avoid the function
being optimized away by Clang.
Review URL: https://codereview.chromium.org/1915693002
|
|
Some unknown software generates cross reference table with the
claimed object numbers are all off by one. Add a simple verification
function to detect this scenario, thus have a chance to rebuild
the correct cross reference table.
To avoid unnecessary checks and potiential performance hit, we only
check for the very first non free entry.
BUG=602650
Review URL: https://codereview.chromium.org/1910063004
|
|
fx_system.h errors out during compile if _FXM_PLATFORM_ is not
one of the four values tested in the ifdef.
Remove duplicated code, and use unique_ptr for cleanup.
Review URL: https://codereview.chromium.org/1912023002
|
|
Review URL: https://codereview.chromium.org/1904303002
|
|
Review URL: https://codereview.chromium.org/1909213002
|
|
The original code caused an optimization warning when
gcc tries to get rid of 'count > m_Length - index'
in CFX_ByteStringC::Mid() while assuming there is no signed
integer overflow.
This could also be avoided once FX_STRSIZE is no longer a
signed integer type.
Review URL: https://codereview.chromium.org/1906213002
|
|
Replace two parallel arrays with an array of pairs.
Several methods always returned same value, make void instead.
Review URL: https://codereview.chromium.org/1908153002
|
|
R=dsinclair@chromium.org
BUG=chromium:605491
Review URL: https://codereview.chromium.org/1910143002
|
|
Use RVO now that we use an array type compatible with it.
Review URL: https://codereview.chromium.org/1906903002
|
|
Its implicit copy constructor is unsafe, since it ends up
sharing the underlying data. Fix one place where it was
being unintentionally invoked.
Review URL: https://codereview.chromium.org/1908073003
|
|
Replace two parallel arrays with single array of pairs.
Review URL: https://codereview.chromium.org/1911673002
|
|
The principle has been implicit in the implementation, but
make it obvious for future generations.
Review URL: https://codereview.chromium.org/1904143002
|
|
There are 4 types of meshes that attempt to convert the shading object into
a stream. According to spec (section 8.7.4.1 table 76), the shading object can
be a stream or a dictionary.
All of this shading code assumes it can load the mesh from a stream. The
original code just early exited if it was not a stream. We skip the call
if it is not a stream.
BUG=pdfium:481
Review URL: https://codereview.chromium.org/1908903003
|
|
Use unqiue_ptrs while we're at it, also better ctor.
Review URL: https://codereview.chromium.org/1896303002
|
|
This was causing issues at one point with the GN build but seems to have been
resolved in the meantime.
Review URL: https://codereview.chromium.org/1907563002
|
|
This CL setups up a standalone GN build. You'll need to set gn args similar to:
use_goma = true
clang_use_chrome_plugins = false
pdf_enable_xfa = true
pdf_enable_v8 = true
pdf_is_standalone = true
The third_party/pymock files are needed to make git cl upload work correctly.
BUG=pdfium:106
Review URL: https://codereview.chromium.org/1904563002
|
|
This cleans up the Initialize methods and the ownership in CPDF_Creator.
Review URL: https://codereview.chromium.org/1902713003
|
|
Remove one left warning from GN Release build.
Review URL: https://codereview.chromium.org/1904473003
|
|
This is a result of looking for the anti-paterns /char\*\sm_/
and /m_.*=.*\.c_str/ which indicate that a class may be using
the contents of a string without extending the lifetime of
the underlying storage.
Along the way, change to uint8_t in fx_dib; this is unrelated but
avoids grep hits (it is binary, not chars anyways).
Also remove two string operators that make it easy to assign in
a manner that does not extend contents lifetime.
Review URL: https://codereview.chromium.org/1902953002
|
|
Each was only used by one subclass. Removed and used the concrete classes.
BUG=pdfium:468
Review URL: https://codereview.chromium.org/1897993002
|
|
This CL replaces the interfaces with the concrete classes. The concrete classes
are also renamed to remove the Standard from their names.
BUG=pdfium:468
Review URL: https://codereview.chromium.org/1898173002
|
|
Remove redundant CPDF_Name constructors given promotion rules.
Rework one char* in CPDF_PageContentGenerator.
Review URL: https://codereview.chromium.org/1890973006
|
|
Fixes a potential mismatch of |m_nComponents| between CPDF_DIBSource and
its CPDF_ColorSpace, from code attempting to recover from a failed decoder
initialisation in CPDF_DIBSource::CreateDecoder.
BUG=chromium:603518
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1892143003
|
|
These are exposed by making the ByteString from ByteStringC
ctor explicit, but we can clean them up independently.
Review URL: https://codereview.chromium.org/1884363002
|
|
StringC's are all that's needed here. Also CMap_GetString()
and GetCode() are side-effect free, so remove calls where
the value is not used.
Review URL: https://codereview.chromium.org/1889003002
|
|
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1888843004
|
|
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1887003003
|
|
There are perfectly fine operators for adding to an existing string
without first duplicating the arguments.
Review URL: https://codereview.chromium.org/1891953002
|
|
Do the same for CFX_WideTextBuf as well.
The name is confusing because these return CFX_ByteStringC,
not CFX_ByteString. The AsStringC naming gives parallelism with
the string types themselves, and may help to indicate that
the result is only good for the lifetime of the object being
operated upon.
Review URL: https://codereview.chromium.org/1886263003
|
|
These are immediately used to access a dictionary, so
the use of static CFX_ByteStringCs may force duplicate
allocations.
BUG=
Review URL: https://codereview.chromium.org/1888893002
|
|
This will help avoid duplicate allocation of CFX_ByteStrings
when the caller already has one. It may seem counter-intuitive
that requiring the caller to pass an allocated CFX_ByteString
rather than a static CFX_ByteStringC would improve the situation,
but due to the idiosyncrasies of std::map, the CPDF_Dictionary
methods must always do an allocation under the covers which
can't be avoided.
The changed callers in this CL are places where we would
previously demote to CFX_ByteStringC and then allocate a
a duplicate CFX_ByteString in the dictionary method.
Review URL: https://codereview.chromium.org/1889863002
|
|
Use the more standard name "clear()" instead.
Review URL: https://codereview.chromium.org/1888103002
|
|
The first PDF attempted by the Skia infra team
uncovered three bugs. This gets past those bugs
crashing; more work to do to get the correct
output.
R=rmistry@google.com,dsinclair@chromium.org
BUG=skia:5183
Review URL: https://codereview.chromium.org/1887073002
|
|
BUG=
Review URL: https://codereview.chromium.org/1882043004
|