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

Side by Side Diff: third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp

Issue 2550663002: Allow creating font data while FontResource is revalidating (Closed)
Patch Set: Allow to create font data while revalidating Created 4 years 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698