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

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

Issue 1857903002: Record parser blocking time for scripts inserted via doc.write (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 6a2134ee38233c4dea9d13ca6db8c208235c6123..80bd3254fa16d7b0c12b12ab3e96d73cee147eaf 100644
--- a/third_party/WebKit/Source/core/dom/DocumentParserTiming.h
+++ b/third_party/WebKit/Source/core/dom/DocumentParserTiming.h
@@ -44,9 +44,12 @@ public:
void markParserDetached();
// Record a duration of time that the parser yielded due to loading a
- // script, in seconds. This may be called multiple times, once for each time
- // the parser yields on a script load.
- void recordParserBlockedOnScriptLoadDuration(double duration);
+ // script, in seconds. scriptInsertedViaDocumentWrite indicates whether the
+ // script causing blocking was inserted via document.write. This may be
+ // called multiple times, once for each time the parser yields on a script
+ // load.
+ void recordParserBlockedOnScriptLoadDuration(
+ 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
@@ -59,6 +62,10 @@ public:
// recordParseBlockedOnScriptLoadDuration.
double parserBlockedOnScriptLoadDuration() const { return m_parserBlockedOnScriptLoadDuration; }
+ // Returns the sum of all blocking script load durations due to
+ // document.write reported via recordParseBlockedOnScriptLoadDuration.
+ double parserBlockedOnScriptLoadDueToDocumentWriteDuration() const { return m_parserBlockedOnScriptLoadDueToDocumentWriteDuration; }
+
DECLARE_VIRTUAL_TRACE();
private:
@@ -68,6 +75,7 @@ private:
double m_parserStart = 0.0;
double m_parserStop = 0.0;
double m_parserBlockedOnScriptLoadDuration = 0.0;
+ double m_parserBlockedOnScriptLoadDueToDocumentWriteDuration = 0.0;
bool m_parserDetached = false;
Member<Document> m_document;

Powered by Google App Engine
This is Rietveld 408576698