| 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/paint/PaintTiming.h" | 5 #include "core/paint/PaintTiming.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/frame/LocalDOMWindow.h" | 9 #include "core/frame/LocalDOMWindow.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 m_firstMeaningfulPaint = stamp; | 97 m_firstMeaningfulPaint = stamp; |
| 98 TRACE_EVENT_MARK_WITH_TIMESTAMP1( | 98 TRACE_EVENT_MARK_WITH_TIMESTAMP1( |
| 99 "blink.user_timing", "firstMeaningfulPaint", | 99 "blink.user_timing", "firstMeaningfulPaint", |
| 100 TraceEvent::toTraceTimestamp(m_firstMeaningfulPaint), "frame", frame()); | 100 TraceEvent::toTraceTimestamp(m_firstMeaningfulPaint), "frame", frame()); |
| 101 notifyPaintTimingChanged(); | 101 notifyPaintTimingChanged(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 void PaintTiming::notifyPaint(bool isFirstPaint, | 104 void PaintTiming::notifyPaint(bool isFirstPaint, |
| 105 bool textPainted, | 105 bool textPainted, |
| 106 bool imagePainted) { | 106 bool imagePainted) { |
| 107 fprintf(stderr, "%s\n", "notifyPaint"); |
| 108 fprintf(stderr, "%s\n", supplementable()->url().getString().ascii().data()); |
| 107 if (isFirstPaint) | 109 if (isFirstPaint) |
| 108 markFirstPaint(); | 110 markFirstPaint(); |
| 109 if (textPainted) | 111 if (textPainted) |
| 110 markFirstTextPaint(); | 112 markFirstTextPaint(); |
| 111 if (imagePainted) | 113 if (imagePainted) |
| 112 markFirstImagePaint(); | 114 markFirstImagePaint(); |
| 113 m_fmpDetector->notifyPaint(); | 115 m_fmpDetector->notifyPaint(); |
| 114 } | 116 } |
| 115 | 117 |
| 116 DEFINE_TRACE(PaintTiming) { | 118 DEFINE_TRACE(PaintTiming) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 setFirstPaint(stamp); | 151 setFirstPaint(stamp); |
| 150 m_firstContentfulPaint = stamp; | 152 m_firstContentfulPaint = stamp; |
| 151 Performance* performance = getPerformanceInstance(frame()); | 153 Performance* performance = getPerformanceInstance(frame()); |
| 152 if (performance) | 154 if (performance) |
| 153 performance->addFirstContentfulPaintTiming(m_firstContentfulPaint); | 155 performance->addFirstContentfulPaintTiming(m_firstContentfulPaint); |
| 154 TRACE_EVENT_INSTANT1("blink.user_timing,rail", "firstContentfulPaint", | 156 TRACE_EVENT_INSTANT1("blink.user_timing,rail", "firstContentfulPaint", |
| 155 TRACE_EVENT_SCOPE_PROCESS, "frame", frame()); | 157 TRACE_EVENT_SCOPE_PROCESS, "frame", frame()); |
| 156 } | 158 } |
| 157 | 159 |
| 158 } // namespace blink | 160 } // namespace blink |
| OLD | NEW |