summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_document.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-23 17:10:46 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-24 00:49:21 +0000
commit655c783b8077f18e17418a3aab9b5a07c8055049 (patch)
treee121b850ead5af67156b126c2e8d2fdcfa4be6a9 /core/fpdfapi/parser/cpdf_document.h
parent6f3593c5cdf62915fc086448312671ce1fce5291 (diff)
downloadpdfium-655c783b8077f18e17418a3aab9b5a07c8055049.tar.xz
Convert to CFX_UnownedPtr, part 3.
Remove an explicit clear to re-order the member destruction order. Change-Id: I33da3f3de4b8e8e0cfbdceaf5140e98f5d6f904a Reviewed-on: https://pdfium-review.googlesource.com/5791 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_document.h')
-rw-r--r--core/fpdfapi/parser/cpdf_document.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h
index f7fb6308c1..493c1edb32 100644
--- a/core/fpdfapi/parser/cpdf_document.h
+++ b/core/fpdfapi/parser/cpdf_document.h
@@ -50,7 +50,7 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
CPDF_Parser* GetParser() const { return m_pParser.get(); }
CPDF_Dictionary* GetRoot() const { return m_pRootDict; }
- CPDF_Dictionary* GetInfo() const { return m_pInfoDict; }
+ CPDF_Dictionary* GetInfo() const { return m_pInfoDict.Get(); }
void DeletePage(int iPage);
int GetPageCount() const;
@@ -131,13 +131,18 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
void ResetTraversal();
std::unique_ptr<CPDF_Parser> m_pParser;
- CPDF_Dictionary* m_pRootDict;
- CPDF_Dictionary* m_pInfoDict;
+
+ // TODO(tsepez): figure out why tests break if this is an UnownedPtr.
+ CPDF_Dictionary* m_pRootDict; // Not owned.
+
+ CFX_UnownedPtr<CPDF_Dictionary> m_pInfoDict;
+
// Vector of pairs to know current position in the page tree. The index in the
// vector corresponds to the level being described. The pair contains a
// pointer to the dictionary being processed at the level, and an index of the
// of the child being processed within the dictionary's /Kids array.
std::vector<std::pair<CPDF_Dictionary*, size_t>> m_pTreeTraversal;
+
// Index of the next page that will be traversed from the page tree.
int m_iNextPageToTraverse;
bool m_bReachedMaxPageLevel;