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

Side by Side Diff: third_party/WebKit/Source/core/css/LocalFontFaceSource.cpp

Issue 2692803005: Avoid checking family name in getLastResortFallbackFont() on Windows (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/fonts/FontCache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/LocalFontFaceSource.h" 5 #include "core/css/LocalFontFaceSource.h"
6 6
7 #include "platform/Histogram.h" 7 #include "platform/Histogram.h"
8 #include "platform/fonts/FontCache.h" 8 #include "platform/fonts/FontCache.h"
9 #include "platform/fonts/FontDescription.h" 9 #include "platform/fonts/FontDescription.h"
10 #include "platform/fonts/SimpleFontData.h" 10 #include "platform/fonts/SimpleFontData.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 bool LocalFontFaceSource::isLocalFontAvailable( 14 bool LocalFontFaceSource::isLocalFontAvailable(
15 const FontDescription& fontDescription) { 15 const FontDescription& fontDescription) {
16 return FontCache::fontCache()->isPlatformFontAvailable(fontDescription, 16 return FontCache::fontCache()->isPlatformFontAvailable(fontDescription,
17 m_fontName); 17 m_fontName);
18 } 18 }
19 19
20 PassRefPtr<SimpleFontData> LocalFontFaceSource::createFontData( 20 PassRefPtr<SimpleFontData> LocalFontFaceSource::createFontData(
21 const FontDescription& fontDescription) { 21 const FontDescription& fontDescription) {
22 // We don't want to check alternate font family names here, so pass true as 22 // We don't want to check alternate font family names here, so pass true as
23 // the checkingAlternateName parameter. 23 // the checkingAlternateName parameter.
24 RefPtr<SimpleFontData> fontData = 24 RefPtr<SimpleFontData> fontData = FontCache::fontCache()->getFontData(
25 FontCache::fontCache()->getFontData(fontDescription, m_fontName, true); 25 fontDescription, m_fontName, AlternateFontName::NoAlternate);
26 m_histograms.record(fontData.get()); 26 m_histograms.record(fontData.get());
27 return fontData.release(); 27 return fontData.release();
28 } 28 }
29 29
30 void LocalFontFaceSource::LocalFontHistograms::record(bool loadSuccess) { 30 void LocalFontFaceSource::LocalFontHistograms::record(bool loadSuccess) {
31 if (m_reported) 31 if (m_reported)
32 return; 32 return;
33 m_reported = true; 33 m_reported = true;
34 DEFINE_STATIC_LOCAL(EnumerationHistogram, localFontUsedHistogram, 34 DEFINE_STATIC_LOCAL(EnumerationHistogram, localFontUsedHistogram,
35 ("WebFont.LocalFontUsed", 2)); 35 ("WebFont.LocalFontUsed", 2));
36 localFontUsedHistogram.count(loadSuccess ? 1 : 0); 36 localFontUsedHistogram.count(loadSuccess ? 1 : 0);
37 } 37 }
38 38
39 } // namespace blink 39 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/fonts/FontCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698