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

Side by Side Diff: Source/core/css/CSSFontFaceSource.cpp

Issue 63713002: Initiate webfont download right after style recalc (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 264
265 bool CSSFontFaceSource::isLocalFontAvailable(const FontDescription& fontDescript ion) 265 bool CSSFontFaceSource::isLocalFontAvailable(const FontDescription& fontDescript ion)
266 { 266 {
267 if (!isLocal()) 267 if (!isLocal())
268 return false; 268 return false;
269 return fontCache()->isPlatformFontAvailable(fontDescription, m_string, true) ; 269 return fontCache()->isPlatformFontAvailable(fontDescription, m_string, true) ;
270 } 270 }
271 271
272 void CSSFontFaceSource::willUseFontData() 272 void CSSFontFaceSource::willUseFontData()
273 { 273 {
274 if (m_font) 274 if (m_face && m_font)
275 m_font->willUseFontData(); 275 beginLoadingFontSoon();
276 } 276 }
277 277
278 void CSSFontFaceSource::beginLoadingFontSoon() 278 void CSSFontFaceSource::beginLoadingFontSoon()
279 { 279 {
280 ASSERT(m_face); 280 ASSERT(m_face);
281 ASSERT(m_font); 281 ASSERT(m_font);
282 m_face->beginLoadingFontSoon(m_font.get()); 282 m_face->beginLoadingFontSoon(m_font.get());
283 } 283 }
284 284
285 void CSSFontFaceSource::FontLoadHistograms::loadStarted() 285 void CSSFontFaceSource::FontLoadHistograms::loadStarted()
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 if (size < 50 * 1024) 322 if (size < 50 * 1024)
323 return "WebFont.DownloadTime.1.10KBTo50KB"; 323 return "WebFont.DownloadTime.1.10KBTo50KB";
324 if (size < 100 * 1024) 324 if (size < 100 * 1024)
325 return "WebFont.DownloadTime.2.50KBTo100KB"; 325 return "WebFont.DownloadTime.2.50KBTo100KB";
326 if (size < 1024 * 1024) 326 if (size < 1024 * 1024)
327 return "WebFont.DownloadTime.3.100KBTo1MB"; 327 return "WebFont.DownloadTime.3.100KBTo1MB";
328 return "WebFont.DownloadTime.4.Over1MB"; 328 return "WebFont.DownloadTime.4.Over1MB";
329 } 329 }
330 330
331 } 331 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698