summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-08-15Change a bunch of methods to take a const CFX_Matrix& param.chromium/3187Lei Zhang
Simplify some code along the way. Change-Id: I0022c8a82188192c63b9ac0bc87e9b9dbf983040 Reviewed-on: https://pdfium-review.googlesource.com/10852 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-15Remove CFX_ByteTextBuf.Henrique Nakashima
Bug: pdfium:731 Change-Id: I00d2097bca369aa4d1743716c4b2615e37a8444d Reviewed-on: https://pdfium-review.googlesource.com/10910 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-08-15Simplify CPWL_EditImpl_Undo.Lei Zhang
Change-Id: I15307562fcf8f0aebd6e14293b46a10106c4ace7 Reviewed-on: https://pdfium-review.googlesource.com/10858 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-15Add to navbar link to SafetyNet readme.Henrique Nakashima
Change-Id: I50eb3b4e94b72efe5978b02db137fab3eb6b21da Reviewed-on: https://pdfium-review.googlesource.com/11090 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-15Make errors in called processes more evident and easier to debug.Henrique Nakashima
Also trying to get unicode filenames right again. Change-Id: I501c94921b92b8a8cd6a10441aff1595fc6d878e Reviewed-on: https://pdfium-review.googlesource.com/10630 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-08-15Readme for SafetyNetHenrique Nakashima
Change-Id: I33ed6b7d8cb40fabd4aee0532a5e7273f630f9ea Reviewed-on: https://pdfium-review.googlesource.com/10930 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-08-15Remove default argument from CPWL_Wnd::InvalidateRect().Lei Zhang
Change-Id: I529925b10fa43d4c9c6c9d398265d2ae7eccf93d Reviewed-on: https://pdfium-review.googlesource.com/10853 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-15Add missing length check before getting element from stringRyan Harrison
BUG=chromium:754993 Change-Id: I9444ef83fb62784fef3bf8d294b2ab88b6574b5a Reviewed-on: https://pdfium-review.googlesource.com/11070 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-15Do some cleanup in CPWL_Edit.Lei Zhang
- Return early in some methods. - Make IsProceedtoOnChar() a static method. Change-Id: I56b92d920b2c0bbdff84cb3024d80e379f1c6a2a Reviewed-on: https://pdfium-review.googlesource.com/10857 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-15IFX_Edit_UndoItem implementations all take a valid CPWL_EditImpl*.Lei Zhang
So assert this is the case and remove all the pointer checks. Change-Id: I8fa273b03c75ec169d1b03ef6fb239defddf7d67 Reviewed-on: https://pdfium-review.googlesource.com/10855 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-15Remove CPWL_EditImpl_UndoItem.Lei Zhang
This base class does not do anything useful. Change-Id: Ib8c44c1778cdc992abb66177ea534bda0f1f15d3 Reviewed-on: https://pdfium-review.googlesource.com/10851 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-15Remove CPWL_EditImpl::EnableOprNotify().Lei Zhang
It's redundant with SetOprNotify(). Change-Id: Iee2741744017ea6bd1b9839fc6395197c560f1e7 Reviewed-on: https://pdfium-review.googlesource.com/10850 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-15Make GetChar & Clone const for IFX_CharIterRyan Harrison
BUG=pdfium:864 Change-Id: Iab03e1977c859f150452825650afed3520024cca Reviewed-on: https://pdfium-review.googlesource.com/11030 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-08-15Remove useless code.Artem Strygin
Change-Id: I2c5ea6a0c4487c0200229f4709214bda1f287de8 Reviewed-on: https://pdfium-review.googlesource.com/10990 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-15Hide the undo/redo record classes inside the engineDan Sinclair
This CL moves the implementation of the records which handle undo/redo in the text edit engine into an anonymous namespace in the engine. Change-Id: I299b9738b72e3eccbbec972fd3ea956c491859fa Reviewed-on: https://pdfium-review.googlesource.com/11010 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-15Add checks on length of string before accessing elements of stringRyan Harrison
BUG=chromium:754982 Change-Id: I41da6828c714d3ed12fe796ae7e228d87b168962 Reviewed-on: https://pdfium-review.googlesource.com/10890 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-15Remove GetAt from string classesRyan Harrison
This method duplicates the behaviour of the const [] operator and doesn't offer any additional safety. Folding them into one implementation. SetAt is retained, since implementing the non-const [] operator to replace SetAt has potential performance concerns. Specifically many non-obvious cases of reading an element using [] will cause a realloc & copy. BUG=pdfium:860 Change-Id: I3ef5e5e5a15376f040256b646eb0d90636e24b67 Reviewed-on: https://pdfium-review.googlesource.com/10870 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-15Remove default params from xfa/fde code.Dan Sinclair
This CL removes the default params from methods in xfa/fde. Change-Id: Ide93a51430c62753656b9e9c0bcd842d8179aa3c Reviewed-on: https://pdfium-review.googlesource.com/10952 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-15Remove CFDE_RenderDeviceDan Sinclair
This CL removes CFDE_RenderDevice. For most of the proxy'd calls we call the CFX_RenderDevice directly now. To set the clip rect an overload was added to accept a CFX_RectF and handle the casting to FX_RECT. The one needed method, DrawString, is move to a static on CFDE_TextOut. Change-Id: I95ea7e1fa1fd4702074b797c06423c9c9cb51db9 Reviewed-on: https://pdfium-review.googlesource.com/10951 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-14Refactoring of CPDF_DataAvail::GetObject.Artem Strygin
Use ReadValidator to request exact data on object read. Change-Id: I1d1863097fa2b037e1bb2e4e89b93d26c5d8e066 Reviewed-on: https://pdfium-review.googlesource.com/10510 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-14Add CPDF_ObjectWalker.Artem Strygin
It is allow us to walk on all non-null sub-objects in an object in depth, include itself, Change-Id: Ia23051073984411668112422b47cf7a4460aa078 Reviewed-on: https://pdfium-review.googlesource.com/8910 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-14Refactoring of CPDF_DataAvail::AreObjectsAvailable.chromium/3186Artem Strygin
Use ReadValidator to request exact data on object read. Change-Id: Ie6c3f452e119fa3514e77f1824473c33bb6b855a Reviewed-on: https://pdfium-review.googlesource.com/10491 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-14Merge CFDE_RenderContext into CFWL_EditDan Sinclair
This CL removes CFDE_RenderContext and moves the ::Render method to be ::RenderText on the CFWL_Edit class which was the only caller. Change-Id: Ic940a3f0d10cfce169f5e491de90803fc8a7940d Reviewed-on: https://pdfium-review.googlesource.com/10950 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-14Cleaning up the visual set iteratorDan Sinclair
This CL starts cleaning up the visual set iterator code. Change-Id: I643dc9edeeb0c7ff06ccd34a1977f811675413d8 Reviewed-on: https://pdfium-review.googlesource.com/10615 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-14Remove FDE_VISUALOBJ_CanvasDan Sinclair
No code sets the visual object type of Canvas. Remove. Change-Id: I213bf7bb93adbb08e949807f53a9e94579d59c1d Reviewed-on: https://pdfium-review.googlesource.com/10614 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-08-14Cleanup more fde definesDan Sinclair
This CL cleans up more defines and shuffles some fde code around to better locations. Change-Id: I6af0e991d9fa489ca45d1d0f9d041657beef3b7e Reviewed-on: https://pdfium-review.googlesource.com/10613 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-14Cleanup CFDE_TextOut methodsDan Sinclair
This CL removes unused CFDE_TextOut methods and merges some single use methods. Change-Id: Ie625ad737aeb1dc163b03f15f4774744062a9491 Reviewed-on: https://pdfium-review.googlesource.com/10570 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-08-14LCMS: upgrade to 2.8Nicolas Pena
This CL upgrades LCMS from version 2.6 to 2.8. All changes from LCMS original version 2.8 are stored in patch files: - Patch 0: memory management modifications to use PDFium methods. This was previously not in any patch, so the changes were manually applied. - Patches 1-5: new patch files corresponding to old changes that can be seen in the history, but did not previously have patch files. - Patches 6-25: previous patches (patch numbers shifted by 6). The one for from16-to-8-overflow.patch was deleted as it was already upstream. Some patches did not apply cleanly so their .patch files were modified. - Patch 26: as I just moved files directly, unsupported characters were moved in unchanged, so I had to fix all of them: e with tilde and other characters were replaced to allow compilation on Windows. - Patch 27: Went over the code and re-applied changes that included comments clearly indicating this was Foxit. These changes are all already seen in the initial PDFium commit. Change-Id: Ic1d84e54803ef9e6b280ef7619bbf0b757312fbf Reviewed-on: https://pdfium-review.googlesource.com/10590 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-14Cleanup FDE_TTO{STYLE|ALIGNMENT} defines.Dan Sinclair
This CL replaceds FDE_TTOSTYLE defines with a FDE_TextStyle struct which is used to set the needed flags. The FDE_TTOALIGNMENT defines are replaced with an enum class and unused members have been removed. Change-Id: Ib0e2818a82e7f1961de57f8d15703477f8235a03 Reviewed-on: https://pdfium-review.googlesource.com/10530 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-13Fix use_system_freetype builds for FreeType changeschromium/3185Bruce Dawson
FreeType has changed so it doesn't define ft_adobe_glyph_list once for every translation unit, which avoids wasting space in the data segment with duplicates. However Chromium builds with use_system_freetype true were depending on this behavior. This fixes these builds while avoiding duplicate arrays in other builds. This change makes no difference to pdfium itself, but is necessary when it is pulled in to Chromium. This is a follow-on to a previous change that fixed this issue for component builds. Change-Id: I3e68d7b778475e4a2781d77cd413e1bc22f82830 Reviewed-on: https://pdfium-review.googlesource.com/10830 Commit-Queue: Bruce Dawson <brucedawson@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-08-12Add a new public method to get the the origin of a character.Andrew Weintraub
Bug: Change-Id: I376f4af26791cd4ed04049ab179c2b39dd262725 Reviewed-on: https://pdfium-review.googlesource.com/10690 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-11Add 'testing' to a path that got missedRyan Harrison
This applies the proper configuration rules the end HTML generation. Bug: Change-Id: Ica159131e574fd805a1363db5b26a6581ecc0ac6 Reviewed-on: https://pdfium-review.googlesource.com/10810 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-08-11Remove potential out of bounds call to GetAt()Ryan Harrison
Since m_pos is passed into GetAt() on the underlying string in getCurrentChar(), the value of it needs to confirmed to be valid after decrementing. Some types were changed to reflect the values being stored. BUG=chromium:752480 Change-Id: Ib6d6f52326defd31785e70a17049a08b64dbe069 Reviewed-on: https://pdfium-review.googlesource.com/10652 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-11Roll zlib to 718f686Nicolas Pena
Bug: chromium:697481 Change-Id: I7ec0feb8f2012f3d17dfa55b2636f7331b400efe Reviewed-on: https://pdfium-review.googlesource.com/10790 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-08-11Add checks of index operations on string classesRyan Harrison
Specifically the index parameter passed in to GetAt(), SetAt() and operator[] are now being tested to be in bounds. BUG=chromium:752480, pdfium:828 Change-Id: I9e94d58c98a8eaaaae53cd0e3ffe2123ea17d8c4 Reviewed-on: https://pdfium-review.googlesource.com/10651 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-10Fix component builds for FreeType changeschromium/3184chromium/3183Bruce Dawson
FreeType has changed so it doesn't define ft_adobe_glyph_list once for every translation unit, which avoids wasting space in the data segment with duplicates. However Chromium component builds were depending on this behavior. This fixes component builds while avoiding duplicate arrays in non-component builds. This change makes no difference to pdfium at the moment but will probably be needed when it gains support for component builds. Change-Id: Ieed7c711bdbd3fa6eef19da60e906667dab8fb1b Reviewed-on: https://pdfium-review.googlesource.com/10670 Commit-Queue: Bruce Dawson <brucedawson@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-08-10Add safetynet_job.py to run safetynet_compare.py periodically.chromium/3182Henrique Nakashima
safetynet.job.py verifies if there were performance changes since its last run. Its state is comprised only of the last checkpoint, and is kept in a directory passed by argument. Results of runs are written to this directory as well. Change-Id: I94e0e176b10fd1d2b18d84f82427f63be107ae17 Reviewed-on: https://pdfium-review.googlesource.com/10370 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-08-10Fixing utf-8 safetynet_conclusions problem when writing the json.Henrique Nakashima
The previous fix (encoding on print) breaks when running compare.py directly. The real problem was in writing the json. Change-Id: Ie4cf926b5c6153731c1ae187ec6a7cffa74ce67b Reviewed-on: https://pdfium-review.googlesource.com/10653 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-08-10Move graphic state operations outside BT/ET operationsRyan Wiley
Bug: pdfium:857 Change-Id: Ic1fb12459cad79b45466df10a24fe6743377ae14 Reviewed-on: https://pdfium-review.googlesource.com/10612 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-08-10Remove unused FDE_TTOSTYLE_ flagsDan Sinclair
This CL removes the unused FDE_TTOSTYLE_ flags and their supporting code. Change-Id: Ib5ff1af77ceab5a526a845c1fc316a3742ab810a Reviewed-on: https://pdfium-review.googlesource.com/10455 Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-10Temporarily disable image mask individual renderingrbpotter
Bug: chromium:753700 Change-Id: I28589739f4258fa62f3f853aa91bc6cffd7d96ba Reviewed-on: https://pdfium-review.googlesource.com/10611 Commit-Queue: Rebekah Potter <rbpotter@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-08-10Remove CFDE_PathDan Sinclair
This CL removes CFDE_Path. There is only one method, AddLine which is required, the rest can be removed. That method is moved to CFX_PathData which is what CFDE_Path is appending to anyway. Change-Id: If50af8cf856a9f7379791fe1999174db5fd13e38 Reviewed-on: https://pdfium-review.googlesource.com/10454 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-10LCMS: rename folderNicolas Pena
Change-Id: I5f240cb0779648dc5427fecb5561086e7c0fb16a Reviewed-on: https://pdfium-review.googlesource.com/10650 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-08-10Rename CFX_UTF8Decoder::AppendChar to AppendCodePoint.Henrique Nakashima
Change-Id: Iec5523492eac3910f5ed105370e9092fd992b1b9 Reviewed-on: https://pdfium-review.googlesource.com/10471 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-10Rename DLLEXPORT AND STDCALLDan Sinclair
This CL renames DLLEXPORT to FPDF_EXPORT and STDCALL to FPDF_CALLCONV to be more PDFium specific. This is split off of https://pdfium-review.googlesource.com/c/8970 by Felix Kauselmann. Bug: pdfium:825 Change-Id: I0aea9d43f1714b1e10e935c4a7eea685a5ad8998 Reviewed-on: https://pdfium-review.googlesource.com/10610 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-10Extracting GetBooleanGnArg from coverage_report.pyHenrique Nakashima
Change-Id: I5475b37aad69361e2e7fae4ce69faf011e3b5c40 Reviewed-on: https://pdfium-review.googlesource.com/10030 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-08-10Revert "Add a build target and a proper export header for shared library ↵Henrique Nakashima
builds." This reverts commit 00334675c18a0203f313cceb670c970a77280f49. Reason for revert: Breaking the deps roller - https://chromium-review.googlesource.com/c/609307 Original change's description: > Add a build target and a proper export header for shared library builds. > > This CL adds support for Chromium's component build feature to pdfium. > > The export header stub in fpdfview.h is expanded to match Chromium's > export mechanisms and patterns (fixes pdfium:825). > > A component/shared library build can be triggered by adding > > is_component_build = true > > as a gn argument. Please note that setting this will also affect some > of pdfiums dependencies like v8, which will be build as components > too. > > Additionally, this CL provides a "pdf_source_set" template which > dynamically enables the use of "source_set" when building a complete > static library or a shared library to reduce build time. > > When testing this it is recommended to only build the pdfium target as > most of pdfiums test rely on non-public functions which aren't exported > by the shared library. > > Bug: pdfium:825,pdfium:826 > Change-Id: Icedc538ec535e11d1e53c4d5fabc8c064b275752 > Reviewed-on: https://pdfium-review.googlesource.com/8970 > Reviewed-by: dsinclair <dsinclair@chromium.org> > Commit-Queue: dsinclair <dsinclair@chromium.org> TBR=thestig@chromium.org,tsepez@chromium.org,brucedawson@chromium.org,dsinclair@google.com,dsinclair@chromium.org,licorn@gmail.com Change-Id: Ib02af2298932481293f50d362ae87bfedf284821 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: pdfium:825, pdfium:826 Reviewed-on: https://pdfium-review.googlesource.com/10550 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-08-10Make CFX_ByteString(ostringstream) const.Henrique Nakashima
Change-Id: I782379cc7f93b93ed34a5d0a39ee2f198c650465 Reviewed-on: https://pdfium-review.googlesource.com/10430 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-08-10Remove default params in CFDE_RenderDeviceDan Sinclair
This CL removes the two default nullptr values in CFDE_RenderDevice. Change-Id: I32e7cf5f45fcf1fbddd0c9070024647ac06203c5 Reviewed-on: https://pdfium-review.googlesource.com/10453 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-09Remove CFX_ByteTextBuf from CFX_UTF8EncoderHenrique Nakashima
Also making CFX_ByteString(ostringstream) const. Bug: pdfium:731 Change-Id: Iaee610248a5634e8731eaf05944c32d52c4e8015 Reviewed-on: https://pdfium-review.googlesource.com/10151 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>