summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa/cpdfxfa_context.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-16 14:11:30 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-16 21:51:53 +0000
commit9792f16f3ef27a1e0c7f0526cc69637a158e3010 (patch)
tree861baddf94e96d7de9bc2c2b27409872d56ebcee /fpdfsdk/fpdfxfa/cpdfxfa_context.h
parentcc205131b021ebded854958973f445ed121da1b8 (diff)
downloadpdfium-9792f16f3ef27a1e0c7f0526cc69637a158e3010.tar.xz
Properly ref-count CPDFXFA_Page
Change-Id: Ibd1ebe4191f61e20d815de7f1a1094d78b72e6a7 Reviewed-on: https://pdfium-review.googlesource.com/5391 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_context.h')
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_context.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.h b/fpdfsdk/fpdfxfa/cpdfxfa_context.h
index 690e1855e3..6d7e33b689 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_context.h
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.h
@@ -13,11 +13,11 @@
#include "core/fxcrt/cfx_unowned_ptr.h"
#include "core/fxcrt/fx_system.h"
#include "fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h"
+#include "fpdfsdk/fpdfxfa/cpdfxfa_page.h"
#include "xfa/fxfa/cxfa_ffdoc.h"
class CJS_Runtime;
class CPDFSDK_FormFillEnvironment;
-class CPDFXFA_Page;
class CXFA_FFDocHandler;
class IJS_EventContext;
class IJS_Runtime;
@@ -48,14 +48,10 @@ class CPDFXFA_Context : public IXFA_AppProvider {
}
void SetFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv);
- void DeletePage(int page_index);
int GetPageCount() const;
-
- CPDFXFA_Page* GetXFAPage(int page_index);
- CPDFXFA_Page* GetXFAPage(CXFA_FFPageView* pPage) const;
-
- void RemovePage(CPDFXFA_Page* page);
-
+ void DeletePage(int page_index);
+ CFX_RetainPtr<CPDFXFA_Page> GetXFAPage(int page_index);
+ CFX_RetainPtr<CPDFXFA_Page> GetXFAPage(CXFA_FFPageView* pPage) const;
void ClearChangeMark();
// IFXA_AppProvider:
@@ -97,20 +93,21 @@ class CPDFXFA_Context : public IXFA_AppProvider {
}
LoadStatus GetLoadStatus() const { return m_nLoadStatus; }
- std::vector<CPDFXFA_Page*>* GetXFAPageList() { return &m_XFAPageList; }
+ std::vector<CFX_RetainPtr<CPDFXFA_Page>>* GetXFAPageList() {
+ return &m_XFAPageList;
+ }
private:
void CloseXFADoc();
XFA_DocType m_iDocType;
-
std::unique_ptr<CPDF_Document> m_pPDFDoc;
std::unique_ptr<CXFA_FFDoc> m_pXFADoc;
CFX_UnownedPtr<CPDFSDK_FormFillEnvironment> m_pFormFillEnv;
CFX_UnownedPtr<CXFA_FFDocView> m_pXFADocView;
std::unique_ptr<CXFA_FFApp> m_pXFAApp;
std::unique_ptr<CJS_Runtime> m_pRuntime;
- std::vector<CPDFXFA_Page*> m_XFAPageList;
+ std::vector<CFX_RetainPtr<CPDFXFA_Page>> m_XFAPageList;
LoadStatus m_nLoadStatus;
int m_nPageCount;