Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1286)

Unified Diff: third_party/WebKit/Source/core/html/parser/ParsedChunkQueue.cpp

Issue 2078723002: Add HTML parser UMA for rewinds and chunk queue statistics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove trace event Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « third_party/WebKit/Source/core/html/parser/ParsedChunkQueue.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698