Revert of Remove unneeded CPVT classes. (patchset #7 id:140001 of https://codereview.chromium.org/1919283008/ )

Reason for revert:
Causing segv on certain PDFs which make the PDF load tests hang.  crbug.com/608901

Original issue's description:
> Remove unneeded CPVT classes.
>
> - CPVT_Size is the same as CFX_PointF
> - CPVT_FloatRange is unused.
> - CPVT_ArrayTemplate is just a wrapper for CFX_ArrayTemplate.
>
> Committed: https://pdfium.googlesource.com/pdfium/+/a354eb517429e10d84abff65e455f0c183fe58e0

TBR=thestig@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.

Review-Url: https://codereview.chromium.org/1947093002
10 files changed
tree: 95b73fc964d2d90c4e2a3770b8c818f5b190dda9
  1. build_gyp/
  2. build_overrides/
  3. core/
  4. docs/
  5. fpdfsdk/
  6. infra/
  7. public/
  8. samples/
  9. skia/
  10. test/
  11. testing/
  12. third_party/
  13. tools/
  14. xfa/
  15. .clang-format
  16. .gitignore
  17. .gn
  18. AUTHORS
  19. BUILD.gn
  20. codereview.settings
  21. DEPS
  22. LICENSE
  23. navbar.md
  24. OWNERS
  25. pdfium.gni
  26. pdfium.gyp
  27. PRESUBMIT.py
  28. README.md
  29. xfa.gyp
README.md

PDFium

News

As of 2016-02-04, the XFA branch is deprecated. Instead, see the section on configuration below.

As of 2016-04-28, the Visual Studio toolchain from depot_tools is used as the default Windows toolchain for Googlers. Please set DEPOT_TOOLS_WIN_TOOLCHAIN=0 if you need to use the system toolchain. See Windows development subsection for details.

Prerequisites

Get the chromium depot tools via the instructions at http://www.chromium.org/developers/how-tos/install-depot-tools (this provides the gclient utilty needed below).

Also install Python, Subversion, and Git and make sure they're in your path.

### Windows development

PDFium uses a similar Windows toolchain as Chromium:

Open source contributors

Visual Studio 2015 Update 2 or later is highly recommended.

Run set DEPOT_TOOLS_WIN_TOOLCHAIN=0, or set that variable in your global environment.

Compilation is done through ninja, not Visual Studio.

Google employees

Run: download_from_google_storage --config and follow the authentication instructions. Note that you must authenticate with your @google.com credentials. Enter “0” if asked for a project-id.

Once you've done this, the toolchain will be installed automatically for you in the step below.

The toolchain will be in depot_tools\win_toolchain\vs_files\<hash>, and windbg can be found in depot_tools\win_toolchain\vs_files\<hash>\win_sdk\Debuggers.

If you want the IDE for debugging and editing, you will need to install it separately, but this is optional and not needed for building PDFium.

Get the code

The name of the top-level directory does not matter. In our examples, we use “repo”. This directory must not have been used before by gclient config as each directory can only house a single gclient configuration.

mkdir repo
cd repo
gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git
gclient sync
cd pdfium

## Generate the build files

We use the GYP library to generate the build files.

At this point, you have two options. The first option is to use the [Ninja] (http://martine.github.io/ninja/) build system (also included with the depot_tools checkout). This is the default as of mid-September, 2015. Previously, the second option (platform-specific build files) was the default. Most PDFium developers use Ninja, as does our [continuous build system] (http://build.chromium.org/p/client.pdfium/).

  • On Windows: build_gyp\gyp_pdfium
  • For all other platforms: build_gyp/gyp_pdfium

The second option is to generate platform-specific build files, i.e. Makefiles on Linux, sln files on Windows, and xcodeproj files on Mac. To do so, set the GYP_GENERATORS environment variable appropriately (e.g. “make”, “msvs”, or “xcode”) before running the above command.

### Selecting build configuration

PDFium may be built either with or without JavaScript support, and with or without XFA forms support. Both of these features are enabled by default. Also note that the XFA feature requires JavaScript.

To build without XFA, set pdf_enable_xfa=0 before running gyp_pdfium. To build without JavaScript, set pdf_enable_v8=0 pdf_enable_xfa=0 before running gyp_pdfium. For example

GYP_DEFINES='pdf_enable_v8=0 pdf_enable_xfa=0' build_gyp/gyp_pdfium

gives the smallest possible build configuration.

Using goma (Googlers only)

If you would like to build using goma, pass use_goma=1 to gyp_pdfium. If you installed goma in a non-standard location, you will also need to set gomadir. e.g.

build_gyp/gyp_pdfium -D use_goma=1 -D gomadir=path/to/goma

Building the code

If you used Ninja, you can build the sample program by: ninja -C out/Debug pdfium_test You can build the entire product (which includes a few unit tests) by: ninja -C out/Debug.

If you're not using Ninja, then building is platform-specific.

  • On Linux: make pdfium_test
  • On Mac: open build_gyp/all.xcodeproj
  • On Windows: open build_gyp\all.sln

Running the sample program

The pdfium_test program supports reading, parsing, and rasterizing the pages of a .pdf file to .ppm or .png output image files (windows supports two other formats). For example: out/Debug/pdfium_test --ppm path/to/myfile.pdf. Note that this will write output images to path/to/myfile.pdf.<n>.ppm.

Testing

There are currently several test suites that can be run:

  • pdfium_unittests
  • pdfium_embeddertests
  • testing/tools/run_corpus_tests.py
  • testing/tools/run_javascript_tests.py
  • testing/tools/run_pixel_tests.py

It is possible the tests in the testing directory can fail due to font differences on the various platforms. These tests are reliable on the bots. If you see failures, it can be a good idea to run the tests on the tip-of-tree checkout to see if the same failures appear.

Waterfall

The current health of the source tree can be found at http://build.chromium.org/p/client.pdfium/console

Community

There are several mailing lists that are setup:

Note, the Reviews and Bugs lists are typically read-only.

Bugs

We will be using this bug tracker, but for security bugs, please use [Chromium's security bug template] (https://code.google.com/p/chromium/issues/entry?template=Security%20Bug) and add the “Cr-Internals-Plugins-PDF” label.

Contributing code

For contributing code, we will follow Chromium's process as much as possible. The main exceptions is:

  1. Code has to conform to the existing style and not Chromium/Google style.

Branches

Prior to 2016-02-04, there existed an actively developed origin/xfa branch. The origin/xfa branch is now an evolutionary dead-end. Everything you need to build either with or without the XFA feature is on origin/master.