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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSParserImpl.cpp

Issue 2687023003: [LazyParseCSS] Add metrics for total # of rules at 0% and 100% usage (Closed)
Patch Set: rune review Created 3 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/parser/CSSParserImpl.h" 5 #include "core/css/parser/CSSParserImpl.h"
6 6
7 #include "core/css/CSSCustomIdentValue.h" 7 #include "core/css/CSSCustomIdentValue.h"
8 #include "core/css/CSSCustomPropertyDeclaration.h" 8 #include "core/css/CSSCustomPropertyDeclaration.h"
9 #include "core/css/CSSKeyframesRule.h" 9 #include "core/css/CSSKeyframesRule.h"
10 #include "core/css/CSSStyleSheet.h" 10 #include "core/css/CSSStyleSheet.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 context, tokenizer.takeEscapedStrings(), string, parser.m_styleSheet); 238 context, tokenizer.takeEscapedStrings(), string, parser.m_styleSheet);
239 } 239 }
240 bool firstRuleValid = 240 bool firstRuleValid =
241 parser.consumeRuleList(tokenizer.tokenRange(), TopLevelRuleList, 241 parser.consumeRuleList(tokenizer.tokenRange(), TopLevelRuleList,
242 [&styleSheet](StyleRuleBase* rule) { 242 [&styleSheet](StyleRuleBase* rule) {
243 if (rule->isCharsetRule()) 243 if (rule->isCharsetRule())
244 return; 244 return;
245 styleSheet->parserAppendRule(rule); 245 styleSheet->parserAppendRule(rule);
246 }); 246 });
247 styleSheet->setHasSyntacticallyValidCSSHeader(firstRuleValid); 247 styleSheet->setHasSyntacticallyValidCSSHeader(firstRuleValid);
248 if (parser.m_lazyState)
249 parser.m_lazyState->finishInitialParsing();
248 TRACE_EVENT_END0("blink,blink_style", "CSSParserImpl::parseStyleSheet.parse"); 250 TRACE_EVENT_END0("blink,blink_style", "CSSParserImpl::parseStyleSheet.parse");
249 251
250 TRACE_EVENT_END2("blink,blink_style", "CSSParserImpl::parseStyleSheet", 252 TRACE_EVENT_END2("blink,blink_style", "CSSParserImpl::parseStyleSheet",
251 "tokenCount", tokenizer.tokenCount(), "length", 253 "tokenCount", tokenizer.tokenCount(), "length",
252 string.length()); 254 string.length());
253 } 255 }
254 256
255 CSSSelectorList CSSParserImpl::parsePageSelector( 257 CSSSelectorList CSSParserImpl::parsePageSelector(
256 CSSParserTokenRange range, 258 CSSParserTokenRange range,
257 StyleSheetContents* styleSheet) { 259 StyleSheetContents* styleSheet) {
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 else 981 else
980 return nullptr; // Parser error, invalid value in keyframe selector 982 return nullptr; // Parser error, invalid value in keyframe selector
981 if (range.atEnd()) 983 if (range.atEnd())
982 return result; 984 return result;
983 if (range.consume().type() != CommaToken) 985 if (range.consume().type() != CommaToken)
984 return nullptr; // Parser error 986 return nullptr; // Parser error
985 } 987 }
986 } 988 }
987 989
988 } // namespace blink 990 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698