summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_parser/include
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-08-23 20:13:41 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-23 20:13:41 -0700
commit03bd7c78ff0411f0db033b5e6b5bf00c7fe2fb87 (patch)
tree76c4090fc95f5efa8d3fa4f47a14e7607ad881a8 /core/fpdfapi/fpdf_parser/include
parent8252bc1e5a42ab406fb5f9f968623ea0c83b8656 (diff)
downloadpdfium-03bd7c78ff0411f0db033b5e6b5bf00c7fe2fb87.tar.xz
IndirectObjectHolder API updates
This Cl updates the names of the methods in the indirect object holder to better reflect their usage. The m_LastObjNum is made private and a setter added. Review-Url: https://codereview.chromium.org/2275593002
Diffstat (limited to 'core/fpdfapi/fpdf_parser/include')
-rw-r--r--core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h15
1 files changed, 10 insertions, 5 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 c29746fdd7..31e0aba5ea 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h
@@ -22,14 +22,17 @@ class CPDF_IndirectObjectHolder {
explicit CPDF_IndirectObjectHolder(CPDF_Parser* pParser);
~CPDF_IndirectObjectHolder();
- CPDF_Object* GetIndirectObject(uint32_t objnum);
- uint32_t AddIndirectObject(CPDF_Object* pObj);
+ CPDF_Object* GetOrParseIndirectObject(uint32_t objnum);
void ReleaseIndirectObject(uint32_t objnum);
- // Takes ownership of |pObj|.
- bool InsertIndirectObject(uint32_t objnum, CPDF_Object* pObj);
+ // Take ownership of |pObj|.
+ uint32_t AddIndirectObject(CPDF_Object* pObj);
+ bool ReplaceIndirectObjectIfHigherGeneration(uint32_t objnum,
+ CPDF_Object* pObj);
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(); }
@@ -37,8 +40,10 @@ class CPDF_IndirectObjectHolder {
protected:
CPDF_Parser* m_pParser;
- uint32_t m_LastObjNum;
std::map<uint32_t, CPDF_Object*> m_IndirectObjs;
+
+ private:
+ uint32_t m_LastObjNum;
};
#endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_INDIRECT_OBJECT_HOLDER_H_