Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp |
| diff --git a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp |
| index 69f8d510dc4e3d0fa584237ed3c124a2acd1ed92..a46ddb3b6203a20acab153954d2942053d354031 100644 |
| --- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp |
| +++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp |
| @@ -156,6 +156,13 @@ DEFINE_TRACE(HTMLDocumentParser) |
| void HTMLDocumentParser::detach() |
| { |
| + if (!isParsingFragment() && m_parsedChunkQueue.get() && m_parsedChunkQueue->peakPendingChunkCount()) { |
| + DEFINE_STATIC_LOCAL(CustomCountHistogram, peakPendingChunkHistogram, ("Parser.PeakPendingChunkCount", 1, 1000, 50)); |
| + peakPendingChunkHistogram.count(m_parsedChunkQueue->peakPendingChunkCount()); |
| + DEFINE_STATIC_LOCAL(CustomCountHistogram, peakPendingTokenHistogram, ("Parser.PeakPendingTokenCount", 1, 100000, 50)); |
| + peakPendingTokenHistogram.count(m_parsedChunkQueue->peakPendingTokenCount()); |
| + } |
| + |
| if (m_haveBackgroundParser) |
| stopBackgroundParser(); |
| DocumentParser::detach(); |
| @@ -382,7 +389,16 @@ void HTMLDocumentParser::validateSpeculations(PassOwnPtr<ParsedChunk> chunk) |
| void HTMLDocumentParser::discardSpeculationsAndResumeFrom(PassOwnPtr<ParsedChunk> lastChunkBeforeScript, PassOwnPtr<HTMLToken> token, PassOwnPtr<HTMLTokenizer> tokenizer) |
| { |
| + TRACE_EVENT0("blink,loading", "HTMLDocumentParser::discardSpeculationsAndResumeFrom"); |
|
kouhei (in TOK)
2016/06/17 11:20:57
caseq: Would you review this TRACE_EVENT?
|
| m_weakFactory.revokeAll(); |
| + |
| + size_t discardedTokenCount = 0; |
| + for (const auto& speculation : m_speculations) { |
| + discardedTokenCount += speculation->tokens->size(); |
| + } |
| + DEFINE_STATIC_LOCAL(CustomCountHistogram, discardedTokenCountHistogram, ("Parser.DiscardedTokenCount", 1, 100000, 50)); |
| + discardedTokenCountHistogram.count(discardedTokenCount); |
| + |
| m_speculations.clear(); |
| OwnPtr<BackgroundHTMLParser::Checkpoint> checkpoint = adoptPtr(new BackgroundHTMLParser::Checkpoint); |