summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_document.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-05-31 23:38:32 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-31 23:38:32 +0000
commit2d11d72e326140b9abeb6de2db1e28e5bf9d7e64 (patch)
treeffd41a61a342924bded55443d6a478b3f8caee0f /core/fpdfapi/parser/cpdf_document.h
parent73659ee409ae4840c5019633a5c4000eececd7c0 (diff)
downloadpdfium-2d11d72e326140b9abeb6de2db1e28e5bf9d7e64.tar.xz
Make CPDF_Document own its Extension.
Inverting the ownership from the current situation makes cleanup much more intuitive. Change-Id: Iad9a7ca70c0746170ba753297732e3e34f96c5ba Reviewed-on: https://pdfium-review.googlesource.com/33190 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_document.h')
-rw-r--r--core/fpdfapi/parser/cpdf_document.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h
index c240e77567..c096e89e28 100644
--- a/core/fpdfapi/parser/cpdf_document.h
+++ b/core/fpdfapi/parser/cpdf_document.h
@@ -56,8 +56,10 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
explicit CPDF_Document(std::unique_ptr<CPDF_Parser> pParser);
~CPDF_Document() override;
- Extension* GetExtension() const { return m_pExtension.Get(); }
- void SetExtension(Extension* pExt) { m_pExtension = pExt; }
+ Extension* GetExtension() const { return m_pExtension.get(); }
+ void SetExtension(std::unique_ptr<Extension> pExt) {
+ m_pExtension = std::move(pExt);
+ }
CPDF_Parser* GetParser() const { return m_pParser.get(); }
const CPDF_Dictionary* GetRoot() const { return m_pRootDict; }
@@ -176,7 +178,7 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
// Dict {objnum, gennum} to page mapping.
std::map<std::pair<uint32_t, uint32_t>, CPDF_Page::ObservedPtr> m_PageMap;
- UnownedPtr<Extension> m_pExtension;
+ std::unique_ptr<Extension> m_pExtension;
};
#endif // CORE_FPDFAPI_PARSER_CPDF_DOCUMENT_H_