| Index: third_party/WebKit/Source/core/html/parser/ParsedChunkQueue.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/parser/ParsedChunkQueue.cpp b/third_party/WebKit/Source/core/html/parser/ParsedChunkQueue.cpp
|
| index 913e2b040a9882cd9d7da47efaa91522a8e13cb4..7adda766265691e9b4e2a725ed1e97bf9327faa6 100644
|
| --- a/third_party/WebKit/Source/core/html/parser/ParsedChunkQueue.cpp
|
| +++ b/third_party/WebKit/Source/core/html/parser/ParsedChunkQueue.cpp
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "core/html/parser/ParsedChunkQueue.h"
|
|
|
| +#include <algorithm>
|
| #include <memory>
|
|
|
| namespace blink {
|
| @@ -20,8 +21,13 @@ bool ParsedChunkQueue::enqueue(std::unique_ptr<HTMLDocumentParser::ParsedChunk>
|
| {
|
| MutexLocker locker(m_mutex);
|
|
|
| + m_pendingTokenCount += chunk->tokens->size();
|
| + m_peakPendingTokenCount = std::max(m_peakPendingTokenCount, m_pendingTokenCount);
|
| +
|
| bool wasEmpty = m_pendingChunks.isEmpty();
|
| m_pendingChunks.append(std::move(chunk));
|
| + m_peakPendingChunkCount = std::max(m_peakPendingChunkCount, m_pendingChunks.size());
|
| +
|
| return wasEmpty;
|
| }
|
|
|
| @@ -29,6 +35,7 @@ void ParsedChunkQueue::clear()
|
| {
|
| MutexLocker locker(m_mutex);
|
|
|
| + m_pendingTokenCount = 0;
|
| m_pendingChunks.clear();
|
| }
|
|
|
| @@ -40,4 +47,16 @@ void ParsedChunkQueue::takeAll(Vector<std::unique_ptr<HTMLDocumentParser::Parsed
|
| m_pendingChunks.swap(vector);
|
| }
|
|
|
| +size_t ParsedChunkQueue::peakPendingChunkCount()
|
| +{
|
| + MutexLocker locker(m_mutex);
|
| + return m_peakPendingChunkCount;
|
| +}
|
| +
|
| +size_t ParsedChunkQueue::peakPendingTokenCount()
|
| +{
|
| + MutexLocker locker(m_mutex);
|
| + return m_peakPendingTokenCount;
|
| +}
|
| +
|
| } // namespace blink
|
|
|