Chromium Code Reviews| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 | 199 |
| 200 return networkIsSlow && m_display == FontDisplayAuto; | 200 return networkIsSlow && m_display == FontDisplayAuto; |
| 201 } | 201 } |
| 202 | 202 |
| 203 bool RemoteFontFaceSource::isLowPriorityLoadingAllowedForRemoteFont() const { | 203 bool RemoteFontFaceSource::isLowPriorityLoadingAllowedForRemoteFont() const { |
| 204 return m_isInterventionTriggered; | 204 return m_isInterventionTriggered; |
| 205 } | 205 } |
| 206 | 206 |
| 207 PassRefPtr<SimpleFontData> RemoteFontFaceSource::createFontData( | 207 PassRefPtr<SimpleFontData> RemoteFontFaceSource::createFontData( |
| 208 const FontDescription& fontDescription) { | 208 const FontDescription& fontDescription) { |
| 209 if (!isLoaded()) | 209 if (!isLoaded() && !m_font->hasCustomFontData()) |
|
Takashi Toyoshima
2017/02/23 03:21:37
Should we still have the check of !isLoaded() here
| |
| 210 return createLoadingFallbackFontData(fontDescription); | 210 return createLoadingFallbackFontData(fontDescription); |
| 211 | 211 |
| 212 if (!m_font->ensureCustomFontData() || m_period == FailurePeriod) | 212 if (!m_font->ensureCustomFontData() || m_period == FailurePeriod) |
|
Takashi Toyoshima
2017/02/23 03:21:37
I'm not sure these checks are still reasonable.
C
| |
| 213 return nullptr; | 213 return nullptr; |
| 214 | 214 |
| 215 m_histograms.recordFallbackTime(m_font.get()); | 215 m_histograms.recordFallbackTime(m_font.get()); |
| 216 | 216 |
| 217 return SimpleFontData::create( | 217 return SimpleFontData::create( |
| 218 m_font->platformDataFromCustomData(fontDescription.effectiveFontSize(), | 218 m_font->platformDataFromCustomData(fontDescription.effectiveFontSize(), |
| 219 fontDescription.isSyntheticBold(), | 219 fontDescription.isSyntheticBold(), |
| 220 fontDescription.isSyntheticItalic(), | 220 fontDescription.isSyntheticItalic(), |
| 221 fontDescription.orientation(), | 221 fontDescription.orientation(), |
| 222 fontDescription.variationSettings()), | 222 fontDescription.variationSettings()), |
| (...skipping 243 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 |