diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-09-19 14:17:02 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-09-19 14:17:02 -0700 |
commit | 81e1e3fd2d33478733e47bd007b76fac1a663e74 (patch) | |
tree | e75e6600e3610a92d8f200c994b92e9d409faf88 /core/fpdfapi/fpdf_parser/include | |
parent | c8544d634a1993e2592e41458be215fcd0956031 (diff) | |
download | pdfium-81e1e3fd2d33478733e47bd007b76fac1a663e74.tar.xz |
Revert "Make CPDF_IndirectObjectHolder use unique_ptr to objects"
This reverts commit c8544d634a1993e2592e41458be215fcd0956031.
TBR=dsinclair@chromium.org
Review URL: https://codereview.chromium.org/2355683002 .
Diffstat (limited to 'core/fpdfapi/fpdf_parser/include')
-rw-r--r-- | core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h | 9 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_parser/include/cpdf_object.h | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h b/core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h index 2abbda2a36..57dafb0528 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h @@ -8,7 +8,6 @@ #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_INDIRECT_OBJECT_HOLDER_H_ #include <map> -#include <memory> #include "core/fxcrt/include/fx_system.h" @@ -16,8 +15,8 @@ class CPDF_Object; class CPDF_IndirectObjectHolder { public: - using const_iterator = - std::map<uint32_t, std::unique_ptr<CPDF_Object>>::const_iterator; + using iterator = std::map<uint32_t, CPDF_Object*>::iterator; + using const_iterator = std::map<uint32_t, CPDF_Object*>::const_iterator; CPDF_IndirectObjectHolder(); virtual ~CPDF_IndirectObjectHolder(); @@ -34,7 +33,9 @@ class CPDF_IndirectObjectHolder { uint32_t GetLastObjNum() const { return m_LastObjNum; } void SetLastObjNum(uint32_t objnum) { m_LastObjNum = objnum; } + iterator begin() { return m_IndirectObjs.begin(); } const_iterator begin() const { return m_IndirectObjs.begin(); } + iterator end() { return m_IndirectObjs.end(); } const_iterator end() const { return m_IndirectObjs.end(); } protected: @@ -42,7 +43,7 @@ class CPDF_IndirectObjectHolder { private: uint32_t m_LastObjNum; - std::map<uint32_t, std::unique_ptr<CPDF_Object>> m_IndirectObjs; + std::map<uint32_t, CPDF_Object*> m_IndirectObjs; }; #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_INDIRECT_OBJECT_HOLDER_H_ diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_object.h b/core/fpdfapi/fpdf_parser/include/cpdf_object.h index de14503bbb..115ce02200 100644 --- a/core/fpdfapi/fpdf_parser/include/cpdf_object.h +++ b/core/fpdfapi/fpdf_parser/include/cpdf_object.h @@ -7,7 +7,6 @@ #ifndef CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_OBJECT_H_ #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_OBJECT_H_ -#include <memory> #include <set> #include "core/fxcrt/include/fx_string.h" @@ -93,7 +92,6 @@ class CPDF_Object { 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(); |