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

Unified Diff: sky/engine/core/css/parser/BisonCSSParser-in.cpp

Issue 867903002: Remove UseCounter (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « sky/engine/core/css/parser/BisonCSSParser.h ('k') | sky/engine/core/css/parser/CSSParserMode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/css/parser/BisonCSSParser-in.cpp
diff --git a/sky/engine/core/css/parser/BisonCSSParser-in.cpp b/sky/engine/core/css/parser/BisonCSSParser-in.cpp
index 6325f21c3a0edb3165960ef1fe963e9c8421b319..aa362f74c2a8135d7b4e145409ece6f4fda127d7 100644
--- a/sky/engine/core/css/parser/BisonCSSParser-in.cpp
+++ b/sky/engine/core/css/parser/BisonCSSParser-in.cpp
@@ -70,7 +70,6 @@
#include "sky/engine/core/frame/FrameHost.h"
#include "sky/engine/core/frame/LocalFrame.h"
#include "sky/engine/core/frame/Settings.h"
-#include "sky/engine/core/frame/UseCounter.h"
#include "sky/engine/core/html/parser/HTMLParserIdioms.h"
#include "sky/engine/core/inspector/ConsoleMessage.h"
#include "sky/engine/core/rendering/RenderTheme.h"
@@ -793,7 +792,7 @@ bool BisonCSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropert
{
ASSERT(!string.isEmpty());
- CSSParserContext context(document, UseCounter::getFrom(&document));
+ CSSParserContext context(document);
if (parseSimpleLengthValue(declaration, propertyID, string, context.mode()))
return true;
@@ -814,10 +813,9 @@ bool BisonCSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropert
if (parseColorValue(declaration, propertyID, string, cssParserMode))
return true;
- CSSParserContext context(0); // FIXME: Why does this not have a UseCounter?
- if (contextStyleSheet) {
+ CSSParserContext context;
+ if (contextStyleSheet)
context = contextStyleSheet->parserContext();
- }
if (parseKeywordValue(declaration, propertyID, string, context))
return true;
@@ -830,9 +828,6 @@ bool BisonCSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropert
bool BisonCSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID propertyID, const String& string, StyleSheetContents* contextStyleSheet)
{
- if (m_context.useCounter())
- m_context.useCounter()->count(m_context, propertyID);
-
setStyleSheet(contextStyleSheet);
setupParser("@-internal-value ", string, "");
@@ -926,7 +921,7 @@ void BisonCSSParser::parseSelector(const String& string, CSSSelectorList& select
PassRefPtr<ImmutableStylePropertySet> BisonCSSParser::parseInlineStyleDeclaration(const String& string, Element* element)
{
Document& document = element->document();
- CSSParserContext context = CSSParserContext(document.elementSheet().contents()->parserContext(), UseCounter::getFrom(&document));
+ CSSParserContext context = CSSParserContext(document.elementSheet().contents()->parserContext());
return BisonCSSParser(context).parseDeclaration(string, document.elementSheet().contents());
}
@@ -1503,29 +1498,6 @@ StyleRuleKeyframes* BisonCSSParser::createKeyframesRule(const String& name, Pass
return rulePtr;
}
-static void recordSelectorStats(const CSSParserContext& context, const CSSSelectorList& selectorList)
-{
- if (!context.useCounter())
- return;
-
- for (const CSSSelector* selector = selectorList.first(); selector; selector = CSSSelectorList::next(*selector)) {
- for (const CSSSelector* current = selector; current ; current = current->tagHistory()) {
- UseCounter::Feature feature = UseCounter::NumberOfFeatures;
- switch (current->pseudoType()) {
- case CSSSelector::PseudoHost:
- feature = UseCounter::CSSSelectorPseudoHost;
- break;
- default:
- break;
- }
- if (feature != UseCounter::NumberOfFeatures)
- context.useCounter()->count(feature);
- if (current->selectorList())
- recordSelectorStats(context, *current->selectorList());
- }
- }
-}
-
StyleRuleBase* BisonCSSParser::createStyleRule(Vector<OwnPtr<CSSParserSelector> >* selectors)
{
StyleRule* result = 0;
@@ -1536,7 +1508,6 @@ StyleRuleBase* BisonCSSParser::createStyleRule(Vector<OwnPtr<CSSParserSelector>
rule->setProperties(createStylePropertySet());
result = rule.get();
m_parsedRules.append(rule.release());
- recordSelectorStats(m_context, result->selectorList());
}
clearProperties();
return result;
« no previous file with comments | « sky/engine/core/css/parser/BisonCSSParser.h ('k') | sky/engine/core/css/parser/CSSParserMode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698