From 0bb1333a9eff1190ddd68f34c71d6a779c69dfef Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 30 Mar 2017 16:12:02 -0400 Subject: Add some calls to MakeUnique This CL replaces some new's with pdfium::MakeUnique. Change-Id: I50faf3ed55e7730b094c14a7989a9dd51cf33cbb Reviewed-on: https://pdfium-review.googlesource.com/3430 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- core/fxcrt/fx_basic_util.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'core/fxcrt') diff --git a/core/fxcrt/fx_basic_util.cpp b/core/fxcrt/fx_basic_util.cpp index 19e5696c86..9f699e4da7 100644 --- a/core/fxcrt/fx_basic_util.cpp +++ b/core/fxcrt/fx_basic_util.cpp @@ -4,14 +4,15 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxcrt/fx_basic.h" -#include "core/fxcrt/fx_ext.h" - #include #include #include #include +#include "core/fxcrt/fx_basic.h" +#include "core/fxcrt/fx_ext.h" +#include "third_party/base/ptr_util.h" + bool FX_atonum(const CFX_ByteStringC& strc, void* pData) { if (strc.Find('.') != -1) { float* pFloat = static_cast(pData); @@ -142,7 +143,7 @@ void FXSYS_vsnprintf(char* str, size_t size, const char* fmt, va_list ap) { FX_FileHandle* FX_OpenFolder(const char* path) { #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ - std::unique_ptr pData(new CFindFileDataA); + auto pData = pdfium::MakeUnique(); pData->m_Handle = FindFirstFileExA((CFX_ByteString(path) + "/*.*").c_str(), FindExInfoStandard, &pData->m_FindData, FindExSearchNameMatch, nullptr, 0); -- cgit v1.2.3