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

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

Issue 2289113002: WebFonts: classify memory cache hit case in WebFont.CacheHit metric (Closed)
Patch Set: Created 4 years, 4 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 | « third_party/WebKit/Source/core/css/RemoteFontFaceSource.h ('k') | tools/metrics/histograms/histograms.xml » ('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.cpp
diff --git a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
index 319e74e8478e12064bdb7a0f472acf66b752815c..9eaab89c8a1282f37cb7b23812587874a146c9bb 100644
--- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
+++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
@@ -116,7 +116,7 @@ bool RemoteFontFaceSource::isValid() const
void RemoteFontFaceSource::notifyFinished(Resource*)
{
- m_histograms.recordRemoteFont(m_font.get());
+ m_histograms.recordRemoteFont(m_font.get(), m_isLoadedFromMemoryCache);
m_histograms.fontLoaded(m_isInterventionTriggered, !m_isLoadedFromMemoryCache && !m_font->url().protocolIsData() && !m_font->response().wasCached());
m_font->ensureCustomFontData();
@@ -260,16 +260,17 @@ void RemoteFontFaceSource::FontLoadHistograms::recordFallbackTime(const FontReso
m_blankPaintTime = -1;
}
-void RemoteFontFaceSource::FontLoadHistograms::recordRemoteFont(const FontResource* font)
+void RemoteFontFaceSource::FontLoadHistograms::recordRemoteFont(const FontResource* font, bool isLoadedFromMemoryCache)
{
if (m_loadStartTime > 0 && font && !font->isLoading()) {
int duration = static_cast<int>(currentTimeMS() - m_loadStartTime);
recordLoadTimeHistogram(font, duration);
m_loadStartTime = -1;
- enum { Miss, Hit, DataUrl, CacheHitEnumMax };
+ enum { Miss, DiskHit, DataUrl, MemoryHit, CacheHitEnumMax };
int histogramValue = font->url().protocolIsData() ? DataUrl
Takashi Toyoshima 2016/08/31 05:38:09 From a chat with yhirano, I should check isLoadedF
- : font->response().wasCached() ? Hit
+ : font->response().wasCached() ? DiskHit
+ : isLoadedFromMemoryCache ? MemoryHit
tkent 2016/08/31 05:21:30 Why don't you refer to m_isLoadedFromMemoryCache d
Takashi Toyoshima 2016/08/31 05:31:50 Because here is inside an inner class, and this in
tkent 2016/08/31 06:21:33 I wasn't aware of it. Got it.
: Miss;
DEFINE_STATIC_LOCAL(EnumerationHistogram, cacheHitHistogram, ("WebFont.CacheHit", CacheHitEnumMax));
cacheHitHistogram.count(histogramValue);
« no previous file with comments | « third_party/WebKit/Source/core/css/RemoteFontFaceSource.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698