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

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

Issue 1064563004: Add separate blink_style category to blink style tracing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "config.h" 5 #include "config.h"
6 #include "core/css/parser/CSSParserImpl.h" 6 #include "core/css/parser/CSSParserImpl.h"
7 7
8 #include "core/css/CSSKeyframesRule.h" 8 #include "core/css/CSSKeyframesRule.h"
9 #include "core/css/CSSStyleSheet.h" 9 #include "core/css/CSSStyleSheet.h"
10 #include "core/css/StylePropertySet.h" 10 #include "core/css/StylePropertySet.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 return nullptr; // Parse error, failed to consume rule 118 return nullptr; // Parse error, failed to consume rule
119 range.consumeWhitespace(); 119 range.consumeWhitespace();
120 if (!rule || !range.atEnd()) 120 if (!rule || !range.atEnd())
121 return nullptr; // Parse error, trailing garbage 121 return nullptr; // Parse error, trailing garbage
122 return rule; 122 return rule;
123 } 123 }
124 124
125 void CSSParserImpl::parseStyleSheet(const String& string, const CSSParserContext & context, StyleSheetContents* styleSheet) 125 void CSSParserImpl::parseStyleSheet(const String& string, const CSSParserContext & context, StyleSheetContents* styleSheet)
126 { 126 {
127 TRACE_EVENT_BEGIN2( 127 TRACE_EVENT_BEGIN2(
128 "blink", "CSSParserImpl::parseStyleSheet", 128 "blink,blink_style", "CSSParserImpl::parseStyleSheet",
129 "baseUrl", context.baseURL().string().utf8(), 129 "baseUrl", context.baseURL().string().utf8(),
130 "mode", context.mode()); 130 "mode", context.mode());
131 131
132 TRACE_EVENT_BEGIN0("blink", "CSSParserImpl::parseStyleSheet.tokenize"); 132 TRACE_EVENT_BEGIN0("blink,blink_style", "CSSParserImpl::parseStyleSheet.toke nize");
133 CSSTokenizer::Scope scope(string); 133 CSSTokenizer::Scope scope(string);
134 TRACE_EVENT_END0("blink", "CSSParserImpl::parseStyleSheet.tokenize"); 134 TRACE_EVENT_END0("blink,blink_style", "CSSParserImpl::parseStyleSheet.tokeni ze");
135 135
136 TRACE_EVENT_BEGIN0("blink", "CSSParserImpl::parseStyleSheet.parse"); 136 TRACE_EVENT_BEGIN0("blink,blink_style", "CSSParserImpl::parseStyleSheet.pars e");
137 CSSParserImpl parser(context, styleSheet); 137 CSSParserImpl parser(context, styleSheet);
138 bool firstRuleValid = parser.consumeRuleList(scope.tokenRange(), TopLevelRul eList, [&styleSheet](PassRefPtrWillBeRawPtr<StyleRuleBase> rule) { 138 bool firstRuleValid = parser.consumeRuleList(scope.tokenRange(), TopLevelRul eList, [&styleSheet](PassRefPtrWillBeRawPtr<StyleRuleBase> rule) {
139 if (rule->isCharsetRule()) 139 if (rule->isCharsetRule())
140 return; 140 return;
141 styleSheet->parserAppendRule(rule); 141 styleSheet->parserAppendRule(rule);
142 }); 142 });
143 styleSheet->setHasSyntacticallyValidCSSHeader(firstRuleValid); 143 styleSheet->setHasSyntacticallyValidCSSHeader(firstRuleValid);
144 TRACE_EVENT_END0("blink", "CSSParserImpl::parseStyleSheet.parse"); 144 TRACE_EVENT_END0("blink,blink_style", "CSSParserImpl::parseStyleSheet.parse" );
145 145
146 TRACE_EVENT_END2( 146 TRACE_EVENT_END2(
147 "blink", "CSSParserImpl::parseStyleSheet", 147 "blink,blink_style", "CSSParserImpl::parseStyleSheet",
148 "tokenCount", scope.tokenCount(), 148 "tokenCount", scope.tokenCount(),
149 "length", string.length()); 149 "length", string.length());
150 } 150 }
151 151
152 PassOwnPtr<Vector<double>> CSSParserImpl::parseKeyframeKeyList(const String& key List) 152 PassOwnPtr<Vector<double>> CSSParserImpl::parseKeyframeKeyList(const String& key List)
153 { 153 {
154 return consumeKeyframeKeyList(CSSTokenizer::Scope(keyList).tokenRange()); 154 return consumeKeyframeKeyList(CSSTokenizer::Scope(keyList).tokenRange());
155 } 155 }
156 156
157 bool CSSParserImpl::supportsDeclaration(CSSParserTokenRange& range) 157 bool CSSParserImpl::supportsDeclaration(CSSParserTokenRange& range)
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 else 746 else
747 return nullptr; // Parser error, invalid value in keyframe selector 747 return nullptr; // Parser error, invalid value in keyframe selector
748 if (range.atEnd()) 748 if (range.atEnd())
749 return result.release(); 749 return result.release();
750 if (range.consume().type() != CommaToken) 750 if (range.consume().type() != CommaToken)
751 return nullptr; // Parser error 751 return nullptr; // Parser error
752 } 752 }
753 } 753 }
754 754
755 } // namespace blink 755 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698