summaryrefslogtreecommitdiff
path: root/xfa/fxgraphics
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-14 05:57:10 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-14 05:57:10 -0800
commita9caab94c1f16929e5acf2676117224617d80f53 (patch)
treed71ff9a82fae6e6080deb76375f43056127b3ee2 /xfa/fxgraphics
parent992ecf7c189e5cabf43e5ad862511cf63d030966 (diff)
downloadpdfium-a9caab94c1f16929e5acf2676117224617d80f53.tar.xz
Avoid the ptr.reset(new XXX()) anti-pattern
Be suspicious of |new|. This removes some of the easy cases. Review-Url: https://codereview.chromium.org/2571913002
Diffstat (limited to 'xfa/fxgraphics')
-rw-r--r--xfa/fxgraphics/cfx_graphics.cpp3
-rw-r--r--xfa/fxgraphics/cfx_path.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/xfa/fxgraphics/cfx_graphics.cpp b/xfa/fxgraphics/cfx_graphics.cpp
index 824e7c68da..5b3bc8cb9d 100644
--- a/xfa/fxgraphics/cfx_graphics.cpp
+++ b/xfa/fxgraphics/cfx_graphics.cpp
@@ -12,6 +12,7 @@
#include "core/fxge/cfx_gemodule.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/cfx_unicodeencoding.h"
+#include "third_party/base/ptr_util.h"
#include "xfa/fxgraphics/cagg_graphics.h"
#include "xfa/fxgraphics/cfx_color.h"
#include "xfa/fxgraphics/cfx_path.h"
@@ -597,7 +598,7 @@ FWL_Error CFX_Graphics::Create(int32_t width,
m_type = FX_CONTEXT_Device;
m_info.isAntialiasing = isAntialiasing;
- m_aggGraphics.reset(new CAGG_Graphics);
+ m_aggGraphics = pdfium::MakeUnique<CAGG_Graphics>();
return m_aggGraphics->Create(this, width, height, format);
}
diff --git a/xfa/fxgraphics/cfx_path.cpp b/xfa/fxgraphics/cfx_path.cpp
index d02b7a8e48..3288631f15 100644
--- a/xfa/fxgraphics/cfx_path.cpp
+++ b/xfa/fxgraphics/cfx_path.cpp
@@ -7,6 +7,7 @@
#include "xfa/fxgraphics/cfx_path.h"
#include "core/fxge/cfx_pathdata.h"
+#include "third_party/base/ptr_util.h"
#include "xfa/fxgraphics/cfx_path_generator.h"
CFX_Path::CFX_Path() {}
@@ -15,7 +16,7 @@ FWL_Error CFX_Path::Create() {
if (m_generator)
return FWL_Error::PropertyInvalid;
- m_generator.reset(new CFX_PathGenerator());
+ m_generator = pdfium::MakeUnique<CFX_PathGenerator>();
return FWL_Error::Succeeded;
}