From 08f4b7762a4453818c76c680f5295986e21418ce Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 23 May 2017 17:21:01 -0700 Subject: Convert to CFX_UnownedPtr, part 4. Fix strange ownership issue in cpdf_type3char.cpp, and describe the absolutely insane stuff happening there. Change-Id: Iae70f9eca8f125ed3ef677729f1776ba9f10183c Reviewed-on: https://pdfium-review.googlesource.com/5830 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- core/fpdfapi/edit/cpdf_creator.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'core/fpdfapi/edit/cpdf_creator.h') diff --git a/core/fpdfapi/edit/cpdf_creator.h b/core/fpdfapi/edit/cpdf_creator.h index 618fffde79..f141c3880a 100644 --- a/core/fpdfapi/edit/cpdf_creator.h +++ b/core/fpdfapi/edit/cpdf_creator.h @@ -12,6 +12,7 @@ #include #include "core/fxcrt/cfx_retain_ptr.h" +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_basic.h" class CPDF_Array; @@ -40,9 +41,9 @@ class CPDF_Creator { uint32_t GetNextObjectNumber() { return ++m_dwLastObjNum; } uint32_t GetLastObjectNumber() const { return m_dwLastObjNum; } CPDF_CryptoHandler* GetCryptoHandler() { return m_pCryptoHandler.Get(); } - CPDF_Document* GetDocument() const { return m_pDocument; } + CPDF_Document* GetDocument() const { return m_pDocument.Get(); } CPDF_Array* GetIDArray() const { return m_pIDArray.get(); } - CPDF_Dictionary* GetEncryptDict() const { return m_pEncryptDict; } + CPDF_Dictionary* GetEncryptDict() const { return m_pEncryptDict.Get(); } uint32_t GetEncryptObjectNumber() const { return m_dwEncryptObjNum; } uint32_t GetObjectOffset(uint32_t objnum) { return m_ObjectOffsets[objnum]; } @@ -79,13 +80,13 @@ class CPDF_Creator { bool IsXRefNeedEnd(); - CPDF_Document* const m_pDocument; - CPDF_Parser* const m_pParser; + CFX_UnownedPtr const m_pDocument; + CFX_UnownedPtr const m_pParser; bool m_bSecurityChanged; - CPDF_Dictionary* m_pEncryptDict; + CFX_UnownedPtr m_pEncryptDict; uint32_t m_dwEncryptObjNum; CFX_RetainPtr m_pCryptoHandler; - CPDF_Object* m_pMetadata; + CFX_UnownedPtr m_pMetadata; uint32_t m_dwLastObjNum; std::unique_ptr m_Archive; FX_FILESIZE m_SavedOffset; -- cgit v1.2.3