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

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

Issue 23720005: Move webfont usage metrics reporting to FontResource (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | « Source/core/css/CSSFontFaceSource.h ('k') | Source/core/fetch/FontResource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSFontFaceSource.cpp
diff --git a/Source/core/css/CSSFontFaceSource.cpp b/Source/core/css/CSSFontFaceSource.cpp
index 106a66bf714a7834439f587b5c4ab3d7aa401ac0..264c496a7d841af9b1e8d31db5b6d9281b71e5ef 100644
--- a/Source/core/css/CSSFontFaceSource.cpp
+++ b/Source/core/css/CSSFontFaceSource.cpp
@@ -250,37 +250,14 @@ bool CSSFontFaceSource::isLocalFontAvailable(const FontDescription& fontDescript
void CSSFontFaceSource::willUseFontData()
{
- if (!isLoaded())
- m_histograms.willUseFontData();
-}
-
-CSSFontFaceSource::FontLoadHistograms::~FontLoadHistograms()
-{
- if (m_styledTime > 0)
- HistogramSupport::histogramEnumeration("WebFont.UsageType", StyledButNotUsed, UsageTypeMax);
-}
-
-void CSSFontFaceSource::FontLoadHistograms::willUseFontData()
-{
- if (!m_styledTime)
- m_styledTime = currentTimeMS();
+ if (m_font)
+ m_font->willUseFontData();
}
void CSSFontFaceSource::FontLoadHistograms::loadStarted()
{
if (!m_loadStartTime)
m_loadStartTime = currentTimeMS();
-
- if (m_styledTime < 0)
- return;
- if (!m_styledTime) {
- HistogramSupport::histogramEnumeration("WebFont.UsageType", NotStyledButUsed, UsageTypeMax);
- } else {
- int duration = static_cast<int>(currentTimeMS() - m_styledTime);
- HistogramSupport::histogramCustomCounts("WebFont.StyleRecalcToDownloadLatency", duration, 0, 10000, 50);
- HistogramSupport::histogramEnumeration("WebFont.UsageType", StyledAndUsed, UsageTypeMax);
- }
- m_styledTime = -1;
}
void CSSFontFaceSource::FontLoadHistograms::recordLocalFont(bool loadSuccess)
« no previous file with comments | « Source/core/css/CSSFontFaceSource.h ('k') | Source/core/fetch/FontResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698