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

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

Issue 2711893002: Loosen FirstMeaningfulPaint UMA network-idle heuristics (Closed)
Patch Set: Created 3 years, 10 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
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 #ifndef FirstMeaningfulPaintDetector_h 5 #ifndef FirstMeaningfulPaintDetector_h
6 #define FirstMeaningfulPaintDetector_h 6 #define FirstMeaningfulPaintDetector_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "platform/Timer.h" 9 #include "platform/Timer.h"
10 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 int contentsHeightAfterLayout, 46 int contentsHeightAfterLayout,
47 int visibleHeight); 47 int visibleHeight);
48 void notifyPaint(); 48 void notifyPaint();
49 void checkNetworkStable(); 49 void checkNetworkStable();
50 50
51 DECLARE_TRACE(); 51 DECLARE_TRACE();
52 52
53 private: 53 private:
54 friend class FirstMeaningfulPaintDetectorTest; 54 friend class FirstMeaningfulPaintDetectorTest;
55 55
56 enum NetworkState { NetworkActive, Network2Quiet, Network0Quiet };
kouhei (in TOK) 2017/02/28 23:47:32 Optional: enum class NetworkState { Active, Quiet2
57
56 Document* document(); 58 Document* document();
59 bool isNetworkQuiet(int maxActiveConnections);
57 void networkStableTimerFired(TimerBase*); 60 void networkStableTimerFired(TimerBase*);
58 61
59 enum State { NextPaintIsNotMeaningful, NextPaintIsMeaningful, Reported }; 62 bool m_nextPaintIsMeaningful = false;
60 State m_state = NextPaintIsNotMeaningful; 63 NetworkState m_networkState = NetworkActive;
64 NetworkState m_networkStateAtFirstMeaningfulPaint = NetworkActive;
61 65
62 Member<PaintTiming> m_paintTiming; 66 Member<PaintTiming> m_paintTiming;
63 double m_provisionalFirstMeaningfulPaint = 0.0; 67 double m_provisionalFirstMeaningfulPaint = 0.0;
64 double m_maxSignificanceSoFar = 0.0; 68 double m_maxSignificanceSoFar = 0.0;
65 double m_accumulatedSignificanceWhileHavingBlankText = 0.0; 69 double m_accumulatedSignificanceWhileHavingBlankText = 0.0;
66 unsigned m_prevLayoutObjectCount = 0; 70 unsigned m_prevLayoutObjectCount = 0;
67 bool m_seenFirstMeaningfulPaintCandidate = false; 71 bool m_seenFirstMeaningfulPaintCandidate = false;
68 TaskRunnerTimer<FirstMeaningfulPaintDetector> m_networkStableTimer; 72 TaskRunnerTimer<FirstMeaningfulPaintDetector> m_networkStableTimer;
69 }; 73 };
70 74
71 } // namespace blink 75 } // namespace blink
72 76
73 #endif 77 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698