| 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 ecac1b8441bce38613c39208877c01c42ce4d74e..94fb52a8d7d7eff7b971e091bd4d0c6e4874ea98 100644
|
| --- a/third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.cpp
|
| +++ b/third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.cpp
|
| @@ -16,14 +16,18 @@ CSSLazyParsingState::CSSLazyParsingState(const CSSParserContext* context,
|
| const String& sheetText,
|
| StyleSheetContents* contents)
|
| : m_context(context),
|
| - m_escapedStrings(std::move(escapedStrings)),
|
| m_sheetText(sheetText),
|
| m_owningContents(contents),
|
| m_parsedStyleRules(0),
|
| m_totalStyleRules(0),
|
| m_styleRulesNeededForNextMilestone(0),
|
| m_usage(UsageGe0),
|
| - m_shouldUseCount(m_context->isUseCounterRecordingEnabled()) {}
|
| + m_shouldUseCount(m_context->isUseCounterRecordingEnabled()) {
|
| + m_escapedStrings.reserveCapacityForSize(escapedStrings.size());
|
| + for (const auto& escapedString : escapedStrings) {
|
| + m_escapedStrings.insert(escapedString.impl()->bytes(), escapedString);
|
| + }
|
| +}
|
|
|
| void CSSLazyParsingState::finishInitialParsing() {
|
| recordUsageMetrics();
|
| @@ -89,6 +93,11 @@ bool CSSLazyParsingState::shouldLazilyParseProperties(
|
| return true;
|
| }
|
|
|
| +bool CSSLazyParsingState::tokenBackingUsesEscapedString(
|
| + const void* tokenBackingBytes) {
|
| + return m_escapedStrings.contains(tokenBackingBytes);
|
| +}
|
| +
|
| void CSSLazyParsingState::recordUsageMetrics() {
|
| DEFINE_STATIC_LOCAL(EnumerationHistogram, usageHistogram,
|
| ("Style.LazyUsage.Percent", UsageLastValue));
|
|
|