| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 return networkIsSlow && m_display == FontDisplayAuto; | 201 return networkIsSlow && m_display == FontDisplayAuto; |
| 202 } | 202 } |
| 203 | 203 |
| 204 bool RemoteFontFaceSource::isLowPriorityLoadingAllowedForRemoteFont() const { | 204 bool RemoteFontFaceSource::isLowPriorityLoadingAllowedForRemoteFont() const { |
| 205 return m_isInterventionTriggered; | 205 return m_isInterventionTriggered; |
| 206 } | 206 } |
| 207 | 207 |
| 208 PassRefPtr<SimpleFontData> RemoteFontFaceSource::createFontData( | 208 PassRefPtr<SimpleFontData> RemoteFontFaceSource::createFontData( |
| 209 const FontDescription& fontDescription) { | 209 const FontDescription& fontDescription) { |
| 210 if (!isLoaded()) | 210 if (!isLoaded() && !m_font->hasCustomFontData()) |
| 211 return createLoadingFallbackFontData(fontDescription); | 211 return createLoadingFallbackFontData(fontDescription); |
| 212 | 212 |
| 213 if (!m_font->ensureCustomFontData() || m_period == FailurePeriod) | 213 if (!m_font->ensureCustomFontData() || m_period == FailurePeriod) |
| 214 return nullptr; | 214 return nullptr; |
| 215 | 215 |
| 216 m_histograms.recordFallbackTime(m_font.get()); | 216 m_histograms.recordFallbackTime(m_font.get()); |
| 217 | 217 |
| 218 return SimpleFontData::create( | 218 return SimpleFontData::create( |
| 219 m_font->platformDataFromCustomData(fontDescription.effectiveFontSize(), | 219 m_font->platformDataFromCustomData(fontDescription.effectiveFontSize(), |
| 220 fontDescription.isSyntheticBold(), | 220 fontDescription.isSyntheticBold(), |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 return Miss; | 466 return Miss; |
| 467 case FromUnknown: | 467 case FromUnknown: |
| 468 // Fall through. | 468 // Fall through. |
| 469 default: | 469 default: |
| 470 NOTREACHED(); | 470 NOTREACHED(); |
| 471 } | 471 } |
| 472 return Miss; | 472 return Miss; |
| 473 } | 473 } |
| 474 | 474 |
| 475 } // namespace blink | 475 } // namespace blink |
| OLD | NEW |