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

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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/DocumentParserTiming.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..647eb34de305975f1f7315f700ea9f7e3944c5d7 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
Nate Chapin 2016/04/07 16:29:31 I'm an old-timey WebKit curmudgeon, so I think thi
+ // 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,12 @@ public:
// recordParseBlockedOnScriptLoadDuration.
double parserBlockedOnScriptLoadDuration() const { return m_parserBlockedOnScriptLoadDuration; }
+ // Returns the sum of all blocking script load durations due to
+ // document.write reported via recordParseBlockedOnScriptLoadDuration. Note
+ // that some uncommon cases are not currently covered by this method. See
+ // crbug/600711 for details.
+ double parserBlockedOnScriptLoadFromDocumentWriteDuration() const { return m_parserBlockedOnScriptLoadFromDocumentWriteDuration; }
+
DECLARE_VIRTUAL_TRACE();
private:
@@ -68,6 +77,7 @@ private:
double m_parserStart = 0.0;
double m_parserStop = 0.0;
double m_parserBlockedOnScriptLoadDuration = 0.0;
+ double m_parserBlockedOnScriptLoadFromDocumentWriteDuration = 0.0;
bool m_parserDetached = false;
Member<Document> m_document;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/DocumentParserTiming.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698