OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r
ights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "HTMLNames.h" | 35 #include "HTMLNames.h" |
36 #include "MediaQueryEvaluator.h" | 36 #include "MediaQueryEvaluator.h" |
37 #include "SecurityOrigin.h" | 37 #include "SecurityOrigin.h" |
38 #include "SelectorChecker.h" | 38 #include "SelectorChecker.h" |
39 #include "SelectorCheckerFastPath.h" | 39 #include "SelectorCheckerFastPath.h" |
40 #include "SelectorFilter.h" | 40 #include "SelectorFilter.h" |
41 #include "StyleResolver.h" | 41 #include "StyleResolver.h" |
42 #include "StyleRule.h" | 42 #include "StyleRule.h" |
43 #include "StyleRuleImport.h" | 43 #include "StyleRuleImport.h" |
44 #include "StyleSheetContents.h" | 44 #include "StyleSheetContents.h" |
45 #include "WebCoreMemoryInstrumentation.h" | |
46 #include "WebKitCSSKeyframesRule.h" | 45 #include "WebKitCSSKeyframesRule.h" |
47 #include <wtf/MemoryInstrumentationHashMap.h> | |
48 #include <wtf/MemoryInstrumentationHashSet.h> | |
49 #include <wtf/MemoryInstrumentationVector.h> | |
50 | 46 |
51 #include "TextTrackCue.h" | 47 #include "TextTrackCue.h" |
52 | 48 |
53 namespace WebCore { | 49 namespace WebCore { |
54 | 50 |
55 using namespace HTMLNames; | 51 using namespace HTMLNames; |
56 | 52 |
57 // ----------------------------------------------------------------- | 53 // ----------------------------------------------------------------- |
58 | 54 |
59 static inline bool isSelectorMatchingHTMLBasedOnRuleHash(const CSSSelector* sele
ctor) | 55 static inline bool isSelectorMatchingHTMLBasedOnRuleHash(const CSSSelector* sele
ctor) |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 , m_containsUncommonAttributeSelector(WebCore::containsUncommonAttributeSele
ctor(selector())) | 133 , m_containsUncommonAttributeSelector(WebCore::containsUncommonAttributeSele
ctor(selector())) |
138 , m_linkMatchType(SelectorChecker::determineLinkMatchType(selector())) | 134 , m_linkMatchType(SelectorChecker::determineLinkMatchType(selector())) |
139 , m_hasDocumentSecurityOrigin(addRuleFlags & RuleHasDocumentSecurityOrigin) | 135 , m_hasDocumentSecurityOrigin(addRuleFlags & RuleHasDocumentSecurityOrigin) |
140 , m_propertyWhitelistType(determinePropertyWhitelistType(addRuleFlags, selec
tor())) | 136 , m_propertyWhitelistType(determinePropertyWhitelistType(addRuleFlags, selec
tor())) |
141 { | 137 { |
142 ASSERT(m_position == position); | 138 ASSERT(m_position == position); |
143 ASSERT(m_selectorIndex == selectorIndex); | 139 ASSERT(m_selectorIndex == selectorIndex); |
144 SelectorFilter::collectIdentifierHashes(selector(), m_descendantSelectorIden
tifierHashes, maximumIdentifierCount); | 140 SelectorFilter::collectIdentifierHashes(selector(), m_descendantSelectorIden
tifierHashes, maximumIdentifierCount); |
145 } | 141 } |
146 | 142 |
147 void RuleData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | |
148 { | |
149 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); | |
150 info.addMember(m_rule, "rule"); | |
151 } | |
152 | |
153 void RuleSet::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | |
154 { | |
155 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); | |
156 info.addMember(m_idRules, "idRules"); | |
157 info.addMember(m_classRules, "classRules"); | |
158 info.addMember(m_tagRules, "tagRules"); | |
159 info.addMember(m_shadowPseudoElementRules, "shadowPseudoElementRules"); | |
160 info.addMember(m_linkPseudoClassRules, "linkPseudoClassRules"); | |
161 info.addMember(m_cuePseudoRules, "cuePseudoRules"); | |
162 info.addMember(m_focusPseudoClassRules, "focusPseudoClassRules"); | |
163 info.addMember(m_universalRules, "universalRules"); | |
164 info.addMember(m_pageRules, "pageRules"); | |
165 info.addMember(m_regionSelectorsAndRuleSets, "regionSelectorsAndRuleSets"); | |
166 info.addMember(m_features, "features"); | |
167 } | |
168 | |
169 void RuleSet::RuleSetSelectorPair::reportMemoryUsage(MemoryObjectInfo* memoryObj
ectInfo) const | |
170 { | |
171 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); | |
172 info.addMember(ruleSet, "ruleSet"); | |
173 info.addMember(selector, "selector"); | |
174 } | |
175 | |
176 static void collectFeaturesFromRuleData(RuleFeatureSet& features, const RuleData
& ruleData) | 143 static void collectFeaturesFromRuleData(RuleFeatureSet& features, const RuleData
& ruleData) |
177 { | 144 { |
178 bool foundSiblingSelector = false; | 145 bool foundSiblingSelector = false; |
179 for (const CSSSelector* selector = ruleData.selector(); selector; selector =
selector->tagHistory()) { | 146 for (const CSSSelector* selector = ruleData.selector(); selector; selector =
selector->tagHistory()) { |
180 features.collectFeaturesFromSelector(selector); | 147 features.collectFeaturesFromSelector(selector); |
181 | 148 |
182 if (const CSSSelectorList* selectorList = selector->selectorList()) { | 149 if (const CSSSelectorList* selectorList = selector->selectorList()) { |
183 for (const CSSSelector* subSelector = selectorList->first(); subSele
ctor; subSelector = CSSSelectorList::next(subSelector)) { | 150 for (const CSSSelector* subSelector = selectorList->first(); subSele
ctor; subSelector = CSSSelectorList::next(subSelector)) { |
184 if (!foundSiblingSelector && selector->isSiblingSelector()) | 151 if (!foundSiblingSelector && selector->isSiblingSelector()) |
185 foundSiblingSelector = true; | 152 foundSiblingSelector = true; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 shrinkMapVectorsToFit(m_tagRules); | 361 shrinkMapVectorsToFit(m_tagRules); |
395 shrinkMapVectorsToFit(m_shadowPseudoElementRules); | 362 shrinkMapVectorsToFit(m_shadowPseudoElementRules); |
396 m_linkPseudoClassRules.shrinkToFit(); | 363 m_linkPseudoClassRules.shrinkToFit(); |
397 m_cuePseudoRules.shrinkToFit(); | 364 m_cuePseudoRules.shrinkToFit(); |
398 m_focusPseudoClassRules.shrinkToFit(); | 365 m_focusPseudoClassRules.shrinkToFit(); |
399 m_universalRules.shrinkToFit(); | 366 m_universalRules.shrinkToFit(); |
400 m_pageRules.shrinkToFit(); | 367 m_pageRules.shrinkToFit(); |
401 } | 368 } |
402 | 369 |
403 } // namespace WebCore | 370 } // namespace WebCore |
OLD | NEW |