diff options
author | weili <weili@chromium.org> | 2016-08-09 10:33:10 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-09 10:33:10 -0700 |
commit | 16fccc51456dbab7e392c3952cc367723f9694f6 (patch) | |
tree | 0bd44bec6b81213db9d1dc487237164cdcaa43a4 /xfa/fxgraphics/cfx_path_generator.h | |
parent | af7ab33c73f58f18d0db0c90d93fa0aab0bc83f3 (diff) | |
download | pdfium-16fccc51456dbab7e392c3952cc367723f9694f6.tar.xz |
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
Diffstat (limited to 'xfa/fxgraphics/cfx_path_generator.h')
-rw-r--r-- | xfa/fxgraphics/cfx_path_generator.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xfa/fxgraphics/cfx_path_generator.h b/xfa/fxgraphics/cfx_path_generator.h index 186178e516..0fed30f93f 100644 --- a/xfa/fxgraphics/cfx_path_generator.h +++ b/xfa/fxgraphics/cfx_path_generator.h @@ -7,6 +7,8 @@ #ifndef XFA_FXGRAPHICS_CFX_PATH_GENERATOR_H_ #define XFA_FXGRAPHICS_CFX_PATH_GENERATOR_H_ +#include <memory> + #include "core/fxge/include/cfx_pathdata.h" #include "core/fxge/include/fx_ge.h" @@ -15,8 +17,7 @@ class CFX_PathGenerator { CFX_PathGenerator(); ~CFX_PathGenerator(); - void Create(); - CFX_PathData* GetPathData() const { return m_pPathData; } + CFX_PathData* GetPathData() const { return m_pPathData.get(); } void AddPathData(CFX_PathData* path_data); void AddPathData(FX_PATHPOINT* points, int count); @@ -62,7 +63,7 @@ class CFX_PathGenerator { FX_FLOAT sweep_angle); protected: - CFX_PathData* m_pPathData; + std::unique_ptr<CFX_PathData> m_pPathData; }; #endif // XFA_FXGRAPHICS_CFX_PATH_GENERATOR_H_ |