OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2010, 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
260 | 260 |
261 bool CSSFontFaceSource::isLocalFontAvailable(const FontDescription& fontDescript ion) | 261 bool CSSFontFaceSource::isLocalFontAvailable(const FontDescription& fontDescript ion) |
262 { | 262 { |
263 if (!isLocal()) | 263 if (!isLocal()) |
264 return false; | 264 return false; |
265 return fontCache()->isPlatformFontAvailable(fontDescription, m_string, true) ; | 265 return fontCache()->isPlatformFontAvailable(fontDescription, m_string, true) ; |
266 } | 266 } |
267 | 267 |
268 void CSSFontFaceSource::willUseFontData() | 268 void CSSFontFaceSource::willUseFontData() |
269 { | 269 { |
270 if (m_font) | 270 if (m_face && m_font && m_font->stillNeedsLoad()) |
Kunihiko Sakamoto
2013/11/18 06:07:39
This condition was missing.
| |
271 m_font->willUseFontData(); | 271 beginLoadingFontSoon(); |
272 } | 272 } |
273 | 273 |
274 void CSSFontFaceSource::beginLoadingFontSoon() | 274 void CSSFontFaceSource::beginLoadingFontSoon() |
275 { | 275 { |
276 ASSERT(m_face); | 276 ASSERT(m_face); |
277 ASSERT(m_font); | 277 ASSERT(m_font); |
278 m_face->beginLoadingFontSoon(m_font.get()); | 278 m_face->beginLoadingFontSoon(m_font.get()); |
279 } | 279 } |
280 | 280 |
281 void CSSFontFaceSource::FontLoadHistograms::loadStarted() | 281 void CSSFontFaceSource::FontLoadHistograms::loadStarted() |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
318 if (size < 50 * 1024) | 318 if (size < 50 * 1024) |
319 return "WebFont.DownloadTime.1.10KBTo50KB"; | 319 return "WebFont.DownloadTime.1.10KBTo50KB"; |
320 if (size < 100 * 1024) | 320 if (size < 100 * 1024) |
321 return "WebFont.DownloadTime.2.50KBTo100KB"; | 321 return "WebFont.DownloadTime.2.50KBTo100KB"; |
322 if (size < 1024 * 1024) | 322 if (size < 1024 * 1024) |
323 return "WebFont.DownloadTime.3.100KBTo1MB"; | 323 return "WebFont.DownloadTime.3.100KBTo1MB"; |
324 return "WebFont.DownloadTime.4.Over1MB"; | 324 return "WebFont.DownloadTime.4.Over1MB"; |
325 } | 325 } |
326 | 326 |
327 } | 327 } |
OLD | NEW |