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

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

Issue 2289303004: WebFonts: measure network loading time (Closed)
Patch Set: minor 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
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..2c9fd5db26b9fb86602384a156897764b2f49325 100644
--- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h
+++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h
@@ -27,6 +27,7 @@ class RemoteFontFaceSource final : public CSSFontFaceSource, public FontResource
USING_GARBAGE_COLLECTED_MIXIN(RemoteFontFaceSource);
public:
enum DisplayPeriod { BlockPeriod, SwapPeriod, FailurePeriod };
+ enum DataSource { FromUnknown, FromDataURL, FromMemoryCache, FromDiskCache, FromNetwork };
explicit RemoteFontFaceSource(FontResource*, CSSFontSelector*, FontDisplay);
~RemoteFontFaceSource() override;
@@ -64,14 +65,14 @@ private:
FontLoadHistograms() : m_loadStartTime(0), m_blankPaintTime(0), m_isLongLimitExceeded(false) { }
void loadStarted();
void fallbackFontPainted(DisplayPeriod);
- void fontLoaded(bool isInterventionTriggered, bool isLoadedFromNetwork);
- void longLimitExceeded(bool isInterventionTriggered);
+ void fontLoaded(bool isInterventionTriggered, DataSource);
+ void longLimitExceeded(bool isInterventionTriggered, DataSource);
void recordFallbackTime(const FontResource*);
- void recordRemoteFont(const FontResource*, bool isLoadedFromMemoryCache);
+ void recordRemoteFont(const FontResource*, DataSource);
bool hadBlankText() { return m_blankPaintTime; }
private:
- void recordLoadTimeHistogram(const FontResource*, int duration);
- void recordInterventionResult(bool isTriggered, bool isLoadedFromNetwork);
+ void recordLoadTimeHistogram(const FontResource*, int duration, DataSource);
+ void recordInterventionResult(bool isTriggered, DataSource);
double m_loadStartTime;
double m_blankPaintTime;
bool m_isLongLimitExceeded;
@@ -86,7 +87,7 @@ private:
DisplayPeriod m_period;
FontLoadHistograms m_histograms;
bool m_isInterventionTriggered;
- bool m_isLoadedFromMemoryCache;
+ DataSource m_dataSource;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698