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

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

Issue 2208423002: Use smart pointers for class owned pointers under xfa/fde (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: more fixes Created 4 years, 4 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
Index: xfa/fde/css/fde_cssstyleselector.h
diff --git a/xfa/fde/css/fde_cssstyleselector.h b/xfa/fde/css/fde_cssstyleselector.h
index 042e98924226db666f79b7306509a4d52c3cd9ad..5927c3181a09df0b1167ece0cf450dfc4066b161 100644
--- a/xfa/fde/css/fde_cssstyleselector.h
+++ b/xfa/fde/css/fde_cssstyleselector.h
@@ -7,6 +7,7 @@
#ifndef XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_
#define XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_
+#include <memory>
#include <vector>
#include "core/fxcrt/include/fx_ext.h"
@@ -26,8 +27,8 @@ class FDE_CSSRuleData : public CFX_Target {
CFDE_CSSDeclaration* pDecl,
uint32_t dwPos);
- CFDE_CSSSelector* pSelector;
- CFDE_CSSDeclaration* pDeclaration;
+ CFDE_CSSSelector* const pSelector;
+ CFDE_CSSDeclaration* const pDeclaration;
uint32_t dwPriority;
FDE_CSSRuleData* pNext;
};
@@ -174,15 +175,15 @@ class CFDE_CSSStyleSelector : public CFX_Target {
FDE_CSSRUBYPOSITION ToRubyPosition(FDE_CSSPROPERTYVALUE eValue);
FDE_CSSRUBYSPAN ToRubySpan(FDE_CSSPROPERTYVALUE eValue);
- IFGAS_FontMgr* m_pFontMgr;
+ IFGAS_FontMgr* m_pFontMgr; // not owned.
FX_FLOAT m_fDefFontSize;
- IFX_MemoryAllocator* m_pRuleDataStore;
+ std::unique_ptr<IFX_MemoryAllocator> m_pRuleDataStore;
CFDE_CSSStyleSheetArray m_SheetGroups[FDE_CSSSTYLESHEETGROUP_MAX];
CFDE_CSSRuleCollection m_RuleCollection[FDE_CSSSTYLESHEETGROUP_MAX];
FDE_CSSSTYLESHEETGROUP m_ePriorities[FDE_CSSSTYLESHEETPRIORITY_MAX];
- IFX_MemoryAllocator* m_pInlineStyleStore;
- IFX_MemoryAllocator* m_pFixedStyleStore;
- CFDE_CSSAccelerator* m_pAccelerator;
+ std::unique_ptr<IFX_MemoryAllocator> m_pInlineStyleStore;
+ std::unique_ptr<IFX_MemoryAllocator> m_pFixedStyleStore;
+ std::unique_ptr<CFDE_CSSAccelerator> m_pAccelerator;
std::vector<FDE_CSSRuleData*> m_MatchedRules;
};
@@ -413,7 +414,7 @@ class CFDE_CSSComputedStyle : public IFDE_CSSComputedStyle,
const CFX_WideString& wsValue);
uint32_t m_dwRefCount;
- IFX_MemoryAllocator* m_pAllocator;
+ IFX_MemoryAllocator* const m_pAllocator;
CFDE_CSSInheritedData m_InheritedData;
CFDE_CSSNonInheritedData m_NonInheritedData;
CFX_WideStringArray m_CustomProperties;

Powered by Google App Engine
This is Rietveld 408576698