summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_document.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-06-26 15:19:38 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-26 15:19:38 +0000
commitb86544285e263310c1017a3aa056d71e68c5d5a1 (patch)
treef35299979dadda2c22f580606e8164cdc84e0d36 /core/fpdfapi/parser/cpdf_document.h
parent8625d3b73eb51d2100cdf15e7a43b998b8251dc9 (diff)
downloadpdfium-b86544285e263310c1017a3aa056d71e68c5d5a1.tar.xz
Make CPDF_Document::m_pRootDict an UnownedPtr<>.
In turn, this requires making some of the tests use an indirect root dictionary so as to satisfy the lifetime requirements. Change-Id: Ibdbe294a76200d4486134e5848c169a6c2d802bf Reviewed-on: https://pdfium-review.googlesource.com/36110 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_document.h')
-rw-r--r--core/fpdfapi/parser/cpdf_document.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h
index 94d20504c5..db659b38c8 100644
--- a/core/fpdfapi/parser/cpdf_document.h
+++ b/core/fpdfapi/parser/cpdf_document.h
@@ -61,8 +61,7 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
}
CPDF_Parser* GetParser() const { return m_pParser.get(); }
- const CPDF_Dictionary* GetRoot() const { return m_pRootDict; }
- CPDF_Dictionary* GetRoot() { return m_pRootDict; }
+ CPDF_Dictionary* GetRoot() const { return m_pRootDict.Get(); }
CPDF_Dictionary* GetInfo();
void DeletePage(int iPage);
@@ -148,10 +147,7 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
void ResetTraversal();
std::unique_ptr<CPDF_Parser> m_pParser;
-
- // TODO(tsepez): figure out why tests break if this is an UnownedPtr.
- CPDF_Dictionary* m_pRootDict; // Not owned.
-
+ UnownedPtr<CPDF_Dictionary> m_pRootDict;
UnownedPtr<CPDF_Dictionary> m_pInfoDict;
// Vector of pairs to know current position in the page tree. The index in the