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

Side by Side Diff: Source/core/css/RuleFeature.h

Issue 1304623002: Make blink classes and structures in core/css fast-allocated (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing (Fixed windows compile error) Created 5 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 unified diff | Download patch
« no previous file with comments | « Source/core/css/RemoteFontFaceSource.h ('k') | Source/core/css/RuleSet.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 WillBeHeapVector<RuleFeature> uncommonAttributeRules; 98 WillBeHeapVector<RuleFeature> uncommonAttributeRules;
99 99
100 protected: 100 protected:
101 DescendantInvalidationSet* invalidationSetForSelector(const CSSSelector&); 101 DescendantInvalidationSet* invalidationSetForSelector(const CSSSelector&);
102 102
103 private: 103 private:
104 using InvalidationSetMap = WillBeHeapHashMap<AtomicString, RefPtrWillBeMembe r<DescendantInvalidationSet>>; 104 using InvalidationSetMap = WillBeHeapHashMap<AtomicString, RefPtrWillBeMembe r<DescendantInvalidationSet>>;
105 using PseudoTypeInvalidationSetMap = WillBeHeapHashMap<CSSSelector::PseudoTy pe, RefPtrWillBeMember<DescendantInvalidationSet>, WTF::IntHash<unsigned>, WTF:: UnsignedWithZeroKeyHashTraits<unsigned>>; 105 using PseudoTypeInvalidationSetMap = WillBeHeapHashMap<CSSSelector::PseudoTy pe, RefPtrWillBeMember<DescendantInvalidationSet>, WTF::IntHash<unsigned>, WTF:: UnsignedWithZeroKeyHashTraits<unsigned>>;
106 106
107 struct FeatureMetadata { 107 struct FeatureMetadata {
108 DISALLOW_ALLOCATION();
108 FeatureMetadata() 109 FeatureMetadata()
109 : usesFirstLineRules(false) 110 : usesFirstLineRules(false)
110 , usesWindowInactiveSelector(false) 111 , usesWindowInactiveSelector(false)
111 , foundSiblingSelector(false) 112 , foundSiblingSelector(false)
112 , maxDirectAdjacentSelectors(0) 113 , maxDirectAdjacentSelectors(0)
113 { } 114 { }
114 void add(const FeatureMetadata& other); 115 void add(const FeatureMetadata& other);
115 void clear(); 116 void clear();
116 117
117 bool usesFirstLineRules; 118 bool usesFirstLineRules;
118 bool usesWindowInactiveSelector; 119 bool usesWindowInactiveSelector;
119 bool foundSiblingSelector; 120 bool foundSiblingSelector;
120 unsigned maxDirectAdjacentSelectors; 121 unsigned maxDirectAdjacentSelectors;
121 }; 122 };
122 123
123 void collectFeaturesFromSelector(const CSSSelector&, FeatureMetadata&); 124 void collectFeaturesFromSelector(const CSSSelector&, FeatureMetadata&);
124 125
125 DescendantInvalidationSet& ensureClassInvalidationSet(const AtomicString& cl assName); 126 DescendantInvalidationSet& ensureClassInvalidationSet(const AtomicString& cl assName);
126 DescendantInvalidationSet& ensureAttributeInvalidationSet(const AtomicString & attributeName); 127 DescendantInvalidationSet& ensureAttributeInvalidationSet(const AtomicString & attributeName);
127 DescendantInvalidationSet& ensureIdInvalidationSet(const AtomicString& attri buteName); 128 DescendantInvalidationSet& ensureIdInvalidationSet(const AtomicString& attri buteName);
128 DescendantInvalidationSet& ensurePseudoInvalidationSet(CSSSelector::PseudoTy pe); 129 DescendantInvalidationSet& ensurePseudoInvalidationSet(CSSSelector::PseudoTy pe);
129 130
130 void updateInvalidationSets(const RuleData&); 131 void updateInvalidationSets(const RuleData&);
131 void updateInvalidationSetsForContentAttribute(const RuleData&); 132 void updateInvalidationSetsForContentAttribute(const RuleData&);
132 133
133 struct InvalidationSetFeatures { 134 struct InvalidationSetFeatures {
135 DISALLOW_ALLOCATION();
134 InvalidationSetFeatures() 136 InvalidationSetFeatures()
135 : customPseudoElement(false) 137 : customPseudoElement(false)
136 , hasBeforeOrAfter(false) 138 , hasBeforeOrAfter(false)
137 , treeBoundaryCrossing(false) 139 , treeBoundaryCrossing(false)
138 , adjacent(false) 140 , adjacent(false)
139 , insertionPointCrossing(false) 141 , insertionPointCrossing(false)
140 , forceSubtree(false) 142 , forceSubtree(false)
141 { } 143 { }
142 144
143 bool useSubtreeInvalidation() const { return forceSubtree || adjacent; } 145 bool useSubtreeInvalidation() const { return forceSubtree || adjacent; }
(...skipping 26 matching lines...) Expand all
170 InvalidationSetMap m_attributeInvalidationSets; 172 InvalidationSetMap m_attributeInvalidationSets;
171 InvalidationSetMap m_idInvalidationSets; 173 InvalidationSetMap m_idInvalidationSets;
172 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets; 174 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets;
173 }; 175 };
174 176
175 } // namespace blink 177 } // namespace blink
176 178
177 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleFeature); 179 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleFeature);
178 180
179 #endif // RuleFeature_h 181 #endif // RuleFeature_h
OLDNEW
« no previous file with comments | « Source/core/css/RemoteFontFaceSource.h ('k') | Source/core/css/RuleSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698