This source file includes following definitions.
- isLocalFontAvailable
- createFontData
- record
#include "config.h"
#include "core/css/LocalFontFaceSource.h"
#include "platform/fonts/FontCache.h"
#include "platform/fonts/FontDescription.h"
#include "platform/fonts/SimpleFontData.h"
#include "public/platform/Platform.h"
namespace WebCore {
bool LocalFontFaceSource::isLocalFontAvailable(const FontDescription& fontDescription)
{
return FontCache::fontCache()->isPlatformFontAvailable(fontDescription, m_fontName);
}
PassRefPtr<SimpleFontData> LocalFontFaceSource::createFontData(const FontDescription& fontDescription)
{
RefPtr<SimpleFontData> fontData = FontCache::fontCache()->getFontData(fontDescription, m_fontName, true);
m_histograms.record(fontData);
return fontData.release();
}
void LocalFontFaceSource::LocalFontHistograms::record(bool loadSuccess)
{
if (m_reported)
return;
m_reported = true;
blink::Platform::current()->histogramEnumeration("WebFont.LocalFontUsed", loadSuccess ? 1 : 0, 2);
}
}