diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-04-19 16:07:21 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-19 21:23:25 +0000 |
commit | 3c66ea01f5239a7b1a0da75285e0c8048e5cf784 (patch) | |
tree | 691729ad6f8924f2fc70dc31f01fafbfdb7ce8a4 /core/fxcrt/cfx_chariter.cpp | |
parent | 4363c8ff37b6e6a98fffe53fff248e61d04f697a (diff) | |
download | pdfium-3c66ea01f5239a7b1a0da75285e0c8048e5cf784.tar.xz |
Update IFX_CharIter::Clone to return unique_ptr
This Cl converts the Clone method of IFX_CharIter to return a
unique_ptr. The usages were all converting to a unique_ptr already.
Change-Id: I1ca5ddd03eca8f21d616efb2b92fb27899c43c23
Reviewed-on: https://pdfium-review.googlesource.com/4351
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/cfx_chariter.cpp')
-rw-r--r-- | core/fxcrt/cfx_chariter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/fxcrt/cfx_chariter.cpp b/core/fxcrt/cfx_chariter.cpp index c14db2f322..b726a7e484 100644 --- a/core/fxcrt/cfx_chariter.cpp +++ b/core/fxcrt/cfx_chariter.cpp @@ -6,6 +6,8 @@ #include "core/fxcrt/cfx_chariter.h" +#include "third_party/base/ptr_util.h" + CFX_CharIter::CFX_CharIter(const CFX_WideString& wsText) : m_wsText(wsText), m_nIndex(0) { ASSERT(!wsText.IsEmpty()); @@ -44,8 +46,8 @@ bool CFX_CharIter::IsEOF(bool bTail) const { return bTail ? (m_nIndex + 1 == m_wsText.GetLength()) : (m_nIndex == 0); } -IFX_CharIter* CFX_CharIter::Clone() { - CFX_CharIter* pIter = new CFX_CharIter(m_wsText); +std::unique_ptr<IFX_CharIter> CFX_CharIter::Clone() { + auto pIter = pdfium::MakeUnique<CFX_CharIter>(m_wsText); pIter->m_nIndex = m_nIndex; return pIter; } |