Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintTiming.cpp

Issue 2738813003: Ensure the scheduler always changes from UseCase LOADING to NONE. (Closed)
Patch Set: rename markFirstMeaningfulPaintCandidate to setFirstMeaningfulPaintCandidate. delete errant comment. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintTiming.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 if (m_firstImagePaint != 0.0) 76 if (m_firstImagePaint != 0.0)
77 return; 77 return;
78 m_firstImagePaint = monotonicallyIncreasingTime(); 78 m_firstImagePaint = monotonicallyIncreasingTime();
79 setFirstContentfulPaint(m_firstImagePaint); 79 setFirstContentfulPaint(m_firstImagePaint);
80 TRACE_EVENT_MARK_WITH_TIMESTAMP1( 80 TRACE_EVENT_MARK_WITH_TIMESTAMP1(
81 "blink.user_timing,rail", "firstImagePaint", 81 "blink.user_timing,rail", "firstImagePaint",
82 TraceEvent::toTraceTimestamp(m_firstImagePaint), "frame", frame()); 82 TraceEvent::toTraceTimestamp(m_firstImagePaint), "frame", frame());
83 notifyPaintTimingChanged(); 83 notifyPaintTimingChanged();
84 } 84 }
85 85
86 void PaintTiming::markFirstMeaningfulPaintCandidate() { 86 void PaintTiming::setFirstMeaningfulPaintCandidate(double timestamp) {
87 if (m_firstMeaningfulPaintCandidate) 87 if (m_firstMeaningfulPaintCandidate)
88 return; 88 return;
89 m_firstMeaningfulPaintCandidate = monotonicallyIncreasingTime(); 89 m_firstMeaningfulPaintCandidate = timestamp;
90 if (frame() && frame()->view() && !frame()->view()->parent()) { 90 if (frame() && frame()->view() && !frame()->view()->parent()) {
91 frame()->frameScheduler()->onFirstMeaningfulPaint(); 91 frame()->frameScheduler()->onFirstMeaningfulPaint();
92 } 92 }
93 } 93 }
94 94
95 void PaintTiming::setFirstMeaningfulPaint(double stamp) { 95 void PaintTiming::setFirstMeaningfulPaint(double stamp) {
96 DCHECK_EQ(m_firstMeaningfulPaint, 0.0); 96 DCHECK_EQ(m_firstMeaningfulPaint, 0.0);
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",
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 setFirstPaint(stamp); 149 setFirstPaint(stamp);
150 m_firstContentfulPaint = stamp; 150 m_firstContentfulPaint = stamp;
151 Performance* performance = getPerformanceInstance(frame()); 151 Performance* performance = getPerformanceInstance(frame());
152 if (performance) 152 if (performance)
153 performance->addFirstContentfulPaintTiming(m_firstContentfulPaint); 153 performance->addFirstContentfulPaintTiming(m_firstContentfulPaint);
154 TRACE_EVENT_INSTANT1("blink.user_timing,rail", "firstContentfulPaint", 154 TRACE_EVENT_INSTANT1("blink.user_timing,rail", "firstContentfulPaint",
155 TRACE_EVENT_SCOPE_PROCESS, "frame", frame()); 155 TRACE_EVENT_SCOPE_PROCESS, "frame", frame());
156 } 156 }
157 157
158 } // namespace blink 158 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintTiming.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698