diff options
author | tsepez <tsepez@chromium.org> | 2016-11-09 13:28:26 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-09 13:28:26 -0800 |
commit | 335cf093231c984a23cb9ea113148ea1f19621ba (patch) | |
tree | e9c7803b0ce71269beb3d423549a2d6a0ac7784a /core/fpdfapi/parser/cpdf_object.h | |
parent | 3ff4deea307c38462393e4f83dabe32949338168 (diff) | |
download | pdfium-335cf093231c984a23cb9ea113148ea1f19621ba.tar.xz |
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
Diffstat (limited to 'core/fpdfapi/parser/cpdf_object.h')
-rw-r--r-- | core/fpdfapi/parser/cpdf_object.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/fpdfapi/parser/cpdf_object.h b/core/fpdfapi/parser/cpdf_object.h index 8f6491ec72..c24b40a789 100644 --- a/core/fpdfapi/parser/cpdf_object.h +++ b/core/fpdfapi/parser/cpdf_object.h @@ -46,12 +46,13 @@ class CPDF_Object { bool IsInline() const { return m_ObjNum == 0; } // Create a deep copy of the object. - virtual CPDF_Object* Clone() const = 0; + virtual std::unique_ptr<CPDF_Object> Clone() const = 0; + // Create a deep copy of the object except any reference object be // copied to the object it points to directly. - virtual CPDF_Object* CloneDirectObject() const; - virtual CPDF_Object* GetDirect() const; + virtual std::unique_ptr<CPDF_Object> CloneDirectObject() const; + virtual CPDF_Object* GetDirect() const; virtual CFX_ByteString GetString() const; virtual CFX_WideString GetUnicodeText() const; virtual FX_FLOAT GetNumber() const; @@ -97,7 +98,7 @@ class CPDF_Object { CPDF_Object() : m_ObjNum(0), m_GenNum(0) {} - CPDF_Object* CloneObjectNonCyclic(bool bDirect) const; + std::unique_ptr<CPDF_Object> CloneObjectNonCyclic(bool bDirect) const; // Create a deep copy of the object with the option to either // copy a reference object or directly copy the object it refers to @@ -105,7 +106,7 @@ class CPDF_Object { // Also check cyclic reference against |pVisited|, no copy if it is found. // Complex objects should implement their own CloneNonCyclic() // function to properly check for possible loop. - virtual CPDF_Object* CloneNonCyclic( + virtual std::unique_ptr<CPDF_Object> CloneNonCyclic( bool bDirect, std::set<const CPDF_Object*>* pVisited) const; |