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

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

Issue 2470803003: Traverse PDF page tree only once in CPDF_Document Try 3 (Closed)
Patch Set: Rebase, nits 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
« no previous file with comments | « no previous file | core/fpdfapi/parser/cpdf_document.cpp » ('j') | core/fpdfapi/parser/cpdf_document.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/parser/cpdf_document.h
diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h
index e1135260ee0543aea0c0d01449ca88ce4e7bbfe7..a9f58f358dc796bc4facf2f9951e8c4269516c83 100644
--- a/core/fpdfapi/parser/cpdf_document.h
+++ b/core/fpdfapi/parser/cpdf_document.h
@@ -105,10 +105,7 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
protected:
// Retrieve page count information by getting count value from the tree nodes
int RetrievePageCount() const;
- CPDF_Dictionary* FindPDFPage(CPDF_Dictionary* pPages,
- int iPage,
- int nPagesToGo,
- int level);
+ CPDF_Dictionary* TraversePDFPages(int iPage, int& nPagesToGo, int level);
Tom Sepez 2016/11/03 22:31:00 nit: the style guide would say int* nPagesToGo.
npm 2016/11/04 19:33:33 Done.
int FindPageIndex(CPDF_Dictionary* pNode,
uint32_t& skip_count,
uint32_t objnum,
@@ -134,6 +131,11 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
std::unique_ptr<CPDF_Parser> m_pParser;
CPDF_Dictionary* m_pRootDict;
CPDF_Dictionary* m_pInfoDict;
+ // Vector of nodes to know current position in the page tree. Int is the index
Lei Zhang 2016/11/04 01:38:52 Maybe mention the index into this vector is the le
npm 2016/11/04 19:33:33 Done.
+ // of the child being processed.
Tom Sepez 2016/11/03 22:31:00 nit: // of the child being processed within the d
npm 2016/11/04 19:33:33 Done.
+ std::vector<std::pair<CPDF_Dictionary*, int>> m_pTreeTraversal;
Lei Zhang 2016/11/04 01:38:52 Should the int also be a size_t here?
npm 2016/11/04 19:33:33 Done.
+ // Index of the next page that will be traversed from the page tree.
+ int m_iNextPageToTraverse;
bool m_bLinearized;
int m_iFirstPageNo;
uint32_t m_dwFirstPageObjNum;
« no previous file with comments | « no previous file | core/fpdfapi/parser/cpdf_document.cpp » ('j') | core/fpdfapi/parser/cpdf_document.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698