OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 RemoteFontFaceSource_h | 5 #ifndef RemoteFontFaceSource_h |
6 #define RemoteFontFaceSource_h | 6 #define RemoteFontFaceSource_h |
7 | 7 |
8 #include "core/css/CSSFontFaceSource.h" | 8 #include "core/css/CSSFontFaceSource.h" |
9 #include "core/fetch/FontResource.h" | 9 #include "core/fetch/FontResource.h" |
10 #include "core/fetch/ResourcePtr.h" | 10 #include "core/fetch/ResourcePtr.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 public: | 63 public: |
64 FontLoadHistograms() : m_loadStartTime(0), m_fallbackPaintTime(0), m_isL
ongLimitExceeded(false) { } | 64 FontLoadHistograms() : m_loadStartTime(0), m_fallbackPaintTime(0), m_isL
ongLimitExceeded(false) { } |
65 void loadStarted(); | 65 void loadStarted(); |
66 void fallbackFontPainted(); | 66 void fallbackFontPainted(); |
67 void fontLoaded(bool isInterventionTriggered); | 67 void fontLoaded(bool isInterventionTriggered); |
68 void longLimitExceeded(bool isInterventionTriggered); | 68 void longLimitExceeded(bool isInterventionTriggered); |
69 void recordFallbackTime(const FontResource*); | 69 void recordFallbackTime(const FontResource*); |
70 void recordRemoteFont(const FontResource*); | 70 void recordRemoteFont(const FontResource*); |
71 bool hadBlankText() { return m_fallbackPaintTime; } | 71 bool hadBlankText() { return m_fallbackPaintTime; } |
72 private: | 72 private: |
73 const char* histogramName(const FontResource*); | 73 void recordLoadTimeHistogram(const FontResource*, int duration); |
74 void recordInterventionResult(bool triggered); | 74 void recordInterventionResult(bool triggered); |
75 double m_loadStartTime; | 75 double m_loadStartTime; |
76 double m_fallbackPaintTime; | 76 double m_fallbackPaintTime; |
77 bool m_isLongLimitExceeded; | 77 bool m_isLongLimitExceeded; |
78 }; | 78 }; |
79 | 79 |
80 void switchToSwapPeriod(); | 80 void switchToSwapPeriod(); |
81 void switchToFailurePeriod(); | 81 void switchToFailurePeriod(); |
82 | 82 |
83 ResourcePtr<FontResource> m_font; | 83 ResourcePtr<FontResource> m_font; |
84 RefPtrWillBeMember<FontLoader> m_fontLoader; | 84 RefPtrWillBeMember<FontLoader> m_fontLoader; |
85 const FontDisplay m_display; | 85 const FontDisplay m_display; |
86 DisplayPeriod m_period; | 86 DisplayPeriod m_period; |
87 FontLoadHistograms m_histograms; | 87 FontLoadHistograms m_histograms; |
88 bool m_isInterventionTriggered; | 88 bool m_isInterventionTriggered; |
89 }; | 89 }; |
90 | 90 |
91 } // namespace blink | 91 } // namespace blink |
92 | 92 |
93 #endif | 93 #endif |
OLD | NEW |