From 16fccc51456dbab7e392c3952cc367723f9694f6 Mon Sep 17 00:00:00 2001 From: weili Date: Tue, 9 Aug 2016 10:33:10 -0700 Subject: Use smart pointers for class owned pointers For classes under xfa/fxfa/fm2js, and xfa/fxgraphics, use smart pointers instead of raw pointer to make memory management easier. Also fix some styling issues along the changes. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2222203002 --- xfa/fxgraphics/cfx_path.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'xfa/fxgraphics/cfx_path.h') diff --git a/xfa/fxgraphics/cfx_path.h b/xfa/fxgraphics/cfx_path.h index f42586f0de..bfef04e591 100644 --- a/xfa/fxgraphics/cfx_path.h +++ b/xfa/fxgraphics/cfx_path.h @@ -7,16 +7,18 @@ #ifndef XFA_FXGRAPHICS_CFX_PATH_H_ #define XFA_FXGRAPHICS_CFX_PATH_H_ +#include + #include "core/fxcrt/include/fx_system.h" #include "xfa/fxgraphics/include/cfx_graphics.h" class CFX_PathData; class CFX_PathGenerator; -class CFX_Path { +class CFX_Path final { public: CFX_Path(); - virtual ~CFX_Path(); + ~CFX_Path(); FWL_Error Create(); FWL_Error MoveTo(FX_FLOAT x, FX_FLOAT y); @@ -68,11 +70,11 @@ class CFX_Path { FWL_Error AddSubpath(CFX_Path* path); FWL_Error Clear(); - FX_BOOL IsEmpty(); - CFX_PathData* GetPathData(); + FX_BOOL IsEmpty() const; + CFX_PathData* GetPathData() const; private: - CFX_PathGenerator* m_generator; + std::unique_ptr m_generator; }; #endif // XFA_FXGRAPHICS_CFX_PATH_H_ -- cgit v1.2.3