Remove useless forward declarations in headers. Found by printing out _CheckUselessForwardDeclarations() variables while running presubmits on a CL with dummy changes to all first party headers. Then fix the build by adding a missing forward declaration. Change-Id: I135285ff7434d5f752eda8824d552ce7501d2d09 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/82152 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/edit/cpdf_pagecontentmanager.h b/core/fpdfapi/edit/cpdf_pagecontentmanager.h index b4e03b2..1552957 100644 --- a/core/fpdfapi/edit/cpdf_pagecontentmanager.h +++ b/core/fpdfapi/edit/cpdf_pagecontentmanager.h
@@ -13,7 +13,6 @@ class CPDF_Array; class CPDF_Document; -class CPDF_Object; class CPDF_Stream; class CPDF_PageObjectHolder;
diff --git a/core/fpdfapi/font/cpdf_cidfont.h b/core/fpdfapi/font/cpdf_cidfont.h index 5a51e40..11f6d81 100644 --- a/core/fpdfapi/font/cpdf_cidfont.h +++ b/core/fpdfapi/font/cpdf_cidfont.h
@@ -28,7 +28,6 @@ }; class CFX_CTTGSUBTable; -class CPDF_Array; class CPDF_CID2UnicodeMap; class CPDF_CMap; class CPDF_StreamAcc;
diff --git a/core/fpdfapi/font/cpdf_font.h b/core/fpdfapi/font/cpdf_font.h index 5390b36..a70ffe4 100644 --- a/core/fpdfapi/font/cpdf_font.h +++ b/core/fpdfapi/font/cpdf_font.h
@@ -25,7 +25,6 @@ class CFX_SubstFont; class CPDF_CIDFont; class CPDF_Document; -class CPDF_Object; class CPDF_TrueTypeFont; class CPDF_Type1Font; class CPDF_Type3Char;
diff --git a/core/fpdfapi/font/cpdf_type3font.h b/core/fpdfapi/font/cpdf_type3font.h index 40b673c..bcbb704 100644 --- a/core/fpdfapi/font/cpdf_type3font.h +++ b/core/fpdfapi/font/cpdf_type3font.h
@@ -18,7 +18,6 @@ class CPDF_Dictionary; class CPDF_Document; -class CPDF_Stream; class CPDF_Type3Char; class CPDF_Type3Font final : public CPDF_SimpleFont {
diff --git a/core/fpdfapi/page/cpdf_form.h b/core/fpdfapi/page/cpdf_form.h index 6f571a2..0731713 100644 --- a/core/fpdfapi/page/cpdf_form.h +++ b/core/fpdfapi/page/cpdf_form.h
@@ -18,7 +18,6 @@ class CPDF_AllStates; class CPDF_Dictionary; class CPDF_Document; -class CPDF_ImageObject; class CPDF_Stream; class CPDF_Type3Char;
diff --git a/core/fpdfapi/page/cpdf_pageobjectholder.h b/core/fpdfapi/page/cpdf_pageobjectholder.h index 29ab76d..3eb976e 100644 --- a/core/fpdfapi/page/cpdf_pageobjectholder.h +++ b/core/fpdfapi/page/cpdf_pageobjectholder.h
@@ -26,7 +26,6 @@ class CPDF_ContentParser; class CPDF_Document; class CPDF_PageObject; -class CPDF_Stream; class PauseIndicatorIface; // These structs are used to keep track of resources that have already been
diff --git a/core/fpdfapi/parser/cpdf_linearized_header.h b/core/fpdfapi/parser/cpdf_linearized_header.h index 44e0422..546e5a9 100644 --- a/core/fpdfapi/parser/cpdf_linearized_header.h +++ b/core/fpdfapi/parser/cpdf_linearized_header.h
@@ -12,7 +12,6 @@ #include "core/fxcrt/fx_system.h" class CPDF_Dictionary; -class CPDF_Object; class CPDF_SyntaxParser; class CPDF_LinearizedHeader {
diff --git a/core/fpdfapi/parser/cpdf_object.h b/core/fpdfapi/parser/cpdf_object.h index 06f8f64..a6b9136 100644 --- a/core/fpdfapi/parser/cpdf_object.h +++ b/core/fpdfapi/parser/cpdf_object.h
@@ -21,7 +21,6 @@ class CPDF_Encryptor; class CPDF_IndirectObjectHolder; class CPDF_Name; -class CPDF_Null; class CPDF_Number; class CPDF_Reference; class CPDF_Stream;
diff --git a/core/fpdfapi/parser/cpdf_object_avail.h b/core/fpdfapi/parser/cpdf_object_avail.h index 901fb17..a1dcc27 100644 --- a/core/fpdfapi/parser/cpdf_object_avail.h +++ b/core/fpdfapi/parser/cpdf_object_avail.h
@@ -13,7 +13,6 @@ #include "core/fxcrt/unowned_ptr.h" class CPDF_Object; -class CPDF_Reference; class CPDF_IndirectObjectHolder; class CPDF_ReadValidator;
diff --git a/core/fpdfapi/parser/cpdf_parser.h b/core/fpdfapi/parser/cpdf_parser.h index c9b590e..a2939cd 100644 --- a/core/fpdfapi/parser/cpdf_parser.h +++ b/core/fpdfapi/parser/cpdf_parser.h
@@ -21,7 +21,6 @@ #include "core/fxcrt/unowned_ptr.h" class CPDF_Array; -class CPDF_CryptoHandler; class CPDF_Dictionary; class CPDF_LinearizedHeader; class CPDF_Object;
diff --git a/core/fpdfapi/parser/cpdf_security_handler.h b/core/fpdfapi/parser/cpdf_security_handler.h index 280d92f..79f5ced 100644 --- a/core/fpdfapi/parser/cpdf_security_handler.h +++ b/core/fpdfapi/parser/cpdf_security_handler.h
@@ -16,7 +16,6 @@ class CPDF_Array; class CPDF_Dictionary; -class CPDF_Parser; class CPDF_SecurityHandler : public Retainable { public:
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.h b/core/fpdfapi/parser/cpdf_syntax_parser.h index d1778fd..e7319f9 100644 --- a/core/fpdfapi/parser/cpdf_syntax_parser.h +++ b/core/fpdfapi/parser/cpdf_syntax_parser.h
@@ -18,7 +18,6 @@ #include "core/fxcrt/unowned_ptr.h" #include "core/fxcrt/weak_ptr.h" -class CPDF_CryptoHandler; class CPDF_Dictionary; class CPDF_IndirectObjectHolder; class CPDF_Object;
diff --git a/core/fpdfapi/render/cpdf_imagerenderer.h b/core/fpdfapi/render/cpdf_imagerenderer.h index 4c3032f..d51e5f3 100644 --- a/core/fpdfapi/render/cpdf_imagerenderer.h +++ b/core/fpdfapi/render/cpdf_imagerenderer.h
@@ -17,12 +17,10 @@ #include "core/fxge/dib/fx_dib.h" #include "third_party/base/optional.h" -class CFX_DIBitmap; class CFX_DIBBase; class CFX_DefaultRenderDevice; class CFX_ImageTransformer; class CPDF_ImageObject; -class CPDF_PageObject; class CPDF_Pattern; class CPDF_RenderOptions; class CPDF_RenderStatus;
diff --git a/core/fpdfapi/render/cpdf_renderstatus.h b/core/fpdfapi/render/cpdf_renderstatus.h index 0d273d0..d455ca6 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.h +++ b/core/fpdfapi/render/cpdf_renderstatus.h
@@ -38,7 +38,6 @@ class CPDF_ShadingPattern; class CPDF_TilingPattern; class CPDF_TransferFunc; -class CPDF_Type3Cache; class CPDF_Type3Char; class CPDF_Type3Font; class PauseIndicatorIface;
diff --git a/core/fpdfdoc/cpdf_apsettings.h b/core/fpdfdoc/cpdf_apsettings.h index e141366..80b6107 100644 --- a/core/fpdfdoc/cpdf_apsettings.h +++ b/core/fpdfdoc/cpdf_apsettings.h
@@ -15,7 +15,6 @@ #include "core/fxge/dib/fx_dib.h" class CPDF_Dictionary; -class CPDF_FormControl; class CPDF_Stream; // Corresponds to PDF spec section 12.5.6.19 (Widget annotation TP dictionary).
diff --git a/core/fpdfdoc/cpdf_formcontrol.h b/core/fpdfdoc/cpdf_formcontrol.h index fbdfed1..c05acbb 100644 --- a/core/fpdfdoc/cpdf_formcontrol.h +++ b/core/fpdfdoc/cpdf_formcontrol.h
@@ -29,8 +29,6 @@ class CPDF_Font; class CPDF_FormField; class CPDF_InteractiveForm; -class CPDF_OCContext; -class CPDF_RenderOptions; class CPDF_Stream; class CPDF_FormControl {
diff --git a/core/fpdfdoc/cpdf_interactiveform.h b/core/fpdfdoc/cpdf_interactiveform.h index 9bac8aa..1b27dfe 100644 --- a/core/fpdfdoc/cpdf_interactiveform.h +++ b/core/fpdfdoc/cpdf_interactiveform.h
@@ -25,7 +25,6 @@ class CPDF_Dictionary; class CPDF_Font; class CPDF_FormControl; -class CPDF_Object; class CPDF_Page; class CPDF_InteractiveForm {
diff --git a/core/fpdfdoc/cpvt_section.h b/core/fpdfdoc/cpvt_section.h index 407e47b..bd8ae00 100644 --- a/core/fpdfdoc/cpvt_section.h +++ b/core/fpdfdoc/cpvt_section.h
@@ -20,7 +20,6 @@ class CPVT_VariableText; struct CPVT_LineInfo; -struct CPVT_WordLine; struct CPVT_WordPlace; class CPVT_Section final {
diff --git a/core/fpdftext/cpdf_textpage.h b/core/fpdftext/cpdf_textpage.h index a03f3fb..ddc9413 100644 --- a/core/fpdftext/cpdf_textpage.h +++ b/core/fpdftext/cpdf_textpage.h
@@ -19,7 +19,6 @@ #include "core/fxcrt/unowned_ptr.h" #include "third_party/base/optional.h" -class CPDF_Font; class CPDF_FormObject; class CPDF_Page; class CPDF_TextObject;
diff --git a/core/fxcodec/jbig2/JBig2_Context.h b/core/fxcodec/jbig2/JBig2_Context.h index 6bc337d..11d104e 100644 --- a/core/fxcodec/jbig2/JBig2_Context.h +++ b/core/fxcodec/jbig2/JBig2_Context.h
@@ -21,7 +21,6 @@ class CJBig2_ArithDecoder; class CJBig2_GRDProc; -class CPDF_StreamAcc; class PauseIndicatorIface; // Cache is keyed by the ObjNum of a stream and an index within the stream.
diff --git a/core/fxcodec/jbig2/jbig2_decoder.h b/core/fxcodec/jbig2/jbig2_decoder.h index 91c78db..9b27417 100644 --- a/core/fxcodec/jbig2/jbig2_decoder.h +++ b/core/fxcodec/jbig2/jbig2_decoder.h
@@ -13,7 +13,6 @@ #include "third_party/base/span.h" class CJBig2_Context; -class CJBig2_Image; class JBig2_DocumentContext; class PauseIndicatorIface;
diff --git a/core/fxcrt/xml/cfx_xmlparser.h b/core/fxcrt/xml/cfx_xmlparser.h index ef171c6..7e1cba7 100644 --- a/core/fxcrt/xml/cfx_xmlparser.h +++ b/core/fxcrt/xml/cfx_xmlparser.h
@@ -16,7 +16,6 @@ class CFX_SeekableStreamProxy; class CFX_XMLDocument; -class CFX_XMLElement; class CFX_XMLNode; class IFX_SeekableReadStream;
diff --git a/core/fxge/cfx_windowsrenderdevice.h b/core/fxge/cfx_windowsrenderdevice.h index a356dc6..635c72b 100644 --- a/core/fxge/cfx_windowsrenderdevice.h +++ b/core/fxge/cfx_windowsrenderdevice.h
@@ -21,7 +21,6 @@ kModeEmfImageMasks = 6, }; -class RenderDeviceDriverIface; struct EncoderIface; #if defined(PDFIUM_PRINT_TEXT_WITH_GDI)
diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h index 1a68354..e44aa42 100644 --- a/core/fxge/skia/fx_skia_device.h +++ b/core/fxge/skia/fx_skia_device.h
@@ -23,7 +23,6 @@ class SkPictureRecorder; class SkiaState; class TextCharPos; -struct SkIRect; class CFX_SkiaDeviceDriver final : public RenderDeviceDriverIface { public:
diff --git a/fxjs/xfa/cfxjse_engine.h b/fxjs/xfa/cfxjse_engine.h index b09643c..9c83c0d 100644 --- a/fxjs/xfa/cfxjse_engine.h +++ b/fxjs/xfa/cfxjse_engine.h
@@ -26,6 +26,7 @@ class CFXJSE_FormCalcContext; class CFXJSE_HostObject; class CFXJSE_ResolveProcessor; +class CFXJSE_Value; class CJS_Runtime; enum XFA_ResolveNode : uint16_t {
diff --git a/fxjs/xfa/cjx_eventpseudomodel.h b/fxjs/xfa/cjx_eventpseudomodel.h index 1f55c44..39b6c08 100644 --- a/fxjs/xfa/cjx_eventpseudomodel.h +++ b/fxjs/xfa/cjx_eventpseudomodel.h
@@ -10,7 +10,6 @@ #include "fxjs/xfa/cjx_object.h" #include "fxjs/xfa/jse_define.h" -class CFXJSE_Value; class CScript_EventPseudoModel; enum class XFA_Event {
diff --git a/fxjs/xfa/cjx_object.h b/fxjs/xfa/cjx_object.h index 7dacd99..b23e87d 100644 --- a/fxjs/xfa/cjx_object.h +++ b/fxjs/xfa/cjx_object.h
@@ -23,7 +23,6 @@ #include "xfa/fxfa/fxfa_basic.h" class CFXJSE_MapModule; -class CFXJSE_Value; class CFX_V8; class CFX_XMLElement; class CJX_Object;
diff --git a/fxjs/xfa/cjx_tree.h b/fxjs/xfa/cjx_tree.h index 271558e..f18d0b7 100644 --- a/fxjs/xfa/cjx_tree.h +++ b/fxjs/xfa/cjx_tree.h
@@ -11,7 +11,6 @@ #include "fxjs/xfa/cjx_object.h" #include "fxjs/xfa/jse_define.h" -class CFXJSE_Value; class CXFA_Object; class CXFA_Node;
diff --git a/fxjs/xfa/fxjse.h b/fxjs/xfa/fxjse.h index fd7ff18..63646ab 100644 --- a/fxjs/xfa/fxjse.h +++ b/fxjs/xfa/fxjse.h
@@ -23,7 +23,6 @@ } // namespace pdfium class CFXJSE_FormCalcContext; -class CFXJSE_Value; class CJS_Result; class CJX_Object;
diff --git a/xfa/fxfa/parser/cxfa_box.h b/xfa/fxfa/parser/cxfa_box.h index 330817d..1a361d5 100644 --- a/xfa/fxfa/parser/cxfa_box.h +++ b/xfa/fxfa/parser/cxfa_box.h
@@ -17,7 +17,6 @@ class CFGAS_GEGraphics; class CXFA_Edge; class CXFA_Fill; -class CXFA_Margin; class CXFA_Stroke; class CXFA_Box : public CXFA_Node {
diff --git a/xfa/fxfa/parser/cxfa_fill.h b/xfa/fxfa/parser/cxfa_fill.h index d1fa47c..2f7fb51 100644 --- a/xfa/fxfa/parser/cxfa_fill.h +++ b/xfa/fxfa/parser/cxfa_fill.h
@@ -13,10 +13,6 @@ #include "xfa/fxfa/parser/cxfa_node.h" class CFGAS_GEGraphics; -class CXFA_Linear; -class CXFA_Pattern; -class CXFA_Radial; -class CXFA_Stipple; class CXFA_Fill final : public CXFA_Node { public: