OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/css/RemoteFontFaceSource.h" | 5 #include "core/css/RemoteFontFaceSource.h" |
6 | 6 |
7 #include "core/css/CSSCustomFontData.h" | 7 #include "core/css/CSSCustomFontData.h" |
8 #include "core/css/CSSFontFace.h" | 8 #include "core/css/CSSFontFace.h" |
9 #include "core/css/CSSFontSelector.h" | 9 #include "core/css/CSSFontSelector.h" |
10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 return; | 259 return; |
260 int duration = static_cast<int>(currentTimeMS() - m_blankPaintTime); | 260 int duration = static_cast<int>(currentTimeMS() - m_blankPaintTime); |
261 DEFINE_STATIC_LOCAL(CustomCountHistogram, blankTextShownTimeHistogram, ("Web
Font.BlankTextShownTime", 0, 10000, 50)); | 261 DEFINE_STATIC_LOCAL(CustomCountHistogram, blankTextShownTimeHistogram, ("Web
Font.BlankTextShownTime", 0, 10000, 50)); |
262 blankTextShownTimeHistogram.count(duration); | 262 blankTextShownTimeHistogram.count(duration); |
263 m_blankPaintTime = -1; | 263 m_blankPaintTime = -1; |
264 } | 264 } |
265 | 265 |
266 void RemoteFontFaceSource::FontLoadHistograms::recordRemoteFont(const FontResour
ce* font) | 266 void RemoteFontFaceSource::FontLoadHistograms::recordRemoteFont(const FontResour
ce* font) |
267 { | 267 { |
268 if (m_loadStartTime > 0 && font && !font->isLoading()) { | 268 if (m_loadStartTime > 0 && font && !font->isLoading()) { |
269 enum { Miss, DiskHit, DataUrl, MemoryHit, CacheHitEnumMax }; | |
270 DEFINE_STATIC_LOCAL(EnumerationHistogram, cacheHitHistogram, ("WebFont.C
acheHit", CacheHitEnumMax)); | 269 DEFINE_STATIC_LOCAL(EnumerationHistogram, cacheHitHistogram, ("WebFont.C
acheHit", CacheHitEnumMax)); |
271 cacheHitHistogram.count(dataSourceMetricsValue()); | 270 cacheHitHistogram.count(dataSourceMetricsValue()); |
272 | 271 |
273 int duration = static_cast<int>(currentTimeMS() - m_loadStartTime); | 272 int duration = static_cast<int>(currentTimeMS() - m_loadStartTime); |
274 recordLoadTimeHistogram(font, duration); | 273 recordLoadTimeHistogram(font, duration); |
275 m_loadStartTime = -1; | 274 m_loadStartTime = -1; |
276 | 275 |
277 enum { CORSFail, CORSSuccess, CORSEnumMax }; | 276 enum { CORSFail, CORSSuccess, CORSEnumMax }; |
278 int corsValue = font->isCORSFailed() ? CORSFail : CORSSuccess; | 277 int corsValue = font->isCORSFailed() ? CORSFail : CORSSuccess; |
279 DEFINE_STATIC_LOCAL(EnumerationHistogram, corsHistogram, ("WebFont.CORSS
uccess", CORSEnumMax)); | 278 DEFINE_STATIC_LOCAL(EnumerationHistogram, corsHistogram, ("WebFont.CORSS
uccess", CORSEnumMax)); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 return Miss; | 365 return Miss; |
367 case FromUnknown: | 366 case FromUnknown: |
368 // Fall through. | 367 // Fall through. |
369 default: | 368 default: |
370 NOTREACHED(); | 369 NOTREACHED(); |
371 } | 370 } |
372 return Miss; | 371 return Miss; |
373 } | 372 } |
374 | 373 |
375 } // namespace blink | 374 } // namespace blink |
OLD | NEW |