| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "core/dom/DocumentTiming.h" | 5 #include "core/dom/DocumentTiming.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/loader/DocumentLoader.h" | 8 #include "core/loader/DocumentLoader.h" |
| 9 #include "platform/TraceEvent.h" | 9 #include "platform/TraceEvent.h" |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 void DocumentTiming::notifyDocumentTimingChanged() | 28 void DocumentTiming::notifyDocumentTimingChanged() |
| 29 { | 29 { |
| 30 if (m_document && m_document->loader()) | 30 if (m_document && m_document->loader()) |
| 31 m_document->loader()->didChangePerformanceTiming(); | 31 m_document->loader()->didChangePerformanceTiming(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void DocumentTiming::markDomLoading() | 34 void DocumentTiming::markDomLoading() |
| 35 { | 35 { |
| 36 m_domLoading = monotonicallyIncreasingTime(); | 36 m_domLoading = monotonicallyIncreasingTime(); |
| 37 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing,rail", "domLoading", m_d
omLoading, "frame", frame()); | 37 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing,rail", "domLoading", Tra
ceEvent::toTraceTimestamp(m_domLoading), "frame", frame()); |
| 38 notifyDocumentTimingChanged(); | 38 notifyDocumentTimingChanged(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void DocumentTiming::markDomInteractive() | 41 void DocumentTiming::markDomInteractive() |
| 42 { | 42 { |
| 43 m_domInteractive = monotonicallyIncreasingTime(); | 43 m_domInteractive = monotonicallyIncreasingTime(); |
| 44 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing,rail", "domInteractive",
m_domInteractive, "frame", frame()); | 44 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing,rail", "domInteractive",
TraceEvent::toTraceTimestamp(m_domInteractive), "frame", frame()); |
| 45 notifyDocumentTimingChanged(); | 45 notifyDocumentTimingChanged(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void DocumentTiming::markDomContentLoadedEventStart() | 48 void DocumentTiming::markDomContentLoadedEventStart() |
| 49 { | 49 { |
| 50 m_domContentLoadedEventStart = monotonicallyIncreasingTime(); | 50 m_domContentLoadedEventStart = monotonicallyIncreasingTime(); |
| 51 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing,rail", "domContentLoaded
EventStart", m_domContentLoadedEventStart, "frame", frame()); | 51 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing,rail", "domContentLoaded
EventStart", TraceEvent::toTraceTimestamp(m_domContentLoadedEventStart), "frame"
, frame()); |
| 52 notifyDocumentTimingChanged(); | 52 notifyDocumentTimingChanged(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void DocumentTiming::markDomContentLoadedEventEnd() | 55 void DocumentTiming::markDomContentLoadedEventEnd() |
| 56 { | 56 { |
| 57 m_domContentLoadedEventEnd = monotonicallyIncreasingTime(); | 57 m_domContentLoadedEventEnd = monotonicallyIncreasingTime(); |
| 58 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing,rail", "domContentLoaded
EventEnd", m_domContentLoadedEventEnd, "frame", frame()); | 58 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing,rail", "domContentLoaded
EventEnd", TraceEvent::toTraceTimestamp(m_domContentLoadedEventEnd), "frame", fr
ame()); |
| 59 notifyDocumentTimingChanged(); | 59 notifyDocumentTimingChanged(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void DocumentTiming::markDomComplete() | 62 void DocumentTiming::markDomComplete() |
| 63 { | 63 { |
| 64 m_domComplete = monotonicallyIncreasingTime(); | 64 m_domComplete = monotonicallyIncreasingTime(); |
| 65 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing,rail", "domComplete", m_
domComplete, "frame", frame()); | 65 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing,rail", "domComplete", Tr
aceEvent::toTraceTimestamp(m_domComplete), "frame", frame()); |
| 66 notifyDocumentTimingChanged(); | 66 notifyDocumentTimingChanged(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void DocumentTiming::markFirstLayout() | 69 void DocumentTiming::markFirstLayout() |
| 70 { | 70 { |
| 71 m_firstLayout = monotonicallyIncreasingTime(); | 71 m_firstLayout = monotonicallyIncreasingTime(); |
| 72 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing,rail", "firstLayout", m_
firstLayout, "frame", frame()); | 72 TRACE_EVENT_MARK_WITH_TIMESTAMP1("blink.user_timing,rail", "firstLayout", Tr
aceEvent::toTraceTimestamp(m_firstLayout), "frame", frame()); |
| 73 notifyDocumentTimingChanged(); | 73 notifyDocumentTimingChanged(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 } // namespace blink | 76 } // namespace blink |
| OLD | NEW |