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

Unified Diff: third_party/WebKit/Source/core/css/RemoteFontFaceSource.h

Issue 2289303004: WebFonts: measure network loading time (Closed)
Patch Set: build fix Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/RemoteFontFaceSource.h
diff --git a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h
index 6bb1e5fc6f1c1bf59bd20ebfb55e6217406994ab..a91c28e07970c3262f697cad7eb60e2d1e20275f 100644
--- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h
+++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h
@@ -61,24 +61,33 @@ private:
class FontLoadHistograms {
DISALLOW_NEW();
public:
- FontLoadHistograms() : m_loadStartTime(0), m_blankPaintTime(0), m_isLongLimitExceeded(false) { }
+ // Should not change following order in CacheHitMetrics to be used for metrics values.
+ enum CacheHitMetrics { Miss, DiskHit, DataUrl, MemoryHit, CacheHitEnumMax };
+ enum DataSource { FromUnknown, FromDataURL, FromMemoryCache, FromDiskCache, FromNetwork };
+
+ FontLoadHistograms(DataSource) : m_loadStartTime(0), m_blankPaintTime(0), m_isLongLimitExceeded(false) { }
Kunihiko Sakamoto 2016/09/07 16:25:42 m_dataSource isn't initialized?
Takashi Toyoshima 2016/09/09 06:25:24 oops, that's right.
void loadStarted();
void fallbackFontPainted(DisplayPeriod);
- void fontLoaded(bool isInterventionTriggered, bool isLoadedFromNetwork);
+ void fontLoaded(bool isInterventionTriggered);
void longLimitExceeded(bool isInterventionTriggered);
void recordFallbackTime(const FontResource*);
- void recordRemoteFont(const FontResource*, bool isLoadedFromMemoryCache);
+ void recordRemoteFont(const FontResource*);
bool hadBlankText() { return m_blankPaintTime; }
+ DataSource dataSource() { return m_dataSource; }
+ void maySetDataSource(DataSource dataSource) { m_dataSource = (m_dataSource != FromUnknown) ? m_dataSource : dataSource; }
private:
void recordLoadTimeHistogram(const FontResource*, int duration);
- void recordInterventionResult(bool isTriggered, bool isLoadedFromNetwork);
+ void recordInterventionResult(bool isTriggered);
+ CacheHitMetrics dataSourceMetricsValue();
double m_loadStartTime;
double m_blankPaintTime;
bool m_isLongLimitExceeded;
+ DataSource m_dataSource;
};
void switchToSwapPeriod();
void switchToFailurePeriod();
+ bool shouldTriggerWebFontsIntervention();
Member<FontResource> m_font;
Member<CSSFontSelector> m_fontSelector;
@@ -86,7 +95,6 @@ private:
DisplayPeriod m_period;
FontLoadHistograms m_histograms;
bool m_isInterventionTriggered;
- bool m_isLoadedFromMemoryCache;
};
} // namespace blink
« 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