| 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..b61e716c9cb99fdd7622b7a4ba18b05d237daa24 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::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;
|
| }
|
|
|