diff options
author | tsepez <tsepez@chromium.org> | 2017-01-02 06:14:29 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2017-01-02 06:14:29 -0800 |
commit | aea77059d309820dbcea9ec3e583fa673960a0b9 (patch) | |
tree | cab0ca95ed9b316bb9f4a0d778fd525124d50ae7 /core/fpdfapi/parser/cpdf_data_avail.h | |
parent | d0bbccdd32113baf95ae16565c0314166d989638 (diff) | |
download | pdfium-aea77059d309820dbcea9ec3e583fa673960a0b9.tar.xz |
Use vector of unique_ptrs for page node children.
Also be sure that a loop terminates without relying on
specific behaviour of the callers.
Review-Url: https://codereview.chromium.org/2598473002
Diffstat (limited to 'core/fpdfapi/parser/cpdf_data_avail.h')
-rw-r--r-- | core/fpdfapi/parser/cpdf_data_avail.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/fpdfapi/parser/cpdf_data_avail.h b/core/fpdfapi/parser/cpdf_data_avail.h index 1ced2a2133..42013e93ec 100644 --- a/core/fpdfapi/parser/cpdf_data_avail.h +++ b/core/fpdfapi/parser/cpdf_data_avail.h @@ -121,7 +121,7 @@ class CPDF_DataAvail final { PDF_PAGENODE_TYPE m_type; uint32_t m_dwPageNo; - CFX_ArrayTemplate<PageNode*> m_childNode; + std::vector<std::unique_ptr<PageNode>> m_ChildNodes; }; static const int kMaxDataAvailRecursionDepth = 64; @@ -179,14 +179,14 @@ class CPDF_DataAvail final { bool CheckPage(uint32_t dwPage, DownloadHints* pHints); bool LoadDocPages(DownloadHints* pHints); bool LoadDocPage(uint32_t dwPage, DownloadHints* pHints); - bool CheckPageNode(PageNode& pageNodes, + bool CheckPageNode(const PageNode& pageNode, int32_t iPage, int32_t& iCount, DownloadHints* pHints, int level); - bool CheckUnkownPageNode(uint32_t dwPageNo, - PageNode* pPageNode, - DownloadHints* pHints); + bool CheckUnknownPageNode(uint32_t dwPageNo, + PageNode* pPageNode, + DownloadHints* pHints); bool CheckArrayPageNode(uint32_t dwPageNo, PageNode* pPageNode, DownloadHints* pHints); @@ -247,7 +247,7 @@ class CPDF_DataAvail final { FX_FILESIZE m_dwPrevXRefOffset; bool m_bTotalLoadPageTree; bool m_bCurPageDictLoadOK; - PageNode m_pageNodes; + PageNode m_PageNode; std::set<uint32_t> m_pageMapCheckState; std::set<uint32_t> m_pagesLoadState; std::unique_ptr<CPDF_HintTables> m_pHintTables; |