Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2855)

Unified Diff: core/fpdfapi/parser/cpdf_object.h

Issue 2484033002: Return unique_ptr from CPDF_Object::Clone(). (Closed)
Patch Set: std::move() it Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/parser/cpdf_number.cpp ('k') | core/fpdfapi/parser/cpdf_object.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/parser/cpdf_object.h
diff --git a/core/fpdfapi/parser/cpdf_object.h b/core/fpdfapi/parser/cpdf_object.h
index 8f6491ec724531781e5cb97db64b5ed31abc05f1..c24b40a7896808885533b0d3bceff587907fee22 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;
« no previous file with comments | « core/fpdfapi/parser/cpdf_number.cpp ('k') | core/fpdfapi/parser/cpdf_object.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698