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

Unified Diff: Source/core/css/CSSFontFaceSource.h

Issue 180273020: UMA histograms to measure whether / how long blank text is rendered for loading web fonts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: early return Created 6 years, 10 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 | « Source/core/css/CSSFontFace.h ('k') | Source/core/css/CSSFontFaceSource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSFontFaceSource.h
diff --git a/Source/core/css/CSSFontFaceSource.h b/Source/core/css/CSSFontFaceSource.h
index 21ebaebc71f4f79a63fee4e4b8e4ac7bb62add57..bab06303312acc9557756440ddb04cce5adf3e1a 100644
--- a/Source/core/css/CSSFontFaceSource.h
+++ b/Source/core/css/CSSFontFaceSource.h
@@ -74,18 +74,26 @@ public:
bool isLocalFontAvailable(const FontDescription&);
void beginLoadIfNeeded();
+ // For UMA reporting
+ void paintRequested() { m_histograms.fallbackFontPainted(); }
+ bool hadBlankText() { return m_histograms.hadBlankText(); }
+
private:
typedef HashMap<unsigned, RefPtr<SimpleFontData> > FontDataTable; // The hash key is composed of size synthetic styles.
class FontLoadHistograms {
public:
- FontLoadHistograms() : m_loadStartTime(0) { }
+ FontLoadHistograms() : m_loadStartTime(0), m_fallbackPaintTime(0) { }
void loadStarted();
+ void fallbackFontPainted();
void recordLocalFont(bool loadSuccess);
void recordRemoteFont(const FontResource*);
+ void recordFallbackTime(const FontResource*);
+ bool hadBlankText() { return m_fallbackPaintTime; }
private:
const char* histogramName(const FontResource*);
double m_loadStartTime;
+ double m_fallbackPaintTime;
};
void pruneTable();
« no previous file with comments | « Source/core/css/CSSFontFace.h ('k') | Source/core/css/CSSFontFaceSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698