| 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 "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 m_isLongLimitExceeded(false), | 82 m_isLongLimitExceeded(false), |
| 83 m_dataSource(dataSource), | 83 m_dataSource(dataSource), |
| 84 m_fontDisplay(fontDisplay) {} | 84 m_fontDisplay(fontDisplay) {} |
| 85 void loadStarted(); | 85 void loadStarted(); |
| 86 void fallbackFontPainted(DisplayPeriod); | 86 void fallbackFontPainted(DisplayPeriod); |
| 87 void fontLoaded(bool isCorsFailed, | 87 void fontLoaded(bool isCorsFailed, |
| 88 bool loadError, | 88 bool loadError, |
| 89 bool isInterventionTriggered); | 89 bool isInterventionTriggered); |
| 90 void longLimitExceeded(bool isInterventionTriggered); | 90 void longLimitExceeded(bool isInterventionTriggered); |
| 91 void recordFallbackTime(const FontResource*); | 91 void recordFallbackTime(const FontResource*); |
| 92 void recordRemoteFont(const FontResource*); | 92 void recordRemoteFont(const FontResource*, bool isInterventionTriggered); |
| 93 bool hadBlankText() { return m_blankPaintTime; } | 93 bool hadBlankText() { return m_blankPaintTime; } |
| 94 DataSource dataSource() { return m_dataSource; } | 94 DataSource dataSource() { return m_dataSource; } |
| 95 void maySetDataSource(DataSource); | 95 void maySetDataSource(DataSource); |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 void recordLoadTimeHistogram(const FontResource*, int duration); | 98 void recordLoadTimeHistogram(const FontResource*, |
| 99 int duration, |
| 100 bool isInterventionTriggered); |
| 99 void recordInterventionResult(bool isTriggered); | 101 void recordInterventionResult(bool isTriggered); |
| 100 CacheHitMetrics dataSourceMetricsValue(); | 102 CacheHitMetrics dataSourceMetricsValue(); |
| 101 double m_loadStartTime; | 103 double m_loadStartTime; |
| 102 double m_blankPaintTime; | 104 double m_blankPaintTime; |
| 103 bool m_isLongLimitExceeded; | 105 bool m_isLongLimitExceeded; |
| 104 DataSource m_dataSource; | 106 DataSource m_dataSource; |
| 105 FontDisplay m_fontDisplay; | 107 FontDisplay m_fontDisplay; |
| 106 }; | 108 }; |
| 107 | 109 |
| 108 void switchToSwapPeriod(); | 110 void switchToSwapPeriod(); |
| 109 void switchToFailurePeriod(); | 111 void switchToFailurePeriod(); |
| 110 bool shouldTriggerWebFontsIntervention(); | 112 bool shouldTriggerWebFontsIntervention(); |
| 111 | 113 |
| 112 Member<FontResource> m_font; | 114 Member<FontResource> m_font; |
| 113 Member<CSSFontSelector> m_fontSelector; | 115 Member<CSSFontSelector> m_fontSelector; |
| 114 const FontDisplay m_display; | 116 const FontDisplay m_display; |
| 115 DisplayPeriod m_period; | 117 DisplayPeriod m_period; |
| 116 FontLoadHistograms m_histograms; | 118 FontLoadHistograms m_histograms; |
| 117 bool m_isInterventionTriggered; | 119 bool m_isInterventionTriggered; |
| 118 }; | 120 }; |
| 119 | 121 |
| 120 } // namespace blink | 122 } // namespace blink |
| 121 | 123 |
| 122 #endif | 124 #endif |
| OLD | NEW |