| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CSSTiming_h | 5 #ifndef CSSTiming_h |
| 6 #define CSSTiming_h | 6 #define CSSTiming_h |
| 7 | 7 |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "platform/Supplementable.h" | 9 #include "platform/Supplementable.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| 11 #include "wtf/Noncopyable.h" | 11 #include "wtf/Noncopyable.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class PaintTiming; | 15 class PaintTiming; |
| 16 | 16 |
| 17 class CSSTiming : public GarbageCollectedFinalized<CSSTiming>, | 17 class CSSTiming : public GarbageCollectedFinalized<CSSTiming>, |
| 18 public Supplement<Document> { | 18 public Supplement<Document> { |
| 19 WTF_MAKE_NONCOPYABLE(CSSTiming); | 19 WTF_MAKE_NONCOPYABLE(CSSTiming); |
| 20 USING_GARBAGE_COLLECTED_MIXIN(CSSTiming); | 20 USING_GARBAGE_COLLECTED_MIXIN(CSSTiming); |
| 21 | 21 |
| 22 public: | 22 public: |
| 23 virtual ~CSSTiming() {} | 23 virtual ~CSSTiming() {} |
| 24 | 24 |
| 25 // TODO(csharrison): Also record update style time before first paint. | |
| 26 void recordAuthorStyleSheetParseTime(double seconds); | 25 void recordAuthorStyleSheetParseTime(double seconds); |
| 26 void recordUpdateDuration(double seconds); |
| 27 | 27 |
| 28 double authorStyleSheetParseDurationBeforeFCP() const { | 28 double authorStyleSheetParseDurationBeforeFCP() const { |
| 29 return m_parseTimeBeforeFCP; | 29 return m_parseTimeBeforeFCP; |
| 30 } | 30 } |
| 31 | 31 |
| 32 double updateDurationBeforeFCP() const { return m_updateTimeBeforeFCP; } |
| 33 |
| 32 static CSSTiming& from(Document&); | 34 static CSSTiming& from(Document&); |
| 33 DECLARE_VIRTUAL_TRACE(); | 35 DECLARE_VIRTUAL_TRACE(); |
| 34 | 36 |
| 35 private: | 37 private: |
| 36 explicit CSSTiming(Document&); | 38 explicit CSSTiming(Document&); |
| 37 | 39 |
| 38 double m_parseTimeBeforeFCP = 0; | 40 double m_parseTimeBeforeFCP = 0; |
| 41 double m_updateTimeBeforeFCP = 0; |
| 39 | 42 |
| 40 Member<Document> m_document; | 43 Member<Document> m_document; |
| 41 Member<PaintTiming> m_paintTiming; | 44 Member<PaintTiming> m_paintTiming; |
| 42 }; | 45 }; |
| 43 | 46 |
| 44 } // namespace blink | 47 } // namespace blink |
| 45 | 48 |
| 46 #endif // CSSTiming_h | 49 #endif // CSSTiming_h |
| OLD | NEW |