Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.cpp |
| diff --git a/third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.cpp b/third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.cpp |
| index c5ed81cc30a8bbd6fa11196056f1df49ca57964b..1c872baa2301eb28e15eb43500c27b80180cda8c 100644 |
| --- a/third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.cpp |
| +++ b/third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.cpp |
| @@ -23,7 +23,9 @@ CSSLazyParsingState::CSSLazyParsingState(const CSSParserContext* context, |
| m_totalStyleRules(0), |
| m_styleRulesNeededForNextMilestone(0), |
| m_usage(UsageGe0), |
| - m_shouldUseCount(m_context->isUseCounterRecordingEnabled()) { |
| + m_shouldUseCount(m_context->isUseCounterRecordingEnabled()) {} |
| + |
| +void CSSLazyParsingState::finishStrictParsing() { |
|
rune
2017/02/10 10:33:52
I was confused by the name. When I see "strict", I
Charlie Harrison
2017/02/10 12:49:42
Done. Changed to "finishInitialParsing".
|
| recordUsageMetrics(); |
| } |
| @@ -91,8 +93,13 @@ bool CSSLazyParsingState::shouldLazilyParseProperties( |
| void CSSLazyParsingState::recordUsageMetrics() { |
| DEFINE_STATIC_LOCAL(EnumerationHistogram, usageHistogram, |
| ("Style.LazyUsage.Percent", UsageLastValue)); |
| + DEFINE_STATIC_LOCAL(CustomCountHistogram, totalRulesHistogram, |
| + ("Style.TotalLazyRules", 0, 100000, 50)); |
| + DEFINE_STATIC_LOCAL(CustomCountHistogram, totalRulesFullUsageHistogram, |
| + ("Style.TotalLazyRules.FullUsage", 0, 100000, 50)); |
| switch (m_usage) { |
| case UsageGe0: |
| + totalRulesHistogram.count(m_totalStyleRules); |
| m_styleRulesNeededForNextMilestone = m_totalStyleRules * .1; |
| break; |
| case UsageGt10: |
| @@ -111,6 +118,7 @@ void CSSLazyParsingState::recordUsageMetrics() { |
| m_styleRulesNeededForNextMilestone = m_totalStyleRules - 1; |
| break; |
| case UsageAll: |
| + totalRulesFullUsageHistogram.count(m_totalStyleRules); |
| m_styleRulesNeededForNextMilestone = m_totalStyleRules; |
| break; |
| } |