Chromium Code Reviews| 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; |