summaryrefslogtreecommitdiff
path: root/xfa/fde/css/cfde_cssstyleselector.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-01-23 16:24:26 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-01-24 15:05:29 +0000
commit7e5fdd0b1a2ce17e89723fee3e58ae472e32461f (patch)
treee8e14a43410d3d159cef27a0140c4fa8a633f8db /xfa/fde/css/cfde_cssstyleselector.cpp
parentaee2d80f628ba02d0561c921b7bb1939b3480fca (diff)
downloadpdfium-7e5fdd0b1a2ce17e89723fee3e58ae472e32461f.tar.xz
Track CFDE_CSSComputedStyle with retained ptrs
Remove the bare new and use CFX_RetainPtr to keep track of the computed styles. Change-Id: Icf235623529797176707482c78676814b7a81b9e Reviewed-on: https://pdfium-review.googlesource.com/2292 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fde/css/cfde_cssstyleselector.cpp')
-rw-r--r--xfa/fde/css/cfde_cssstyleselector.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/xfa/fde/css/cfde_cssstyleselector.cpp b/xfa/fde/css/cfde_cssstyleselector.cpp
index 63d8e0986b..1b4aa0e13b 100644
--- a/xfa/fde/css/cfde_cssstyleselector.cpp
+++ b/xfa/fde/css/cfde_cssstyleselector.cpp
@@ -55,9 +55,9 @@ CFDE_CSSAccelerator* CFDE_CSSStyleSelector::InitAccelerator() {
return m_pAccelerator.get();
}
-CFDE_CSSComputedStyle* CFDE_CSSStyleSelector::CreateComputedStyle(
+CFX_RetainPtr<CFDE_CSSComputedStyle> CFDE_CSSStyleSelector::CreateComputedStyle(
CFDE_CSSComputedStyle* pParentStyle) {
- CFDE_CSSComputedStyle* pStyle = new CFDE_CSSComputedStyle();
+ auto pStyle = pdfium::MakeRetain<CFDE_CSSComputedStyle>();
if (pParentStyle)
pStyle->m_InheritedData = pParentStyle->m_InheritedData;
return pStyle;
@@ -77,6 +77,7 @@ int32_t CFDE_CSSStyleSelector::MatchDeclarations(
CXFA_CSSTagProvider* pTag,
CFX_ArrayTemplate<CFDE_CSSDeclaration*>& matchedDecls) {
ASSERT(pTag);
+
CFDE_CSSTagCache* pCache = m_pAccelerator->top();
ASSERT(pCache && pCache->GetTag() == pTag);