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

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

Issue 2581633002: [FirstMeaningfulPaint] Do not stop observing layouts before FirstContentfulPaint (Closed)
Patch Set: fix&add test Created 4 years 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 | « no previous file | third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "core/paint/FirstMeaningfulPaintDetector.h" 5 #include "core/paint/FirstMeaningfulPaintDetector.h"
6 6
7 #include "core/css/FontFaceSet.h" 7 #include "core/css/FontFaceSet.h"
8 #include "core/fetch/ResourceFetcher.h" 8 #include "core/fetch/ResourceFetcher.h"
9 #include "core/paint/PaintTiming.h" 9 #include "core/paint/PaintTiming.h"
10 #include "platform/tracing/TraceEvent.h" 10 #include "platform/tracing/TraceEvent.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 DCHECK(document()); 108 DCHECK(document());
109 if (m_state == Reported || document()->fetcher()->hasPendingRequest()) 109 if (m_state == Reported || document()->fetcher()->hasPendingRequest())
110 return; 110 return;
111 111
112 m_networkStableTimer.startOneShot(kSecondsWithoutNetworkActivityThreshold, 112 m_networkStableTimer.startOneShot(kSecondsWithoutNetworkActivityThreshold,
113 BLINK_FROM_HERE); 113 BLINK_FROM_HERE);
114 } 114 }
115 115
116 void FirstMeaningfulPaintDetector::networkStableTimerFired(TimerBase*) { 116 void FirstMeaningfulPaintDetector::networkStableTimerFired(TimerBase*) {
117 if (m_state == Reported || !document() || 117 if (m_state == Reported || !document() ||
118 document()->fetcher()->hasPendingRequest()) 118 document()->fetcher()->hasPendingRequest() ||
119 !m_paintTiming->firstContentfulPaint())
119 return; 120 return;
120 121
121 if (m_provisionalFirstMeaningfulPaint) 122 if (m_provisionalFirstMeaningfulPaint)
122 m_paintTiming->setFirstMeaningfulPaint(m_provisionalFirstMeaningfulPaint); 123 m_paintTiming->setFirstMeaningfulPaint(m_provisionalFirstMeaningfulPaint);
123 m_state = Reported; 124 m_state = Reported;
124 } 125 }
125 126
126 DEFINE_TRACE(FirstMeaningfulPaintDetector) { 127 DEFINE_TRACE(FirstMeaningfulPaintDetector) {
127 visitor->trace(m_paintTiming); 128 visitor->trace(m_paintTiming);
128 } 129 }
129 130
130 } // namespace blink 131 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/FirstMeaningfulPaintDetectorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698