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

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

Issue 2478253002: Revert of Remove CPDF_Object::Release() in favor of direct delete (Closed)
Patch Set: 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_indirect_object_holder.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..c888605d72a54265ae96ce2c2bce237cc2da124a 100644
--- a/core/fpdfapi/parser/cpdf_object.h
+++ b/core/fpdfapi/parser/cpdf_object.h
@@ -38,8 +38,6 @@
REFERENCE
};
- virtual ~CPDF_Object();
-
virtual Type GetType() const = 0;
uint32_t GetObjNum() const { return m_ObjNum; }
uint32_t GetGenNum() const { return m_GenNum; }
@@ -51,6 +49,8 @@
// copied to the object it points to directly.
virtual CPDF_Object* CloneDirectObject() const;
virtual CPDF_Object* GetDirect() const;
+
+ void Release();
virtual CFX_ByteString GetString() const;
virtual CFX_WideString GetUnicodeText() const;
@@ -94,8 +94,10 @@
friend class CPDF_Parser;
friend class CPDF_Reference;
friend class CPDF_Stream;
+ friend struct std::default_delete<CPDF_Object>;
CPDF_Object() : m_ObjNum(0), m_GenNum(0) {}
+ virtual ~CPDF_Object();
CPDF_Object* CloneObjectNonCyclic(bool bDirect) const;
@@ -116,4 +118,6 @@
CPDF_Object(const CPDF_Object& src) {}
};
+using UniqueObject = std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>>;
+
#endif // CORE_FPDFAPI_PARSER_CPDF_OBJECT_H_
« no previous file with comments | « core/fpdfapi/parser/cpdf_indirect_object_holder.cpp ('k') | core/fpdfapi/parser/cpdf_object.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698