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

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

Issue 2479303002: Use unique_ptr return from CPDF_Parser::ParseIndirectObject() (Closed)
Patch Set: Work around android 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
Index: core/fpdfapi/parser/cpdf_data_avail.h
diff --git a/core/fpdfapi/parser/cpdf_data_avail.h b/core/fpdfapi/parser/cpdf_data_avail.h
index e4fc7bad8ba13db1f40522f84fed03d2475d47c1..250064f38adfe21971825cfe1b50a19391417e3f 100644
--- a/core/fpdfapi/parser/cpdf_data_avail.h
+++ b/core/fpdfapi/parser/cpdf_data_avail.h
@@ -156,13 +156,13 @@ class CPDF_DataAvail final {
void SetStartOffset(FX_FILESIZE dwOffset);
bool GetNextToken(CFX_ByteString& token);
bool GetNextChar(uint8_t& ch);
- CPDF_Object* ParseIndirectObjectAt(
+ std::unique_ptr<CPDF_Object> ParseIndirectObjectAt(
FX_FILESIZE pos,
uint32_t objnum,
CPDF_IndirectObjectHolder* pObjList = nullptr);
- CPDF_Object* GetObject(uint32_t objnum,
- DownloadHints* pHints,
- bool* pExistInFile);
+ std::unique_ptr<CPDF_Object> GetObject(uint32_t objnum,
+ DownloadHints* pHints,
+ bool* pExistInFile);
bool GetPageKids(CPDF_Parser* pParser, CPDF_Object* pPages);
bool PreparePageItem();
bool LoadPages(DownloadHints* pHints);
@@ -197,7 +197,7 @@ class CPDF_DataAvail final {
IFX_SeekableReadStream* const m_pFileRead;
CPDF_Parser m_parser;
CPDF_SyntaxParser m_syntaxParser;
- CPDF_Object* m_pRoot;
+ std::unique_ptr<CPDF_Object> m_pRoot;
uint32_t m_dwRootObjNum;
uint32_t m_dwInfoObjNum;
std::unique_ptr<CPDF_LinearizedHeader> m_pLinearized;
@@ -239,7 +239,7 @@ class CPDF_DataAvail final {
bool m_bNeedDownLoadResource;
bool m_bPageLoadedOK;
bool m_bLinearizedFormParamLoad;
- std::vector<CPDF_Object*> m_PagesArray;
+ std::vector<std::unique_ptr<CPDF_Object>> m_PagesArray;
uint32_t m_dwEncryptObjNum;
FX_FILESIZE m_dwPrevXRefOffset;
bool m_bTotalLoadPageTree;

Powered by Google App Engine
This is Rietveld 408576698