From 55865454c43fbc3b163cff166544ba0a060dcbc4 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 27 Aug 2018 20:18:04 +0000 Subject: The final game: mark everything final. Then revert the ones that break compilation. Fix one IWYU noticed during presubmit. Change-Id: I881a8a72818e55dbc4816247e35ff5e3015194e7 Reviewed-on: https://pdfium-review.googlesource.com/41470 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- core/fpdfapi/page/cpdf_allstates.h | 2 +- core/fpdfapi/page/cpdf_clippath.h | 2 +- core/fpdfapi/page/cpdf_colorspace.cpp | 14 +++++++------- core/fpdfapi/page/cpdf_colorstate.h | 2 +- core/fpdfapi/page/cpdf_contentmark.h | 2 +- core/fpdfapi/page/cpdf_contentmarkitem.h | 2 +- core/fpdfapi/page/cpdf_devicecs.h | 2 +- core/fpdfapi/page/cpdf_expintfunc.h | 2 +- core/fpdfapi/page/cpdf_form.h | 2 +- core/fpdfapi/page/cpdf_formobject.h | 2 +- core/fpdfapi/page/cpdf_generalstate.h | 2 +- core/fpdfapi/page/cpdf_iccprofile.h | 2 +- core/fpdfapi/page/cpdf_image.h | 2 +- core/fpdfapi/page/cpdf_imageobject.h | 2 +- core/fpdfapi/page/cpdf_page.h | 2 +- core/fpdfapi/page/cpdf_pageobjectlist.h | 2 +- core/fpdfapi/page/cpdf_pathobject.h | 2 +- core/fpdfapi/page/cpdf_patterncs.h | 2 +- core/fpdfapi/page/cpdf_psfunc.h | 2 +- core/fpdfapi/page/cpdf_sampledfunc.h | 2 +- core/fpdfapi/page/cpdf_shadingobject.h | 2 +- core/fpdfapi/page/cpdf_shadingpattern.h | 2 +- core/fpdfapi/page/cpdf_stitchfunc.h | 2 +- core/fpdfapi/page/cpdf_textobject.h | 2 +- core/fpdfapi/page/cpdf_textstate.h | 2 +- core/fpdfapi/page/cpdf_tilingpattern.h | 2 +- 26 files changed, 32 insertions(+), 32 deletions(-) (limited to 'core/fpdfapi/page') diff --git a/core/fpdfapi/page/cpdf_allstates.h b/core/fpdfapi/page/cpdf_allstates.h index 730003a96a..e388b9470f 100644 --- a/core/fpdfapi/page/cpdf_allstates.h +++ b/core/fpdfapi/page/cpdf_allstates.h @@ -15,7 +15,7 @@ class CPDF_Array; class CPDF_Dictionary; class CPDF_StreamContentParser; -class CPDF_AllStates : public CPDF_GraphicStates { +class CPDF_AllStates final : public CPDF_GraphicStates { public: CPDF_AllStates(); ~CPDF_AllStates() override; diff --git a/core/fpdfapi/page/cpdf_clippath.h b/core/fpdfapi/page/cpdf_clippath.h index 91a25cda1a..c0b5ce5011 100644 --- a/core/fpdfapi/page/cpdf_clippath.h +++ b/core/fpdfapi/page/cpdf_clippath.h @@ -44,7 +44,7 @@ class CPDF_ClipPath { void Transform(const CFX_Matrix& matrix); private: - class PathData : public Retainable { + class PathData final : public Retainable { public: using PathAndTypeData = std::pair; diff --git a/core/fpdfapi/page/cpdf_colorspace.cpp b/core/fpdfapi/page/cpdf_colorspace.cpp index a3b88b05b8..882b5657d8 100644 --- a/core/fpdfapi/page/cpdf_colorspace.cpp +++ b/core/fpdfapi/page/cpdf_colorspace.cpp @@ -105,7 +105,7 @@ bool GetWhitePoint(const CPDF_Dictionary* pDict, float* pPoints) { return pPoints[0] > 0.0f && pPoints[1] == 1.0f && pPoints[2] > 0.0f; } -class CPDF_CalGray : public CPDF_ColorSpace { +class CPDF_CalGray final : public CPDF_ColorSpace { public: explicit CPDF_CalGray(CPDF_Document* pDoc); ~CPDF_CalGray() override {} @@ -130,7 +130,7 @@ class CPDF_CalGray : public CPDF_ColorSpace { float m_BlackPoint[kBlackWhitePointCount]; }; -class CPDF_CalRGB : public CPDF_ColorSpace { +class CPDF_CalRGB final : public CPDF_ColorSpace { public: explicit CPDF_CalRGB(CPDF_Document* pDoc); ~CPDF_CalRGB() override {} @@ -160,7 +160,7 @@ class CPDF_CalRGB : public CPDF_ColorSpace { bool m_bMatrix = false; }; -class CPDF_LabCS : public CPDF_ColorSpace { +class CPDF_LabCS final : public CPDF_ColorSpace { public: explicit CPDF_LabCS(CPDF_Document* pDoc); ~CPDF_LabCS() override {} @@ -190,7 +190,7 @@ class CPDF_LabCS : public CPDF_ColorSpace { float m_Ranges[kRangesCount]; }; -class CPDF_ICCBasedCS : public CPDF_ColorSpace { +class CPDF_ICCBasedCS final : public CPDF_ColorSpace { public: explicit CPDF_ICCBasedCS(CPDF_Document* pDoc); ~CPDF_ICCBasedCS() override; @@ -226,7 +226,7 @@ class CPDF_ICCBasedCS : public CPDF_ColorSpace { std::vector m_pRanges; }; -class CPDF_IndexedCS : public CPDF_ColorSpace { +class CPDF_IndexedCS final : public CPDF_ColorSpace { public: explicit CPDF_IndexedCS(CPDF_Document* pDoc); ~CPDF_IndexedCS() override; @@ -248,7 +248,7 @@ class CPDF_IndexedCS : public CPDF_ColorSpace { std::vector m_pCompMinMax; }; -class CPDF_SeparationCS : public CPDF_ColorSpace { +class CPDF_SeparationCS final : public CPDF_ColorSpace { public: explicit CPDF_SeparationCS(CPDF_Document* pDoc); ~CPDF_SeparationCS() override; @@ -270,7 +270,7 @@ class CPDF_SeparationCS : public CPDF_ColorSpace { enum { None, All, Colorant } m_Type; }; -class CPDF_DeviceNCS : public CPDF_ColorSpace { +class CPDF_DeviceNCS final : public CPDF_ColorSpace { public: explicit CPDF_DeviceNCS(CPDF_Document* pDoc); ~CPDF_DeviceNCS() override; diff --git a/core/fpdfapi/page/cpdf_colorstate.h b/core/fpdfapi/page/cpdf_colorstate.h index 49416db1d5..7b72a2a9d2 100644 --- a/core/fpdfapi/page/cpdf_colorstate.h +++ b/core/fpdfapi/page/cpdf_colorstate.h @@ -50,7 +50,7 @@ class CPDF_ColorState { bool HasRef() const { return !!m_Ref; } private: - class ColorData : public Retainable { + class ColorData final : public Retainable { public: ColorData(); ColorData(const ColorData& src); diff --git a/core/fpdfapi/page/cpdf_contentmark.h b/core/fpdfapi/page/cpdf_contentmark.h index dc4cc08838..1395db12f8 100644 --- a/core/fpdfapi/page/cpdf_contentmark.h +++ b/core/fpdfapi/page/cpdf_contentmark.h @@ -40,7 +40,7 @@ class CPDF_ContentMark { size_t FindFirstDifference(const CPDF_ContentMark* other) const; private: - class MarkData : public Retainable { + class MarkData final : public Retainable { public: MarkData(); MarkData(const MarkData& src); diff --git a/core/fpdfapi/page/cpdf_contentmarkitem.h b/core/fpdfapi/page/cpdf_contentmarkitem.h index 435aef4b10..a0a92dbc3c 100644 --- a/core/fpdfapi/page/cpdf_contentmarkitem.h +++ b/core/fpdfapi/page/cpdf_contentmarkitem.h @@ -17,7 +17,7 @@ class CPDF_Dictionary; -class CPDF_ContentMarkItem : public Retainable { +class CPDF_ContentMarkItem final : public Retainable { public: enum ParamType { None, PropertiesDict, DirectDict }; diff --git a/core/fpdfapi/page/cpdf_devicecs.h b/core/fpdfapi/page/cpdf_devicecs.h index bf668c359b..ab88d74c93 100644 --- a/core/fpdfapi/page/cpdf_devicecs.h +++ b/core/fpdfapi/page/cpdf_devicecs.h @@ -11,7 +11,7 @@ #include "core/fpdfapi/page/cpdf_colorspace.h" -class CPDF_DeviceCS : public CPDF_ColorSpace { +class CPDF_DeviceCS final : public CPDF_ColorSpace { public: explicit CPDF_DeviceCS(int family); ~CPDF_DeviceCS() override; diff --git a/core/fpdfapi/page/cpdf_expintfunc.h b/core/fpdfapi/page/cpdf_expintfunc.h index c93cc86cff..95bdab68e2 100644 --- a/core/fpdfapi/page/cpdf_expintfunc.h +++ b/core/fpdfapi/page/cpdf_expintfunc.h @@ -12,7 +12,7 @@ #include "core/fpdfapi/page/cpdf_function.h" -class CPDF_ExpIntFunc : public CPDF_Function { +class CPDF_ExpIntFunc final : public CPDF_Function { public: CPDF_ExpIntFunc(); ~CPDF_ExpIntFunc() override; diff --git a/core/fpdfapi/page/cpdf_form.h b/core/fpdfapi/page/cpdf_form.h index 63cc4a96c1..abb5c40a46 100644 --- a/core/fpdfapi/page/cpdf_form.h +++ b/core/fpdfapi/page/cpdf_form.h @@ -19,7 +19,7 @@ class CPDF_AllStates; class CFX_Matrix; class CPDF_Type3Char; -class CPDF_Form : public CPDF_PageObjectHolder { +class CPDF_Form final : public CPDF_PageObjectHolder { public: CPDF_Form(CPDF_Document* pDocument, CPDF_Dictionary* pPageResources, diff --git a/core/fpdfapi/page/cpdf_formobject.h b/core/fpdfapi/page/cpdf_formobject.h index b229dce444..dc53c454c4 100644 --- a/core/fpdfapi/page/cpdf_formobject.h +++ b/core/fpdfapi/page/cpdf_formobject.h @@ -14,7 +14,7 @@ class CPDF_Form; -class CPDF_FormObject : public CPDF_PageObject { +class CPDF_FormObject final : public CPDF_PageObject { public: CPDF_FormObject(int32_t content_stream, std::unique_ptr pForm, diff --git a/core/fpdfapi/page/cpdf_generalstate.h b/core/fpdfapi/page/cpdf_generalstate.h index 4a101b99de..9ee20db8a5 100644 --- a/core/fpdfapi/page/cpdf_generalstate.h +++ b/core/fpdfapi/page/cpdf_generalstate.h @@ -77,7 +77,7 @@ class CPDF_GeneralState { CFX_Matrix* GetMutableMatrix(); private: - class StateData : public Retainable { + class StateData final : public Retainable { public: StateData(); StateData(const StateData& that); diff --git a/core/fpdfapi/page/cpdf_iccprofile.h b/core/fpdfapi/page/cpdf_iccprofile.h index a9e11700f1..0f13b0be21 100644 --- a/core/fpdfapi/page/cpdf_iccprofile.h +++ b/core/fpdfapi/page/cpdf_iccprofile.h @@ -16,7 +16,7 @@ class CLcmsCmm; class CPDF_Stream; -class CPDF_IccProfile : public Retainable { +class CPDF_IccProfile final : public Retainable { public: template friend RetainPtr pdfium::MakeRetain(Args&&... args); diff --git a/core/fpdfapi/page/cpdf_image.h b/core/fpdfapi/page/cpdf_image.h index 4306109199..1be9b4d47f 100644 --- a/core/fpdfapi/page/cpdf_image.h +++ b/core/fpdfapi/page/cpdf_image.h @@ -22,7 +22,7 @@ class CPDF_Page; class PauseIndicatorIface; class IFX_SeekableReadStream; -class CPDF_Image : public Retainable { +class CPDF_Image final : public Retainable { public: template friend RetainPtr pdfium::MakeRetain(Args&&... args); diff --git a/core/fpdfapi/page/cpdf_imageobject.h b/core/fpdfapi/page/cpdf_imageobject.h index d54ef8d818..2e01598b8a 100644 --- a/core/fpdfapi/page/cpdf_imageobject.h +++ b/core/fpdfapi/page/cpdf_imageobject.h @@ -14,7 +14,7 @@ class CPDF_Image; -class CPDF_ImageObject : public CPDF_PageObject { +class CPDF_ImageObject final : public CPDF_PageObject { public: explicit CPDF_ImageObject(int32_t content_stream); CPDF_ImageObject(); diff --git a/core/fpdfapi/page/cpdf_page.h b/core/fpdfapi/page/cpdf_page.h index 44bb6d8798..b641253f84 100644 --- a/core/fpdfapi/page/cpdf_page.h +++ b/core/fpdfapi/page/cpdf_page.h @@ -23,7 +23,7 @@ class CPDF_Object; class CPDF_PageRenderCache; class CPDF_PageRenderContext; -class CPDF_Page : public IPDF_Page, public CPDF_PageObjectHolder { +class CPDF_Page final : public IPDF_Page, public CPDF_PageObjectHolder { public: class View {}; // Caller implements as desired, empty here due to layering. diff --git a/core/fpdfapi/page/cpdf_pageobjectlist.h b/core/fpdfapi/page/cpdf_pageobjectlist.h index 77c7d811e1..1b4bf8f75c 100644 --- a/core/fpdfapi/page/cpdf_pageobjectlist.h +++ b/core/fpdfapi/page/cpdf_pageobjectlist.h @@ -12,7 +12,7 @@ class CPDF_PageObject; -class CPDF_PageObjectList +class CPDF_PageObjectList final : public std::deque> { public: CPDF_PageObject* GetPageObjectByIndex(int index) const; diff --git a/core/fpdfapi/page/cpdf_pathobject.h b/core/fpdfapi/page/cpdf_pathobject.h index 5155c40c3d..0a1e4d01f9 100644 --- a/core/fpdfapi/page/cpdf_pathobject.h +++ b/core/fpdfapi/page/cpdf_pathobject.h @@ -12,7 +12,7 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_system.h" -class CPDF_PathObject : public CPDF_PageObject { +class CPDF_PathObject final : public CPDF_PageObject { public: explicit CPDF_PathObject(int32_t content_stream); CPDF_PathObject(); diff --git a/core/fpdfapi/page/cpdf_patterncs.h b/core/fpdfapi/page/cpdf_patterncs.h index 23735fd8f2..5de9875dbf 100644 --- a/core/fpdfapi/page/cpdf_patterncs.h +++ b/core/fpdfapi/page/cpdf_patterncs.h @@ -13,7 +13,7 @@ class CPDF_Document; -class CPDF_PatternCS : public CPDF_ColorSpace { +class CPDF_PatternCS final : public CPDF_ColorSpace { public: explicit CPDF_PatternCS(CPDF_Document* pDoc); ~CPDF_PatternCS() override; diff --git a/core/fpdfapi/page/cpdf_psfunc.h b/core/fpdfapi/page/cpdf_psfunc.h index 1274c21d50..b81c2e7acd 100644 --- a/core/fpdfapi/page/cpdf_psfunc.h +++ b/core/fpdfapi/page/cpdf_psfunc.h @@ -14,7 +14,7 @@ class CPDF_Object; -class CPDF_PSFunc : public CPDF_Function { +class CPDF_PSFunc final : public CPDF_Function { public: CPDF_PSFunc(); ~CPDF_PSFunc() override; diff --git a/core/fpdfapi/page/cpdf_sampledfunc.h b/core/fpdfapi/page/cpdf_sampledfunc.h index bd129662cf..579fdcea09 100644 --- a/core/fpdfapi/page/cpdf_sampledfunc.h +++ b/core/fpdfapi/page/cpdf_sampledfunc.h @@ -14,7 +14,7 @@ #include "core/fpdfapi/parser/cpdf_stream_acc.h" #include "core/fxcrt/retain_ptr.h" -class CPDF_SampledFunc : public CPDF_Function { +class CPDF_SampledFunc final : public CPDF_Function { public: struct SampleEncodeInfo { float encode_max; diff --git a/core/fpdfapi/page/cpdf_shadingobject.h b/core/fpdfapi/page/cpdf_shadingobject.h index af88128443..c246870469 100644 --- a/core/fpdfapi/page/cpdf_shadingobject.h +++ b/core/fpdfapi/page/cpdf_shadingobject.h @@ -13,7 +13,7 @@ class CPDF_ShadingPattern; -class CPDF_ShadingObject : public CPDF_PageObject { +class CPDF_ShadingObject final : public CPDF_PageObject { public: CPDF_ShadingObject(int32_t content_stream, CPDF_ShadingPattern* pattern, diff --git a/core/fpdfapi/page/cpdf_shadingpattern.h b/core/fpdfapi/page/cpdf_shadingpattern.h index d7aa1cb272..dbf80874b6 100644 --- a/core/fpdfapi/page/cpdf_shadingpattern.h +++ b/core/fpdfapi/page/cpdf_shadingpattern.h @@ -33,7 +33,7 @@ class CPDF_Document; class CPDF_Function; class CPDF_Object; -class CPDF_ShadingPattern : public CPDF_Pattern { +class CPDF_ShadingPattern final : public CPDF_Pattern { public: CPDF_ShadingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, diff --git a/core/fpdfapi/page/cpdf_stitchfunc.h b/core/fpdfapi/page/cpdf_stitchfunc.h index 20dac6cbc1..022bd4ee6d 100644 --- a/core/fpdfapi/page/cpdf_stitchfunc.h +++ b/core/fpdfapi/page/cpdf_stitchfunc.h @@ -13,7 +13,7 @@ #include "core/fpdfapi/page/cpdf_function.h" -class CPDF_StitchFunc : public CPDF_Function { +class CPDF_StitchFunc final : public CPDF_Function { public: CPDF_StitchFunc(); ~CPDF_StitchFunc() override; diff --git a/core/fpdfapi/page/cpdf_textobject.h b/core/fpdfapi/page/cpdf_textobject.h index ac17c6df68..9ed5ff7ff0 100644 --- a/core/fpdfapi/page/cpdf_textobject.h +++ b/core/fpdfapi/page/cpdf_textobject.h @@ -23,7 +23,7 @@ class CPDF_TextObjectItem { CFX_PointF m_Origin; }; -class CPDF_TextObject : public CPDF_PageObject { +class CPDF_TextObject final : public CPDF_PageObject { public: explicit CPDF_TextObject(int32_t content_stream); CPDF_TextObject(); diff --git a/core/fpdfapi/page/cpdf_textstate.h b/core/fpdfapi/page/cpdf_textstate.h index aa128072b6..c1c3ba8015 100644 --- a/core/fpdfapi/page/cpdf_textstate.h +++ b/core/fpdfapi/page/cpdf_textstate.h @@ -59,7 +59,7 @@ class CPDF_TextState { float* GetMutableCTM(); private: - class TextData : public Retainable { + class TextData final : public Retainable { public: TextData(); TextData(const TextData& src); diff --git a/core/fpdfapi/page/cpdf_tilingpattern.h b/core/fpdfapi/page/cpdf_tilingpattern.h index d9450d7c2f..c79708d635 100644 --- a/core/fpdfapi/page/cpdf_tilingpattern.h +++ b/core/fpdfapi/page/cpdf_tilingpattern.h @@ -17,7 +17,7 @@ class CPDF_Document; class CPDF_Form; class CPDF_Object; -class CPDF_TilingPattern : public CPDF_Pattern { +class CPDF_TilingPattern final : public CPDF_Pattern { public: CPDF_TilingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, -- cgit v1.2.3