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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 } | 224 } |
225 RefPtr<CSSCustomFontData> cssFontData = CSSCustomFontData::create( | 225 RefPtr<CSSCustomFontData> cssFontData = CSSCustomFontData::create( |
226 this, m_period == BlockPeriod ? CSSCustomFontData::InvisibleFallback | 226 this, m_period == BlockPeriod ? CSSCustomFontData::InvisibleFallback |
227 : CSSCustomFontData::VisibleFallback); | 227 : CSSCustomFontData::VisibleFallback); |
228 return SimpleFontData::create(temporaryFont->platformData(), cssFontData); | 228 return SimpleFontData::create(temporaryFont->platformData(), cssFontData); |
229 } | 229 } |
230 | 230 |
231 void RemoteFontFaceSource::beginLoadIfNeeded() { | 231 void RemoteFontFaceSource::beginLoadIfNeeded() { |
232 if (m_fontSelector->document() && m_font->stillNeedsLoad()) { | 232 if (m_fontSelector->document() && m_font->stillNeedsLoad()) { |
233 m_fontSelector->document()->fetcher()->startLoad(m_font); | 233 m_fontSelector->document()->fetcher()->startLoad(m_font); |
| 234 if (!m_font->isLoaded()) |
| 235 m_font->startLoadLimitTimers(); |
234 m_histograms.loadStarted(); | 236 m_histograms.loadStarted(); |
235 } | 237 } |
236 m_font->startLoadLimitTimersIfNeeded(); | |
237 | 238 |
238 if (m_face) | 239 if (m_face) |
239 m_face->didBeginLoad(); | 240 m_face->didBeginLoad(); |
240 } | 241 } |
241 | 242 |
242 DEFINE_TRACE(RemoteFontFaceSource) { | 243 DEFINE_TRACE(RemoteFontFaceSource) { |
243 visitor->trace(m_font); | 244 visitor->trace(m_font); |
244 visitor->trace(m_fontSelector); | 245 visitor->trace(m_fontSelector); |
245 CSSFontFaceSource::trace(visitor); | 246 CSSFontFaceSource::trace(visitor); |
246 FontResourceClient::trace(visitor); | 247 FontResourceClient::trace(visitor); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 return Miss; | 420 return Miss; |
420 case FromUnknown: | 421 case FromUnknown: |
421 // Fall through. | 422 // Fall through. |
422 default: | 423 default: |
423 NOTREACHED(); | 424 NOTREACHED(); |
424 } | 425 } |
425 return Miss; | 426 return Miss; |
426 } | 427 } |
427 | 428 |
428 } // namespace blink | 429 } // namespace blink |
OLD | NEW |