diff options
author | Lei Zhang <thestig@chromium.org> | 2018-09-14 23:19:51 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-09-14 23:19:51 +0000 |
commit | 3db36ef21df4187877f50212aec43ad865abb42c (patch) | |
tree | fb715766112eaca23362fbc1e74cf55568fc383f /core/fpdfapi/parser/cpdf_document.h | |
parent | 75560afd066b5a7e8f050232964bb013fa355f83 (diff) | |
download | pdfium-3db36ef21df4187877f50212aec43ad865abb42c.tar.xz |
Add CPDF_Document::StockFontClearer.
So CPDF_Document's dtor does not have to do any explicit cleanup.
Change-Id: Iaec7d18f67422914542fc1dc5f3b1b5a9cf5ffc5
Reviewed-on: https://pdfium-review.googlesource.com/42551
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_document.h')
-rw-r--r-- | core/fpdfapi/parser/cpdf_document.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h index 09bfb21550..be3f30ce5d 100644 --- a/core/fpdfapi/parser/cpdf_document.h +++ b/core/fpdfapi/parser/cpdf_document.h @@ -125,6 +125,15 @@ class CPDF_Document : public Observable<CPDF_Document>, #endif protected: + class StockFontClearer { + public: + explicit StockFontClearer(CPDF_Document* pDoc); + ~StockFontClearer(); + + private: + UnownedPtr<CPDF_Document> const m_pDoc; + }; + // Retrieve page count information by getting count value from the tree nodes int RetrievePageCount(); // When this method is called, m_pTreeTraversal[level] exists. @@ -171,6 +180,11 @@ class CPDF_Document : public Observable<CPDF_Document>, std::unique_ptr<JBig2_DocumentContext> m_pCodecContext; std::unique_ptr<CPDF_LinkList> m_pLinksContext; std::vector<uint32_t> m_PageList; // Page number to page's dict objnum. + + // Must be second to last. + StockFontClearer m_StockFontClearer; + + // Must be last. Destroy the extension before any non-extension teardown. std::unique_ptr<Extension> m_pExtension; }; |