summaryrefslogtreecommitdiff
path: root/xfa/fde/css/fde_cssstyleselector.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-03 14:13:29 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-03 14:13:29 -0700
commit4d06f83da7fbc65e83ecc3c36b339c04ac1ab668 (patch)
tree183592694f9c93951838111130d78d204e1e9a68 /xfa/fde/css/fde_cssstyleselector.cpp
parent89fcde88f0c03da77d7fd83dece7726d66fd190e (diff)
downloadpdfium-4d06f83da7fbc65e83ecc3c36b339c04ac1ab668.tar.xz
Cleanup XFA-Specific memory allocators.
Remove unused "dynamic" allocator (the scary one). Use malloc/free wrapper allocator under #ifdef for CF/asan testing. Rename IFX_MEMAllocator to IFX_MemoryAllocator (MEM in all caps would imply that MEM was an acroynm, not an abbreviation). Review-Url: https://codereview.chromium.org/1944093002
Diffstat (limited to 'xfa/fde/css/fde_cssstyleselector.cpp')
-rw-r--r--xfa/fde/css/fde_cssstyleselector.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/xfa/fde/css/fde_cssstyleselector.cpp b/xfa/fde/css/fde_cssstyleselector.cpp
index 55a1477b4c..01a19267e1 100644
--- a/xfa/fde/css/fde_cssstyleselector.cpp
+++ b/xfa/fde/css/fde_cssstyleselector.cpp
@@ -247,10 +247,9 @@ CFDE_CSSAccelerator* CFDE_CSSStyleSelector::InitAccelerator() {
IFDE_CSSComputedStyle* CFDE_CSSStyleSelector::CreateComputedStyle(
IFDE_CSSComputedStyle* pParentStyle) {
- if (m_pFixedStyleStore == NULL) {
- m_pFixedStyleStore = FX_CreateAllocator(FX_ALLOCTYPE_Fixed, 16,
- sizeof(CFDE_CSSComputedStyle));
- ASSERT(m_pFixedStyleStore != NULL);
+ if (!m_pFixedStyleStore) {
+ m_pFixedStyleStore = IFX_MemoryAllocator::Create(
+ FX_ALLOCTYPE_Fixed, 16, sizeof(CFDE_CSSComputedStyle));
}
CFDE_CSSComputedStyle* pStyle = FXTARGET_NewWith(m_pFixedStyleStore)
CFDE_CSSComputedStyle(m_pFixedStyleStore);
@@ -292,8 +291,7 @@ void CFDE_CSSStyleSelector::SetStylePriority(
}
void CFDE_CSSStyleSelector::UpdateStyleIndex(uint32_t dwMediaList) {
Reset();
- m_pRuleDataStore = FX_CreateAllocator(FX_ALLOCTYPE_Static, 1024, 0);
- ASSERT(m_pRuleDataStore != NULL);
+ m_pRuleDataStore = IFX_MemoryAllocator::Create(FX_ALLOCTYPE_Static, 1024, 0);
for (int32_t iGroup = 0; iGroup < FDE_CSSSTYLESHEETGROUP_MAX; ++iGroup) {
CFDE_CSSRuleCollection& rules = m_RuleCollection[iGroup];
rules.m_pStaticStore = m_pRuleDataStore;
@@ -425,9 +423,10 @@ void CFDE_CSSStyleSelector::ComputeStyle(
static const uint32_t s_dwAlignHash = FX_HashCode_GetW(L"align", true);
if (!pTag->empty()) {
- if (!m_pInlineStyleStore)
- m_pInlineStyleStore = FX_CreateAllocator(FX_ALLOCTYPE_Static, 2048, 0);
-
+ if (!m_pInlineStyleStore) {
+ m_pInlineStyleStore =
+ IFX_MemoryAllocator::Create(FX_ALLOCTYPE_Static, 2048, 0);
+ }
CFDE_CSSDeclaration* pDecl = nullptr;
for (auto it : *pTag) {
CFX_WideString wsAttri = it.first;