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

Unified Diff: third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698