diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-12 19:07:03 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-12 19:07:03 +0000 |
commit | 35d4587eceb07cad6b38675b0ebb4b73eca3a62b (patch) | |
tree | 19c84b514dad085d75c76977f1ee9da123748441 /core | |
parent | 8460088891f98a9138718fc9c89bf309eb88580f (diff) | |
download | pdfium-35d4587eceb07cad6b38675b0ebb4b73eca3a62b.tar.xz |
Remove more unnecessary includes and do IWYU as needed.
Also move some implementations out of headers.
Change-Id: I321fc26970c440d874b135bd28e8bc8156b9afee
Reviewed-on: https://pdfium-review.googlesource.com/c/43890
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core')
38 files changed, 22 insertions, 25 deletions
diff --git a/core/fpdfapi/edit/cpdf_creator.cpp b/core/fpdfapi/edit/cpdf_creator.cpp index be63960199..c4bc698acc 100644 --- a/core/fpdfapi/edit/cpdf_creator.cpp +++ b/core/fpdfapi/edit/cpdf_creator.cpp @@ -23,7 +23,7 @@ #include "core/fxcrt/fx_extension.h" #include "core/fxcrt/fx_random.h" #include "third_party/base/ptr_util.h" -#include "third_party/base/span.h" +#include "third_party/base/stl_util.h" namespace { diff --git a/core/fpdfapi/font/cpdf_cmapmanager.cpp b/core/fpdfapi/font/cpdf_cmapmanager.cpp index 8eebd89b30..bbf77f59b1 100644 --- a/core/fpdfapi/font/cpdf_cmapmanager.cpp +++ b/core/fpdfapi/font/cpdf_cmapmanager.cpp @@ -11,7 +11,6 @@ #include "core/fpdfapi/font/cpdf_cid2unicodemap.h" #include "core/fpdfapi/font/cpdf_cmap.h" #include "third_party/base/ptr_util.h" -#include "third_party/base/stl_util.h" CPDF_CMapManager::CPDF_CMapManager() {} diff --git a/core/fpdfapi/font/cpdf_type3font.cpp b/core/fpdfapi/font/cpdf_type3font.cpp index 1d70c8bb48..df56e5f192 100644 --- a/core/fpdfapi/font/cpdf_type3font.cpp +++ b/core/fpdfapi/font/cpdf_type3font.cpp @@ -16,7 +16,6 @@ #include "core/fpdfapi/parser/cpdf_stream.h" #include "core/fxcrt/fx_system.h" #include "third_party/base/ptr_util.h" -#include "third_party/base/stl_util.h" namespace { diff --git a/core/fpdfapi/page/cpdf_expintfunc.cpp b/core/fpdfapi/page/cpdf_expintfunc.cpp index e04ce1282c..68eeea87fb 100644 --- a/core/fpdfapi/page/cpdf_expintfunc.cpp +++ b/core/fpdfapi/page/cpdf_expintfunc.cpp @@ -10,6 +10,7 @@ #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_number.h" #include "core/fxcrt/fx_memory.h" +#include "third_party/base/stl_util.h" CPDF_ExpIntFunc::CPDF_ExpIntFunc() : CPDF_Function(Type::kType2ExpotentialInterpolation) {} diff --git a/core/fpdfapi/page/cpdf_function.cpp b/core/fpdfapi/page/cpdf_function.cpp index fc8eb46d73..066af65440 100644 --- a/core/fpdfapi/page/cpdf_function.cpp +++ b/core/fpdfapi/page/cpdf_function.cpp @@ -16,6 +16,7 @@ #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_stream.h" #include "third_party/base/ptr_util.h" +#include "third_party/base/stl_util.h" // static std::unique_ptr<CPDF_Function> CPDF_Function::Load( diff --git a/core/fpdfapi/page/cpdf_pageobjectholder.cpp b/core/fpdfapi/page/cpdf_pageobjectholder.cpp index c6f310f77b..c51ab172f7 100644 --- a/core/fpdfapi/page/cpdf_pageobjectholder.cpp +++ b/core/fpdfapi/page/cpdf_pageobjectholder.cpp @@ -16,6 +16,7 @@ #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_document.h" #include "core/fxcrt/fx_extension.h" +#include "third_party/base/stl_util.h" bool GraphicsData::operator<(const GraphicsData& other) const { if (!FXSYS_SafeEQ(fillAlpha, other.fillAlpha)) diff --git a/core/fpdfapi/page/cpdf_sampledfunc.cpp b/core/fpdfapi/page/cpdf_sampledfunc.cpp index d898daadc5..7c1fea150f 100644 --- a/core/fpdfapi/page/cpdf_sampledfunc.cpp +++ b/core/fpdfapi/page/cpdf_sampledfunc.cpp @@ -11,6 +11,7 @@ #include "core/fxcrt/cfx_bitstream.h" #include "core/fxcrt/cfx_fixedbufgrow.h" #include "core/fxcrt/fx_safe_types.h" +#include "third_party/base/stl_util.h" namespace { diff --git a/core/fpdfapi/page/cpdf_streamparser_unittest.cpp b/core/fpdfapi/page/cpdf_streamparser_unittest.cpp index d83fedcb7d..64bb57c78f 100644 --- a/core/fpdfapi/page/cpdf_streamparser_unittest.cpp +++ b/core/fpdfapi/page/cpdf_streamparser_unittest.cpp @@ -4,7 +4,6 @@ #include "core/fpdfapi/page/cpdf_streamparser.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/base/span.h" TEST(cpdf_streamparser, ReadHexString) { { diff --git a/core/fpdfapi/page/cpdf_textobject.cpp b/core/fpdfapi/page/cpdf_textobject.cpp index 2b866baa25..13e727963e 100644 --- a/core/fpdfapi/page/cpdf_textobject.cpp +++ b/core/fpdfapi/page/cpdf_textobject.cpp @@ -12,7 +12,6 @@ #include "core/fpdfapi/font/cpdf_cidfont.h" #include "core/fpdfapi/font/cpdf_font.h" #include "third_party/base/ptr_util.h" -#include "third_party/base/stl_util.h" CPDF_TextObjectItem::CPDF_TextObjectItem() : m_CharCode(0) {} diff --git a/core/fpdfapi/parser/cpdf_cross_ref_table.cpp b/core/fpdfapi/parser/cpdf_cross_ref_table.cpp index 77c0e8136c..4f7c482c9f 100644 --- a/core/fpdfapi/parser/cpdf_cross_ref_table.cpp +++ b/core/fpdfapi/parser/cpdf_cross_ref_table.cpp @@ -8,6 +8,7 @@ #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_parser.h" +#include "third_party/base/stl_util.h" // static std::unique_ptr<CPDF_CrossRefTable> CPDF_CrossRefTable::MergeUp( diff --git a/core/fpdfapi/parser/cpdf_object.cpp b/core/fpdfapi/parser/cpdf_object.cpp index a32a5c2eed..3fdb2351bf 100644 --- a/core/fpdfapi/parser/cpdf_object.cpp +++ b/core/fpdfapi/parser/cpdf_object.cpp @@ -16,7 +16,6 @@ #include "core/fxcrt/fx_string.h" #include "third_party/base/logging.h" #include "third_party/base/ptr_util.h" -#include "third_party/base/stl_util.h" CPDF_Object::~CPDF_Object() {} diff --git a/core/fpdfapi/render/cpdf_dibbase.cpp b/core/fpdfapi/render/cpdf_dibbase.cpp index b95c14b59f..5e48c68bd5 100644 --- a/core/fpdfapi/render/cpdf_dibbase.cpp +++ b/core/fpdfapi/render/cpdf_dibbase.cpp @@ -32,6 +32,7 @@ #include "core/fxcrt/fx_safe_types.h" #include "core/fxge/dib/cfx_dibitmap.h" #include "third_party/base/ptr_util.h" +#include "third_party/base/stl_util.h" namespace { diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp index 842272bc02..982f69acf9 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.cpp +++ b/core/fpdfapi/render/cpdf_renderstatus.cpp @@ -61,6 +61,7 @@ #include "third_party/base/logging.h" #include "third_party/base/numerics/safe_math.h" #include "third_party/base/ptr_util.h" +#include "third_party/base/stl_util.h" #ifdef _SKIA_SUPPORT_ #include "core/fxge/skia/fx_skia_device.h" diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp index a076b150a8..4cb9496af9 100644 --- a/core/fpdfdoc/cpdf_formfield.cpp +++ b/core/fpdfdoc/cpdf_formfield.cpp @@ -250,6 +250,10 @@ bool CPDF_FormField::ResetField(NotificationOption notify) { return true; } +int CPDF_FormField::CountControls() const { + return pdfium::CollectionSize<int>(m_ControlList); +} + int CPDF_FormField::GetControlIndex(const CPDF_FormControl* pControl) const { if (!pControl) return -1; diff --git a/core/fpdfdoc/cpdf_formfield.h b/core/fpdfdoc/cpdf_formfield.h index a718cec29c..ce12169a71 100644 --- a/core/fpdfdoc/cpdf_formfield.h +++ b/core/fpdfdoc/cpdf_formfield.h @@ -15,7 +15,6 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" #include "core/fxcrt/unowned_ptr.h" -#include "third_party/base/stl_util.h" class CPDF_Dictionary; class CPDF_Font; @@ -110,9 +109,7 @@ class CPDF_FormField { bool ResetField(NotificationOption notify); - int CountControls() const { - return pdfium::CollectionSize<int>(m_ControlList); - } + int CountControls() const; CPDF_FormControl* GetControl(int index) const { return m_ControlList[index].Get(); diff --git a/core/fxcodec/bmp/cfx_bmpcontext.h b/core/fxcodec/bmp/cfx_bmpcontext.h index ddb179b0b3..66e3f54b28 100644 --- a/core/fxcodec/bmp/cfx_bmpcontext.h +++ b/core/fxcodec/bmp/cfx_bmpcontext.h @@ -9,6 +9,7 @@ #include "core/fxcodec/bmp/cfx_bmpdecompressor.h" #include "core/fxcodec/bmp/fx_bmp.h" +#include "core/fxcrt/unowned_ptr.h" class CFX_BmpContext final : public CodecModuleIface::Context { public: diff --git a/core/fxcodec/bmp/cfx_bmpdecompressor.h b/core/fxcodec/bmp/cfx_bmpdecompressor.h index ebab9ea223..0af4da4b08 100644 --- a/core/fxcodec/bmp/cfx_bmpdecompressor.h +++ b/core/fxcodec/bmp/cfx_bmpdecompressor.h @@ -12,7 +12,6 @@ #include <vector> #include "core/fxcodec/bmp/fx_bmp.h" -#include "third_party/base/span.h" class CFX_BmpContext; class CFX_CodecMemory; diff --git a/core/fxcodec/codec/ccodec_iccmodule.cpp b/core/fxcodec/codec/ccodec_iccmodule.cpp index a15e72d5fd..ae88dec708 100644 --- a/core/fxcodec/codec/ccodec_iccmodule.cpp +++ b/core/fxcodec/codec/ccodec_iccmodule.cpp @@ -12,6 +12,7 @@ #include "core/fxcodec/codec/codec_int.h" #include "third_party/base/ptr_util.h" +#include "third_party/base/stl_util.h" namespace { diff --git a/core/fxcodec/codec/ccodec_jpxmodule.cpp b/core/fxcodec/codec/ccodec_jpxmodule.cpp index 28221be340..aaaaf81d24 100644 --- a/core/fxcodec/codec/ccodec_jpxmodule.cpp +++ b/core/fxcodec/codec/ccodec_jpxmodule.cpp @@ -17,6 +17,7 @@ #include "core/fxcrt/fx_memory.h" #include "core/fxcrt/fx_safe_types.h" #include "third_party/base/ptr_util.h" +#include "third_party/base/stl_util.h" #include "third_party/libopenjpeg20/openjpeg.h" #include "third_party/libopenjpeg20/opj_malloc.h" diff --git a/core/fxcodec/gif/cfx_gifcontext.h b/core/fxcodec/gif/cfx_gifcontext.h index 5febb5940b..2bb2adcf6a 100644 --- a/core/fxcodec/gif/cfx_gifcontext.h +++ b/core/fxcodec/gif/cfx_gifcontext.h @@ -15,7 +15,6 @@ #include "core/fxcodec/gif/cfx_lzwdecompressor.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/unowned_ptr.h" -#include "third_party/base/span.h" class CFX_CodecMemory; diff --git a/core/fxcodec/gif/cfx_lzwdecompressor.cpp b/core/fxcodec/gif/cfx_lzwdecompressor.cpp index 5708d11cbf..14e34f595d 100644 --- a/core/fxcodec/gif/cfx_lzwdecompressor.cpp +++ b/core/fxcodec/gif/cfx_lzwdecompressor.cpp @@ -12,7 +12,6 @@ #include <utility> #include "third_party/base/numerics/safe_math.h" -#include "third_party/base/stl_util.h" std::unique_ptr<CFX_LZWDecompressor> CFX_LZWDecompressor::Create( uint8_t color_exp, diff --git a/core/fxcodec/jbig2/JBig2_Image.cpp b/core/fxcodec/jbig2/JBig2_Image.cpp index a2d9f486e1..5054ab5867 100644 --- a/core/fxcodec/jbig2/JBig2_Image.cpp +++ b/core/fxcodec/jbig2/JBig2_Image.cpp @@ -16,7 +16,6 @@ #include "core/fxcrt/fx_memory.h" #include "core/fxcrt/fx_safe_types.h" #include "third_party/base/ptr_util.h" -#include "third_party/base/stl_util.h" #define JBIG2_GETDWORD(buf) \ ((static_cast<uint32_t>((buf)[0]) << 24) | \ diff --git a/core/fxcrt/css/cfx_csscomputedstyle.cpp b/core/fxcrt/css/cfx_csscomputedstyle.cpp index f06092c7f9..eff708122b 100644 --- a/core/fxcrt/css/cfx_csscomputedstyle.cpp +++ b/core/fxcrt/css/cfx_csscomputedstyle.cpp @@ -8,7 +8,6 @@ #include "core/fxcrt/css/cfx_cssstringvalue.h" #include "core/fxcrt/css/cfx_cssvaluelist.h" -#include "third_party/base/stl_util.h" CFX_CSSComputedStyle::CFX_CSSComputedStyle() {} diff --git a/core/fxcrt/fx_arabic.cpp b/core/fxcrt/fx_arabic.cpp index 0d6f0395a6..6d049bd427 100644 --- a/core/fxcrt/fx_arabic.cpp +++ b/core/fxcrt/fx_arabic.cpp @@ -11,7 +11,6 @@ #include "core/fxcrt/fx_memory.h" #include "core/fxcrt/fx_unicode.h" -#include "third_party/base/stl_util.h" namespace { diff --git a/core/fxcrt/fx_bidi.cpp b/core/fxcrt/fx_bidi.cpp index 672e2d9dae..29eb6ead55 100644 --- a/core/fxcrt/fx_bidi.cpp +++ b/core/fxcrt/fx_bidi.cpp @@ -9,6 +9,7 @@ #include <algorithm> #include "core/fxcrt/fx_unicode.h" +#include "third_party/base/stl_util.h" #ifdef PDF_ENABLE_XFA #include "core/fxcrt/fx_extension.h" diff --git a/core/fxcrt/fx_extension.h b/core/fxcrt/fx_extension.h index d1ea795fa8..c1cd188c81 100644 --- a/core/fxcrt/fx_extension.h +++ b/core/fxcrt/fx_extension.h @@ -13,7 +13,6 @@ #include <memory> #include "core/fxcrt/fx_string.h" -#include "third_party/base/span.h" #if defined(USE_SYSTEM_ICUUC) #include <unicode/uchar.h> diff --git a/core/fxcrt/pdfium_span_unittest.cpp b/core/fxcrt/pdfium_span_unittest.cpp index 177bc4097e..6778bbb145 100644 --- a/core/fxcrt/pdfium_span_unittest.cpp +++ b/core/fxcrt/pdfium_span_unittest.cpp @@ -4,7 +4,6 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/base/span.h" -#include "third_party/base/stl_util.h" // Tests PDFium-modifications to base::span. The name of this file is // chosen to avoid collisions with base's span_unittest.cc diff --git a/core/fxcrt/widestring_unittest.cpp b/core/fxcrt/widestring_unittest.cpp index 160dc929db..0d20d71200 100644 --- a/core/fxcrt/widestring_unittest.cpp +++ b/core/fxcrt/widestring_unittest.cpp @@ -10,6 +10,8 @@ #include "core/fxcrt/fx_string.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/base/span.h" +#include "third_party/base/stl_util.h" namespace fxcrt { diff --git a/core/fxcrt/xml/cfx_xmlelement.cpp b/core/fxcrt/xml/cfx_xmlelement.cpp index f5031624e8..434b474df7 100644 --- a/core/fxcrt/xml/cfx_xmlelement.cpp +++ b/core/fxcrt/xml/cfx_xmlelement.cpp @@ -13,7 +13,6 @@ #include "core/fxcrt/xml/cfx_xmlchardata.h" #include "core/fxcrt/xml/cfx_xmldocument.h" #include "core/fxcrt/xml/cfx_xmltext.h" -#include "third_party/base/stl_util.h" CFX_XMLElement::CFX_XMLElement(const WideString& wsTag) : CFX_XMLNode(), name_(wsTag) { diff --git a/core/fxcrt/xml/cfx_xmlinstruction.cpp b/core/fxcrt/xml/cfx_xmlinstruction.cpp index 9c00e38528..e0af2d1c95 100644 --- a/core/fxcrt/xml/cfx_xmlinstruction.cpp +++ b/core/fxcrt/xml/cfx_xmlinstruction.cpp @@ -11,7 +11,6 @@ #include "core/fxcrt/fx_codepage.h" #include "core/fxcrt/fx_extension.h" #include "core/fxcrt/xml/cfx_xmldocument.h" -#include "third_party/base/stl_util.h" CFX_XMLInstruction::CFX_XMLInstruction(const WideString& wsTarget) : CFX_XMLNode(), name_(wsTarget) {} diff --git a/core/fxcrt/xml/cfx_xmlnode.cpp b/core/fxcrt/xml/cfx_xmlnode.cpp index c8fea23bda..59eb3f77ce 100644 --- a/core/fxcrt/xml/cfx_xmlnode.cpp +++ b/core/fxcrt/xml/cfx_xmlnode.cpp @@ -13,7 +13,6 @@ #include "core/fxcrt/xml/cfx_xmlelement.h" #include "core/fxcrt/xml/cfx_xmlinstruction.h" #include "core/fxcrt/xml/cfx_xmltext.h" -#include "third_party/base/stl_util.h" CFX_XMLNode::CFX_XMLNode() = default; diff --git a/core/fxge/dib/cfx_bitmapstorer.h b/core/fxge/dib/cfx_bitmapstorer.h index 12b0537157..86f7f8719f 100644 --- a/core/fxge/dib/cfx_bitmapstorer.h +++ b/core/fxge/dib/cfx_bitmapstorer.h @@ -11,7 +11,6 @@ #include "core/fxcrt/retain_ptr.h" #include "core/fxge/dib/cfx_dibitmap.h" #include "core/fxge/dib/scanlinecomposer_iface.h" -#include "third_party/base/stl_util.h" class CFX_BitmapStorer final : public ScanlineComposerIface { public: diff --git a/core/fxge/dib/cfx_dibitmap.h b/core/fxge/dib/cfx_dibitmap.h index dc6720ed96..63aed7ffc6 100644 --- a/core/fxge/dib/cfx_dibitmap.h +++ b/core/fxge/dib/cfx_dibitmap.h @@ -11,7 +11,6 @@ #include "core/fxcrt/maybe_owned.h" #include "core/fxcrt/retain_ptr.h" #include "core/fxge/dib/cfx_dibbase.h" -#include "third_party/base/stl_util.h" class CFX_DIBitmap : public CFX_DIBBase { public: diff --git a/core/fxge/dib/cfx_imagerenderer.h b/core/fxge/dib/cfx_imagerenderer.h index 5232933f49..10dca178bf 100644 --- a/core/fxge/dib/cfx_imagerenderer.h +++ b/core/fxge/dib/cfx_imagerenderer.h @@ -16,7 +16,6 @@ #include "core/fxge/dib/cfx_dibbase.h" #include "core/fxge/dib/cfx_dibitmap.h" #include "core/fxge/fx_dib.h" -#include "third_party/base/stl_util.h" class CFX_ImageTransformer; class CFX_ImageStretcher; diff --git a/core/fxge/dib/cfx_imagestretcher.cpp b/core/fxge/dib/cfx_imagestretcher.cpp index ea4dcaea49..53c47c996e 100644 --- a/core/fxge/dib/cfx_imagestretcher.cpp +++ b/core/fxge/dib/cfx_imagestretcher.cpp @@ -14,6 +14,7 @@ #include "core/fxge/dib/cstretchengine.h" #include "core/fxge/fx_dib.h" #include "third_party/base/ptr_util.h" +#include "third_party/base/stl_util.h" namespace { diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp index 66446ce52c..9edcc5d1fa 100644 --- a/core/fxge/dib/cfx_imagetransformer.cpp +++ b/core/fxge/dib/cfx_imagetransformer.cpp @@ -15,6 +15,7 @@ #include "third_party/base/compiler_specific.h" #include "third_party/base/numerics/safe_conversions.h" #include "third_party/base/ptr_util.h" +#include "third_party/base/stl_util.h" namespace { diff --git a/core/fxge/dib/cstretchengine.cpp b/core/fxge/dib/cstretchengine.cpp index 41a843de66..969ab03667 100644 --- a/core/fxge/dib/cstretchengine.cpp +++ b/core/fxge/dib/cstretchengine.cpp @@ -14,6 +14,7 @@ #include "core/fxge/dib/cfx_dibitmap.h" #include "core/fxge/dib/scanlinecomposer_iface.h" #include "core/fxge/fx_dib.h" +#include "third_party/base/stl_util.h" namespace { diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp index 526eea58f3..fec656ef93 100644 --- a/core/fxge/win32/fx_win32_device.cpp +++ b/core/fxge/win32/fx_win32_device.cpp @@ -27,7 +27,6 @@ #include "core/fxge/win32/cfx_windowsdib.h" #include "core/fxge/win32/win32_int.h" #include "third_party/base/ptr_util.h" -#include "third_party/base/stl_util.h" #ifndef _SKIA_SUPPORT_ #include "core/fxge/agg/fx_agg_driver.h" |