diff options
author | tsepez <tsepez@chromium.org> | 2016-05-25 14:58:09 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-25 14:58:09 -0700 |
commit | 1e2c557e0fa0e47c8bafdb31c833ea4f90f5fedd (patch) | |
tree | 86c90cdb10f3c478570934816a56070ed6d51260 /fpdfsdk/include | |
parent | edfd3c3d6a56bee2456e96df4b945c095ea3a290 (diff) | |
download | pdfium-1e2c557e0fa0e47c8bafdb31c833ea4f90f5fedd.tar.xz |
Remove CFX_PrivateData from CPDF_Page
CFX_PrivateData served two purposes here:
The first was to hold an opaque pointer to the corresponding
page structure in the next higher layer, of which it knows
no details. Introduce an empty CPDF_Page::View class to
represent this higher class, so as to get type safety while
preserving layering.
The second was to hold an opaque render context, which it
also happened to own. Make this a CFX_Deletable to help
with management.
Also remove an unused inheritance from CFX_PrivateData
in CPDF_Annot.
Review-Url: https://codereview.chromium.org/2008553008
Diffstat (limited to 'fpdfsdk/include')
-rw-r--r-- | fpdfsdk/include/fsdk_define.h | 1 | ||||
-rw-r--r-- | fpdfsdk/include/fsdk_mgr.h | 3 | ||||
-rw-r--r-- | fpdfsdk/include/fsdk_rendercontext.h | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/fpdfsdk/include/fsdk_define.h b/fpdfsdk/include/fsdk_define.h index f3ed2da00f..536e35886f 100644 --- a/fpdfsdk/include/fsdk_define.h +++ b/fpdfsdk/include/fsdk_define.h @@ -109,7 +109,6 @@ FPDF_DOCUMENT FPDFDocumentFromCPDFDocument(CPDF_Document* doc); CPDF_Page* CPDFPageFromFPDFPage(FPDF_PAGE page); -void DropContext(void* data); void FSDK_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable); FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy); void FPDF_RenderPage_Retail(CRenderContext* pContext, diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h index ca46a069f1..a47f230c92 100644 --- a/fpdfsdk/include/fsdk_mgr.h +++ b/fpdfsdk/include/fsdk_mgr.h @@ -11,6 +11,7 @@ #include <memory> #include <vector> +#include "core/fpdfapi/fpdf_page/include/cpdf_page.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" #include "fpdfsdk/cfx_systemhandler.h" #include "fpdfsdk/include/fsdk_actionhandler.h" @@ -530,7 +531,7 @@ class CPDFSDK_Document { FX_BOOL m_bBeingDestroyed; }; -class CPDFSDK_PageView final { +class CPDFSDK_PageView final : public CPDF_Page::View { public: CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc, UnderlyingPageType* page); ~CPDFSDK_PageView(); diff --git a/fpdfsdk/include/fsdk_rendercontext.h b/fpdfsdk/include/fsdk_rendercontext.h index f984a64583..1bcd076466 100644 --- a/fpdfsdk/include/fsdk_rendercontext.h +++ b/fpdfsdk/include/fsdk_rendercontext.h @@ -8,14 +8,15 @@ #define FPDFSDK_INCLUDE_FSDK_RENDERCONTEXT_H_ #include "core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h" +#include "core/fxcrt/include/fx_basic.h" #include "fpdfsdk/include/fsdk_define.h" #include "public/fpdf_progressive.h" // Everything about rendering is put here: for OOM recovery -class CRenderContext { +class CRenderContext : public CFX_Deletable { public: CRenderContext() { Clear(); } - ~CRenderContext(); + ~CRenderContext() override; void Clear(); |