| 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 263c9a9719085e123cb4b284932ce9686b1625fa..82ecd2c2721030b327c3129a0b25650134153666 100644
|
| --- a/third_party/WebKit/Source/core/html/parser/ParsedChunkQueue.cpp
|
| +++ b/third_party/WebKit/Source/core/html/parser/ParsedChunkQueue.cpp
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "core/html/parser/ParsedChunkQueue.h"
|
|
|
| +#include <algorithm>
|
| +
|
| namespace blink {
|
|
|
| ParsedChunkQueue::ParsedChunkQueue()
|
| @@ -18,8 +20,13 @@ bool ParsedChunkQueue::enqueue(PassOwnPtr<HTMLDocumentParser::ParsedChunk> chunk
|
| {
|
| 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;
|
| }
|
|
|
| @@ -27,6 +34,7 @@ void ParsedChunkQueue::clear()
|
| {
|
| MutexLocker locker(m_mutex);
|
|
|
| + m_pendingTokenCount = 0;
|
| m_pendingChunks.clear();
|
| }
|
|
|
| @@ -38,4 +46,16 @@ void ParsedChunkQueue::takeAll(Vector<OwnPtr<HTMLDocumentParser::ParsedChunk>>&
|
| 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
|
|
|