From 335cf093231c984a23cb9ea113148ea1f19621ba Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 9 Nov 2016 13:28:26 -0800 Subject: Return unique_ptr from CPDF_Object::Clone(). Because that's what clone does. There are numerous release() calls that will go away as more code is converted. Review-Url: https://codereview.chromium.org/2484033002 --- core/fpdfapi/parser/cpdf_object.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core/fpdfapi/parser/cpdf_object.cpp') diff --git a/core/fpdfapi/parser/cpdf_object.cpp b/core/fpdfapi/parser/cpdf_object.cpp index e9c215ce19..acda334c9e 100644 --- a/core/fpdfapi/parser/cpdf_object.cpp +++ b/core/fpdfapi/parser/cpdf_object.cpp @@ -22,16 +22,17 @@ CPDF_Object* CPDF_Object::GetDirect() const { return const_cast(this); } -CPDF_Object* CPDF_Object::CloneObjectNonCyclic(bool bDirect) const { +std::unique_ptr CPDF_Object::CloneObjectNonCyclic( + bool bDirect) const { std::set visited_objs; return CloneNonCyclic(bDirect, &visited_objs); } -CPDF_Object* CPDF_Object::CloneDirectObject() const { +std::unique_ptr CPDF_Object::CloneDirectObject() const { return CloneObjectNonCyclic(true); } -CPDF_Object* CPDF_Object::CloneNonCyclic( +std::unique_ptr CPDF_Object::CloneNonCyclic( bool bDirect, std::set* pVisited) const { return Clone(); -- cgit v1.2.3