summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_parser.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-07 13:49:17 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-07 13:49:17 -0800
commit5ab31ef3ed4c86211f1ebb3686abb4f5a66472ec (patch)
tree87c1fda94151528b7fcfa3a18cfda87a78cd3b4f /core/fpdfapi/parser/cpdf_parser.h
parentc09625ca59701fabeb49dc59edcf33031b2c6672 (diff)
downloadpdfium-5ab31ef3ed4c86211f1ebb3686abb4f5a66472ec.tar.xz
Use unique_ptr return from CPDF_Parser::ParseIndirectObject()
In turn, propgate to callers. This introduces a few release() calls that will go away as more code is converted. It also removes a couple of WrapUnique calls that are no longer needed as ownership of the object flows along. Review-Url: https://codereview.chromium.org/2479303002
Diffstat (limited to 'core/fpdfapi/parser/cpdf_parser.h')
-rw-r--r--core/fpdfapi/parser/cpdf_parser.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.h b/core/fpdfapi/parser/cpdf_parser.h
index faac6c5195..007193b3ea 100644
--- a/core/fpdfapi/parser/cpdf_parser.h
+++ b/core/fpdfapi/parser/cpdf_parser.h
@@ -59,8 +59,9 @@ class CPDF_Parser {
CPDF_Dictionary* GetEncryptDict() const { return m_pEncryptDict; }
- CPDF_Object* ParseIndirectObject(CPDF_IndirectObjectHolder* pObjList,
- uint32_t objnum);
+ std::unique_ptr<CPDF_Object> ParseIndirectObject(
+ CPDF_IndirectObjectHolder* pObjList,
+ uint32_t objnum);
uint32_t GetLastObjNum() const;
bool IsValidObjectNumber(uint32_t objnum) const;
@@ -79,11 +80,12 @@ class CPDF_Parser {
int GetFileVersion() const { return m_FileVersion; }
bool IsXRefStream() const { return m_bXRefStream; }
- CPDF_Object* ParseIndirectObjectAt(CPDF_IndirectObjectHolder* pObjList,
- FX_FILESIZE pos,
- uint32_t objnum);
+ std::unique_ptr<CPDF_Object> ParseIndirectObjectAt(
+ CPDF_IndirectObjectHolder* pObjList,
+ FX_FILESIZE pos,
+ uint32_t objnum);
- CPDF_Object* ParseIndirectObjectAtByStrict(
+ std::unique_ptr<CPDF_Object> ParseIndirectObjectAtByStrict(
CPDF_IndirectObjectHolder* pObjList,
FX_FILESIZE pos,
uint32_t objnum,