| 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 // This temporary font is not retained and should not be returned. | 228 // This temporary font is not retained and should not be returned. |
| 229 FontCachePurgePreventer fontCachePurgePreventer; | 229 FontCachePurgePreventer fontCachePurgePreventer; |
| 230 SimpleFontData* temporaryFont = | 230 SimpleFontData* temporaryFont = |
| 231 FontCache::fontCache()->getNonRetainedLastResortFallbackFont( | 231 FontCache::fontCache()->getNonRetainedLastResortFallbackFont( |
| 232 fontDescription); | 232 fontDescription); |
| 233 if (!temporaryFont) { | 233 if (!temporaryFont) { |
| 234 ASSERT_NOT_REACHED(); | 234 ASSERT_NOT_REACHED(); |
| 235 return nullptr; | 235 return nullptr; |
| 236 } | 236 } |
| 237 RefPtr<CSSCustomFontData> cssFontData = CSSCustomFontData::create( | 237 RefPtr<CSSCustomFontData> cssFontData = CSSCustomFontData::create( |
| 238 this, m_period == BlockPeriod ? CSSCustomFontData::InvisibleFallback | 238 this, |
| 239 : CSSCustomFontData::VisibleFallback); | 239 m_period == BlockPeriod ? CSSCustomFontData::InvisibleFallback |
| 240 : CSSCustomFontData::VisibleFallback); |
| 240 return SimpleFontData::create(temporaryFont->platformData(), cssFontData); | 241 return SimpleFontData::create(temporaryFont->platformData(), cssFontData); |
| 241 } | 242 } |
| 242 | 243 |
| 243 void RemoteFontFaceSource::beginLoadIfNeeded() { | 244 void RemoteFontFaceSource::beginLoadIfNeeded() { |
| 244 if (m_fontSelector->document() && m_font->stillNeedsLoad()) { | 245 if (m_fontSelector->document() && m_font->stillNeedsLoad()) { |
| 245 if (!m_font->url().protocolIsData() && !m_font->isLoaded() && | 246 if (!m_font->url().protocolIsData() && !m_font->isLoaded() && |
| 246 m_display == FontDisplayAuto && | 247 m_display == FontDisplayAuto && |
| 247 m_font->isLowPriorityLoadingAllowedForRemoteFont()) { | 248 m_font->isLowPriorityLoadingAllowedForRemoteFont()) { |
| 248 // Set the loading priority to VeryLow since this font is not required | 249 // Set the loading priority to VeryLow since this font is not required |
| 249 // for painting the text. | 250 // for painting the text. |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 return Miss; | 467 return Miss; |
| 467 case FromUnknown: | 468 case FromUnknown: |
| 468 // Fall through. | 469 // Fall through. |
| 469 default: | 470 default: |
| 470 NOTREACHED(); | 471 NOTREACHED(); |
| 471 } | 472 } |
| 472 return Miss; | 473 return Miss; |
| 473 } | 474 } |
| 474 | 475 |
| 475 } // namespace blink | 476 } // namespace blink |
| OLD | NEW |