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..6eef324624492d24e6afe74ca607b34dac7207d3 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 parserBlockedOnScriptLoadFromDocumentWriteDuration() const { return m_parserBlockedOnScriptLoadFromDocumentWriteDuration; } |
|
Charlie Harrison
2016/04/04 21:33:26
Can you include a comment that this is a lower bou
Bryan McQuade
2016/04/05 15:14:11
Done.
|
| + |
| 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_parserBlockedOnScriptLoadFromDocumentWriteDuration = 0.0; |
| bool m_parserDetached = false; |
| Member<Document> m_document; |