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

Side by Side Diff: third_party/WebKit/Source/core/css/RemoteFontFaceSource.h

Issue 2465643002: WebFonts intervention: understand if download time matches the decision (Closed)
Patch Set: Created 4 years, 1 month 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/css/RemoteFontFaceSource.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 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 FontLoadHistograms(DataSource dataSource) 79 FontLoadHistograms(DataSource dataSource)
80 : m_loadStartTime(0), 80 : m_loadStartTime(0),
81 m_blankPaintTime(0), 81 m_blankPaintTime(0),
82 m_isLongLimitExceeded(false), 82 m_isLongLimitExceeded(false),
83 m_dataSource(dataSource) {} 83 m_dataSource(dataSource) {}
84 void loadStarted(); 84 void loadStarted();
85 void fallbackFontPainted(DisplayPeriod); 85 void fallbackFontPainted(DisplayPeriod);
86 void fontLoaded(bool isInterventionTriggered); 86 void fontLoaded(bool isInterventionTriggered);
87 void longLimitExceeded(bool isInterventionTriggered); 87 void longLimitExceeded(bool isInterventionTriggered);
88 void recordFallbackTime(const FontResource*); 88 void recordFallbackTime(const FontResource*);
89 void recordRemoteFont(const FontResource*); 89 void recordRemoteFont(const FontResource*, bool isInterventionTriggered);
90 bool hadBlankText() { return m_blankPaintTime; } 90 bool hadBlankText() { return m_blankPaintTime; }
91 DataSource dataSource() { return m_dataSource; } 91 DataSource dataSource() { return m_dataSource; }
92 void maySetDataSource(DataSource); 92 void maySetDataSource(DataSource);
93 93
94 private: 94 private:
95 void recordLoadTimeHistogram(const FontResource*, int duration); 95 void recordLoadTimeHistogram(const FontResource*,
96 int duration,
97 bool isInterventionTriggered);
96 void recordInterventionResult(bool isTriggered); 98 void recordInterventionResult(bool isTriggered);
97 CacheHitMetrics dataSourceMetricsValue(); 99 CacheHitMetrics dataSourceMetricsValue();
98 double m_loadStartTime; 100 double m_loadStartTime;
99 double m_blankPaintTime; 101 double m_blankPaintTime;
100 bool m_isLongLimitExceeded; 102 bool m_isLongLimitExceeded;
101 DataSource m_dataSource; 103 DataSource m_dataSource;
102 }; 104 };
103 105
104 void switchToSwapPeriod(); 106 void switchToSwapPeriod();
105 void switchToFailurePeriod(); 107 void switchToFailurePeriod();
106 bool shouldTriggerWebFontsIntervention(); 108 bool shouldTriggerWebFontsIntervention();
107 109
108 Member<FontResource> m_font; 110 Member<FontResource> m_font;
109 Member<CSSFontSelector> m_fontSelector; 111 Member<CSSFontSelector> m_fontSelector;
110 const FontDisplay m_display; 112 const FontDisplay m_display;
111 DisplayPeriod m_period; 113 DisplayPeriod m_period;
112 FontLoadHistograms m_histograms; 114 FontLoadHistograms m_histograms;
113 bool m_isInterventionTriggered; 115 bool m_isInterventionTriggered;
114 }; 116 };
115 117
116 } // namespace blink 118 } // namespace blink
117 119
118 #endif 120 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698