| 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 d2e5924f5214a552e001bb7cab419b8e1ed9ae40..9dadd381c111a0c8a2486653fded57b7ab002e5e 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/text/TextPosition.h"
|
|
|
| namespace blink {
|
| @@ -286,9 +288,10 @@ void BackgroundHTMLParser::sendTokensToMainThread()
|
| checkThatPreloadsAreSafeToSendToAnotherThread(m_pendingPreloads);
|
| checkThatXSSInfosAreSafeToSendToAnotherThread(m_pendingXSSInfos);
|
| #endif
|
| -
|
| + double chunkStartTime = monotonicallyIncreasingTimeMS();
|
| OwnPtr<HTMLDocumentParser::ParsedChunk> chunk = adoptPtr(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;
|
| @@ -303,6 +306,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,
|
|
|