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
|
|
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=pdfium:422
Review-Url: https://codereview.chromium.org/1930743003
|
|
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
|
|
- 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
|
|
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
|
|
Replace two parallel arrays with single array of pairs.
Review URL: https://codereview.chromium.org/1911673002
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
BUG=
Review URL: https://codereview.chromium.org/1885973002
|
|
Add iterators to enable range based for loop. Also add unit tests for recent modified functions.
Review URL: https://codereview.chromium.org/1878803002
|
|
Clean up three 4701 warnings (use potientially uninitialized variable)
which are the only ones left;
Re-enable warning 4701 for GN build;
Remove an unused data structure;
BUG=pdfium:29
Review URL: https://codereview.chromium.org/1885093002
|
|
This CL removes IFX_ArabicChar, IFX_RTFBreak, IFX_TxtBreak, IFX_WordBreak,
IFX_FormatString, and IFX_GSUBTable. References were updated to be the concrete
classes.
The CFX_GSUBTable was also removed as it is unused.
BUG=pdfium:468
Review URL: https://codereview.chromium.org/1882213002
|
|
if |m_Family| was RGB, the code assumed there were 3 components, which
may not be the case.
BUG=chromium:602046
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1877033003
|
|
All of the ICodec_* interfaces had a single implementation. This CL removes
the interfaces and uses the concrete classes in their place.
BUG=pdfium:468
Review URL: https://codereview.chromium.org/1876023003
|
|
Using these webpages as guides
http://www.globelegislators.org/pdfjs/test/pdfs/alphatrans.pdf
http://www.antennahouse.com/antenna1/wp-content/uploads/2015/07/background-image-gradient-1.pdf
flesh out the gradient shaders to include the PostScript Type 0
sampling function and to include radial gradients. This CL makes
rendering these pages agree with Adobe Reader output.
Some of these examples use an Extend array to clip the gradient.
Skia does not currently support this natively, so construct the
clip manually for now.
Other PDF pages may construct gradients using alternate mechanisms
-- this code will continue to be refactored as those come to light.
In particular, this CL sets up the clip and matrix differently for
axial gradients and radial gradients -- while it makes sense to do
it one way only, I prefer to defer until I have more examples to
work with.
R=dsinclair@chromium.org,tsepez@chromium.org
Review URL: https://codereview.chromium.org/1870463002
|
|
GetConstString() has sharp edges in that when applied to
a CPDF_Number, it must return null whereas GetString() returns
a the stringified number, because of the inability to
control the lifetime of the underlying allocated string.
Deleting this method showed several places where we
actually wanted a *String, not a *StringC, so we were
re-allocating a string we already had.
Review URL: https://codereview.chromium.org/1879683002
|
|
BUG=chromium:401189
Review URL: https://codereview.chromium.org/1871373002
|
|
Replace the usage of CFX_ArrayTemplate inside CPDF_Array, which
has non-standard APIs such as GetSize() returns int.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1867183002 .
|
|
BUG=
Review URL: https://codereview.chromium.org/1868293002
|
|
The naming is redundant given the base type, and will stand
in the way of consolidating Byte and Wide code.
BUG=
Review URL: https://codereview.chromium.org/1862123003
|
|
The few places these are called are better served by explicit
calls to CFX_ByteString() itself. This helps make Byte and
Wide strings more similar.
Also prevents fx_string.h from having any knowledge of fx_basic.h's
ByteTextBuf class.
Review URL: https://codereview.chromium.org/1870043003
|
|
Review URL: https://codereview.chromium.org/1864153002
|
|
We removed the FX_DWORD typedef in favour of uint32_t. This CL cleans up the
FX_SAFE_DWORD naming to match.
BUG=pdfium:81, pdfium:470
Review URL: https://codereview.chromium.org/1861403002
|
|
This CL is a straight move of the fxge includes into core/fxge/include.
Review URL: https://codereview.chromium.org/1868533002
|
|
Review URL: https://codereview.chromium.org/1860223002
|
|
This CL updates CFX_ByteStringC to use the more common c_str
and raw_str instead of GetCStr and GetPtr.
Review URL: https://codereview.chromium.org/1857713003
|
|
Having this happen implicitly can be dangerous because the lifetime
has to be considered; we should have caught the "red bots" in
https://codereview.chromium.org/1847333004/#ps60001 at compile time.
Review URL: https://codereview.chromium.org/1853233002
|
|
This CL removes _FXBSTR and changes FPDF_AbbrPair to hold
two FX_CHAR pointers. The two remaining uses of FX_BSTRC()
were in unused FDE_CSS defines which have been removed.
BUG=pdfium:151
Review URL: https://codereview.chromium.org/1847333004
|
|
The code is changed or had been changed to no longer generate these
warnings. It is safe to re-enabled these warnings.
In this code change, we fixed some code which generates warnings 4018
(signed/unsigned mismatch) and 4146 (unary minus operator applied to
unsigned type, result still unsigned).
Warning 4333 (right shift by too large amount, data loss) and 4345
(an object of POD type constructed with an initializer of the form ()
will be default-initialized) are no longer generated.
The same setting is applied and verified for GN build as well.
BUG=pdfium:29
Review URL: https://codereview.chromium.org/1849443003
|
|
Review URL: https://codereview.chromium.org/1841313004
|
|
This makes pdfium code on Linux and Mac sign-compare warning free.
The warning flag will be re-enabled after checking on windows clang build.
BUG=pdfium:29
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1841643002 .
|
|
Every time I read this code, I have to make the mental substituion
that "Element value" means "de-ref indirect object", so it might
as well just say so.
BUG=
Review URL: https://codereview.chromium.org/1841173002
|