diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-06-05 19:24:42 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-06-05 19:24:42 +0000 |
commit | 778e59ed40ed31f6176a68253b694acd31f640c9 (patch) | |
tree | 8fbaac034139d4a64a561f481c56eaf28d2b8118 /core/fpdfapi/page/cpdf_page.cpp | |
parent | 354ed202ccd4d6b9d408789a30517ebb1633570b (diff) | |
download | pdfium-778e59ed40ed31f6176a68253b694acd31f640c9.tar.xz |
Tidy parser lifecycle state machine in CPDF_PageObjectHolder.
Only update state in CPDF_PageObjectHolder itself.
Make more data private.
Remove CPDF_Page::GetPageBBox() as exact duplicate of
CPDF_PageObjectHolder::GetBBox().
Change-Id: I083ec33f61a1490e7a5e673c9787751af15a6cd1
Reviewed-on: https://pdfium-review.googlesource.com/33810
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_page.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_page.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/core/fpdfapi/page/cpdf_page.cpp b/core/fpdfapi/page/cpdf_page.cpp index 7c0a3234c9..019c2b6418 100644 --- a/core/fpdfapi/page/cpdf_page.cpp +++ b/core/fpdfapi/page/cpdf_page.cpp @@ -78,16 +78,14 @@ bool CPDF_Page::IsPage() const { return true; } -void CPDF_Page::StartParse() { - if (m_ParseState == CONTENT_PARSED || m_ParseState == CONTENT_PARSING) +void CPDF_Page::ParseContent() { + if (GetParseState() == ParseState::kParsed) return; - m_pParser = pdfium::MakeUnique<CPDF_ContentParser>(this); - m_ParseState = CONTENT_PARSING; -} + if (GetParseState() == ParseState::kNotParsed) + StartParse(pdfium::MakeUnique<CPDF_ContentParser>(this)); -void CPDF_Page::ParseContent() { - StartParse(); + ASSERT(GetParseState() == ParseState::kParsing); ContinueParse(nullptr); } @@ -97,7 +95,7 @@ void CPDF_Page::SetRenderContext( } CPDF_Object* CPDF_Page::GetPageAttr(const ByteString& name) const { - CPDF_Dictionary* pPageDict = m_pFormDict.Get(); + CPDF_Dictionary* pPageDict = GetFormDict(); std::set<CPDF_Dictionary*> visited; while (1) { visited.insert(pPageDict); |