Changeset 195309 in webkit
- Timestamp:
- Jan 19, 2016 12:59:56 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r195308 r195309 1 2016-01-19 Chris Dumez <cdumez@apple.com> 2 3 Unreviewed, rolling out r195173. 4 5 It relies on r195141 which was rolled out 6 7 Reverted changeset: 8 9 "Give RuleSet a BumpArena and start using it for 10 RuleDataVectors." 11 https://bugs.webkit.org/show_bug.cgi?id=153169 12 http://trac.webkit.org/changeset/195173 13 1 14 2016-01-19 Commit Queue <commit-queue@webkit.org> 2 15 -
trunk/Source/WebCore/css/RuleSet.cpp
r195173 r195309 184 184 } 185 185 186 RuleSet::RuleSet()187 : m_arena(WTF::BumpArena::create())188 {189 }190 191 186 void RuleSet::addToRuleSet(AtomicStringImpl* key, AtomRuleMap& map, const RuleData& ruleData) 192 187 { … … 195 190 auto& rules = map.add(key, nullptr).iterator->value; 196 191 if (!rules) 197 rules = RuleDataVector::create(m_arena.get());192 rules = std::make_unique<RuleDataVector>(); 198 193 rules->append(ruleData); 199 194 } … … 405 400 { 406 401 for (auto& keyValuePair : other.m_shadowPseudoElementRules) 407 m_shadowPseudoElementRules.add(keyValuePair.key, RuleDataVector::create(m_arena.get(),*keyValuePair.value));402 m_shadowPseudoElementRules.add(keyValuePair.key, std::make_unique<RuleDataVector>(*keyValuePair.value)); 408 403 409 404 #if ENABLE(VIDEO_TRACK) -
trunk/Source/WebCore/css/RuleSet.h
r195173 r195309 26 26 #include "SelectorCompiler.h" 27 27 #include "StyleRule.h" 28 #include <wtf/BumpArena.h>29 28 #include <wtf/Forward.h> 30 29 #include <wtf/HashMap.h> … … 160 159 RuleSet(); 161 160 162 class RuleDataVector : public Vector<RuleData, 1> { 163 WTF_MAKE_BUMPARENA_ALLOCATED; 164 public: 165 static std::unique_ptr<RuleDataVector> create(BumpArena& arena) 166 { 167 return std::unique_ptr<RuleDataVector>(new (&arena) RuleDataVector); 168 } 169 static std::unique_ptr<RuleDataVector> create(BumpArena& arena, const RuleDataVector& other) 170 { 171 return std::unique_ptr<RuleDataVector>(new (&arena) RuleDataVector(other)); 172 } 173 }; 174 161 typedef Vector<RuleData, 1> RuleDataVector; 175 162 typedef HashMap<AtomicStringImpl*, std::unique_ptr<RuleDataVector>> AtomRuleMap; 176 163 … … 227 214 RuleDataVector m_universalRules; 228 215 Vector<StyleRulePage*> m_pageRules; 229 unsigned m_ruleCount { 0 };230 bool m_autoShrinkToFitEnabled { true };216 unsigned m_ruleCount; 217 bool m_autoShrinkToFitEnabled; 231 218 RuleFeatureSet m_features; 232 219 Vector<RuleSetSelectorPair> m_regionSelectorsAndRuleSets; 233 Ref<BumpArena> m_arena; 234 }; 220 }; 221 222 inline RuleSet::RuleSet() 223 : m_ruleCount(0) 224 , m_autoShrinkToFitEnabled(true) 225 { 226 } 235 227 236 228 inline const RuleSet::RuleDataVector* RuleSet::tagRules(AtomicStringImpl* key, bool isHTMLName) const
Note: See TracChangeset
for help on using the changeset viewer.