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

Unified Diff: third_party/WebKit/Source/core/dom/DocumentParserTiming.h

Issue 2238543002: Instrument parser blocking script execution time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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/dom/DocumentParserTiming.h
diff --git a/third_party/WebKit/Source/core/dom/DocumentParserTiming.h b/third_party/WebKit/Source/core/dom/DocumentParserTiming.h
index 647eb34de305975f1f7315f700ea9f7e3944c5d7..e049b620794f6393184b9d2edd9c6c50e55ed01a 100644
--- a/third_party/WebKit/Source/core/dom/DocumentParserTiming.h
+++ b/third_party/WebKit/Source/core/dom/DocumentParserTiming.h
@@ -51,6 +51,13 @@ public:
void recordParserBlockedOnScriptLoadDuration(
double duration, bool scriptInsertedViaDocumentWrite);
+ // Record a duration of time that the parser spent executing a script, in
+ // seconds. scriptInsertedViaDocumentWrite indicates whether the script
+ // being executed was inserted via document.write. This may be called
+ // multiple times, once for each time the parser executes a script.
+ void recordParserBlockedOnScriptExecutionDuration(
+ double duration, bool scriptInsertedViaDocumentWrite);
+
// The getters below return monotonically-increasing seconds, or zero if the
// given parser event has not yet occurred. See the comments for
// monotonicallyIncreasingTime in wtf/CurrentTime.h for additional details.
@@ -68,6 +75,16 @@ public:
// crbug/600711 for details.
double parserBlockedOnScriptLoadFromDocumentWriteDuration() const { return m_parserBlockedOnScriptLoadFromDocumentWriteDuration; }
+ // Returns the sum of all script execution durations reported via
+ // recordParseBlockedOnScriptExecutionDuration.
+ double parserBlockedOnScriptExecutionDuration() const { return m_parserBlockedOnScriptExecutionDuration; }
+
+ // Returns the sum of all script execution durations due to
+ // document.write reported via recordParseBlockedOnScriptExecutionDuration. Note
+ // that some uncommon cases are not currently covered by this method. See
+ // crbug/600711 for details.
+ double parserBlockedOnScriptExecutionFromDocumentWriteDuration() const { return m_parserBlockedOnScriptExecutionFromDocumentWriteDuration; }
+
DECLARE_VIRTUAL_TRACE();
private:
@@ -78,6 +95,8 @@ private:
double m_parserStop = 0.0;
double m_parserBlockedOnScriptLoadDuration = 0.0;
double m_parserBlockedOnScriptLoadFromDocumentWriteDuration = 0.0;
+ double m_parserBlockedOnScriptExecutionDuration = 0.0;
+ double m_parserBlockedOnScriptExecutionFromDocumentWriteDuration = 0.0;
bool m_parserDetached = false;
Member<Document> m_document;

Powered by Google App Engine
This is Rietveld 408576698