summaryrefslogtreecommitdiff
path: root/core/fxcrt
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-10-03 15:24:27 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-03 15:24:27 -0700
commit36eb4bdcae719cf33c536ff72ac000482aed8382 (patch)
treeb3c3467fa10eafc3863a619ef511d1bf20af6367 /core/fxcrt
parent76383db4906c9357292846ace77566b34eb47de9 (diff)
downloadpdfium-36eb4bdcae719cf33c536ff72ac000482aed8382.tar.xz
Add ptr_util.h from base until std::make_unique<> available
Review-Url: https://codereview.chromium.org/2386273004
Diffstat (limited to 'core/fxcrt')
-rw-r--r--core/fxcrt/fx_memory.h6
-rw-r--r--core/fxcrt/fx_xml_parser.cpp3
2 files changed, 2 insertions, 7 deletions
diff --git a/core/fxcrt/fx_memory.h b/core/fxcrt/fx_memory.h
index beb194fbda..0ad28ce896 100644
--- a/core/fxcrt/fx_memory.h
+++ b/core/fxcrt/fx_memory.h
@@ -101,12 +101,6 @@ struct ReleaseDeleter {
inline void operator()(T* ptr) const { ptr->Release(); }
};
-// Used to help transfer ownership of a raw pointer to std::unique_ptr.
-template <typename T>
-std::unique_ptr<T> WrapUnique(T* ptr) {
- return std::unique_ptr<T>(ptr);
-}
-
#endif // __cplusplus
#endif // CORE_FXCRT_FX_MEMORY_H_
diff --git a/core/fxcrt/fx_xml_parser.cpp b/core/fxcrt/fx_xml_parser.cpp
index a7026e9bb1..563e1c961b 100644
--- a/core/fxcrt/fx_xml_parser.cpp
+++ b/core/fxcrt/fx_xml_parser.cpp
@@ -10,6 +10,7 @@
#include "core/fxcrt/fx_ext.h"
#include "core/fxcrt/fx_xml.h"
+#include "third_party/base/ptr_util.h"
#include "third_party/base/stl_util.h"
CXML_DataBufAcc::CXML_DataBufAcc(const uint8_t* pBuffer, size_t size)
@@ -894,7 +895,7 @@ void CXML_AttrMap::SetAt(const CFX_ByteString& space,
const CFX_ByteString& name,
const CFX_WideString& value) {
if (!m_pMap)
- m_pMap = WrapUnique(new std::vector<CXML_AttrItem>);
+ m_pMap = pdfium::MakeUnique<std::vector<CXML_AttrItem>>();
for (CXML_AttrItem& item : *m_pMap) {
if (item.Matches(space, name)) {