From d15ce4c1e088e8bc084b52b0acdb5f0ef6597f95 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 19 May 2017 17:08:52 -0700 Subject: Use observed ptrs from CFGAS_GEFont back to its font mgrs. CFGAS_GEFonts are ref counted, and its a good thing since they are managed by at least three different font managers: CFGAS_FontMgr, CXFA_PDFFontMgr, and CXFA_FontMgr. None of these have a clear claim to ownership of the CFGAS_GEFont. CFGAS_GEFont has back-pointers to two of these, CFGAS_FontMgr, and CXFA_PDFFontMgr, and they could each outlive the other. Thus the font needs to watch for destruction of either of its managers, so as to stop using it after its gone. Bug: 724640 Change-Id: I907ec35e300e11e532e13545d51fb200ac86b4f9 Reviewed-on: https://pdfium-review.googlesource.com/5735 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- xfa/fxfa/cxfa_pdffontmgr.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xfa/fxfa/cxfa_pdffontmgr.h') diff --git a/xfa/fxfa/cxfa_pdffontmgr.h b/xfa/fxfa/cxfa_pdffontmgr.h index 1188ce1fba..d0a824067a 100644 --- a/xfa/fxfa/cxfa_pdffontmgr.h +++ b/xfa/fxfa/cxfa_pdffontmgr.h @@ -11,15 +11,16 @@ #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_document.h" +#include "core/fxcrt/cfx_observable.h" #include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_string.h" -#include "xfa/fgas/font/cfgas_gefont.h" #include "xfa/fxfa/cxfa_ffdoc.h" +class CFGAS_GEFont; class CPDF_Font; class CXFA_FFDoc; -class CXFA_PDFFontMgr { +class CXFA_PDFFontMgr : public CFX_Observable { public: explicit CXFA_PDFFontMgr(CXFA_FFDoc* pDoc); ~CXFA_PDFFontMgr(); -- cgit v1.2.3