Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(611)

Unified Diff: xfa/fde/css/fde_cssstyleselector.cpp

Issue 1944093002: Cleanup XFA-Specific memory allocators. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Dan's comments, remove more unused methods. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fde/css/fde_cssstyleselector.h ('k') | xfa/fde/css/fde_cssstylesheet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fde/css/fde_cssstyleselector.cpp
diff --git a/xfa/fde/css/fde_cssstyleselector.cpp b/xfa/fde/css/fde_cssstyleselector.cpp
index 55a1477b4c619ea6d8ece74704cb5153d840116f..01a19267e1f58e3d2e4bb36cd66056e00152edb2 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;
« no previous file with comments | « xfa/fde/css/fde_cssstyleselector.h ('k') | xfa/fde/css/fde_cssstylesheet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698