| Index: third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp b/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp
|
| index a022af565ecae3dd8f73203a58855b00dbc2c437..ebaf32762314d7ed22520646b6e85010e7c7aaff 100644
|
| --- a/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp
|
| +++ b/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp
|
| @@ -29,10 +29,12 @@
|
| #include "core/html/parser/HTMLDocumentParser.h"
|
| #include "core/html/parser/TextResourceDecoder.h"
|
| #include "core/html/parser/XSSAuditor.h"
|
| +#include "platform/Histogram.h"
|
| #include "platform/ThreadSafeFunctional.h"
|
| #include "platform/TraceEvent.h"
|
| #include "public/platform/Platform.h"
|
| #include "public/platform/WebTaskRunner.h"
|
| +#include "wtf/CurrentTime.h"
|
| #include "wtf/PtrUtil.h"
|
| #include "wtf/text/TextPosition.h"
|
| #include <memory>
|
| @@ -289,8 +291,10 @@ void BackgroundHTMLParser::sendTokensToMainThread()
|
| checkThatXSSInfosAreSafeToSendToAnotherThread(m_pendingXSSInfos);
|
| #endif
|
|
|
| + double chunkStartTime = monotonicallyIncreasingTimeMS();
|
| std::unique_ptr<HTMLDocumentParser::ParsedChunk> chunk = wrapUnique(new HTMLDocumentParser::ParsedChunk);
|
| TRACE_EVENT_WITH_FLOW0("blink,loading", "BackgroundHTMLParser::sendTokensToMainThread", chunk.get(), TRACE_EVENT_FLAG_FLOW_OUT);
|
| +
|
| chunk->preloads.swap(m_pendingPreloads);
|
| if (m_viewportDescription.set)
|
| chunk->viewport = m_viewportDescription;
|
| @@ -305,6 +309,10 @@ void BackgroundHTMLParser::sendTokensToMainThread()
|
| m_startingScript = false;
|
|
|
| bool isEmpty = m_parsedChunkQueue->enqueue(std::move(chunk));
|
| +
|
| + DEFINE_STATIC_LOCAL(CustomCountHistogram, chunkEnqueueTime, ("Parser.ChunkEnqueueTime", 1, 10000, 50));
|
| + chunkEnqueueTime.count(monotonicallyIncreasingTimeMS() - chunkStartTime);
|
| +
|
| if (isEmpty) {
|
| m_loadingTaskRunner->postTask(
|
| BLINK_FROM_HERE,
|
|
|